The AR5007EG card on CentOS-5.

NOTE! This page isn't maintained, and some links may turn out to be broken. The latest information is more likely to be available from The CentOS Wiki article.

The Atheros 5007EG card and MadWifi

As of early July, 2008, there is a MadWifi snapshot that works with this card. It is not in the main MadWifi trunk. The snapshot works with both 32 and 64 bit systems.

Many thanks to the MadWifi team.

Note that most of these commands require root privilege and also require root's $PATH of /sbin and /usr/sbin. Before starting, either log in as root or do an su - (note the space and hyphen after the su) to ensure that all commands are found.

The rest of this page will assume that you are logged in as root, with root's full path, including /sbin and /usr/sbin.

1. Determine if it is the AR5007EG card

Start with the lspci command.
lspci

Running lspci on a 32 bit system often shows the card as AR5006EG. If you haven't uninstalled Windows, you can check with its Device Manager, which will show the card to be the AR5007EG. On an Acer 4720z, there is a sticker on the bottom, apparently present in most Acers, saying that it has AR5BXB63. Running lscpi may identify it as AR242x 802.11 abg. Running the command lspci -nn should show, however a vendor ID of 168c:001c.

2. Remove any ndiswrapper or other MadWifi cruft.

If you've previously installed ndiswrapper or MadWifi, there's a possibilty that whatever is left might interefere with what we're going to do. With ndiswrapper, first uninstall whatever driver you installed. (It will probably be either the net5211 or net5416.)
ndiswrapper -l

That will tell you what's installed. If it was the net5211 then
ndiswrapper -e net5211

If it's the 5416 then change that to net5416.

Then remove ndiswrapper. If you installed it from an rpm then use yum remove ndiswrapper

If you installed ndiswrapper from source, then cd into the ndiswrapper directory that was created when you untarred the tar.gz file and type
make uninstall

It will remove the various files it installed and suggest that you run make uninstall a couple of times till you're sure there's nothing left.

If you've installed a version of MadWifi the procedure is similar. If you used one of the repos then use yum remove madwifi. If you installed from source, cd into the directory created when you untarred the source and run make uninstall.

3. Download the patched snapshot from here.

At time of writing, the above link to ticket 1192 has a link to their special snapshots page. At the moment, there is r4100-20090929 available. To download it

wget http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6/madwifi-hal-0.10.5.6-r4100-20090929.tar.gz

That should be on one line. (If that site is down, which happens on occasion, you can grab a copy here.)

Save it somewhere. If you're in Gnome, the default will be your Desktop.

4. Make sure you have the necessary tools to compile source code.

yum -y install gcc gcc-c++ make kernel-devel

This should also pull in kernel-headers and other necessary things.

5. Untar the file, cd into the directory and run make; make install.

Make sure you are in the directory where you downloaded the file. For example, if it downloaded to the Desktop directory, when you open your terminal, do a cd Desktop. (Then run the ls command to make sure you are in the same directory as the file.)

To untar, build and install the source file
tar zxvf madwifi-<version>tar.gz
cd madwifi-<version>
make
make install

<version> refers to whatever the latest file name will be. At time of writing the commands would be
tar zxvf madwifi-hal-0.10.5.6-r4100-20090929.tar.gz
cd madwifi-hal-0.10.5.6-r4100-20090929

6. It may be necessary to remove and/or blacklist conflicting Atheros modules.

rmmod ath5k

Add the module to blacklisted modules. With your favorite text editor, open the file /etc/modprobe.d/blacklist and add this line to it.
blacklist ath5k

7. Insert the ath_pci module
modprobe ath_pci

Hopefully, you then see a command prompt, meaning that the module installed without error. If you get an error message, it still might work after a reboot. For the moment, let's assume you didn't get any error messages. Now, doing lsmod |grep ath should show
ath_rate_sample
ath_pci
wlan
ath_hal

(It may show a few other things containing the string "ath" which can be ignored.)

8. Bring the card up with ifconfig.
ifconfig ath0 up

That step isn't always necesary. However, it doesn't hurt anything, and sometimes things won't work until you do it.

Hopefully, you'll get back a command prompt, indicating that the command succeeded. (If there are no errors, there is no message, you're just put back at the command prompt.)

9. Run iwlist ath0 scan
iwlist ath0 scan

If this gives you a list of available wireless networks, you should be in good shape. From there, you can enable wireless the way you usually do.

With luck, you'll now be able to use your wireless card. Sometimes, a reboot might be necessary, but most of the time, it isn't needed.

Many laptops have a button or switch to turn the wireless on and off. On the Acer 4720z laptop, there is such a button. Unfortunately, the wireless LED doesn't work with the MadWifi driver, so one can't tell if it's on or off. If it isn't working, and you have such a button, try pushing it a few times as it doesn't always succeed in turning the card on or off on the first push.

If you still have no luck, then try a reboot. After rebooting, run
dmesg |grep HAL

If it didn't work there might be some sort of HAL error, such as HAL error 3, Hardware didn't respond as expected, or unable to attach hardware: Hardware revision not supported (HAL status 13). You might get some other sort of error. If running the above command doesn't return anything, that's a good sign. Another indication of success will be a message like
MadWifi: ath_attach: HAL mangaed transmit power control (TPC) disabled

If it's still not working, run through this checklist. It's not a very good one, but it covers a few things that people have missed If you've followed all of the above instructions, you've already covered this.

If this wasn't the first time you installed madwifi, did you run make uninstall and then make clean before running make?

If you had used or tried using ndiswrapper first, did you uninstall that driver and ndiswrapper?

If you did an su to root, did you do su -, with the space and then the hyphen after the su? If not, there might have been an error somewhere, since CentOS only gives a path that includes /sbin and /usr/sbin to root's environment.

Did you remember to blacklist the kernel's built in ath5k module?

Did you remember to modprobe ath_pci?

If your laptop has a switch or button to enable or disable wireless, did you remember to check that? On some, the only indication is an LED light that doesn't work in Linux, so one has to guess and possibly try a few times.

IMPORTANT NOTE
Each time you upgrade your kernel, you'll have to do the following. (The modules are tied into the kernel version, so when the kernel is updated, the modules no longer work.)

Go back into the Madwifi directory. (Hopefully, you haven't deleted it. If you have, download and untar it again.) Once you're in the directory
make uninstall
make clean
make 
make install
modprobe ath_pci

At that point, you might get an error. If you do, then reboot and try the modprobe ath_pci line again. It should work this time.