rt2x00 (rt2500) hostapd, master mode

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

mhsk

03-08-2008 12:58:43

Hello,

I have the latest rt2x00.git, hostapd.git and libnl.git.

$ lspci | grep Link
000d.0 Network controller RaLink RT2561/RT61 802.11g PCI

$ lsmod
rt61pci 22272 0
crc_itu_t 3200 1 rt61pci
rt2x00pci 7936 1 rt61pci
rt2x00lib 40448 2 rt61pci,rt2x00pci
rfkill 10008 1 rt2x00lib
led_class 5124 1 rt2x00lib
mac80211 167016 2 rt2x00pci,rt2x00lib
cfg80211 25224 2 rt2x00lib,mac80211
eeprom_93cx6 3200 1 rt61pci

$ sudo iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06)
SET failed on device wlan0 ; Invalid argument.

when I start hostapd it fails with an error, after inserting some printfs, the problem is

driver_nl80211.c nl80211_create_iface while creating mon.wlan0
nl_wait_for_ack returns -1, error code returned from kernel (NL80211_CMD_NEW_INTERFACE) is ENFILE (-23)
parameters are
ATTR_IFINDEX=5
ATTR_IFNAME=mon.wlan0
ATTR_IFTYPE=IFTYPE_MONITOR
genl_family_get_id(...) = 20

i commented out the return to let the code continue, (mon.wlan0 is created, i can see it with iwconfig)
it fails again in nl80211_set_master_mode
nl_wait_for_ack returns -7 (kernel error code was -22)

any ideas?

Thanks,
M

P.S. The card works in ad-hoc mode, is visible and can be connected to from other computers.

milanc

14-08-2008 11:38:09

(hello everyone -) )

Same problem here, with Asus WL-167G (rt2500usb)
I got latest libnl, hostapd and kernel (rt2x00 branch) from git yesterday morning, as I couldn't find anything recent in debian testing/unstable/experimental)
Can't set adapter to master mode...
I did get through "driver_nl80211.c nl80211_create_iface creating mon.wlan0 error (...)", though. I think it had something to do with udev (That might have been for some other problem, though. I get sort of messed up after manually patching libnl, hostapd, and fiddling with kernel sources for a few hours.)
In /etc/udev/rules.d/z25_persistent-net.rules
SUSBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="(insert_MACaddr_here)", ATTR{type}=="1", NAME="rausb0"

Of course, iwconfig still complains about not being able to set master mode. So does hostapd now.

IvD

14-08-2008 16:06:29

'iwconfig wlan0 mode master' is by default incorrect and will _never_ be allowed.
The only solution is to use hostapd.
For a week or so the hostapd feature was disabled, but since 4 days this feature has been reenabled again.

milanc

14-08-2008 22:51:16

Thanks... I'll retry in a few days, when I get home.
[ Seems strange, though, that with GIT version downloaded august 13th it didn't work. That's definitely less than 4 days old. ]

IvD

15-08-2008 06:14:56

I have just heard that drivers are now supposed to register the supported modes, that is most likely the reason why it it failing. Patch will follow in a few hours.

milanc

19-08-2008 10:35:49

Came home last evening, kernel compiled overnight (slowish computer...).
Hostapd did start correctly. However, there's now an other problem.
Same as there
viewtopic.php?f=5&t=4922
The only difference is that I didn't mention anything about encryption in my hostapd.conf.

milanc

19-08-2008 22:40:38

Um, nevermind. I was using hostapd 0.6.4 instead of GIT.

UPDATE I still get those "unknown mgmt cb frame subtype 10" and "did not acknowledge authentication response", even using latest GIT. It did seem to work once, no more of those error messages, got associated, but no ping. Then went back to old errors.

UPDATE2 Seems to be a wider card/driver problem. I can't get ad-hoc mode to work either. Pings once out of ten.

By the way, I once got a kernel panic 'BUG in kernel/timer.c' yesterday (I think it was somewhere around line 750) after doing 'modprobe -r rt2500usb'. Unknown instruction '0000'. Last module unloaded mac80211.
(there was a second kernel panic later, but I don't remember much about it. it seemed quite random.)