From owner-freebsd-stable@FreeBSD.ORG Tue Sep 16 00:19:59 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C980616A4B3 for ; Tue, 16 Sep 2003 00:19:59 -0700 (PDT) Received: from falcon.midgard.homeip.net (h76n3fls24o1048.bredband.comhem.se [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 81E7243F93 for ; Tue, 16 Sep 2003 00:19:57 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: (qmail 25758 invoked by uid 1001); 16 Sep 2003 07:19:56 -0000 Date: Tue, 16 Sep 2003 09:19:56 +0200 From: Erik Trulsson To: Gianmarco Giovannelli Message-ID: <20030916071956.GA25582@falcon.midgard.homeip.net> Mail-Followup-To: Gianmarco Giovannelli , stable@freebsd.org, esperti@gufi.org References: <6.0.0.22.2.20030916073154.03af28a8@194.184.65.4> <20030916062637.GA25332@falcon.midgard.homeip.net> <6.0.0.22.2.20030916084546.0305c1c0@194.184.65.4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.0.0.22.2.20030916084546.0305c1c0@194.184.65.4> User-Agent: Mutt/1.5.4i cc: stable@freebsd.org cc: esperti@gufi.org Subject: Re: strange problem with: ed driver / 4.9-PRE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2003 07:20:00 -0000 On Tue, Sep 16, 2003 at 08:47:07AM +0200, Gianmarco Giovannelli wrote: > At 16/09/2003, Erik Trulsson wrote: > > > >> Any idea on what is happening ? > > > >What is happening is that the system is attempting to load support for > >'ed' (and by extension also 'miibus') as a module, but since you already > >have it in the kernel this loading fails and the system complains. > >This is harmless, but annoying. > > Ok, this was clear, but I'd like to know why it tries to load it as module > when it has it defined in the kernel. :-) What is happening is that ifconfig(8) checks if the desired driver is available in the kernel and if not it attempts to load the corresponding module. Unfortunately ifconfig(8) makes certain assumptions about what the internal name of the module (which you can see with a 'kldstat -v') should look like. These assumptions are met by most of the network drivers, with 'ed' as a notable exception. Since ifconfig(8) cannot find the desired driver it attempts to load it, which fails since it actually is in the kernel already. (A quick look at the source indicates that there are some other drivers that do not meet those assumptions either, so a proper fix should include changing ifconfig(8) to make fewer assumptions but such a change would require lots of testing to make sure it is correct.) The following patch (which I have been using a couple of months now to get rid of those annoying warnings) should bring the 'ed' driver into line with what ifconfig(8) expects. Index: if_ed_cbus.c =================================================================== RCS file: /ncvs/src/sys/dev/ed/if_ed_cbus.c,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 if_ed_cbus.c --- if_ed_cbus.c 10 Sep 2000 08:45:11 -0000 1.1.2.1 +++ if_ed_cbus.c 24 Jun 2003 17:29:11 -0000 @@ -297,7 +297,7 @@ static devclass_t ed_isa_devclass; -DRIVER_MODULE(ed, isa, ed_isa_driver, ed_isa_devclass, 0, 0); +DRIVER_MODULE(if_ed, isa, ed_isa_driver, ed_isa_devclass, 0, 0); #ifdef PC98 /* Index: if_ed_isa.c =================================================================== RCS file: /ncvs/src/sys/dev/ed/if_ed_isa.c,v retrieving revision 1.5.2.2 diff -u -r1.5.2.2 if_ed_isa.c --- if_ed_isa.c 29 Jul 2002 07:52:57 -0000 1.5.2.2 +++ if_ed_isa.c 24 Jun 2003 17:29:30 -0000 @@ -156,4 +156,4 @@ static devclass_t ed_isa_devclass; -DRIVER_MODULE(ed, isa, ed_isa_driver, ed_isa_devclass, 0, 0); +DRIVER_MODULE(if_ed, isa, ed_isa_driver, ed_isa_devclass, 0, 0); Index: if_ed_pccard.c =================================================================== RCS file: /ncvs/src/sys/dev/ed/if_ed_pccard.c,v retrieving revision 1.9.2.6 diff -u -r1.9.2.6 if_ed_pccard.c --- if_ed_pccard.c 25 Jul 2001 18:06:01 -0000 1.9.2.6 +++ if_ed_pccard.c 24 Jun 2003 17:28:39 -0000 @@ -99,7 +99,7 @@ static devclass_t ed_pccard_devclass; -DRIVER_MODULE(ed, pccard, ed_pccard_driver, ed_pccard_devclass, 0, 0); +DRIVER_MODULE(if_ed, pccard, ed_pccard_driver, ed_pccard_devclass, 0, 0); DRIVER_MODULE(miibus, ed, miibus_driver, miibus_devclass, 0, 0); /* Index: if_ed_pci.c =================================================================== RCS file: /ncvs/src/sys/dev/ed/if_ed_pci.c,v retrieving revision 1.23.2.1 diff -u -r1.23.2.1 if_ed_pci.c --- if_ed_pci.c 10 Sep 2000 08:45:11 -0000 1.23.2.1 +++ if_ed_pci.c 24 Jun 2003 17:29:21 -0000 @@ -122,4 +122,4 @@ static devclass_t ed_devclass; -DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); +DRIVER_MODULE(if_ed, pci, ed_pci_driver, ed_devclass, 0, 0); -- Erik Trulsson ertr1013@student.uu.se