1USB_STRING_IDS_N(9) Kernel Mode Gadget API USB_STRING_IDS_N(9)
2
3
4
6 usb_string_ids_n - allocate unused string IDs in batch
7
9 int usb_string_ids_n(struct usb_composite_dev * c, unsigned n);
10
12 c
13 the device whose string descriptor IDs are being allocated
14
15 n
16 number of string IDs to allocate
17
19 single threaded during gadget setup
20
22 Returns the first requested ID. This ID and next n-1 IDs are now valid
23 IDs. At least provided that n is non-zero because if it is, returns
24 last requested ID which is now very useful information.
25
26 usb_string_ids_n() is called from bind callbacks to allocate string
27 IDs. Drivers for functions, configurations, or gadgets will then store
28 that ID in the appropriate descriptors and string table.
29
30 All string identifier should be allocated using this, usb_string_id()
31 or usb_string_ids_n() routine, to ensure that for example different
32 functions don't wrongly assign different meanings to the same
33 identifier.
34
36 David Brownell <dbrownell@users.sourceforge.net>
37 Author.
38
40Kernel Hackers Manual 3.10 June 2019 USB_STRING_IDS_N(9)