david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

undipci_probe() has to calculate busdevfn anyway, so we may as well pass

it directly to undi_load_pci().
This commit is contained in:
Michael Brown 2007-01-09 02:58:07 +00:00
parent ed44e3730d
commit 6b09dd8244
3 changed files with 21 additions and 22 deletions

View File

@ -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;
}

View File

@ -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;
@ -138,22 +138,6 @@ static int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
return 0;
}
/**
* 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
*
@ -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 */

View File

@ -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 */