After upgrading to the latest Ubuntu version 9.10 I could no longer compile and install the madwifi drivers. Here are the compilation errors I was getting:

In file included from /home/user/madwifi/madwifi-hal-,
from /home/user/madwifi/madwifi-hal-
/home/user/madwifi/madwifi-hal- error: conflicting types for 'irqreturn_t'
include/linux/irqreturn.h:16: note: previous declaration of 'irqreturn_t' was here
/home/user/madwifi/madwifi-hal- In function 'ath_attach':
/home/user/madwifi/madwifi-hal- error: 'struct net_device' has no member named 'priv'
/home/user/madwifi/madwifi-hal- error: 'struct net_device' has no member named 'open'
/home/user/madwifi/madwifi-hal- error: 'struct net_device' has no member named 'stop'
/home/user/madwifi/madwifi-hal- error: 'struct net_device' has no member named 'hard_start_xmit'
/home/user/madwifi/madwifi-hal- error: 'struct net_device' has no member named 'tx_timeout'
make[3]: *** [/home/user/madwifi/madwifi-hal-] Error 1
make[2]: *** [/home/user/madwifi/madwifi-hal-] Error 2
make[1]: *** [_module_/home/user/madwifi/madwifi-hal-] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
make: *** [modules] Error 2

This is due to the fact that there was a change in the kernel headers. The new kernels replaced the old net_device structure with a new one called net_device_ops. It looks like this change exists since kernel 2.6.29 and up.

There currently is no stable release of the madwifi drivers for the new kernerls. But the madwifi project's latest trunk compiles and works fine (at least for me) and I have not noticed any issues yet. This should work with any Linux distribution with a kernel of 2.6.29 and above. To find out your kernel version run:

uname -r

Here is how to get and install it:

1. You can either get the latest trunk from the madwifi website at or use the one that worked for me: madwifi-trunk-r4099-20090929.tar.gz

2. Download and uncompress the files:

Provided you downloaded the madwifi-trunk-r4099-20090929.tar.gz file, cd to the directory containing the file. Then gunzip and untar the files:

tar -xvzf madwifi-trunk-r4099-20090929.tar.gz

Cd into the newly created directory:

cd madwifi-trunk-r4099-20090929

3. Install the drivers:

First make sure you have the kernel headers:

sudo apt-get install build-essential

Now compile and install:

sudo make
sudo make install

4. Add the ath_pci module to the kernel:

You need to add a line to the end of the /etc/modules file. The line should read: ath_pci. You can do this with vi of course, but if you don't know the vi editor then it would be much easier to use gedit. So, do:

sudo gedit /etc/modules

Add ath_pci to the end of the file. Here is how my file looks:

# /etc/modules: kernel modules to load at boot time.
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.


At this point you can reboot and you should have wireless. You could save yourself a reboot by modprobing the kernel with the ath_pci module like this:

sudo modprobe ath_pci

You should be good to go.

Madwifi drivers for Ubuntu 9.10 (Karmic Koala) or linux kernels 2.6.29 and above.

