9/27/07 rt2x00 git iwconfig mode master "Invalid argume

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4315

corp186

29-09-2007 19:31:16

I checked out the latest rt2x00 git on Thursday and would like to use the card as an AP. I also checked out the latest hostapd git. Unfortunately, hostapd would not compile against the current devicescape headers.

Since I do not need WPA (although it would be nice), I tried to just enable master mode, but I got the following error

[code7475ft9m]
# iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.
[/code7475ft9m]

If it makes any difference, I'm building ARCH=arm.

duky

01-10-2007 06:47:15

I you find the solution tell it !

I have exactly the same problem...

Sorry, I have no help for you.

lfcorreia

01-10-2007 08:40:39

Please make sure that the interface is down before changing it's mode.

(ifconfig wlan0 down)

duky

01-10-2007 10:08:24

Please make sure that the interface is down before changing it's mode.

(ifconfig wlan0 down)[/quote3jnq8dgj]
Yes my interface is down.

Tell me if I am wrong...

The rt2x00 kernel is based on the new mac80211 stack, isn't it ?

I check my rt2x00 git kernel downloaded source code and in the ioctl interface of mac80211 (file ieee80211_ioctl.c function ieee80211_ioctl_siwmode()) we clearly see that the master mode is not supported
switch (*mode) {
case IW_MODE_INFRA
type = IEEE80211_IF_TYPE_STA;
break;
case IW_MODE_ADHOC
type = IEEE80211_IF_TYPE_IBSS;
break;
case IW_MODE_MONITOR
type = IEEE80211_IF_TYPE_MNTR;
break;
default
return -EINVAL;
}

If you look to the rt2x00 driver (rt61pci specific part) the master mode seems to be handle.

If you look to the mac80211 git kernel tree, the master mode is implemented in the mac80211 stack but not the rt2x00 driver.

So, if i'm not wrong a merge betwin mac80211 and rt2x00 kernel trees shall be done...

lfcorreia

01-10-2007 10:30:19

Well, actually, the master mode has been removed from the chunk that is being pushed upstream towards 2.6.24

since our main objective is having a stable driver in the mainline kernel, we are fine by not having master mode.

if you really want to work with master mode, 'I think' it is still available in the wireless-dev branch. but there may be some API incompatibilities between these two versions.

please help us in make a stabler driver and leave out master mode for now )

corp186

01-10-2007 12:38:38

If there's no support in the rt2x00 tree now, when was there support? I would be fine with going back to earlier tags to get master mode functionality. And although I would like to see the current code become better, the only reason I have this card is to use it as an AP.

Thanks

IvD

01-10-2007 17:41:06

Hmm I guess master mode was dropped when I rebased rt2x00.git to wireless-2.6 instead of wireless-dev.

If you need master mode, you best grab the wireless-dev kernel tree from git.kernel.org

Since rt2x00 is moving towards the vanilla kernel rt2x00.git will strictly follow the upstream tree to make sure we are fully compatible with the vanilla kernel.

Amp_God

01-10-2007 18:42:25

Hmm I guess master mode was dropped when I rebased rt2x00.git to wireless-2.6 instead of wireless-dev.

If you need master mode, you best grab the wireless-dev kernel tree from git.kernel.org

Since rt2x00 is moving towards the vanilla kernel rt2x00.git will strictly follow the upstream tree to make sure we are fully compatible with the vanilla kernel.[/quote222o0r03]


Any wild quesses when the rt2x00 drivers will be on the normal stable vanilla? roll

corp186

01-10-2007 18:57:07

Assuming the code snippet duky posted is the correct piece of code, wireless-dev never had this support since that code is the same in the latest wireless-dev and when the mac80211 stack was imported into the tree. Am I missing something?

IvD

01-10-2007 21:55:56

Any wild quesses when the rt2x00 drivers will be on the normal stable vanilla? roll[/quote3okttmxk]

No wild guesses are needed. Since about a week this is one of the most simple questions to anwer kernel 2.6.24 will contain rt2x00


