STRUCT I3C_IBI_SETUP(9)
β¨ struct i3c_ibi_setup(9) β¨
okay so bestie, welcome to the Kernel API Manual entry for struct i3c_ibi_setup β aka the IBI setup object π this is the little cutie you fill out before you go ask the kernel for some IBI slots, and honestly? it's giving "small struct, big responsibility" π
πΈ NAME πΈ
struct i3c_ibi_setup β the IBI setup object, periodt β¨
π¦ SYNOPSIS π¦
struct i3c_ibi_setup {
unsigned int max_payload_len;
unsigned int num_slots;
void (*handler)(struct i3c_device *dev, const struct i3c_ibi_payload *payload);
};
like, look at her. three members. no notes. π
π Members π
max_payload_lenβ the maximum length of the payload that comes attached to an IBI. and listen, this one has teeth π¦·: if an IBI shows up with a payload bigger than this number, the IBI gets rejected. no cap, it's just gone. so pick this number like you mean it πnum_slotsβ how many IBI slots you're pre-allocating. the whole vibe here is: choose it so the system never runs out of IBI slots, because if it does β you'll lose IBIs π literally just dropping them. so size it generously, bestie, this is not the place to be stingy πhandlerβ your IBI handler, and it fires every time an IBI is received β important detail: this handler is called in a workqueue context. that means it is allowed to sleep π΄ and it is allowed to send new messages on the bus. but like β keep the processing in there as fast as possible, because otherwise you're delaying the processing of other work queued on the same workqueue, and nobody wants that energy π«Ά
π Description π
so what even is this thing? it's a temporary structure used to pass information into i3c_device_request_ibi. that's the whole job. she's a messenger π§
and here's the slay part: this object can be allocated on the stack β¨ because i3c_device_request_ibi copies every single bit of information out of it, and does not use it after i3c_device_request_ibi has returned. so you can just make one on the stack, hand it over, and move on with your life. iconic behavior honestly π
quick vibe check π¨: stack-allocating is fine specifically because the copy happens. don't go thinking the kernel is keeping a pointer to your little stack struct β it's not, and that's the whole reason this is allowed π
π SEE ALSO π
go read these next, bestie, they're all in the kernel file ./include/linux/i3c/device.h π:
enum i3c_error_code(9)enum i3c_xfer_mode(9)struct i3c_xfer(9)enum i3c_dcr(9)struct i3c_device_info(9)struct i3c_driver(9)dev_to_i3cdev(9)module_i3c_driver(9)i3c_i2c_driver_register(9)i3c_i2c_driver_unregister(9)module_i3c_i2c_driver(9)
and that's the whole page, bestie π«Ά this lil gem lives in ./include/linux/i3c and it's dated October 2026 β so yeah, technically it's from the future, and honestly? it ate. πβ¨
π¦ 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