Browse Source

Add isapnp_max_csn to reduce scan time.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
e301acc0d4
1 changed files with 20 additions and 2 deletions
  1. 20
    2
      src/drivers/bus/isapnp.c

+ 20
- 2
src/drivers/bus/isapnp.c View File

@@ -58,6 +58,21 @@
58 58
  */
59 59
 uint16_t isapnp_read_port;
60 60
 
61
+/*
62
+ * Highest assigned CSN.
63
+ *
64
+ * Note that *we* do not necessarily assign CSNs; it could be done by
65
+ * the PnP BIOS instead.  We therefore set this only when we first try
66
+ * to Wake[CSN] a device and find that there's nothing there.  Page 16
67
+ * (PDF page 22) of the ISAPnP spec states that "Valid Card Select
68
+ * Numbers for identified ISA cards range from 1 to 255 and must be
69
+ * assigned sequentially starting from 1", so we are (theoretically,
70
+ * at least) safe to assume that there are no ISAPnP cards at CSNs
71
+ * higher than the first unused CSN.
72
+ *
73
+ */
74
+static uint8_t isapnp_max_csn = 0xff;
75
+
61 76
 /*
62 77
  * ISAPnP utility functions
63 78
  *
@@ -483,6 +498,10 @@ static int isapnp_fill_device ( struct bus_dev *bus_dev,
483 498
 	if ( ! isapnp->csn )
484 499
 		return 0;
485 500
 
501
+	/* Check to see if we are already past the maximum CSN */
502
+	if ( isapnp->csn > isapnp_max_csn )
503
+		return 0;
504
+
486 505
 	/* Check cache to see if we are already past the highest
487 506
 	 * logical device of this CSN
488 507
 	 */
@@ -504,8 +523,7 @@ static int isapnp_fill_device ( struct bus_dev *bus_dev,
504 523
 
505 524
 	/* Need to return 0 if no device exists at this CSN */
506 525
 	if ( identifier.vendor_id & 0x80 ) {
507
-		cache.csn = isapnp->csn;
508
-		cache.first_nonexistent_logdev = 0;
526
+		isapnp_max_csn = isapnp->csn - 1;
509 527
 		return 0;
510 528
 	}
511 529
 

Loading…
Cancel
Save