1USB_IFNUM_TO_IF(9)               USB Core APIs              USB_IFNUM_TO_IF(9)
2
3
4

NAME

6       usb_ifnum_to_if - get the interface object with a given interface
7       number
8

SYNOPSIS

10       struct usb_interface * usb_ifnum_to_if(const struct usb_device * dev,
11                                              unsigned ifnum);
12

ARGUMENTS

14       dev
15           the device whose current configuration is considered
16
17       ifnum
18           the desired interface
19

DESCRIPTION

21       This walks the device descriptor for the currently active configuration
22       to find the interface object with the particular interface number.
23
24       Note that configuration descriptors are not required to assign
25       interface numbers sequentially, so that it would be incorrect to assume
26       that the first interface in that descriptor corresponds to interface
27       zero. This routine helps device drivers avoid such mistakes. However,
28       you should make sure that you do the right thing with any alternate
29       settings available for this interfaces.
30
31       Don't call this function unless you are bound to one of the interfaces
32       on this device or you have locked the device!
33

RETURN

35       A pointer to the interface that has ifnum as interface number, if
36       found.  NULL otherwise.
37
39Kernel Hackers Manual 3.10         June 2019                USB_IFNUM_TO_IF(9)
Impressum