Sunday, May 9, 2010

Atheros AR5212 in Ubuntu 10.04 Lucid Lynx

I've just finished a fresh install of Ubuntu Lucid Lynx 10.04 on my crusty old Thinkpad T60. Everything is working great with the exception of my Atheros AR5212 wireless card.

Clicking the network manager applet in the panel I see the wireless listed as "Device not ready". This is tedious.

The solution to this issue is to remove the mainline ATK5K wireless driver from your Kernel and replace it with non-mainline MadWifi driver (source). MadWifi has superior support for the AR5212 card. This shouldn't take you more than about 20 minutes to sort out.
  1. Open a terminal: Aplications -> Accessories -> Terminal
  2. To check on your wireless card and make sure you have the AR5212:
    trastle$ sudo lshw -c network
    The result will look similar to this:
        description: Wireless interface
        product: AR5212 802.11abg NIC
        vendor: Atheros Communications Inc.
        physical id: 0
        bus info: pci@0000:03:00.0
        logical name: wifi0
    Now you know your sporting an Atheros AR5212.
  3. Install some software you'll need to build MadWifi:
    trastle$ sudo apt-get install subversion linux-kernel-headers build-essential \
  4. Now go to your desktop
    trastle$ cd ~/Desktop 
  5. Make a directory to put the MadWifi source in:
    trastle$ mkdir madwifi-src
  6. Get the latest MadWifi source:
    trastle$ svn checkout madwifi-src
  7. Change into your new source directory:
    trastle$ cd madwifi-src
  8. Change to the root user:
    trastle$ sudo -i
  9. Blacklist the non working ATH5K drivers:
    root$ echo "# Block ATH5K" >> /etc/modprobe.d/blacklist
    root$ echo "blacklist ath9k" >> /etc/modprobe.d/blacklist
    root$ echo "blacklist ath5k" >> /etc/modprobe.d/blacklist
  10. Change to the MadWifi source directory
    root$ cd /home/[your user]/Desktop/madwifi-src
  11. Build and install the MadWifi driver:
    root$ make && make install -d
  12. Add the MadWifi driver to your Kernel
    root$ echo ath_pci >> /etc/modules

Now save anything else you have been working on and reboot your laptop. After the reboot your wireless will be working nicely.

2010-06-20: Edit added step 10. Thanks Xi.