]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[bofm] Report {slot,port} to {bus:dev.fn,mport} mapping on newer BOFM builds
authorMichael Brown <mcb30@ipxe.org>
Wed, 4 May 2011 11:04:14 +0000 (12:04 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 4 May 2011 11:14:37 +0000 (12:14 +0100)
Newer BOFM builds provide support for mapping multiple physical ports
to a single PCI bus:dev.fn via PCI VPD descriptions.  These builds
will also leave the {slot,port} field intact, and will populate the
mport field with a meaningful value.

Older BOFM builds will zero out the {slot,port} field.  A zero value
in this field may indicate either a genuine zero value (i.e. slot 0
first port) or an older build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/bofm/bofm.c

index dbb98dc44ba243294edf460713bd3a5c6d30383a..63b25a55d3007fab5cc85c73147537778a7e8570 100644 (file)
@@ -306,11 +306,16 @@ int bofm ( userptr_t bofmtab, struct pci_device *pci ) {
                              en.slot, ( en.port + 1 ) );
                        continue;
                }
+               DBG ( "BOFM: slot %d port %d%s is " PCI_FMT " mport %d\n",
+                     en.slot, ( en.port + 1 ),
+                     ( ( en.slot || en.port ) ? "" : "(?)" ),
+                     PCI_BUS ( en.busdevfn ), PCI_SLOT ( en.busdevfn ),
+                     PCI_FUNC ( en.busdevfn ), en.mport );
                bofm = bofm_find_busdevfn ( en.busdevfn );
                if ( ! bofm ) {
-                       DBG ( "BOFM: " PCI_FMT " ignored\n",
+                       DBG ( "BOFM: " PCI_FMT " mport %d ignored\n",
                              PCI_BUS ( en.busdevfn ), PCI_SLOT ( en.busdevfn ),
-                             PCI_FUNC ( en.busdevfn ) );
+                             PCI_FUNC ( en.busdevfn ), en.mport );
                        continue;
                }
                if ( ( rc = bofm_en ( bofm, &en ) ) == 0 ) {