All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch(2.4.2): isapnp detect fix (wrong checksum)
@ 2001-03-16  8:30 Gunther Mayer
  0 siblings, 0 replies; only message in thread
From: Gunther Mayer @ 2001-03-16  8:30 UTC (permalink / raw)
  To: alan; +Cc: linux-kernel

[-- 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];

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-03-16  7:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-16  8:30 Patch(2.4.2): isapnp detect fix (wrong checksum) Gunther Mayer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.