STRUCT MHUV3_PROTOCOL_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mhuv3_protocol_ops

okay bestie so this is from the Kernel API Manual, and it's literally the page for struct mhuv3_protocol_ops β€” the MHUv3 operations vtable. iykyk, it's the little bundle of function pointers that makes the mailbox magic happen ✨


✨ SYNOPSIS ✨

lowkey just look at it, it's giving function-pointer buffet:

struct mhuv3_protocol_ops {
    int (*rx_startup)(struct mhuv3 *mhu, struct mbox_chan *chan);
    void (*rx_shutdown)(struct mhuv3 *mhu, struct mbox_chan *chan);
    void *(*read_data)(struct mhuv3 *mhu, struct mbox_chan *chan);
    void (*rx_complete)(struct mhuv3 *mhu, struct mbox_chan *chan);
    void (*tx_startup)(struct mhuv3 *mhu, struct mbox_chan *chan);
    void (*tx_shutdown)(struct mhuv3 *mhu, struct mbox_chan *chan);
    int (*last_tx_done)(struct mhuv3 *mhu, struct mbox_chan *chan);
    int (*send_data)(struct mhuv3 *mhu, struct mbox_chan *chan, void
*arg);
 };

no cap, copy it exactly or the compiler will absolutely drag you 🫢


πŸŽ€ Members πŸŽ€

the whole squad, in order

  • rx_startup β€” the Receiver startup callback. when the receiving era begins, this gets the call πŸ“ž
  • rx_shutdown β€” the Receiver shutdown callback. wrapping it up on the rx side, periodt.
  • read_data β€” reads whatever available Sender in-band LE data there is (if any!). returns void *, and yes the "(if any)" is doing a lot of heavy lifting there 😭
  • rx_complete β€” acknowledge data reception to the Sender. and here's the important part bestie: any out-of-band data has to have already been retrieved before you call this. like, do not call it early, that's the rule πŸ™ˆ
  • tx_startup β€” the Sender startup callback. sender girlies rise πŸŒ…
  • tx_shutdown β€” the Sender shutdown callback. bye bye sending era πŸ’€
  • last_tx_done β€” reports back to the Sender whether the last transfer has completed. yes/no energy, very main character πŸ‘‘
  • send_data β€” sends data to the receiver. takes (struct mhuv3 *mhu, struct mbox_chan *chan, void *arg) and returns an int. that's the whole job, slay πŸ’…

🌸 Description 🌸

so the vibe here is: every supported transport protocol brings its own implementation of these operations. that's it, that's the whole point β€” this struct is the plug-and-play contract, and each protocol fills it in with its own flavor 🧚


πŸ¦‹ SEE ALSO πŸ¦‹

  • the kernel file ./drivers/mailbox/arm_mhuv3.c β€” go read it, it's iconic ⭐
  • struct mhuv3_mbox_chan_priv(9)
  • struct mhuv3_extension(9)
  • struct mhuv3(9)

and that's the page!! πŸ“ found in ./drivers/mailbox, dated October 2026, all about struct mhuv3_protocol_ops(9) β€” mwah, go forth and implement your protocols bestie πŸ’–πŸŽ€

πŸ“¦ where this page comes from