usb_altnum_to_altsetting (9) - Linux Man Pages
usb_altnum_to_altsetting: get the altsetting structure with a given alternate setting number.
usb_altnum_to_altsetting - get the altsetting structure with a given alternate setting number.
struct usb_host_interface * usb_altnum_to_altsetting(const struct usb_interface
*intf, unsigned int altnum);
- the interface containing the altsetting in question
- the desired alternate setting number
This searches the altsetting array of the specified interface for an entry with the correct bAlternateSetting value.
Note that altsettings need not be stored sequentially by number, so it would be incorrect to assume that the first altsetting entry in the array corresponds to altsetting zero. This routine helps device drivers avoid such mistakes.