Sfoglia il codice sorgente

Don't verify checksum except after serial isolation

tags/v0.9.3
Michael Brown 19 anni fa
parent
commit
ab443ba4b0
1 ha cambiato i file con 7 aggiunte e 10 eliminazioni
  1. 7
    10
      src/drivers/bus/isapnp.c

+ 7
- 10
src/drivers/bus/isapnp.c Vedi File

@@ -374,18 +374,15 @@ static int fill_isapnp_device ( struct isapnp_device *isapnp ) {
374 374
 	isapnp_send_key ();
375 375
 	isapnp_wake ( isapnp->csn );
376 376
 
377
-	/* Read the identifier and verify the checksum.  Allow
378
-	 * checksum = 0 to cope with cards that just generate the
379
-	 * checksum using the LFSR during serial isolation.
377
+	/* Read the identifier.  Do *not* verify the checksum, because
378
+	 * the PnP ISA spec explicitly states in section 4.5 that the
379
+	 * checksum is invalid except when read via the serial
380
+	 * isolation protocol.  (This is presumably to allow for lazy
381
+	 * card designers who implement the checksum using the LFSR
382
+	 * only and can't be bothered to write the same value into the
383
+	 * EPROM).
380 384
 	 */
381 385
 	isapnp_peek ( identifier.bytes, sizeof ( identifier ) );
382
-	if ( ( identifier.checksum != 0 ) &&
383
-	     ( identifier.checksum != isapnp_checksum ( &identifier ) ) ) {
384
-		DBG ( "ISAPnP invalid checksum on CSN %hhx "
385
-		      "(is %hhx, should be %hhx)\n", isapnp->csn,
386
-		      identifier.checksum, isapnp_checksum ( &identifier ) );
387
-		return 0;
388
-	}
389 386
 
390 387
 	/* Read information from identifier structure */
391 388
 	isapnp->vendor_id = identifier.vendor_id;

Loading…
Annulla
Salva