DHCP and a wireless card (reprise)

After upgrading amber (IBM Thinkpad T30 with a Netgear wireless card) to FreeBSD 4.8, I found dhclient was not getting hold of an IP address from the DHCP server. I was also getting an error reported by pccardc - "(PIOCRWMEM): invalid argument". Since this only occurred after I'd allowed mergemaster to update the configuration files in /etc, I figured this was a configuration problem.

I started scanning the /etc/rc.pccard and /etc/pccard_ether scripts to find out what was going on. After a little investigation, it appeared that my original solution for DHCP and wireless was not working in the new set-up for 4.8.

In 4.7, I had the relevant rc.conf entries for DHCP and pccard as:

    pccard_enable="YES"
    ifconfig_wi0="DHCP"

I had placed the necessary ifconfig setup for the wireless connection into /etc/pccard.conf, into which I had copied the Netgear card section from /etc/defaults/pccard.conf.

This no longer worked, partly because I should have used the pccard_ifconfig="DHCP" setting in rc.conf, and partly because the defaults flags passed to pccardd had changed from "" for 4.7 to "-z" for 4.8. The -z argument tells pccardd to delay running as a daemon until after the card has been attached. With 4.7, the card was recognised at around the same time the login prompt was issued. With 4.8, the boot process waited until the card was recognised and initialised.

I therefore did what I should have set up earlier. First, I put the ifconfig command to set up the wireless connection in a file called /etc/start_if.wi0, which is run by pccard_ether, if it exists:

    /sbin/ifconfig wi0 ssid default channel 6 wepmode on wepkey 0xdeadbeef56

Doing this allowed me to delete my /etc/pccard.conf file. Then, rc.conf was set as follows:

    pccard_enable="YES"
    pccard_ifconfig="DHCP"
    pccard_mem="0xd4000"

Note that the ifconfig_wi0="DHCP" entry is not required. In fact, if you leave it in rc.conf, along with the pccard_ifconfig="DHCP" setting, dhclient does not acquire an IP address; must get confused somehow. The pccard_mem entry stopped the PIOCRWMEM error; the default address of 0xd0000 didn't seem to be liked by the Thinkpad.