[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:
Michael Brown
2015-09-14 21:45:34 +01:00
parent e727f576c2
commit 549a0caabb
10 changed files with 309 additions and 167 deletions
+2 -2
View File
@@ -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];