LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 10-18-2011, 07:16 AM   #1
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Rep: Reputation: Disabled
could not set master mode for created wlan0 inteface by inserting ath9k module.


Dear all,

I am using cavium networks evb board, in which i am suppose to get working connected wifi module on PCI-e (having chip-set ar9287).

I have used latest linux kernel 3.0 and enabled ath9k as module.
once i insert ath9k module like..
# modprobe ath9k

i found wlan0 interface created in managed mode..

now, i want to make it working in master mode i.e. as an access point, so as per my knowledge i used iwconfig command for the same like...

# iwconfig wlan0 mode master

but it gives error like..

Error for wireless request "Set Mode" (8B06):
SET failed on device wlan0: invalid argument.

as per http://linuxwireless.org/en/users/Drivers/ath9k

Features and modes of operation

All of these modes of operation are supported and should work on all ath9k cards.

Station Mode
AP Mode
IBSS Mode
Monitor Mode
Mesh point
WDS (as of >= 2.6.37)

why am i getting failed to set master mode on wlan0...

Please guide me...

Thanks in advance.
Darshan
 
Old 10-18-2011, 09:27 AM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Hi,

with ath9k you can't set the master mode in this manner, this is because it uses the new mac80211 stack. The only way to set up master mode with ath9k is to install and set up hostapd (info). All you need to do is set an ip to the interface, bring it up, and start hostapd, you will then have a functional wireless access point. I have such a setup (different chip though), so I'm 100% sure it works

Serafean
 
Old 10-18-2011, 11:26 PM   #3
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Dear Serafean,

that means i will need
1) hostapd Authenticator(stable relese),
2) madwifi driver for used wifi-chipset(ar9287) in my case,
and
3) ath9k driver provided linux-kernel 2.35>= ,

to make it work as access points and to use some other utilities for security purpose.
 
Old 10-19-2011, 09:16 AM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Hi,

1)Hostapd - Yes
2)Madwifi - I don't think so : I have a AR9285 running as an AP with ath9k.
3)Yes.

Madwifi and ath9k are two separate driers for the same class of hardware, you cannot use both at the same time.
As for security, hostapd handles WPA1/2, it can also handle Radius authentication. If you don't have any very specific needs, hostapd should suffice.

Serafean
 
Old 10-21-2011, 05:56 AM   #5
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Dear serafean,

I have compiled and install hoastapd stabel release "hostapd-0.7.3.tar.gz" on my board.

then i have inserted ath9k module like # modprobe ath9k

and got wireless extension on wlan0 with managed mode ..

now as soon as i start hostapd by,,,

# ./hostapd /etc/hostadp.conf [with default .conf file found in hoastapd package]

it got failed to enable hostapd mode on wlan0 interface, the output was like

# Configuration file : /etc/hoastapd.conf
# ioctl[PRISM2_IOCTL_PRISM2_PARAM}: operation not supported.
# could not enable hostapd mode for interface wlan0
# hostapd driver initialization filed
# rmdir[Ctrl_interface]: no such file or directory


Why it is happening like this....?
 
Old 10-23-2011, 02:25 PM   #6
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Quote:
with default .conf file found in hoastapd package
There's your problem. You need to configure it. the most important part is the
Code:
driver=nl80211
line. Right now you're trying to run with the wrong driver. Setting the SSID is also an important step. I strongly recommend you read through the file (the comments document pretty well the options) and configure to your liking.
If you want an easy (or almost no) configuration, I suggest you try finding a tutorial on how to configure connection sharing using NetworkManager (if you have a GUI running).

Serafean
 
Old 10-25-2011, 02:08 AM   #7
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Dear serafean,


By selecting driver=nl80211,

it gives error.....

line 25: invalid/unknown driver nl80211

I have compiled hostapd for nl80211 also. any suggestion?
 
Old 10-31-2011, 02:14 AM   #8
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Dear serafean,

I have been working with other stuff last week,,

actually once i have selected hostapd to build for nl80211 driver it is giving some errors from libnl-1.1 include file(netlink/netlink.h)
like...

In file included from /home/Darshan/Drivers/libnl-1.1/include/netlink/genl/genl.h:15,
from ../src/drivers/driver_nl80211.c:22:
/home/Darshan/Drivers/libnl-1.1/include/netlink/netlink.h:56: warning: 'struct ucred' declared inside parameter list
../src/drivers/driver_nl80211.c: In function 'family_handler':
../src/drivers/driver_nl80211.c:251: error: 'CTRL_ATTR_MCAST_GROUPS' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:251: error: (Each undeclared identifier is reported only once
../src/drivers/driver_nl80211.c:251: error: for each function it appears in.)
../src/drivers/driver_nl80211.c:255: error: 'CTRL_ATTR_MCAST_GRP_MAX' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:258: error: 'CTRL_ATTR_MCAST_GRP_NAME' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:259: error: 'CTRL_ATTR_MCAST_GRP_ID' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:255: warning: unused variable 'tb2'
make: *** [../src/drivers/driver_nl80211.o] Error 1


i have used libnl-1.1 for hostapd, is this supported for hostapd-0.7.3 ???

