STRUCT MHI_BUF(9)
π struct mhi_buf(9) β the Kernel API Manual, but make it make sense
okay bestie, so this whole page is about one lil struct called mhi_buf, and it's basically the "here's my buffer, here's where it lives, here's how big it is" receipt for MHI. that's it. that's the vibe. MHI Buffer description, periodt. π
β¨ SYNOPSIS β¨
like, here's the actual shape of it, copy it exactly or don't come crying to me:
struct mhi_buf {
void *buf;
const char *name;
dma_addr_t dma_addr;
size_t len;
};
that's the whole struct. four fields. iconic minimalism honestly. π¦
πΈ Members πΈ
so let's go through each field one by one, no skipping, i promise:
bufβ the virtual address of the buffer. yes bestie, the virtual one. it's the pointer you actually use in your code, the vibe-address, the one your CPU sees. πnameβ the buffer label. cute little nametag for your buffer. BUT β and this is the part where you gotta pay attention β for an offload channel, the configurationsnamemust be:ECAβ Event context array dataCCAβ Channel context array data
like, those aren't suggestions, that's literally what it must be. the kernel will be like "who is this" if you name it anything else. no cap. π₯
dma_addrβ the IOMMU address of the buffer. so like,bufis the address you know, anddma_addris the address the device knows after IOMMU translation. two addresses, one buffer, main character energy. β¨lenβ the # of bytes. just the count. how many bytes are we talking. that's the whole field. π
π«Ά SEE ALSO π«Ά
okay so the kernel file lives at ./include/linux/mhi.h and it's surrounded by a whole friend group of related symbols β literally the entire MHI extended universe, i'm obsessed. here's every single one, i'm not leaving a single one out because you deserve the full list:
enum mhi_callback(9), enum mhi_flags(9), enum mhi_device_type(9), enum mhi_ch_type(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), struct mhi_driver(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)
go read those too, iykyk. π
ok so that's the whole page bestie, you ate that fr fr π
and like, credits where credits are due: this came from the kernel file ./include/linux, dated October 2026 β so yeah, future-coded of it, we love that for us. stay hydrated, read your headers, mwah ππ§
π¦ 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