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-0.10.5.6/ath/../net80211/ieee80211_monitor.h:34,
from /home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:75:
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/../ath/if_athvar.h:107: error: conflicting types for 'irqreturn_t'
include/linux/irqreturn.h:16: note: previous declaration of 'irqreturn_t' was here
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c: In function 'ath_attach':
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:478: error: 'struct net_device' has no member named 'priv'
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:819: error: 'struct net_device' has no member named 'open'
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:820: error: 'struct net_device' has no member named 'stop'
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:821: error: 'struct net_device' has no member named 'hard_start_xmit'
/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.c:822: error: 'struct net_device' has no member named 'tx_timeout'
.....
.....
.....
make[3]: *** [/home/user/madwifi/madwifi-hal-0.10.5.6/ath/if_ath.o] Error 1
make[2]: *** [/home/user/madwifi/madwifi-hal-0.10.5.6/ath] Error 2
make[1]: *** [_module_/home/user/madwifi/madwifi-hal-0.10.5.6] 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 http://snapshots.madwifi-project.org/madwifi-trunk-current.tar.gz 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.
lp
sbp2
ath_pci
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.
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.
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!
Thank you very much, i was pretty clueless when my wifi stopped working after updating to 9.10 on my old thinkpad t40.
I don’t think you need to use madwifi any more.
@ 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.
You sir, are a gent 🙂
Work perfectly 🙂
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.
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.
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: the_way_of_hope@hotmail.com
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.
Thanks a lot. Having problems downloading large files (+50Mb) loosing connection all the time.
cheers man! this is f***ing awesome!!!
i think this driver is necessary for my chip (won’t work with ath5k)
for more bugtracking look here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/461419
thanks!
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.
cheers
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.
@ Amit
It looks like you have exactly the same wireless chip set as mine. Here is my output of lshw -C network:
*-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=192.168.1.153 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.
Run:
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.
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
Makefile.inc:66: *** /lib/modules/2.6.31-15-generic/build is missing, please set KERNELPATH. Arresto.
ismaele@radioCiao:~/Desktop/madwifi-trunk-r4099-20090929$
”
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)crema.unimi.it)
@ 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`
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!
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!
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).
III LOOVVE YOUUUUUUUUUUUU
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.
Thanks,
daedalus wmclemore@gmail.com
U Rock!
Short, Sweet, and to the point, not to mention how well it works! – Nice!
Thank you. Breaking my wifi mid-upgrade through Jaunty to Karmic was not a pleasant event. but it’s fixed.
Thanks again
Thank You very much. It works fine.
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
You rock sir!
You sir, are amazing!
sudo modprode ath_pci
sudo /etc/init.d/networking restart
I followed the steps, but it encounters a problem with sudo make…I’m a newbe so have pitty on me here…
What is the output when you do sudo make ?
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?
Thanks
@Tom
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
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,
@Tom
I am glad it works for you now…
And yes, the output of the lsmod command looks right.
Thank you very much this has ended hours of frustration for me after upgrading to 9.10.
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?
Nok
sudo lsmod | grep ath
ath_pci 197012 0
wlan 228848 1 ath_pci
ath_hal 362144 1 ath_pci
@Noktuki,
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:
http://madwifi-project.org/wiki/Chipsets
thank you so much 🙂
You are gent, thank you very much to help me solve this issue…
THANK YOU SO MUCH!!
My Ubuntu 9.10 now accept my card on Atheros 5007G and works fine!
THANK YOU AGAIN!!!
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.
THIS Sir just saved my life! Thank very much for sharing this with us…
Greetings from Germany
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.
Thanks alot, these instructions worked perfectly.
Perfect! Thank you
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
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).
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