1USB_IFNUM_TO_IF(9) USB Core APIs USB_IFNUM_TO_IF(9)
2
3
4
6 usb_ifnum_to_if - get the interface object with a given interface
7 number
8
10 struct usb_interface * usb_ifnum_to_if(const struct usb_device * dev,
11 unsigned ifnum);
12
14 dev
15 the device whose current configuration is considered
16
17 ifnum
18 the desired interface
19
21 This walks the device descriptor for the currently active configuration
22 and returns a pointer to the interface with that particular interface
23 number, or null.
24
25 Note that configuration descriptors are not required to assign
26 interface numbers sequentially, so that it would be incorrect to assume
27 that the first interface in that descriptor corresponds to interface
28 zero. This routine helps device drivers avoid such mistakes. However,
29 you should make sure that you do the right thing with any alternate
30 settings available for this interfaces.
31
32 DonĀ“t call this function unless you are bound to one of the interfaces
33 on this device or you have locked the device!
34
36Kernel Hackers Manual 2.6. June 2019 USB_IFNUM_TO_IF(9)