STRUCT MEI_HW_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mei_hw_ops(9) β€” the Kernel API Manual, bestie edition ✨

okay so picture this: it's struct mei_hw_ops, and it lives in the Kernel API Manual, and it is literally the blueprint for "hw specific ops" πŸŽ€ like, this is the struct that tells your driver how to talk to its actual hardware. every hook you could possibly need, all in one adorable little bundle. iykyk.


✨ SYNOPSIS ✨

here's the whole thing, character for character, no cap:

struct mei_hw_ops {
    bool (*host_is_ready)(struct mei_device *dev);
    bool (*hw_is_ready)(struct mei_device *dev);
    int (*hw_reset)(struct mei_device *dev, bool enable);
    int (*hw_start)(struct mei_device *dev);
    int (*hw_config)(struct mei_device *dev);
    int (*fw_status)(struct mei_device *dev, struct mei_fw_status
*fw_sts);
    int (*trc_status)(struct mei_device *dev, u32 *trc);
    enum mei_pg_state (*pg_state)(struct mei_device *dev);
    bool (*pg_in_transition)(struct mei_device *dev);
    bool (*pg_is_enabled)(struct mei_device *dev);
    void (*intr_clear)(struct mei_device *dev);
    void (*intr_enable)(struct mei_device *dev);
    void (*intr_disable)(struct mei_device *dev);
    void (*synchronize_irq)(struct mei_device *dev);
    int (*hbuf_free_slots)(struct mei_device *dev);
    bool (*hbuf_is_ready)(struct mei_device *dev);
    u32 (*hbuf_depth)(const struct mei_device *dev);
    int (*write)(struct mei_device *dev, const void *hdr, size_t
hdr_len, const void *data, size_t data_len);
    int (*rdbuf_full_slots)(struct mei_device *dev);
    u32 (*read_hdr)(const struct mei_device *dev);
    int (*read)(struct mei_device *dev, unsigned char *buf, unsigned
long len);
 };

like, look at her. twenty-one function pointers. main character energy fr fr. πŸ‘‘


🌸 Members 🌸

okay bestie, let's go through every single one, because we do NOT skip:

  • host_is_ready β€” query for host readiness 🫢 (is the host awake and vibing?)
  • hw_is_ready β€” query if hw is ready ✨ (is the hardware itself good to go?)
  • hw_reset β€” reset hw πŸ”„
  • hw_start β€” start hw after reset πŸš€ (post-reset glow-up)
  • hw_config β€” configure hw πŸŽ€
  • fw_status β€” get fw status registers πŸ“‹
  • trc_status β€” get trc status register πŸ”
  • pg_state β€” power gating state of the device πŸ’€
  • pg_in_transition β€” is device now in pg transition πŸ¦‹ (mid-nap, basically)
  • pg_is_enabled β€” is power gating enabled πŸ”‹
  • intr_clear β€” clear pending interrupts 🧹
  • intr_enable β€” enable interrupts πŸ””
  • intr_disable β€” disable interrupts πŸ”•
  • synchronize_irq β€” synchronize irqs 🎡 (everybody on beat, periodt)
  • hbuf_free_slots β€” query for write buffer empty slots πŸ•³οΈ
  • hbuf_is_ready β€” query if write buffer is empty πŸ«™ (yes, it says "is ready" but the vibe is "is empty" β€” that's what the page says, don't come for me)
  • hbuf_depth β€” query for write buffer depth πŸ“
  • write β€” write a message to FW πŸ“¨ (send it, bestie)
  • rdbuf_full_slots β€” query how many slots are filled 🧺
  • read_hdr β€” get first 4 bytes (header) 🏷️
  • read β€” read a buffer from the FW πŸ“₯

highkey obsessed with how tidy this list is. every op accounted for. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

if you wanna go deeper (and you do), the Kernel file to peek at is ./drivers/misc/mei/mei_dev.h, and these besties are all in the same orbit:


ok that's the whole page, nothing skipped, nothing invented, all 21 members and all 20 SEE ALSO refs present and accounted for πŸ’―

and that's a wrap, bestie!! πŸŽ€ this legendary page lives under ./drivers/misc/mei, and it's dated October 2026 β€” so go forth, wire up your hw ops, and slay πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from