diff options
author | Michael Brown | 2007-01-09 03:58:07 +0100 |
---|---|---|
committer | Michael Brown | 2007-01-09 03:58:07 +0100 |
commit | 6b09dd824420f4507efe4ddf956f63825a1b4f35 (patch) | |
tree | 7a170a71cea0032be4af6f00b6e9b8deecba7832 /src/arch | |
parent | Avoid erasing non-existent signatures in undi_unload() (diff) | |
download | ipxe-6b09dd824420f4507efe4ddf956f63825a1b4f35.tar.gz ipxe-6b09dd824420f4507efe4ddf956f63825a1b4f35.tar.xz ipxe-6b09dd824420f4507efe4ddf956f63825a1b4f35.zip |
undipci_probe() has to calculate busdevfn anyway, so we may as well pass
it directly to undi_load_pci().
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/drivers/net/undi.c | 3 | ||||
-rw-r--r-- | src/arch/i386/drivers/net/undiload.c | 20 | ||||
-rw-r--r-- | src/arch/i386/include/undiload.h | 20 |
3 files changed, 21 insertions, 22 deletions
diff --git a/src/arch/i386/drivers/net/undi.c b/src/arch/i386/drivers/net/undi.c index a6f1267b..4508253d 100644 --- a/src/arch/i386/drivers/net/undi.c +++ b/src/arch/i386/drivers/net/undi.c @@ -91,8 +91,7 @@ static int undipci_probe ( struct pci_device *pci, } /* Call UNDI ROM loader to create pixie */ - if ( ( rc = undi_load_pci ( undi, undirom, pci->bus, - pci->devfn ) ) != 0 ) + if ( ( rc = undi_load_pci ( undi, undirom, busdevfn ) ) != 0 ) goto err_load_pci; } diff --git a/src/arch/i386/drivers/net/undiload.c b/src/arch/i386/drivers/net/undiload.c index a0669d95..27f26526 100644 --- a/src/arch/i386/drivers/net/undiload.c +++ b/src/arch/i386/drivers/net/undiload.c @@ -49,7 +49,7 @@ static SEGOFF16_t __data16 ( undi_loader_entry ); * @v undirom UNDI ROM * @ret rc Return status code */ -static int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) { +int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) { struct s_PXE ppxe; uint16_t fbms; unsigned int fbms_seg; @@ -139,22 +139,6 @@ static int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) { } /** - * Call UNDI loader to create a pixie - * - * @v undi UNDI device - * @v undirom UNDI ROM - * @v pci_busdevfn PCI bus:dev.fn - * @ret rc Return status code - */ -int undi_load_pci ( struct undi_device *undi, struct undi_rom *undirom, - unsigned int bus, unsigned int devfn ) { - undi->pci_busdevfn = ( ( bus << 8 ) | devfn ); - undi->isapnp_csn = 0xffff; - undi->isapnp_read_port = 0xffff; - return undi_load ( undi, undirom ); -} - -/** * Unload a pixie * * @v undi UNDI device @@ -172,7 +156,7 @@ int undi_unload ( struct undi_device *undi ) { /* Erase signatures */ if ( undi->pxenv.segment ) put_real ( dead, undi->pxenv.segment, undi->pxenv.offset ); - if ( undi->ppxe_segment ) + if ( undi->ppxe.segment ) put_real ( dead, undi->ppxe.segment, undi->ppxe.offset ); /* Free base memory, if possible */ diff --git a/src/arch/i386/include/undiload.h b/src/arch/i386/include/undiload.h index cfb9066c..e42563b4 100644 --- a/src/arch/i386/include/undiload.h +++ b/src/arch/i386/include/undiload.h @@ -10,8 +10,24 @@ struct undi_device; struct undi_rom; -extern int undi_load_pci ( struct undi_device *undi, struct undi_rom *undirom, - unsigned int bus, unsigned int devfn ); +extern int undi_load ( struct undi_device *undi, struct undi_rom *undirom ); extern int undi_unload ( struct undi_device *undi ); +/** + * Call UNDI loader to create a pixie + * + * @v undi UNDI device + * @v undirom UNDI ROM + * @v pci_busdevfn PCI bus:dev.fn + * @ret rc Return status code + */ +static inline int undi_load_pci ( struct undi_device *undi, + struct undi_rom *undirom, + unsigned int pci_busdevfn ) { + undi->pci_busdevfn = pci_busdevfn; + undi->isapnp_csn = 0xffff; + undi->isapnp_read_port = 0xffff; + return undi_load ( undi, undirom ); +} + #endif /* _UNDILOAD_H */ |