]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[usb] Move usbio driver to end of USB driver list
authorMichael Brown <mcb30@ipxe.org>
Tue, 13 Oct 2020 14:29:23 +0000 (15:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 13 Oct 2020 14:56:38 +0000 (15:56 +0100)
commit88288407af0e24bebdc7a6cebe93a82285bbc4a1
tree5bd19dcdbaef1b574e1683e2d0c19125b6c3dbc7
parente30c26d01c7493a7e02e77fc80c490fc85612d5a
[usb] Move usbio driver to end of USB driver list

iPXE will often have multiple drivers available for a USB device.  For
example: some USB network devices will support both RNDIS and CDC-ECM,
and any device may be consumed by the fallback "usbio" driver under
UEFI in order to expose an EFI_USB_IO_PROTOCOL instance.

The driver scoring mechanism is used to select a device configuration
based on the availability of drivers for the interfaces exposed in
each configuration.

For the case of RNDIS versus CDC-ECM, this mechanism will always
produce the correct result since RNDIS and CDC-ECM will not exist
within the same configuration and so each configuration will receive a
score based on the relevant driver.

This guarantee does not hold for the "usbio" driver, which will match
against any device.  It is a surprising coincidence that the "usbio"
driver seems to usually end up at the tail end of the USB drivers
list, thereby resulting in the expected behaviour.

Guarantee the expected behaviour by explicitly placing the "usbio"
driver at the end of the USB drivers list.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/usb.h
src/interface/efi/efi_usb.c