STRUCT USB_OS_STRING(9)
β¨ struct usb_os_string(9) β¨
okay so bestie, welcome to the Kernel API Manual β section 9, we're in the gadget weeds today π
this one's all about struct usb_os_string, which is literally the thing that represents the OS String that a gadget reports. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
here's the whole struct, character for character, no cap:
struct usb_os_string {
__u8 bLength;
__u8 bDescriptorType;
__u8 qwSignature[OS_STRING_QW_SIGN_LEN];
__u8 bMS_VendorCode;
__u8 bPad;
};
π MEMBERS π
bLengthβ the total length of the entire descriptor, and it's always0x12. like, always always. don't be quirky about it π«ΆbDescriptorTypeβ this bad boy isUSB_DT_STRING. that's the whole assignment, icon behavior βqwSignatureβ the OS String proper, the main character energy of the whole struct πbMS_VendorCodeβ the code the host uses for the requests that come after this one π₯bPadβ not used at all, and it must be zero. zero. nada. nothing. don't put stuff in there π
π¦ SEE ALSO π¦
so many siblings, iykyk π all of these live in the kernel file ./drivers/usb/gadget/composite.c:
function_descriptors(9)next_desc(9)config_ep_by_speed_and_alt(9)config_ep_by_speed(9)usb_add_function(9)usb_function_deactivate(9)usb_function_activate(9)usb_interface_id(9)usb_func_wakeup(9)bos_desc(9)usb_add_config(9)usb_string_id(9)usb_string_ids_tab(9)usb_gstrings_attach(9)usb_string_ids_n(9)usb_composite_probe(9)usb_composite_unregister(9)usb_composite_setup_continue(9)
ok that's the whole page bestie, go struct responsibly π§π
source: ./drivers/usb/gadget β dated October 2026 β that's the tea, 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