STRUCT MHI_DRIVER(9)
π 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 returnsint, and it gets handed astruct mhi_device *mhi_devplus aconst struct mhi_device_id *id. Main character callback energy β¨removeβ the CB function for the client driver remove function. It takesstruct mhi_device *mhi_devand returns nothing. Clean exit, no drama πul_xfer_cbβ the CB function for UL data transfer. Signature isstruct mhi_device *mhi_devandstruct mhi_result *resultβ UL girlies rise πdl_xfer_cbβ the CB function for DL data transfer. Same deal:struct mhi_device *mhi_devandstruct mhi_result *result. DL girlies you're also seen π¦status_cbβ the CB functions for asynchronous status. It takesstruct mhi_device *mhi_devandenum mhi_callback mhi_cb, because status updates don't wait for anyone βdriverβ the Device driver model driver, straight up astruct 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:
enum mhi_callback(9)enum mhi_flags(9)enum mhi_device_type(9)enum mhi_ch_type(9)struct mhi_buf(9)struct image_info(9)struct mhi_link_info(9)enum mhi_ee_type(9)enum mhi_state(9)enum mhi_ch_ee_mask(9)enum mhi_er_data_type(9)enum mhi_db_brst_mode(9)struct mhi_channel_config(9)struct mhi_event_config(9)struct mhi_controller_config(9)struct mhi_controller(9)struct mhi_device(9)struct mhi_result(9)mhi_alloc_controller(9)mhi_free_controller(9)mhi_register_controller(9)mhi_unregister_controller(9)__mhi_driver_register(9)mhi_driver_unregister(9)mhi_set_mhi_state(9)mhi_notify(9)mhi_get_free_desc_count(9)mhi_prepare_for_power_up(9)mhi_async_power_up(9)mhi_sync_power_up(9)mhi_power_down(9)mhi_power_down_keep_dev(9)mhi_unprepare_after_power_down(9)mhi_pm_suspend(9)mhi_pm_resume(9)mhi_pm_resume_force(9)mhi_download_rddm_image(9)mhi_force_rddm_mode(9)mhi_get_exec_env(9)mhi_get_mhi_state(9)mhi_soc_reset(9)mhi_device_get_sync(9)mhi_device_put(9)mhi_prepare_for_transfer(9)mhi_unprepare_from_transfer(9)mhi_queue_buf(9)mhi_queue_skb(9)mhi_queue_is_full(9)mhi_get_channel_doorbell_offset(9)
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
- 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