From bfd8b3bff9b187850ca8b1e436b2eedbb45b5971 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 4 May 2011 12:04:14 +0100 Subject: [PATCH] [bofm] Report {slot,port} to {bus:dev.fn,mport} mapping on newer BOFM builds 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 --- src/interface/bofm/bofm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/interface/bofm/bofm.c b/src/interface/bofm/bofm.c index dbb98dc4..63b25a55 100644 --- a/src/interface/bofm/bofm.c +++ b/src/interface/bofm/bofm.c @@ -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 ) {