Hi all,

I'm using ubuntu 9.10 with 2.6.31 kernel, Atheros AR 9285 wireless card.
This is what I've done:

$ sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless /root/backup/

I downloaded madwifi and 0.9.4, both have similar errors when I do
$ sudo make
Checking requirements... ok.
Checking kernel configuration... ok.
make -C /lib/modules/2.6.31-14-generic/build SUBDIRS=/usr/src/madwifi-0.9.4 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
  CC [M]  /usr/src/madwifi-0.9.4/ath/if_ath.o
In file included from /usr/src/madwifi-0.9.4/ath/../net80211/ieee80211_monitor.h:45,
                 from /usr/src/madwifi-0.9.4/ath/if_ath.c:71:
/usr/src/madwifi-0.9.4/ath/../ath/if_athvar.h:98: error: conflicting types for 'irqreturn_t'
include/linux/irqreturn.h:16: note: previous declaration of 'irqreturn_t' was here
/usr/src/madwifi-0.9.4/ath/if_ath.c: In function 'ath_attach':
/usr/src/madwifi-0.9.4/ath/if_ath.c:402: error: 'struct net_device' has no member named 'priv'
/usr/src/madwifi-0.9.4/ath/if_ath.c:678: error: 'struct net_device' has no member named 'open'
....... (lots of "has no member" errors)
/usr/src/madwifi-0.9.4/ath/if_ath.c: In function 'ath_rcv_dev_event':
/usr/src/madwifi-0.9.4/ath/if_ath.c:9926: error: 'struct net_device' has no member named 'priv'
/usr/src/madwifi-0.9.4/ath/if_ath.c:9928: error: 'struct net_device' has no member named 'open'
make[3]: *** [/usr/src/madwifi-0.9.4/ath/if_ath.o] Error 1
make[2]: *** [/usr/src/madwifi-0.9.4/ath] Error 2
make[1]: *** [_module_/usr/src/madwifi-0.9.4] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
make: *** [modules] Error 2

The solution for this I found is to use trunk:
$ svn checkout http://svn.madwifi-project.org/madwifi/trunk madwifi
Tried this, and moved the whole folder to Change to the /usr/src.
Install the sharutils from the package manager:
$ sudo apt-get -y install sharutils
Make the drivers
sudo make clean
sudo make
sudo make install
No errors so far.

$ sudo gedit /etc/modules
add a line at the very end of the file:
In /etc/modprobe.d/blacklist.conf, add line :
blacklist ath5k
blacklist ath9k
In /etc/modprobe.d/blacklist-ath_pci.conf
uncomment ath_pci(delete the # before #blacklist ath_pci)

After reboot, it seems that the wireless interface card can't be detected, the switch is on but the light is off, and output for iwconfig is
~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

I tried to put the original wireless driver back:
$ sudo mv /root/backup/wireless /lib/modules/$(uname -r)/kernel/drivers/net/
and change the blacklist file back, the wireless card still can't be detected, and the output of iwconfig is the same as above.

Anyone any ideas, please?

PS: Ticket #2391 has patch for madwifi trunk 4122 and ANI support for AR9285
but the trunk I use is 4144.
There's also a saying "There is no way to support AR9285 or any new hardware in the madwifi-0.9.4 branch since it has a non-free HAL that cannot be patched. " Is this true?
And in madwifi wiki/Compatibility/Atheros,
at the bottom, it says that Atheros AR928X chipsets usually works well with ath9k driver. So could this be the reason that madwifi doesn't work on my laptop with AR9285 wireless network adapter?

Thank you,