Google
 

Monday, January 05, 2009

No Wifi to Master-mode

Linux recognizes my wifi card as AR242x and there's no out-of-the-box support till now.

$ lspci | grep 'Wireless'
02:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
However compiling the latest snapshot from madwifi.org works. (Instructions here)
$ wget -c http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6-current.tar.gz
$ tar xvf madwifi*.tar.gz
$ cd madwifi*r*

$ sudo make install
$ sudo modprobe ath_pci
$ sudo modprobe wlan_scan_sta
Cool. But the problem is no other modes except managed-mode seem to work.
$ sudo iwconfig ath1 mode ad-hoc
Error for wireless request "Set Mode" (8B06) :
SET failed on device ath1 ; Operation not permitted.
I was little curious about this as every wireless card supports at least ad-hoc mode if not managed. So I did a lil' diggin into madwifi's source code and found out that it supports all modes including master (or ap) mode too. This was quite startling to me coz i've been told that Master (or AP) mode is only for dedicated Wireless APs or expensive wireless cards.

Madwifi comes with nice wlanconfig tool.
$ wlanconfig
usage: wlanconfig athX create [nounit] wlandev wifiY
wlanmode [sta|adhoc|ap|monitor|wds|ahdemo] [uniquebssid]
usage: wlanconfig athX destroy
usage: wlanconfig athX list [active|ap|caps|chan|freq|keys|scan|sta|wme]
Now to start AP mode,
$ sudo wlanconfig ath1 destroy
$ sudo wlanconfig ath1 create wlandev wifi0 wlanmode ap
Now set the ESSID for the wireless network and IP for the interface
$ sudo ifconfig ath1 192.168.0.1
$ sudo iwconfig ath1 essid 'TestAP'
Voila! It worked and I can connect to this AP from another computer, set the IP to 192.168.0.x range and ping too. Now I'm wondering if AP mode is available in every card but is restricted by software so that ppl are forced to buy expensive APs.

6 comments:

  1. oho ! sounds like jackpot ;-)
    ढुङ्गो खोज्दा देउता भेट्ने भन्या यही हो क्यार !

    ReplyDelete
  2. this post was of bilg help to me, thanks

    ReplyDelete
  3. ekdam ramro lagyo but i got one problem how to install wirleless 3945 adaptor in slackware i have tried it but i could'nt can anyone help me ?

    ReplyDelete
  4. plz post ur problem with detailed description at foss-nepal mailing list. someone might be able to fix it..

    ReplyDelete
  5. hajur jwalanti ji maile linux slackware intall gareko lan line chalchha but my wireless is not working,i got systemax laptop .if anyone know how to install wirless adaptor 3945,can anyone give me any suggestion?

    ReplyDelete
  6. thanks for making that blog entry, it proved invaluable for getting my atheros card up and running in ad-hoc and master mode. I wanted to use the 3G card in my laptop from my ipodtouch, so needed it to work in ad-hoc or even better AP mode.

    ReplyDelete