STRUCT MODE_SELECTION(9)
π struct mode_selection β Kernel API Manual π
okay so bestie, welcome to the iconic little struct that manages the selection and state of Alternate Modes β¨. yes, that's its whole job. it's giving "I keep the Alt Modes in line" main character energy, and honestly? it ate.
β¨ NAME β¨
struct mode_selection β Manages the selection and state of Alternate Modes π¦
π SYNOPSIS π
struct mode_selection {
struct list_head mode_list;
struct mutex lock;
struct delayed_work work;
struct typec_partner *partner;
u16 active_svid;
unsigned int timeout;
unsigned int delay;
};
like, that's the whole thing. seven members. no cap. πΈ
π Members π
okay so here's the member-by-member breakdown, and yes I'm gonna hype each one because they all matter fr fr:
mode_listβ Prioritized list of available Alternate Modes π the order here is literally the priority, so don't be messy with it.lockβ Mutex to protectmode_listπ yes bestie, protect it. concurrent access is not the vibe.workβ Work structure βοΈpartnerβ Handle to the Type-C partner device π«Άactive_svidβ svid of currently active mode π·οΈtimeoutβ Timeout for a mode entry attempt, ms β³ (milliseconds, so like, don't blink)delayβ Delay between mode entry/exit attempts, ms π (also milliseconds β pacing is everything, periodt)
π₯ SEE ALSO π₯
- Kernel file
./drivers/usb/typec/mode_selection.c struct mode_state(9)struct mode_order(9)mode_selection_work_fn(9)
like, go read those too, iykyk π
lowkey reminder bestie: this is kernel API territory β read the actual source before you go pokingmode_listwithout holdinglock, okay? π
π that's the whole page! source/version: ./drivers/usb/typec, dated October 2026, and the man page name is struct mode_selection(9) β take care of her, she's iconic. 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