Assuming the code snippet duky posted is the correct piece of code, wireless-dev never had this support since that code is the same in the latest wireless-dev and when the mac80211 stack was imported into the tree. Am I missing something?[/quote3okttmxk]

Well that probably means that master mode has been pulled out of wireless-dev as well. Probably caused by the same rebasing that has occured as in rt2x00.

corp186

02-10-2007 12:18:44

So does this mean there's no trees available with master mode functionality? I wouldn't mind legacy drivers as long as they can do master mode and function well.

duky

02-10-2007 14:00:04

So does this mean there's no trees available with master mode functionality? I wouldn't mind legacy drivers as long as they can do master mode and function well.[/quote1m86g439]
On the mac80211 tree the master mode is available.

Of course the rt2x00 does not compile on the mac80211 tree due to important changes of the api...

I tried the legacy driver but it does not compile with recent kernels.

Do you know on what kernel version the legacy driver compile ? (no mention about it on ralink website)

IvD

02-10-2007 18:13:30

As long as you use the CVS tarballs instead of the official releases, they should compile on all kernels.
When experiencing compilation problems for the legacy driver you should post the error messages in a thread on the correct forum.

duky

03-10-2007 12:40:14

I was talking about ralink legacy driver, not enhanced legacy driver from serialmonkey.

I actually use this enhanced leagcy driver that works very well but does not support master mode.

The ralink legacy driver (1.1.1.0) does not compile on a recent kernel and I didn't see any CVS repository in there (remark I do not even know if this driver support master mode)

Spy84464

03-10-2007 15:09:01

No, Ralink's drivers do not support master mode more than ours (rt2x00 aside of course).

AdamBaker

06-10-2007 23:05:56

John Linville (wirelss-dev tree maintainer) has now announced that the wireless-dev tree is dead and the master mode functionality is in his new wireless-legacy tree where it will remain until the new (not yet finished) master mode support gets added to the wireless-2.6 tree

duky

08-10-2007 12:54:56

John Linville (wirelss-dev tree maintainer) has now announced that the wireless-dev tree is dead and the master mode functionality is in his new wireless-legacy tree where it will remain until the new (not yet finished) master mode support gets added to the wireless-2.6 tree[/quote1z729qbg]

Indeed, wireless-dev tree disapeared.
I've just take a look to both (wireless-legacy and wireless-2.6), none seems to include master mode. Moreover wireless-2.16 seems to be more up to date than the wireless-legacy tree.

Anyway, I figure it will appear soon in these trees...

fatbob

24-10-2007 12:19:18

