STRUCT SENSOR_HUB_DATA(9)
π struct sensor_hub_data(9) π
okay so bestie, welcome to the Kernel API Manual β this one's from the struct sensor_hub_data(9) page and it's literally all about the vibes of one single HID hub device's private data. think of it as the group chat that holds all the state for a hub. no cap. π«Ά
β¨ NAME β¨
struct sensor_hub_data β hold a instance data for a HID hub device
like, it's the little container where the instance data for a HID hub device lives. main character storage unit energy. π
πΈ SYNOPSIS πΈ
struct sensor_hub_data {
struct mutex mutex;
spinlock_t lock;
struct list_head dyn_callback_list;
spinlock_t dyn_callback_lock;
struct mfd_cell *hid_sensor_hub_client_devs;
int hid_sensor_client_cnt;
int ref_cnt;
};
that's the whole struct, exactly as it is β do not come for me about the spacing, I copied it character for character. π
π¦ Members π¦
get comfy, we're going through every single field, one by one, and yes I mean all of them:
mutexβ a mutex whose whole job is to serialize synchronous requests. one at a time please, we're not doing chaos in here. πlockβ a spin lock that protects the pending request structure. it's giving bodyguard for pending requests. π‘οΈdyn_callback_listβ holds the callback function. that's it, that's the whole thing. the callbacks live here. β¨dyn_callback_lockβ a spin lock to protect the callback list. someone's gotta guard the list, and it's her. πhid_sensor_hub_client_devsβ stores all the MFD cells for a hub instance. like a little shoebox full of MFD cells, one hub instance at a time. πhid_sensor_client_cntβ the number of MFD cells, which is also (no of sensors attached). so if you ever wondered how many sensors are attached, it's this number. πref_cntβ the number of MFD clients that have opened this device. it's a headcount, basically. every client that opens the device increments the vibe. π§
ngl if you touch this struct you should know what every single one of these fields is doing. it's kernel code bestie, not a sandbox. π₯
π SEE ALSO π
- Kernel file
./drivers/hid/hid-sensor-hub.cstruct hid_sensor_hub_callbacks_list(9)β go read this one too, iykyk π
β aaand that's the page! cute little sign-off for you: this gem lives over in ./drivers/hid, and the page is dated October 2026. slay, go read the kernel source, 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