All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PnP Updates for 2.6.4-mm2
Date: Mon, 15 Mar 2004 00:15:19 +0000	[thread overview]
Message-ID: <20040315001519.GC5972@neo.rr.com> (raw)
In-Reply-To: <20040315001029.GB5972@neo.rr.com>

[ISAPNP] Fix Device Detection Issue

Some isapnp devices were not getting detected as a result of a bug in the isapnp 
driver.  It was not following the specifications and calculating a checksum when
it was not reliable.  This problem was originally discovered by Paul L. Rogers
<rogerspl@datasync.com>.  He made an initial patch.  This release has some small 
modifications, including a check to see if we run out of CSNs.

--- a/drivers/pnp/isapnp/core.c	2004-03-11 02:55:28.000000000 +0000
+++ b/drivers/pnp/isapnp/core.c	2004-03-14 21:55:12.000000000 +0000
@@ -99,6 +99,7 @@
 static unsigned char isapnp_checksum_value;
 static DECLARE_MUTEX(isapnp_cfg_mutex);
 static int isapnp_detected;
+static int isapnp_csn_count;

 /* some prototypes */
 
@@ -371,11 +372,14 @@
 			break;
 		}
 	      __next:
+		if (csn == 255)
+			break;
 		checksum = 0x6a;
 		chksum = 0x00;
 		bit = 0x00;
 	}
 	isapnp_wait();
+	isapnp_csn_count = csn;
 	return csn;
 }
 
@@ -880,7 +884,7 @@
 
 	isapnp_wait();
 	isapnp_key();
-	for (csn = 1; csn <= 10; csn++) {
+	for (csn = 1; csn <= isapnp_csn_count; csn++) {
 		isapnp_wake(csn);
 		isapnp_peek(header, 9);
 		checksum = isapnp_checksum(header);
@@ -890,12 +894,6 @@
 			header[4], header[5], header[6], header[7], header[8]);
 		printk(KERN_DEBUG "checksum = 0x%x\n", checksum);
 #endif
-		/* 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 pnp_card))) == NULL)
 			continue;

@@ -932,7 +930,7 @@

 int isapnp_cfg_begin(int csn, int logdev)
 {
-	if (csn < 1 || csn > 10 || logdev > 10)
+	if (csn < 1 || csn > isapnp_csn_count || logdev > 10)
 		return -EINVAL;
 	MOD_INC_USE_COUNT;
 	down(&isapnp_cfg_mutex);

  reply	other threads:[~2004-03-15  5:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15  0:06 [PATCH] PnP Updates for 2.6.4-mm2 Adam Belay
2004-03-15  0:10 ` Adam Belay
2004-03-15  0:15   ` Adam Belay [this message]
2004-03-15  0:21     ` Adam Belay
2004-03-15  0:23       ` Adam Belay
2004-03-15  0:26         ` Adam Belay
2004-03-15  0:27           ` Adam Belay
2004-03-15  0:33             ` Adam Belay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040315001519.GC5972@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.