瀏覽代碼

Don't verify checksum except after serial isolation

tags/v0.9.3
Michael Brown 19 年之前
父節點
當前提交
ab443ba4b0
共有 1 個檔案被更改,包括 7 行新增10 行删除
  1. 7
    10
      src/drivers/bus/isapnp.c

+ 7
- 10
src/drivers/bus/isapnp.c 查看文件

@@ -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…
取消
儲存