cdx_mcdi_rpc_async(9)
π cdx_mcdi_rpc_async(9) β straight out of the Kernel API Manual, bestie
Okay so picture this: you're deep in kernel land, you've got an MCDI command that needs to go out, and you literally cannot block. That's the whole vibe of this function. Let's get into it π¦
β¨ NAME β¨
cdx_mcdi_rpc_async β schedule an MCDI command to run asynchronously. Like, fire and forget, but make it β¨responsibleβ¨.
π SYNOPSIS π
int cdx_mcdi_rpc_async (struct cdx_mcdi *cdx , unsigned int cmd , const
struct cdx_dword *inbuf , size_t inlen , cdx_mcdi_async_completer
*complete , unsigned long cookie );
That's the whole signature, no cap. Six things go in, an int comes out π₯π€
πΈ ARGUMENTS πΈ
cdxβ the NIC you're issuing the command through. Like, which card are we talking to, bestie?cmdβ the command type number. The ~what~ of it all.inbufβ the command parameters themselves. The payload, the content, the main character.inlenβ length of those command parameters, in bytes. Gotta know how much you're working with πcompleteβ the function that gets called on completion or cancellation. Your callback, your moment π«Άcookieβ an arbitrary value that gets passed straight through tocomplete. You can put literally whatever you want in there, it's giving "note to self" π
π₯ DESCRIPTION π₯
The headline is: this function does not sleep, and that is exactly why it's iconic π Because it doesn't sleep, you can call it in atomic context. Slay.
β οΈ But listen β it will fail if event queues are disabled, or if MCDI event completions have been disabled due to an error. So check that return value, bestie, don't just vibe past it π
If it succeeds? Then the complete function gets called exactly once in process context. Exactly once. Not zero times, not two times β one time, periodt. And it happens when one of these two things goes down:
- the completion event is received (in process context), or
- event queues are disabled (in the process that disables them).
That's it, that's the whole trigger list. Two scenarios, one call. Iykyk π
π SEE ALSO π
Kernel file ./drivers/cdx/controller/mcdi.c, plus these absolute legends:
Go read them, they're all connected, it's a whole ecosystem π§
Okay that's the page!! Written up from the Kernel API Manual, sourced from ./drivers/cdx/controller, dated October 2026 β mwah, go forth and async responsibly π
π
π¦ 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