[1307] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: Problem PCMCIA and network initialization

daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Thu Nov 2 03:15:26 1995

Date: Wed, 1 Nov 1995 12:29:42 -0500
From: "Theodore Ts'o" <tytso@mit.edu>
To: "Al Longyear" <longyear@netcom.com>
Cc: gpg109@rsphy4.anu.edu.au, linux-net@vger.rutgers.edu
Cc: Paul Gortmaker <gpg109@rsphy1.anu.edu.au>,
        iialan@iifeak.swan.ac.uk (Alan Cox)
Cc: Linus.Torvalds@cs.Helsinki.FI
In-Reply-To: Al Longyear's message of Wed, 1 Nov 1995 06:18:33 -0800 (PST),
	<199511011418.GAA00188@sii-4-30.sii.com>


I found the problem; it was indeed in the 2.2 version of PPP which is in
the kernel.  The problem is that when the PPP driver is in the kernel,
it tries to remove itself from the device chain by calling
unregister_netdev() directly, instead of simply return ENODEV.
unregister_netdev() modifies the device chain, but this confuses the
heck out of net_dev_init(), which is itself iterating through the list
and doesn't expect for a device to return SUCCESS and remove itself from
the list.  

A patch which solves this problem follows; it's modelled on how the SLIP
driver works.  My suspicion is that around 1.3.33, how net_dev_init()
worked changed, but the PPP driver wasn't modified accordingly.  With
this patch, I can now get PCMCIA networking to work again (which means I
can start using more recent kernels on my laptop again.)

Thanks especially to Paul Gortmaker, who provided me with the necessary
debugging printk's so that I was finally able to track down the problem!

							- Ted

--- ppp.c	1995/11/01 17:16:15	1.1
+++ ppp.c	1995/11/01 17:18:24
@@ -567,13 +567,13 @@
 		if (answer == 0)
 			(void) register_symtab (&ppp_syms);
 	}
-/*
- * Un-register the devices defined at the start of the system. They will
- * be added when they are needed again. The first device just gets us into
- * this code to register the handlers.
- */
-	unregister_netdev (dev);
-	return answer;
+	if (answer)
+		return answer;
+	/*
+	 * Return "not found", so that dev_init() will unlink
+	 * the placeholder device entry for us.
+	 */
+	return ENODEV;
 }
 #endif
 

home help back first fref pref prev next nref lref last post