what should i do to handle this issue ???

Thanks..
Darshan Prajapati...
 
Old 11-01-2011, 10:33 AM   #9
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Hi, do you have "iw" installed? It's the wireless extesions replacement.
Other than that, I'm sorry to say that i have no idea as to what is causing your issue. Personnally I'd try combining different versions. At this point, either someone more experienced will come along here, or try asking on IRC/mailing list of the respective projects.
What architecture is the board you're trying to run this on?

Serafean
 
Old 11-04-2011, 05:42 AM   #10
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Dear Serafean,

I made it working now...

Actually the problem was in included file linux/genetlink.h in libnl-1.1, it has to be updated, and so why i do the same and finally could compile the hostapd for nl80211 driver with libnl-1.1.


Now i have started hostapd with interface=wlan0 and driver=nl80211 after inserting ath9k module(linuxkernel-2.6.35).
for some steps it goes well but it my it gets hanged. you can see the below log for refernece..
_______________________________________________________________
# modprobe ath9k
[ 121.260000] PCI: enabling device 0000:01:00.0 (0140 -> 0142)
[ 121.590000] phy0: Atheros AR9287 Rev:2 mem=0xb0aa0000, irq=61
#
#
#
# iwconfig wlan0

wlan0 IEEE 802.11bgn ESSIDff/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry long limit:7 RTS thrff Fragment thrff
Encryption keyff
Power Managementff

#
# cd /bin/
#
# ./hostapd -dd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
ctrl_interface_group=0
nl80211: Add own interface ifindex 5
nl80211: New interface mon.wlan0 created: ifindex=6
nl80211: Add own interface ifindex 6
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Completing interface initialization
Mode: IEEE 802.11g Channel: 6 Frequency: 2437 MHz
Flushing old station entries
Deauthenticate all stations
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=0 set_tx=1 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 00:0b:6b:02:8c:da and ssid 'test'
nl80211: Set beacon (beacon_set=0)
wlan0: Setup of interface done.
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
-----------------------------{here it got hanged ???}

Signal 2 received - terminating
Flushing old station entries
Deauthenticate all stations
nl80211: Remove interface ifindex=6
netlink: Operstate: linkmode=0, operstate=6
#


_______________________________________________________________

why its not working? any idea????
 
Old 11-06-2011, 12:35 PM   #11
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Hi, are you sure it hanged, not that hostapd simply didn't have anything to log ("say")?
Quote:
Signal 2 received - terminating
You killed it...
I suggest you try associating with this AP. IMO it should work.
Be advised that in order to have a working connection you'll need to setup the IP addresses of both the AP and the client.

Serafean
 
Old 11-06-2011, 11:56 PM   #12
Darshan P
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
yes i killed it, actually at that point hostapd did not returned so why i could not have the console again. is it normal ?

and also after ...

wlan0: Setup of interface done

i am getting ....

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5


what about Unknown event 5 ?

Please put your comment on this!

Last edited by Darshan P; 11-06-2011 at 11:59 PM.
 
Old 11-08-2011, 01:43 AM   #13
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 982
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
Quote:
actually at that point hostapd did not returned so why i could not have the console again. is it normal ?
Yes, its the same as wpa_supplicant : unless you tell it to run in the background, it will continue logging to the active console without releasing it. To make it go into the background, use the -B switch.

As for the unknown event 5, I have no idea. I have seen it in several searches, and for most it seemed to work even with that output.

Serafean
 
Old 07-02-2014, 09:06 AM   #14
GREYES71
LQ Newbie
 
Registered: Jul 2014
Location: Buenos Aires, Argentina
Distribution: Debian [Wheezy-Jessie] && Ubuntu [Hardy-Lucid-Trusty] && Suse [9~10.3] && Mandrake [5.2 Leeloo~10.1]
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by serafean View Post

As for the unknown event 5, I have no idea. I have seen it in several searches, and for most it seemed to work even with that output.

Serafean
there is a bug raised in launchpad for this very purpose. This workaround suggested there works perfectly for me:

sudo nmcli nm wifi off
sudo rfkill unblock wlan

sudo ifconfig wlan0 10.15.0.1/24 up
sleep 1
sudo service isc-dhcp-server restart
sudo service hostapd restart

The first two lines stop wlan from network manager, and then unblocks the interface, so ifconfig can work.

The next commands uses ifconfig to bring up wlan and allows a second's delay, then restart the dhcp server (though I did not need this restart in my setup), and finally start the hostapd service.

It should now start w/o any issues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Master mode on AR928X using ath9k driver. Jophish Linux - Networking 1 10-26-2010 06:05 AM
Unable to set WUSB600N v2 in Master Mode Mohammad Abdelhadi Linux - Networking 0 07-22-2010 04:35 PM
Prism54 chipset USB Can't set it to Master mode babbab Linux - Wireless Networking 2 06-17-2010 10:50 AM
Wlan0 failing master mode Geneset Linux - Wireless Networking 5 09-18-2007 11:48 AM
Can't `iwconfig wlan0 mode master` michaelsanford Linux - Wireless Networking 3 05-05-2005 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 03:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration