cdx_mcdi_rpc_async(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to complete. 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:

  1. the completion event is received (in process context), or
  2. 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