usb_gstrings_attach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ usb_gstrings_attach(9) ✨

okay so welcome to the Kernel API Manual, bestie πŸ’– this is the page for usb_gstrings_attach, and it's all about attaching gadget strings to a cdev and assigning ids. no cap, it's a real one.

🌸 NAME 🌸

usb_gstrings_attach β€” attach gadget strings to a cdev and assign ids

πŸŽ€ SYNOPSIS πŸŽ€

struct usb_string * usb_gstrings_attach (struct usb_composite_dev *cdev
, struct usb_gadget_strings **sp , unsigned n_strings );

πŸ’… ARGUMENTS πŸ’…

  • cdev β€” the device whose string descriptor IDs are being allocated and attached.
  • sp β€” an array of usb_gadget_strings to attach.
  • n_strings β€” number of entries in each usb_strings array (sp[]->strings)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what this function does is create a deep copy of usb_gadget_strings and usb_string, and attach it to the cdev. The actual string (usb_string.s) will not be copied β€” only a reference will be made to it. So like, the string data stays where it is, bestie.

The struct usb_gadget_strings array may contain multiple languages and should be NULL terminated. The ->language pointer of each struct usb_gadget_strings has to contain the same amount of entries. For instance: sp[0] is en-US, sp[1] is es-ES. It is expected that the first usb_string entry of es-ES contains the translation of the first usb_string entry of en-US. Therefore both entries become the same id assign.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./drivers/usb/gadget/composite.c β€” that's the spot, iykyk πŸ‘€


okay that's the whole page, bestie πŸ’– source: ./drivers/usb/gadget; version/manual: Kernel API Manual; date: October 2026; page: usb_gstrings_attach(9). periodt ✨

πŸ“¦ where this page comes from