david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Add isapnp_max_csn to reduce scan time.

This commit is contained in:
Michael Brown 2005-04-26 14:07:30 +00:00
parent 3dbdeb588f
commit e301acc0d4
1 changed files with 20 additions and 2 deletions

View File

@ -58,6 +58,21 @@
*/ */
uint16_t isapnp_read_port; uint16_t isapnp_read_port;
/*
* Highest assigned CSN.
*
* Note that *we* do not necessarily assign CSNs; it could be done by
* the PnP BIOS instead. We therefore set this only when we first try
* to Wake[CSN] a device and find that there's nothing there. Page 16
* (PDF page 22) of the ISAPnP spec states that "Valid Card Select
* Numbers for identified ISA cards range from 1 to 255 and must be
* assigned sequentially starting from 1", so we are (theoretically,
* at least) safe to assume that there are no ISAPnP cards at CSNs
* higher than the first unused CSN.
*
*/
static uint8_t isapnp_max_csn = 0xff;
/* /*
* ISAPnP utility functions * ISAPnP utility functions
* *
@ -483,6 +498,10 @@ static int isapnp_fill_device ( struct bus_dev *bus_dev,
if ( ! isapnp->csn ) if ( ! isapnp->csn )
return 0; return 0;
/* Check to see if we are already past the maximum CSN */
if ( isapnp->csn > isapnp_max_csn )
return 0;
/* Check cache to see if we are already past the highest /* Check cache to see if we are already past the highest
* logical device of this CSN * logical device of this CSN
*/ */
@ -504,8 +523,7 @@ static int isapnp_fill_device ( struct bus_dev *bus_dev,
/* Need to return 0 if no device exists at this CSN */ /* Need to return 0 if no device exists at this CSN */
if ( identifier.vendor_id & 0x80 ) { if ( identifier.vendor_id & 0x80 ) {
cache.csn = isapnp->csn; isapnp_max_csn = isapnp->csn - 1;
cache.first_nonexistent_logdev = 0;
return 0; return 0;
} }