]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[undi] Try matching UNDI ROMs in BIOS enumeration order
authorMichael Brown <mcb30@ipxe.org>
Wed, 7 Dec 2016 07:25:44 +0000 (07:25 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 7 Dec 2016 07:25:44 +0000 (07:25 +0000)
When searching for an UNDI ROM to match against a PCI device, search
in order of increasing ROM address (within the 128kB BIOS option ROM
area).  This is likely (though not guaranteed) to match the order of
the original enumeration performed by the BIOS, which is in turn
likely to match the order of enumeration on the PCI bus.

Since we load at most one UNDI ROM, the net result is that we increase
our chances of loading the ROM corresponding to the selected PCI
device (rather than loading a ROM corresponding to a higher-numbered
PCI device with the same vendor and device IDs.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/drivers/net/undirom.c

index b54c6170f116c2c3ff729f52401a48ad1ac88eac..257b12411a4264bc0e61c659424409669b83a5e7 100644 (file)
@@ -168,7 +168,7 @@ static int undirom_probe ( unsigned int rom_segment ) {
 
        /* Add to UNDI ROM list and return */
        DBGC ( undirom, "UNDIROM %p registered\n", undirom );
-       list_add ( &undirom->list, &undiroms );
+       list_add_tail ( &undirom->list, &undiroms );
        return 0;
 
  err: