lkml.org 
[lkml]   [1998]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Patch: 2.1.85: Bugfix: LP device selection
On Sun, 8 Feb 1998, Adam Heath wrote:

> When specifying lp devices to be associated with parport devices, lp.c says to
> use parport=-1,0 to make it work like 2.0. However, this doesn't work as
> advertised. It insists on makes lp0=parport0. The following *simple* patch
> fixes this, at least for me. All it does it move one line lower in the file.

I don't think that quite gives the intended behaviour either. Below is a
patch to allow -1,0 to work as *well* as just leaving out the parameters.

There's still a small problem with loading lp as a module in this way, in
that if you are using kerneld to load parport for you, you'll get parport0
the first time but parport1 after parport0 goes away.

Hope this patch works okay - it's been hand-modified to remove an
unrelated hunk. My current parport-related diffs are at
<ftp://ftp.torque.net/pub/parport/parport-diff-980208> and will soon
include this.

Tim.
*/

--- /big/linux-2.1.85/drivers/char/lp.c Tue Jan 27 08:50:51 1998
+++ linux/drivers/char/lp.c Sun Feb 8 11:44:58 1998
@@ -662,7 +663,7 @@
} else if (!strcmp(str, "auto")) {
parport[0] = LP_PARPORT_AUTO;
} else if (!strcmp(str, "none")) {
- parport_ptr++;
+ parport[parport_ptr++] = LP_PARPORT_NONE;
} else if (!strcmp(str, "reset")) {
reset = 1;
} else {
@@ -721,9 +722,10 @@
}
break;

+ case LP_PARPORT_NONE:
default:
for (count = 0; count < LP_NO; count++) {
- if (parport[count] != LP_PARPORT_UNSPEC) {
+ if (parport[count] >= 0) {
char buffer[16];
sprintf(buffer, "parport%d", parport[count]);
for (port = parport_enumerate(); port;
--- /big/linux-2.1.85/include/linux/lp.h Tue Jan 27 08:51:00 1998
+++ linux/include/linux/lp.h Sun Feb 8 11:48:52 1998
@@ -8,9 +8,10 @@
*/

/* Magic numbers for defining port-device mappings */
+#define LP_PARPORT_UNSPEC -4
#define LP_PARPORT_AUTO -3
#define LP_PARPORT_OFF -2
-#define LP_PARPORT_UNSPEC -1
+#define LP_PARPORT_NONE -1

/*
* Per POSIX guidelines, this module reserves the LP and lp prefixes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.045 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site