pccard woes (probably rcNG buglet)

Matthew Dillon dillon at apollo.backplane.com
Tue Oct 7 20:24:50 PDT 2003


    I think this is more a matter of fixing dhclient.  RCNG obviously expects
    dhclient to generate a pid file based on the interface name.  We should
    fix dhclient instead of hack RCNG, I think.

    Would you like to have a go at that?  I think it would be rather easy.  If
    not I can do it (I always like to give people a chance to dig into the
    source code themselves, especially when solutions are potentially very
    easy to implement!).

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

:
:--nextPart1104924.Ykpi29D9i1
:Content-Type: text/plain; charset=iso-8859-1
:Content-Transfer-Encoding: 8Bit
:
:Emiel Kollof wrote:
:
:> Matthew Dillon wrote:
:
:[snip]
:
:>> :Test case:
:>> :
:>> :1. Boot up, leave network pcmcia card out of the slot.
:>> :2. Insert card, hear some nice beeps. Tail /var/log/messages to see if
:>> :it gets detected and stuff.
:>> :3. Monitor ifconfig to see if it gets an IP number (either from dhclient
:>> :or otherwise).
:>> :
:>> :With a world/kernel as of last friday afternoon (CEST), the interface
:>> :doesn't come up *at all*.
:>> 
:>>     Hmm.  The RC stuff could simply be some RCNG hookups that we haven't
:>>     made.  Does it start pccardd up?  If not try starting it manually.
:
:I've been poking around in some source and config files and the following is
:what I found out:
:
:Short version: 
:
:/etc/pccard_ether has a few bugs
:
:Long version:
:
:pccardd is not to blame. It works fine, and parses /etc/defaults/pccard.conf
:fine. I went looking in there to see what it does next. Observe this entry
:(which is incindently for my 3com pcmcia card):
:
:# 3Com Megahertz 574B same as 3Com Fast Etherlink 3C574B
:card "3Com" "Megahertz 574B"
:        config  auto "ep" ? 0x1
:        insert  /etc/pccard_ether $device start
:        remove  /etc/pccard_ether $device stop
:
:Allright, so it starts up /etc/pccard_ether ep0 start. And lo and behold,
:when I try to initialize my ep0 card with that script, it doesn't work.
:Examining the file shows that I have to use some vars in rc.conf I never
:seen before. Browsing through the rc.conf manpage I saw I need to set
:'removable_interfaces' and 'pccard_ifconfig'.
:
:I have to note that the pccard_ether script is somewhat buggy in places. It
:doesn't kill dhclient correctly on ejection, for example. This is because
:there's a bug in the dhcp_kill function in the pccard_ether script. Lines
:35 to 38 in that script don't get executed, so it just starts a plain
:dhclient with no interface specific pidfile. The attached patch fixes the
:dhcp_stop function, albeit in a slightly hackish way. It just detects the
:default dhclient pidfile and uses the pid in that to kill dhclient. It
:still doesn't take the interface down properly, but that's a bit of a
:non-issue, since on ejection the interface is gone anyway.
:
:So, in conclusion, to get pcmcia network cards to work, one needs to set the
:following in rc.conf:
:
:removable_interfaces="<interface name>"
:pccard_ifconfig="inet bla.bla.bla.bla netmask bla.bla.bla"
:_or_
:pccard_ifconfig="DHCP"
:
:Which is different from the "old way" with which you just set
:ifconfig_<interface> and was done with it. Oh well... 
:
:I liked the old way better though, but I'm just an old fart that fears
:change (just kidding) ;)
:
:Cheers,
:Emiel
:--nextPart1104924.Ykpi29D9i1
:Content-Type: text/x-diff; name="pccard_ether.diff"
:Content-Transfer-Encoding: 8Bit
:Content-Disposition: attachment; filename="pccard_ether.diff"
:
:--- /usr/src/etc/pccard_ether	Thu Jul 24 08:35:32 2003
:+++ pccard_ether	Tue Oct  7 12:17:38 2003
:@@ -11,6 +11,8 @@
: stop_dhcp() {
: 	if [ -s /var/run/dhclient.${interface}.pid ]; then
: 		pidfile="/var/run/dhclient.${interface}.pid"
:+	elif [ -s /var/run/dhclient.pid ]; then
:+		pidfile="/var/run/dhclient.pid"
: 	elif [ -s /var/run/dhcpc.${interface}.pid ]; then
: 		pidfile="/var/run/dhcpc.${interface}.pid"
: 	else
:
:--nextPart1104924.Ykpi29D9i1--
:






More information about the Submit mailing list