STRUCT MHI_DRIVER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct mhi_driver β€” the struct that's basically the whole personality of an MHI client driver πŸ‘‘

Okay bestie, so this is the Kernel API Manual page for it, and it's genuinely not that deep once you see it β€” but the details matter, so let's go 🫢


✨ SYNOPSIS ✨

struct mhi_driver {
    const struct mhi_device_id *id_table;
    int (*probe)(struct mhi_device *mhi_dev, const struct mhi_device_id *id);
    void (*remove)(struct mhi_device *mhi_dev);
    void (*ul_xfer_cb)(struct mhi_device *mhi_dev, struct mhi_result *result);
    void (*dl_xfer_cb)(struct mhi_device *mhi_dev, struct mhi_result *result);
    void (*status_cb)(struct mhi_device *mhi_dev, enum mhi_callback mhi_cb);
    struct device_driver driver;
 };

Like… it's a struct with a bunch of function pointers and one embedded struct device_driver. That's the whole vibe check and it passes πŸ’…


🌸 Members 🌸

  • id_table β€” the table of MHI channel names that a driver supports. This is your driver's ~aesthetic~, aka what it's willing to match with πŸ”₯
  • probe β€” the CB function for the client driver probe function. Yes bestie, it returns int, and it gets handed a struct mhi_device *mhi_dev plus a const struct mhi_device_id *id. Main character callback energy ✨
  • remove β€” the CB function for the client driver remove function. It takes struct mhi_device *mhi_dev and returns nothing. Clean exit, no drama πŸŽ€
  • ul_xfer_cb β€” the CB function for UL data transfer. Signature is struct mhi_device *mhi_dev and struct mhi_result *result β€” UL girlies rise 😭
  • dl_xfer_cb β€” the CB function for DL data transfer. Same deal: struct mhi_device *mhi_dev and struct mhi_result *result. DL girlies you're also seen πŸ¦‹
  • status_cb β€” the CB functions for asynchronous status. It takes struct mhi_device *mhi_dev and enum mhi_callback mhi_cb, because status updates don't wait for anyone ⭐
  • driver β€” the Device driver model driver, straight up a struct device_driver. It's giving "I'm embedded in the kernel driver model now" πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

Okay so the source of all this is the kernel file ./include/linux/mhi.h β€” go read it, it's iconic πŸ’œ

And then there's the whole friend group of references, all (9) section besties, no cap:


ngl the __mhi_driver_register(9) one leading with double underscores is such a mood β€” it's the internal one, iykyk πŸ™ˆ

Okay that's the whole page, you ate that πŸ’… The source lives at ./include/linux, this snapshot is dated October 2026, and it's filed under struct mhi_driver(9) β€” remember it, cite it, periodt πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from