STRUCT USB_INTERFACE_CACHE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct usb_interface_cache(9) ✨

okay so bestie, we're in the Kernel API Manual today and this one is genuinely one of the good ones β€” it's the long-term representation of a device interface πŸ’… like, this struct is the one that stays.


🌸 NAME 🌸

struct usb_interface_cache β€” long-term representation of a device interface ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct usb_interface_cache {
    unsigned num_altsetting;
    struct kref ref;
    struct usb_host_interface altsetting[];
 };

πŸŽ€ Members πŸŽ€

  • num_altsetting β€” the number of altsettings that are defined, fr fr. that's the count, no cap.
  • ref β€” the reference counter 🫢 (it's a struct kref, she's keeping track).
  • altsetting β€” a variable-length array of interface structures, one for each alternate setting that may be selected ✨. each one includes a set of endpoint configurations. and heads up: they will be in no particular order πŸ™ˆ so don't go assuming any kind of sorted vibe, because there isn't one.

πŸ’– Description πŸ’–

so here's the moment. these structures persist for the lifetime of a usb_device β€” which is literally the whole point of them. unlike struct usb_interface (which persists only as long as its configuration is installed 😭), these ones stick around.

and because they stick around, the altsetting arrays can be accessed through these structures at any time ⭐ β€” that means you can compare configurations, and it's also what provides support for the /sys/kernel/debug/usb/devices pseudo-file. icon behaviour. ate. πŸ‘‘


🌈 SEE ALSO 🌈

kernel file ./include/linux/usb.h, plus the whole friend group:


okay that's the whole page bestie, go forth and cache responsibly πŸ§šπŸ’œ

this one came out of ./include/linux and it's dated October 2026 β€” and the page footer is still signing off as struct usb_interface_cache(9), periodt πŸ’…πŸ“
πŸ“¦ where this page comes from