[usb] Try multiple USB device configurations

Iterate over a USB device's available configurations until we find one
for which we have working drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-02-09 13:37:34 +00:00
parent 2e72d100af
commit a60f2ddfeb
2 changed files with 137 additions and 72 deletions

View File

@@ -1034,13 +1034,13 @@ usb_get_config_descriptor ( struct usb_device *usb, unsigned int index,
* Set USB configuration
*
* @v usb USB device
* @v config Configuration value
* @v index Configuration index
* @ret rc Return status code
*/
static inline __attribute__ (( always_inline )) int
usb_set_configuration ( struct usb_device *usb, unsigned int config ) {
usb_set_configuration ( struct usb_device *usb, unsigned int index ) {
return usb_control ( usb, USB_SET_CONFIGURATION, config, 0, NULL, 0 );
return usb_control ( usb, USB_SET_CONFIGURATION, index, 0, NULL, 0 );
}
/**