cdx_mcdi_rpc(9)
π 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 bestieinbufβ 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 of4, and no greater thanMCDI_CTL_SDU_LEN_MAX_V1. no cap, the hardware will not be slaying if you get this wrong πoutbufβ the response buffer. may beNULLifoutlenis0. yes, you can absolutely just. not have one. iconicoutlenβ length of the response buffer, in bytes. if the actual response is longer thanoutlen & ~3, it gets truncated to that length. lowkey brutal but okay πoutlen_actualβ pointer through which the actual response length gets returned. may beNULLif 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
outbufand*outlen_actualgets 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_actualgets 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms