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/arch | |
| 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/arch')
| -rw-r--r-- | src/arch/i386/drivers/net/undi.c | 7 | ||||
| -rw-r--r-- | src/arch/i386/interface/pcbios/pcibios.c | 5 | ||||
| -rw-r--r-- | src/arch/x86/core/pcidirect.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/arch/i386/drivers/net/undi.c b/src/arch/i386/drivers/net/undi.c index 71d8453a4..017843f6a 100644 --- a/src/arch/i386/drivers/net/undi.c +++ b/src/arch/i386/drivers/net/undi.c @@ -66,7 +66,6 @@ static int undipci_probe ( struct pci_device *pci, const struct pci_device_id *id __unused ) { struct undi_device *undi; struct undi_rom *undirom; - unsigned int busdevfn = PCI_BUSDEVFN ( pci->bus, pci->devfn ); int rc; /* Ignore non-network devices */ @@ -80,7 +79,7 @@ static int undipci_probe ( struct pci_device *pci, pci_set_drvdata ( pci, undi ); /* Find/create our pixie */ - if ( preloaded_undi.pci_busdevfn == busdevfn ) { + if ( preloaded_undi.pci_busdevfn == pci->busdevfn ) { /* Claim preloaded UNDI device */ DBGC ( undi, "UNDI %p using preloaded UNDI device\n", undi ); memcpy ( undi, &preloaded_undi, sizeof ( *undi ) ); @@ -93,8 +92,10 @@ static int undipci_probe ( struct pci_device *pci, } /* Call UNDI ROM loader to create pixie */ - if ( ( rc = undi_load_pci ( undi, undirom, busdevfn ) ) != 0 ) + if ( ( rc = undi_load_pci ( undi, undirom, + pci->busdevfn ) ) != 0 ) { goto err_load_pci; + } } /* Add to device hierarchy */ diff --git a/src/arch/i386/interface/pcbios/pcibios.c b/src/arch/i386/interface/pcbios/pcibios.c index 4d09c054e..9f69fe6e4 100644 --- a/src/arch/i386/interface/pcbios/pcibios.c +++ b/src/arch/i386/interface/pcbios/pcibios.c @@ -73,7 +73,7 @@ int pcibios_read ( struct pci_device *pci, uint32_t command, uint32_t *value ){ : "=a" ( status ), "=b" ( discard_b ), "=c" ( *value ), "=D" ( discard_D ) : "a" ( command >> 16 ), "D" ( command ), - "b" ( PCI_BUSDEVFN ( pci->bus, pci->devfn ) ) + "b" ( pci->busdevfn ) : "edx" ); return ( ( status >> 8 ) & 0xff ); @@ -99,8 +99,7 @@ int pcibios_write ( struct pci_device *pci, uint32_t command, uint32_t value ){ : "=a" ( status ), "=b" ( discard_b ), "=c" ( discard_c ), "=D" ( discard_D ) : "a" ( command >> 16 ), "D" ( command ), - "b" ( PCI_BUSDEVFN ( pci->bus, pci->devfn ) ), - "c" ( value ) + "b" ( pci->busdevfn ), "c" ( value ) : "edx" ); return ( ( status >> 8 ) & 0xff ); diff --git a/src/arch/x86/core/pcidirect.c b/src/arch/x86/core/pcidirect.c index 38e056d57..ae74b7f15 100644 --- a/src/arch/x86/core/pcidirect.c +++ b/src/arch/x86/core/pcidirect.c @@ -34,8 +34,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); * @v where Location within PCI configuration space */ void pcidirect_prepare ( struct pci_device *pci, int where ) { - outl ( ( 0x80000000 | ( pci->bus << 16 ) | ( pci->devfn << 8 ) | - ( where & ~3 ) ), PCIDIRECT_CONFIG_ADDRESS ); + outl ( ( 0x80000000 | ( pci->busdevfn << 8 ) | ( where & ~3 ) ), + PCIDIRECT_CONFIG_ADDRESS ); } PROVIDE_PCIAPI_INLINE ( direct, pci_max_bus ); |
