aboutsummaryrefslogtreecommitdiff
path: root/src/usr
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2015-03-17 02:30:06 +0000
committerMichael Brown <mcb30@ipxe.org>2015-03-17 02:30:06 +0000
commit75d6fec6c4209e090dd48f83a1a6d1054c66af3c (patch)
treeb7978802aea214b7893bb8819df1054488e3f3d3 /src/usr
parent3de0ffc8872267c2352a86f738474a91660443d0 (diff)
downloadipxe-75d6fec6c4209e090dd48f83a1a6d1054c66af3c.zip
ipxe-75d6fec6c4209e090dd48f83a1a6d1054c66af3c.tar.gz
ipxe-75d6fec6c4209e090dd48f83a1a6d1054c66af3c.tar.bz2
[autoboot] Match against parent devices when matching by bus type and location
When using iPXE as an option ROM for a PCI USB controller (e.g. via qemu's "-device nec-usb-xhci,romfile=..." syntax), the ROM prefix will set the PCI bus:dev.fn address of the USB controller as the PCI autoboot device. This will cause iPXE to fail to boot from any detected USB network devices, since they will not match the autoboot bus type (or location). Fix by allowing the autoboot bus type and location to match against the network device or any of its parent devices. This allows the match to succeed for USB network devices attached to the selected PCI USB controller. Reported-by: Dan Ellis <Dan.Ellis@displaylink.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/autoboot.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 72b8350..ccafeae 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -439,9 +439,14 @@ int netboot ( struct net_device *netdev ) {
* @ret is_autoboot Network device matches the autoboot device
*/
static int is_autoboot_busloc ( struct net_device *netdev ) {
+ struct device *dev;
- return ( ( netdev->dev->desc.bus_type == autoboot_desc.bus_type ) &&
- ( netdev->dev->desc.location == autoboot_desc.location ) );
+ for ( dev = netdev->dev ; dev ; dev = dev->parent ) {
+ if ( ( dev->desc.bus_type == autoboot_desc.bus_type ) &&
+ ( dev->desc.location == autoboot_desc.location ) )
+ return 1;
+ }
+ return 0;
}
/**