cdx_mcdi_rpc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cdx_mcdi_rpc β€” like, the Kernel API Manual page, bestie

okay so this is cdx_mcdi_rpc(9) from the Kernel API Manual and honestly? she's a baddie. let's get into it πŸŽ€


✨ NAME ✨

cdx_mcdi_rpc β€” issue an MCDI command and wait for completion. that's it, that's the vibe. you send it, you sit there, you wait. main character energy fr πŸ’…


🌸 SYNOPSIS 🌸

int cdx_mcdi_rpc (struct cdx_mcdi *cdx , unsigned int cmd , const struct
cdx_dword *inbuf , size_t inlen , struct cdx_dword *outbuf , size_t
outlen , size_t *outlen_actual );

look at all those args. she's got RANGE πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cdx β€” the NIC you're issuing the command through. your ride or die, literally.
  • cmd β€” the command type number. which flavor of command are we doing today bestie
  • inbuf β€” the command parameters. the tea you're sending πŸ“
  • inlen β€” length of the command parameters, in bytes. heads up: this has got to be a multiple of 4, and no greater than MCDI_CTL_SDU_LEN_MAX_V1. no cap, the hardware will not be slaying if you get this wrong 😭
  • outbuf β€” the response buffer. may be NULL if outlen is 0. yes, you can absolutely just. not have one. iconic
  • outlen β€” length of the response buffer, in bytes. if the actual response is longer than outlen & ~3, it gets truncated to that length. lowkey brutal but okay πŸ™ˆ
  • outlen_actual β€” pointer through which the actual response length gets returned. may be NULL if you don't need it. not everyone needs to know their length, and that's valid πŸ’œ

πŸ”₯ DESCRIPTION πŸ”₯

so here's the thing β€” this function may sleep. which means you must call it in process context. not an interrupt, not whatever spicy place you were thinking of. process context or nothing periodt πŸ’€


⭐ RETURN ⭐

you get a negative error code, or zero if it's successful. slay ✨

now, the error code itself can come from two places and you need to know the difference:

  • from the MCDI response β€” in this case the response still gets copied to outbuf and *outlen_actual gets set accordingly. so like, it errored but you still got the data. we love a generous queen πŸ‘‘
  • from a failure to communicate with the MC β€” in this case *outlen_actual gets set to zero. nothing came back. ghosted πŸ’”

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/cdx/controller/mcdi.c, plus her besties:


🫢 and that's the whole page! brought to you by ./drivers/cdx/controller, dated October 2026 β€” cdx_mcdi_rpc(9), iykyk. go forth and issue those commands bestie, and remember: process context only πŸ’–πŸŒˆ

πŸ“¦ where this page comes from