summaryrefslogtreecommitdiffstats
path: root/src/drivers/bus
diff options
context:
space:
mode:
authorMichael Brown2005-04-26 16:07:30 +0200
committerMichael Brown2005-04-26 16:07:30 +0200
commite301acc0d43a25f52e2217a49edbe1ef71f1441b (patch)
treeeeb77fdea1572460b0575d569f28603805651c8f /src/drivers/bus
parentISA bus driver updated to report devices as present only if a driver (diff)
downloadipxe-e301acc0d43a25f52e2217a49edbe1ef71f1441b.tar.gz
ipxe-e301acc0d43a25f52e2217a49edbe1ef71f1441b.tar.xz
ipxe-e301acc0d43a25f52e2217a49edbe1ef71f1441b.zip
Add isapnp_max_csn to reduce scan time.
Diffstat (limited to 'src/drivers/bus')
-rw-r--r--src/drivers/bus/isapnp.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/drivers/bus/isapnp.c b/src/drivers/bus/isapnp.c
index 5adf4480..6b7c79e4 100644
--- a/src/drivers/bus/isapnp.c
+++ b/src/drivers/bus/isapnp.c
@@ -59,6 +59,21 @@
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
*
*/
@@ -483,6 +498,10 @@ static int isapnp_fill_device ( struct bus_dev *bus_dev,
if ( ! isapnp->csn )
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
* 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 */
if ( identifier.vendor_id & 0x80 ) {
- cache.csn = isapnp->csn;
- cache.first_nonexistent_logdev = 0;
+ isapnp_max_csn = isapnp->csn - 1;
return 0;
}