diff options
author | Michael Brown | 2011-02-09 01:32:58 +0100 |
---|---|---|
committer | Michael Brown | 2011-02-17 02:25:11 +0100 |
commit | f9b3fae8d46a6b1862b3f5b02490e5a8c224286f (patch) | |
tree | 1862f41cd2b7ab031780881ed953acc647d38114 /src/interface/efi/efi_pci.c | |
parent | [bitops] Add missing __attribute__ (( packed )) (diff) | |
download | ipxe-f9b3fae8d46a6b1862b3f5b02490e5a8c224286f.tar.gz ipxe-f9b3fae8d46a6b1862b3f5b02490e5a8c224286f.tar.xz ipxe-f9b3fae8d46a6b1862b3f5b02490e5a8c224286f.zip |
[pci] Use single "busdevfn" field in struct pci_device
Merge the "bus" and "devfn" fields into a single "busdevfn" field, to
match the format used by the majority of external code.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_pci.c')
-rw-r--r-- | src/interface/efi/efi_pci.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/interface/efi/efi_pci.c b/src/interface/efi/efi_pci.c index 9a402c44..c240d4cb 100644 --- a/src/interface/efi/efi_pci.c +++ b/src/interface/efi/efi_pci.c @@ -35,8 +35,9 @@ EFI_REQUIRE_PROTOCOL ( EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL, &efipci ); static unsigned long efipci_address ( struct pci_device *pci, unsigned long location ) { - return EFI_PCI_ADDRESS ( pci->bus, PCI_SLOT ( pci->devfn ), - PCI_FUNC ( pci->devfn ), + return EFI_PCI_ADDRESS ( PCI_BUS ( pci->busdevfn ), + PCI_SLOT ( pci->busdevfn ), + PCI_FUNC ( pci->busdevfn ), EFIPCI_OFFSET ( location ) ); } @@ -47,10 +48,9 @@ int efipci_read ( struct pci_device *pci, unsigned long location, if ( ( efirc = efipci->Pci.Read ( efipci, EFIPCI_WIDTH ( location ), efipci_address ( pci, location ), 1, value ) ) != 0 ) { - DBG ( "EFIPCI config read from %02x:%02x.%x offset %02lx " - "failed: %s\n", pci->bus, PCI_SLOT ( pci->devfn ), - PCI_FUNC ( pci->devfn ), EFIPCI_OFFSET ( location ), - efi_strerror ( efirc ) ); + DBG ( "EFIPCI config read from " PCI_FMT " offset %02lx " + "failed: %s\n", PCI_ARGS ( pci ), + EFIPCI_OFFSET ( location ), efi_strerror ( efirc ) ); return -EIO; } @@ -64,10 +64,9 @@ int efipci_write ( struct pci_device *pci, unsigned long location, if ( ( efirc = efipci->Pci.Write ( efipci, EFIPCI_WIDTH ( location ), efipci_address ( pci, location ), 1, &value ) ) != 0 ) { - DBG ( "EFIPCI config write to %02x:%02x.%x offset %02lx " - "failed: %s\n", pci->bus, PCI_SLOT ( pci->devfn ), - PCI_FUNC ( pci->devfn ), EFIPCI_OFFSET ( location ), - efi_strerror ( efirc ) ); + DBG ( "EFIPCI config write to " PCI_FMT " offset %02lx " + "failed: %s\n", PCI_ARGS ( pci ), + EFIPCI_OFFSET ( location ), efi_strerror ( efirc ) ); return -EIO; } |