STRUCT MODE_SELECTION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌈 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 protect mode_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 πŸ”₯

like, go read those too, iykyk πŸ’…


lowkey reminder bestie: this is kernel API territory β€” read the actual source before you go poking mode_list without holding lock, 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