[usb] Select preferred USB device configuration based on driver score
Generate a score for each possible USB device configuration based on the available driver support, and select the configuration with the highest score. This will allow us to prefer ECM over RNDIS (for devices which support both) and will allow us to meaningfully select a configuration even when we have drivers available for all functions (e.g. when exposing unused functions via EFI_USB_IO_PROTOCOL). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -173,7 +173,7 @@ static int usbnet_comms_describe ( struct usbnet_device *usbnet,
|
||||
int rc;
|
||||
|
||||
/* Iterate over all available interfaces */
|
||||
for ( i = 0 ; i < usbnet->func->count ; i++ ) {
|
||||
for ( i = 0 ; i < usbnet->func->desc.count ; i++ ) {
|
||||
|
||||
/* Get interface number */
|
||||
comms = usbnet->func->interface[i];
|
||||
@@ -217,7 +217,7 @@ static int usbnet_data_describe ( struct usbnet_device *usbnet,
|
||||
int rc;
|
||||
|
||||
/* Iterate over all available interfaces */
|
||||
for ( i = 0 ; i < usbnet->func->count ; i++ ) {
|
||||
for ( i = 0 ; i < usbnet->func->desc.count ; i++ ) {
|
||||
|
||||
/* Get interface number */
|
||||
data = usbnet->func->interface[i];
|
||||
|
||||
Reference in New Issue
Block a user