According to a post from Johannes Berg on the linux-wireless mailing list ([url3rikfael]http://marc.info/?l=linux-wireless&m=119152122022701&w=2[/url3rikfael]) he is maintaining a set of patches to the wireless-2.6 git tree and git hostapd that enables hostap in mac80211.
It builds fine except for hostapd which needed a removal of some typedefs (defined twice) in src/utils/common.h.

I tried these patches with a rt61 PCI card and the AP is visible to clients, but they fail to associate with it. Before investigating further, I wonder if the current rt2x00 driver (in wireless-2.6 git) is missing functionality to make hostap/master mode work, or if this (in theory) should work?
The kernel patches does not touch driver code, just the mac80211 stuff.

I realize that the focus of the rt2x00 driver is on managed mode stability at the moment for the 2.6.24 inclusion, which is great! I'm not demanding it to work right now, but it would be nice )

The patches can be found here
[url3rikfael]http://johannes.sipsolutions.net/patches/[/url3rikfael]

/Martin

IvD

24-10-2007 19:02:51

No we never "crippled" rt2x00 to prevent master mode. So in theory it should work.

duky

25-10-2007 07:59:24

I downloaded the patches and applied them to the rt2x00 git kernel tree and to hostapd git sources.

After solving some other little problems, I finally get the kernel and hostapd compiling properly.

When I run hostapd, I have some errors messages but it starts.

See my logs
[quote53dvymfo]
Configuration file /etc/hostapd/hostapd.conf
Opening raw packet socket for ifindex 17
BSS count 1, BSSID mask ffffffffffff (0 bits)
Failed to set channel flag (mode=1 chan=1 flag=0x7)
Failed to set channel flag (mode=1 chan=2 flag=0x7)
Failed to set channel flag (mode=1 chan=3 flag=0x7)
Failed to set channel flag (mode=1 chan=4 flag=0x7)
Failed to set channel flag (mode=1 chan=5 flag=0x7)
Failed to set channel flag (mode=1 chan=6 flag=0x7)
Failed to set channel flag (mode=1 chan=7 flag=0x7)
Failed to set channel flag (mode=1 chan=8 flag=0x7)
Failed to set channel flag (mode=1 chan=9 flag=0x7)
Failed to set channel flag (mode=1 chan=10 flag=0x7)
Failed to set channel flag (mode=1 chan=11 flag=0x7)
Failed to set channel flag (mode=1 chan=12 flag=0x0)
Failed to set channel flag (mode=1 chan=13 flag=0x0)
Failed to set channel flag (mode=1 chan=14 flag=0x0)
Failed to set channel flag (mode=0 chan=1 flag=0x7)
Failed to set channel flag (mode=0 chan=2 flag=0x7)
Failed to set channel flag (mode=0 chan=3 flag=0x7)
Failed to set channel flag (mode=0 chan=4 flag=0x7)
Failed to set channel flag (mode=0 chan=5 flag=0x7)
Failed to set channel flag (mode=0 chan=6 flag=0x7)
Failed to set channel flag (mode=0 chan=7 flag=0x7)
Failed to set channel flag (mode=0 chan=8 flag=0x7)
Failed to set channel flag (mode=0 chan=9 flag=0x7)
Failed to set channel flag (mode=0 chan=10 flag=0x7)
Failed to set channel flag (mode=0 chan=11 flag=0x7)
Failed to set channel flag (mode=0 chan=12 flag=0x0)
Failed to set channel flag (mode=0 chan=13 flag=0x0)
Failed to set channel flag (mode=0 chan=14 flag=0x0)
Failed to set rate sets.
Failed to update rate sets in kernel module
RATE[0] rate=10 flags=0x152
RATE[1] rate=20 flags=0x156
RATE[2] rate=55 flags=0x156
RATE[3] rate=110 flags=0x156
RATE[4] rate=60 flags=0x131
RATE[5] rate=90 flags=0x31
RATE[6] rate=120 flags=0x131
RATE[7] rate=180 flags=0x31
RATE[8] rate=240 flags=0x131
RATE[9] rate=360 flags=0x31
RATE[10] rate=480 flags=0x31
RATE[11] rate=540 flags=0x31
Could not set passive scanning Unknown error 4294967295
Could not connect to kernel driver.
Mode IEEE 802.11g Channel 2 Frequency 2417 MHz
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Failed to set CTS protect in kernel driver
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Failed to set Short Slot Time option in kernel driver
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Could not set preamble for kernel driver
Using interface wlan0 with hwaddr 0008d3287c52 and ssid 'Anemoi'
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Failed to set CTS protect in kernel driver
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Failed to set Short Slot Time option in kernel driver
wlan0 ioctl[PRISM2_IOCTL_PRISM2_PARAM] Operation not supported
Could not set preamble for kernel driver
Wireless event cmd=0x8b04 len=12
Wireless event cmd=0x8b1a len=14
[/quote53dvymfo]

When I do a scan, I see my AP and I can associate with ! Unfortunately, I can not do more. It creates a "wmgmt0" interface that seems to well manage AP stuffs but it seems to failed to link with the wlan0 interface.

To resume, I can associate and communicate with wmgmt0 interface (see packets incoming and outgoing) but the ip part seems not to work (no packet on wlan0 interface)

I will try to look further more to see where these problems come from !