STRUCT MEI_HW_OPS(9)
π 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:
enum mei_dev_pxp_mode(9)enum mei_dev_reset_to_pxp(9)enum mei_cb_file_ops(9)enum mei_cl_io_mode(9)struct mei_dma_dscr(9)struct mei_me_client(9)struct mei_cl_cb(9)struct mei_cl_vtag(9)struct mei_cl(9)enum mei_pg_event(9)enum mei_pg_state(9)struct mei_fw_version(9)enum mei_dev_kind(9)struct mei_device(9)mei_data2slots(9)mei_hbm2slots(9)mei_slots2data(9)mei_fw_status_str(9)kind_is_gsc(9)kind_is_gscfi(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms