STRUCT CXL_MBOX_CMD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct cxl_mbox_cmd β€” bestie, this is literally the command that gets submitted to hardware ✨ like it's the little envelope you hand over to the hardware and you're like "here, do this for me, ily" 🫢


🌸 SYNOPSIS 🌸

struct cxl_mbox_cmd {
    u16 opcode;
    void *payload_in;
    void *payload_out;
    size_t size_in;
    size_t size_out;
    size_t min_out;
    int poll_count;
    int poll_interval_ms;
    u16 return_code;
 };

πŸŽ€ MEMBERS πŸŽ€

  • opcode β€” (input) the command set, plus the actual command you're submitting to hardware. it's giving "who are you and what do you want" πŸ’…
  • payload_in β€” (input) a pointer to the input payload. the little gift bag of data you're sending in 🎁
  • payload_out β€” (output) pointer to the output payload. ngl, the caller has to allocate it β€” that's on you bestie, no cap πŸ™ˆ
  • size_in β€” (input) how many bytes to load from payload_in. count 'em fr fr πŸ”’
  • size_out β€” (input) the max number of bytes loaded into payload_out. (output) the number of bytes actually generated by the device. for fixed-size output commands this is always expected to be deterministic (iconic, predictable behaviour ✨). for variable-sized output commands, it tells you the exact number of bytes written. so it's doing double duty and honestly? main character energy πŸ‘‘
  • min_out β€” (input) the internal command output payload size validation. like a bouncer checking the payload is big enough πŸšͺ
  • poll_count β€” (input) the number of timeouts to attempt. how many chances you're giving it before you're like "ok I'm done" πŸ’€
  • poll_interval_ms β€” (input) the time between mailbox background command polling interval timeouts. the lil breather between checks ⏳
  • return_code β€” (output) the error code returned from hardware. the hardware's final verdict on your request 🫑

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is the primary mechanism used to send commands to the hardware. like, this is the way. periodt πŸ’…

all the fields except payload_* correspond exactly to the fields described in the Command Register section of CXL 2.0 8.2.8.4.5. not approximately. exactly. we don't do approximation here 🎯

and then payload_in and payload_out get written to, and read from, the Command Payload Registers defined in CXL 2.0 8.2.8.4.8. iykyk 🌈


⭐ SEE ALSO ⭐

  • Kernel file ./include/cxl/mailbox.h
  • struct cxl_mailbox(9)

okay that's the whole page bestie, go forth and submit commands responsibly πŸ§šβ€β™€οΈβœ¨ this lil writeup lives in ./include/cxl and it's dated October 2026 β€” mwah, bye! πŸ’œπŸŽ€

πŸ“¦ where this page comes from