Patch(2.4.2): isapnp detect fix (wrong checksum)

Gunther Mayer
2001-03-16T07:32:05Z

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

Hi,
this fix lets linux detect cards which don't
have a correct checksum.

These are probably common, it seems isapnptools _silently_
fixes this up !

Please apply if you like, comments welcome.

Regards, Gunther

--- linux/drivers/pnp/isapnp.c-2.4.2-orig Fri Mar 16 09:08:47 2001
+++ linux/drivers/pnp/isapnp.c Fri Mar 16 09:21:45 2001
@@ -993,10 +993,15 @@
header[4], header[5], header[6], header[7], header[8]);
printk("checksum = 0x%x\n", checksum);
#endif
- if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */
+ /* Don't be strict on the checksum, here !
+ e.g. 'SCM SwapBox Plug and Play' has header[8]==0 (should be: b7)*/
+ if (header[8] == 0)
+ ;
+ else if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */
continue;
if ((card = isapnp_alloc(sizeof(struct pci_bus))) == NULL)
continue;
+
card->number = csn;
card->vendor = (header[1] << 8) | header[0];
card->device = (header[3] << 8) | header[2];

[-- Attachment #2: gmdiff-242-isapnp-checksum-swapbox --]
[-- Type: application/octet-stream, Size: 774 bytes --]

--- linux/drivers/pnp/isapnp.c-2.4.2-orig Fri Mar 16 09:08:47 2001
+++ linux/drivers/pnp/isapnp.c Fri Mar 16 09:21:45 2001
@@ -993,10 +993,15 @@
header[4], header[5], header[6], header[7], header[8]);
printk("checksum = 0x%x\n", checksum);
#endif
- if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */
+ /* Don't be strict on the checksum, here !
+ e.g. 'SCM SwapBox Plug and Play' has header[8]==0 (should be: b7)*/
+ if (header[8] == 0)
+ ;
+ else if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */
continue;
if ((card = isapnp_alloc(sizeof(struct pci_bus))) == NULL)
continue;
+
card->number = csn;
card->vendor = (header[1] << 8) | header[0];
card->device = (header[3] << 8) | header[2];