52 thoughts on “Madwifi drivers for Ubuntu 9.10 (Karmic Koala) or linux kernels 2.6.29 and above.

  • November 7, 2009 at 10:39 am

    Thank you! works fine now. I’ve got atheros 5212 and it should be supported by ath5k from kernel 2.6.25 but I was never unable to make wifi connection through it so I used madwifi 0.9.4. I was shocked when this crappy kubuntu upgraded to 9.10 and kernel 2.6.31 and I was unable to compile the madwifi… I got connected with ath5k but connection was unstable, dmesg full of errors like ath5k phy0: unsupported jumbo and after that the card was stopping receiving data, but there was still full wifi signal.

  • November 7, 2009 at 7:27 pm

    THANK YOU THANK YOU THANK YOU THANK YOU!!! I have been looking for days to find out why madwifi is not working out. I even resorted to a fresh install of 9.04 to find that my internet would not connect! This has ended a series of trial and error headaches. Greatly appreciated!

  • November 8, 2009 at 2:07 pm

    Thank you very much, i was pretty clueless when my wifi stopped working after updating to 9.10 on my old thinkpad t40.

  • November 10, 2009 at 11:08 am

    @ Jamie Kitson

    If you just want to have wireless working you have a lot of other options. That has been the case for a while…

    But if you have an Atheros chipset and you want to be able to put your wireless interface in monitor mode and be able to actively inject packets, then your best bet is to go with madwifi.

  • November 10, 2009 at 6:52 pm

    You sir, are a gent 🙂

    Work perfectly 🙂

  • November 16, 2009 at 12:11 am

    I’m so sick of people saying “You don’t need madwifi anymore” YES YOU DO! Some cards don’t work without it!!

    Thanks much, exactly what I was looking for.

  • November 16, 2009 at 12:12 am

    BTW – you don’t have to run make as sudo and you can checkinstall the package to make a deb instead of just make install.

  • November 16, 2009 at 7:47 pm

    I sucessfully install madwifi-ng, blacklisted ath5k and load the correct modules (i.e using sudo modprobe ath_pci). My ifconfig shows the correct interfaces (wifi0 and ath0) but the wifi does not work =(
    when i click in the network manager, I can’t see any acess points
    any idea???
    mail me please:

  • November 16, 2009 at 9:40 pm

    Thanks for making this tutorial. I’ve been running Karmic for a while now and I can’t get WPA enterprise to work with the ath5k module. Hoping the madwifi will work better.

  • November 17, 2009 at 7:35 pm

    Thanks a lot. Having problems downloading large files (+50Mb) loosing connection all the time.

  • November 18, 2009 at 2:31 pm

    NOTE: be sure to remove ath_pci from the blacklist in /etc/modprobe/* (was by default blacklisted in karmic)

    to check if it is listed
    $ cat /etc/modprobe.d/* | rgrep ‘blacklist ath_pci’

    if there’s an output, comment the line out.


  • November 22, 2009 at 8:10 am

    I tried this and i was able to install the driver but my wireless still doesn’t work. The network manager is showing

    unknown interface(wifi0)
    unknown interface(ath0)

    and my network is coming as disabled

    *-network DISABLED
    description: Wireless interface
    product: AR5001 Wireless Network Adapter
    vendor: Atheros Communications Inc.
    physical id: 0
    bus info: pci@0000:03:00.0
    logical name: wifi0
    version: 01
    serial: 00:21:63:e6:a3:f4
    width: 64 bits
    clock: 33MHz
    capabilities: bus_master cap_list logical ethernet physical wireless
    configuration: broadcast=yes driver=ath_pci latency=0 multicast=yes wireless=IEEE 802.11b
    resources: irq:17 memory:d4600000-d460ffff

    Any ideas on how to fix it.

  • November 22, 2009 at 3:24 pm

    @ Amit

    It looks like you have exactly the same wireless chip set as mine. Here is my output of lshw -C network:

    description: Wireless interface
    product: AR5001 Wireless Network Adapter
    vendor: Atheros Communications Inc.
    physical id: 0
    bus info: pci@0000:04:00.0
    logical name: wifi0
    version: 01
    serial: 00:1f:3a:2b:d8:6a
    width: 64 bits
    clock: 33MHz
    capabilities: pm msi pciexpress msix bus_master cap_list logical ethernet physical wireless
    configuration: broadcast=yes driver=ath_pci ip= latency=0 multicast=yes wireless=IEEE 802.11g
    resources: irq:17 memory:80000000-8000ffff

    Check if you have the ath5k driver load up on boot as well. I have seen cases where both ath_pci and ath5k load up and then you would have problems like that.

    lsmod | grep ath5k

    If it comes back with the ath5k, you need to remove it:

    sudo rmmod ath5k

    and then blacklist it:

    echo “blacklist ath5k” | sudo tee -a /etc/modprobe.d/blacklist.conf

    Your laptop probably has a button that disables the wireless. Make sure that the wireless is enabled. My laptop would show that the wireless is disabled if I press that button.

    If you run Ubuntu, open System -> Administration -> Hardware Drivers and make sure that no driver is enabled for your wireless there. If it is, disable it. Hardware Drivers manager is implemented by Ubuntu to manage the proprietary drivers. There might be an equivalent for your Linux distribution.

  • November 29, 2009 at 5:30 am

    Hello people !

    When i digit ‘sudo make’, my shell (Ubuntu 9.10 on ‘Samsung R509’ notebook) write me this message :

    “ismaele@radioCiao:~/Desktop/madwifi-trunk-r4099-20090929$ sudo make
    cd: 1: can’t cd to /lib/modules/2.6.31-15-generic/build *** /lib/modules/2.6.31-15-generic/build is missing, please set KERNELPATH. Arresto.

    Why? Can you help me?

    I have ‘Athero ar5007’ wi-fi card, and i wish i want to run in monitor mode.

    Very tnx,
    Ismaele (mdimuzio(ATT)

  • November 29, 2009 at 4:45 pm

    @ Ismaele,

    it looks like you don’t have the kernel source installed.
    Run this and it should solve your problem:

    sudo apt-get install kernel-source-`uname -r`

  • December 1, 2009 at 7:50 am

    Thank you very much! I do all was you told and now Atheros Communications Inc. AR5001 Wireless Network Adapter worked correctly (Samsung NP-R20) Ubuntu 9.10
    Thank you!

  • December 5, 2009 at 7:55 pm

    WOW, thank you so much, this seems to have fixed all of my issues that I have tried to spend months attempting to resolve, and you fixed it in 10 minutes…. why isn’t this in an update? Or in a sticky on ubuntu forums, none of the other modules seem to support my chipset (AR2413) except this one
    Thank you very much!

  • December 10, 2009 at 8:56 am

    Thanks! I just updated to Ubuntu 9.10 and my wifi stopped working! I had to get a keyfob from my mac to my pc tower just to get the madwifi…gz onto the machine. This step by step worked perfectly. I’m online again! (glad I had 2 computers here).

  • December 11, 2009 at 5:02 pm


  • December 16, 2009 at 2:06 am

    Got the card working… well for a little bit and device drops. What the hell is going on here?

    If anyone knows please tell me.


  • December 28, 2009 at 3:25 am

    U Rock!
    Short, Sweet, and to the point, not to mention how well it works! – Nice!

  • January 2, 2010 at 11:34 am

    Thank you. Breaking my wifi mid-upgrade through Jaunty to Karmic was not a pleasant event. but it’s fixed.

    Thanks again

  • January 7, 2010 at 3:45 pm

    Thank You very much. It works fine.

  • January 9, 2010 at 7:29 pm

    thank you. i just install according by your instructions. now i dont need to use rt73 chip on usb to be able to put hardware in injection mod. Atheros rocks. thx

  • January 21, 2010 at 7:41 pm

    You rock sir!

  • January 22, 2010 at 2:10 pm

    You sir, are amazing!

  • January 24, 2010 at 8:32 am

    sudo modprode ath_pci
    sudo /etc/init.d/networking restart

  • February 6, 2010 at 10:46 am

    I followed the steps, but it encounters a problem with sudo make…I’m a newbe so have pitty on me here…

  • February 7, 2010 at 11:57 pm

    What is the output when you do sudo make ?

  • February 8, 2010 at 2:09 pm

    Thanks for the work on this.

    I’ve followed the instructions exactly (cutting and pasting into a terminal window). Everything seems to go okay, but I don’t seem to have the Madwifi drivers installed…or at least they don’t seem to work. I went into the files in /etc/modprobe.d and commented out two lines I found that blaclisted ath_pci. I added the line “ath_pci” to the end of the /etc/modules

    When I enter “sudo modprobe ath_pci” I get the following”

    “WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.”

    Any ideas?


  • February 8, 2010 at 6:55 pm


    You are getting this error, because the blacklist file should be named blacklist.conf.

    You need to rename it:

    sudo mv /etc/modprobe.d/blacklist /etc/modprobe.d/blacklist.conf

    Also, to check if the madwifi driver is loaded do:

    lsmod | grep ath_pci

  • February 8, 2010 at 8:21 pm

    Thanks, I think I have it running. Here is the output of “lsmod | grep ath_pci”:

    ath_pci 214848 0
    wlan 255680 1 ath_pci
    ath_hal 394784 1 ath_pci

    Does that look right? It seems that my connection is more stable, but I’ll have to see how things go over the next few days.

    BTW, I found that I had 2 different download packages in the same folder (one from sourceforge, recommended on the atheros website), so I started over and deleted everthing except madwifi-trunk-r4099-20090929.tar.gz, extracted again, and followed your instructions. When I got to “make install” I got error messages. It worked when I logged in as root and ran the command again.

    Thanks for your help,

  • February 9, 2010 at 3:53 pm


    I am glad it works for you now…

    And yes, the output of the lsmod command looks right.

  • February 15, 2010 at 1:01 pm

    Thank you very much this has ended hours of frustration for me after upgrading to 9.10.

  • February 24, 2010 at 3:25 am

    Hello Dimitar,

    I followed your instructions word by word, but to no avail. I have ar928x chipset and it’s working properly with ath9x. However, I’d like to switch to madwifi. I’m using ubuntu 9.10, and when I follow your instructions, I don’t get ath0 or wifi0. I removed blacklisted ath_pci from mod modprobe.d, and I blacklisted ath9x, but on reboot, I don’t get any wireless devices. As soon as I modprobe ath9x, I get connected normally, and wlan1 device is created. Below is lsmod excerpt. Any ideas or suggestions?


    sudo lsmod | grep ath
    ath_pci 197012 0
    wlan 228848 1 ath_pci
    ath_hal 362144 1 ath_pci

  • February 25, 2010 at 12:21 am


    Unfortunately I do not think that your chipset is supported by madwifi. You will have to continue using ath9x.

    Here is a complete list of the supported hardware by madwifi:

  • March 7, 2010 at 6:17 pm

    thank you so much 🙂

  • March 9, 2010 at 8:39 pm

    You are gent, thank you very much to help me solve this issue…

  • March 21, 2010 at 5:15 am

    My Ubuntu 9.10 now accept my card on Atheros 5007G and works fine!

  • March 31, 2010 at 5:31 pm

    Thank you. Good manual. I dnt understand why when i run Ubuntu from botable flash i see wifi drivers, but when install madwifi all be fine.

  • April 28, 2010 at 7:05 am

    THIS Sir just saved my life! Thank very much for sharing this with us…

    Greetings from Germany

  • May 8, 2010 at 5:18 pm

    Your instructions were great!!! You help me recover from an upgrade to Ubuntu 9.10. Keep up the good work and thanks again for having this website with helpful information.

  • June 27, 2010 at 6:32 pm

    Thanks alot, these instructions worked perfectly.

  • August 23, 2010 at 5:42 am

    Perfect! Thank you

  • December 31, 2010 at 11:52 am

    wireless not working ubuntu 9.10 help please.

    ath_pci 197044 0
    wlan 228464 4 wlan_scan_sta,ath_rate_sample,ath_pci
    ath_hal 397504 3 ath_rate_sample,ath_pci

  • Pingback:Wifi en Ubuntu

  • February 26, 2011 at 10:11 pm

    Thank-you so much. All the other how-tos gave me a swathe of error messages I couldn’t understand and no wi-fi. I could not for the life of me get my atheros card working – The Webcaster ft-stc-sg – under Ubuntu 9.10 (my laptop is as old as the hills).

    Using your how-to I got it up and running in about 10 minutes. It would have been less but I had to download the driver and this how-to on another partition. The how-to didn’t work with the newer drivers, but who cares, wireless now works better on Ubuntu than on the windows partition.

    Please keep this how-to up. It’s still relevant for us using older machines / ubuntu version (10.4 won’t play on this machine at all).

  • May 6, 2011 at 11:59 am

    You should also remove the blacklist of ath_pci in the file “blacklist-ath_pci.conf”

    Open the terminal and enter the following:
    sudo gedit /etc/modprobe.d/blacklist-ath_pci.conf

    change the text in that file so it looks like this:
    # blacklist ath_pci
    blacklist ath5k

Leave a Reply

Your email address will not be published. Required fields are marked *