Madwifi and xsupplicant
by Matthew Gast
Related link: http://sourceforge.net/projects/madwifi/
As part of my ongoing saga with xsupplicant, I wanted to use a modern card that is widely deployed. The Hermes chipset is everywhere, but it is no longer an interesting hardware design. I recently worked with a client to get xsupplicant running on Atheros-based cards. xsupplicant installation is the same as in my previous note; this message is a guide for the Atheros card only.
I did this on a SuSE 9.0 system, which uses kernel version 2.4.21. I did try briefly to get it running on a 2.6 kernel using a different distribution, but I didn't have enough time to figure it out.
The target card is a Linksys WPC55AG card, which is based on a dual-band/tri-mode Atheros chipset. It supports a+b/g. There was no hardware version apparent on the card. Atheros chips do not have firmware, which is a boon. There is a single Linux driver, the madwifi project, for all Atheros-based cards. It consists of three components, a hardware driver (ath_pci), a hardware abstraction layer (ath_hal), and an 802.11 module (wlan). The HAL is a binary-only package; I worked with ath_pci ver 0.8.5.4, and wlan version 0.7.3.1.
The reason for the HAL is to satisfy regulatory requirements. In order to meet regulatory requirements, the card needs to enforce certain channel and power limits. The binary-only HAL allows Atheros to meet this requirement by distributing the HAL to prevent users from arbitrarily setting the card to do something that might not be allowed.
You must have UUCP tools for uudecode. The madwifi driver depends on the binary-only HAL to comply with regulatory requirements. It is distributed as a uuencoded file, so you will need to get uudecode to recover the binary-only object. On most Linux distributions, this is in the sharutils package.
The driver is updated regularly, and does not appear to be packaged for distribution on a regular basis. You will want to fetch the latest version from CVS. If you don't have CVS, get the package from your favorite distribution.
Building the driver
You should fetch the latest version from CVS:
# cvs -z3 -d:pserver:email@example.com:/cvsroot/madwifi co madwifi
That will copy the source for the driver to a directory called madwifi. To build the driver, use the standard open-source command set:
# cd madwifi
(lots of build messages)
# make install
In the case of this test system, I manually installed the driver. SuSE 9.0 includes the madwifi driver as part of the distribution, but the driver is too old to be effective. So, I determined where the driver was loading from in /lib/modules and manually copied my new modules over. When you install new modules, you will need to run "depmod -a"; make install may do this for you.
Using the driver
Loading the driver creates an interface prefaced with "ath". Most likely, it will be ath0, since you will only have one Atheros card running in your system. (Older versions of madwifi used the prefix "wlan". If you see "wlan", you probably need to update your drivers.)
As in the case of Hermes-based cards, you need to set a static key to force the card and driver into the encrypted mode. It is a dummy key that won't be used. madwifi uses iwconfig, so the command set is the same as it is for the Hermes card that was in the last note:
# iwconfig ath0 key 12345678901234567890123456
# iwconfig ath0 essid "MyNetwork"
# ifconfig ath0 up
After running those three commands, the card will come up and start scanning to find an AP. Once it associates, the AP MAC address will be filled in in iwconfig. You can run Xsupplicant just like before, and it will authenticate and plumb the keys. Afterwards, if you run iwconfig, you will see the key in use for your station:
# iwconfig ath0
ath0 IEEE 802.11 ESSID:"myssid"
Mode:Managed Frequency:5.28GHz Access Point: 00:0B:0E:00:F0:43
Bit Rate:36Mb/s Tx-Power:off Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:E452-94AC-09DB-2200-1256-6D7D-74 Security mode:open
Link Quality:31/94 Signal level:-64 dBm Noise level:-95 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
This information is obsolete now.
MadWiFi is no longer on Sourceforge but rather on www.madwifi.org, the instruction are clear on that website.