STRUCT PCI_DOE_MB(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, so we're deep in the Kernel API Manual today and the page is struct pci_doe_mb(9). it's giving "small struct, big responsibilities" and honestly? obsessed. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

struct pci_doe_mb β€” the state for a single DOE mailbox. one mailbox, one struct, no sharing, no cap πŸ’…


✨ SYNOPSIS ✨

struct pci_doe_mb {
    struct pci_dev *pdev;
    u16 cap_offset;
    struct xarray feats;
    wait_queue_head_t wq;
    struct workqueue_struct *work_queue;
    unsigned long flags;
  #ifdef CONFIG_SYSFS;
    struct device_attribute *sysfs_attrs;
  #endif;
 };

like, look at her. iconic layout. note the #ifdef CONFIG_SYSFS; in there β€” yes, that's conditional, and yes, you gotta respect it 🌸


🌈 Members 🌈

okay so every single field, one by one, no skipping, we're doing the full tour 🧚

  • pdev β€” the PCI device that this mailbox belongs to. her home. her origin story πŸ’–
  • cap_offset β€” the capability offset. the coordinates of where the magic lives ✨
  • feats β€” array of the features that are supported, encoded as long values. like a little roster of what she can do πŸŽ€
  • wq β€” wait queue for the work item. she queues, she waits, she slays πŸ¦‹
  • work_queue β€” the queue of pci_doe_work items. it's literally a queue of work, main character energy πŸ”₯
  • flags β€” a bit array of PCI_DOE_FLAG_* flags. bit array!! bit array!! πŸ’…
  • sysfs_attrs β€” array of sysfs device attributes. (this one's chillin' behind CONFIG_SYSFS, iykyk) 🌸

πŸ’œ DESCRIPTION πŸ’œ

so this state is what manages a single DOE mailbox capability. one struct, one capability, that's the whole vibe.

and here's the thing, bestie β€” listen closely: all fields should be considered opaque to the consumers. literally all of them. don't go poking at her internals, don't try to be cute with it, that's not the assignment πŸ™ˆ

how it actually works: the structure gets created by pci_doe_create_mb, and then you pass it into the helpers below. that's it. that's the flow. chef's kiss πŸ‘‘

ngl, "opaque" is doing a lot of heavy lifting in that sentence. respect it. do not reach into the struct. fr fr πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, keep them close, they're all linked πŸ‘‘:


and that's the page, bestie πŸ“ this whole thing lives over in ./drivers/pci, it's dated October 2026, and it's part of the Kernel API Manual. go forth, treat the struct as opaque, and slay πŸ’–βœ¨

πŸ“¦ where this page comes from