lkml.org 
[lkml]   [1999]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subjectfix for plip module parameter treatment
THE BUG:

You have two parallel ports, parport0 on 0x3bc (polling) and parport1 on
0x378 (IRQ5). Plip is compiled as a module. Without specifying module
parameters everything works fine.

a) Specifying parport=0

root@spiral:/usr/src/linux# insmod ./plip.o parport=0
plip: parport0 has no IRQ.
NET3 PLIP version 2.3-parport gniibe@mri.co.jp
plip0: Parallel port at 0x378, using IRQ 5
root@spiral:/usr/src/linux#

Parport0 is polling. Thus plip.o should not be loaded, but it ignores the
parport=0 option and checks for parport1, too, as if no parameters had
been given. Plip is then actually loaded using parport1.

b) Specifying parport=1

root@spiral:/usr/src/linux# insmod ./plip.o parport=1
plip: no devices registered
./plip.o: init_module: Device or resource busy
root@spiral:/usr/src/linux#

Parport1 is using IRQ5. Anyway plip.o doesn't detect it. No plip module is
loaded though it should!

THE REASON:

In /usr/src/linux/drivers/net/plip.c in function plip_init(void) line 1243
the driver checks wether integer variable i is in the list of specified
parport devices. Anyway i is the number of registered plip devices. This
is not what we want to search for, but the number of the parport device pb
is.

Variable pb is a pointer to struct parport which has a member name. This
contains "parportX" where X is the number of the parport device. We would
have to search for this number in the list of parport devices specified as
module parameters and plip.o will operate properly. I had no better idea
to get the actual parport device number.

THE FIX:

============================================================================
--- plip.c.orig Sat Jan 16 17:50:18 1999
+++ plip.c Sat Jan 16 20:05:49 1999
@@ -1240,7 +1240,7 @@
/* If the user feeds parameters, use them */
while (pb) {
if ((parport[0] == -1 && (!timid || !pb->devices)) ||
- plip_searchfor(parport, i)) {
+ plip_searchfor(parport, simple_strtoul(pb->name+7, NULL, 10))) {
if (i == PLIP_MAX) {
printk(KERN_ERR "plip: too many devices\n");
break;
============================================================================
--
Raoul Boenisch, Winkhauser Talweg 165, 45473 Muelheim an der Ruhr, Germany
homepage: http://www.raoul.home.pages.de/ home phone: +49 208 764257
Reply-To: st0136@hrz.uni-essen.de



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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