Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2003 09:19:56 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Gianmarco Giovannelli <gmarco@giovannelli.it>
Cc:        esperti@gufi.org
Subject:   Re: strange problem with: ed driver / 4.9-PRE
Message-ID:  <20030916071956.GA25582@falcon.midgard.homeip.net>
In-Reply-To: <6.0.0.22.2.20030916084546.0305c1c0@194.184.65.4>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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);




-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030916071956.GA25582>