Wireless Networking under FreeBSD

Getting a wireless card to work under freebsd can be easy if someone has already included support for detecting the card. However not all versions of all cards will be recognized. Western has this cool program where students can checkout a wireless card for the quarter, free of charge. So I picked up one to use in my decrepit Toshiba Satellite Pro 430CDT which has a fresh install of FreeBSD 4.9. The card is an Intel AnyPoint Wireless II card which uses the fairly common, and well supported prism2 chip. So now the matter of setting up the system to recognize the card.

Note: PCcard daemon must be loaded

Upon inserting the card, the pccard daemon returns the following:

pccard: card inserted, slot 1
pccardd[49]: No card in database for “Intel”(”AnyPoint(TM) Wireless II PC Card”)

Well nuts. Looks like this is gonna take a little bit more work.

The file /etc/defaults/pccard.conf contains a whole slew of entries for all types of pcmcia cards. You can add your entry in here, but it’s a pretty big file to be mucking around in. But if you take a look near the top you’ll notice a line that reads: include /etc/pccard.conf This file is where we’re gonna add our entry.

Following the template of the other entries in the database we add the following lines to /etc/pccard.conf Note: The strings are case sensitive, so double check you typed everything right.

#Intel AnyPoint Wireless II PC Card
card "Intel" "AnyPoint(TM) Wireless II PC Card"
config auto "wi" ?
insert /etc/pccard_ether $device start
remove /etc/pccard_ether $device stop

Let’s break this down a bit. The card command defines a new entry which is followed by the strings used to identify the card. The first variable is typically the manufacturer of the device. The second variable is the device id string. Third and fourth variables exist for specific versions of cards. However, they dont matter much to us so we just leave them out.

The next line tells the system how to configure the device. auto tells the system to try and figure out what resources to allocate, and “wi” indicates that we will be using the wi driver for this card.

Insert and remove specifiy the actions to be taken when the card is inserted or removed. In our case we will only need to be sending the start and stop signals.

Now we can either do a reboot, or do a send a SIGHUP signal to the pccard daemon which will cause it to reload the its config files. kill -s SIGHUP (process id).

All right, now with a little luck when we insert the card you should see something like this:

pccard: card inserted, slot 1
pccardd[49]: Card “Intel”(”AnyPoint(TM) Wireless II PC Card”) [Version 01.02] [] matched “Intel” (”AnyPoint(TM) Wireless II PC Card”) [(null)] [(null)]
wi0 at port 0×240-0×27f irq 5 slot 1 on pccard1
wi0: 802.11 address: 00:00:00:00:00:00 < --your mac address here
wi0: using RF:PRISM2 MAC:HFABLAH CARD:HWB3163-SST-flash
wi0: Intersil Firmware: Primary 0.03.00, Station 1.03.04
wi0: Intel (AnyPoint(TM) Wireless II PC Card) inserted.

Success! Your data may not match exactly, but the important part is that last line. It signfies that the proper resources have been alocated to the device and that it is ready for use. A call to ifconfig brings up the following info:

wi0: flags=8843< UP, BROADCAST, RUNNING, SIMPLEX, MULTICAST> mtu 1500
inet 0.0.0.0 netmaxk 0xff000000 broadcast 255.255.255.255
ether 00:00:00:00:00:00 < -- your mac here
media: IEEE 802.11 Wireless Ethernet autoselect (DS/2Mbps)
status: no carrier
ssid "" 1:""
stationname "FreeBSD WaveLAN/IEEE node"
channel 9 authmode OPEN powersavemode OFF powersavesleep 100
wepmode OFF weptxkey 0