rt2500pci + hostapd = not works [MGMT (TX callback) fail]

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

n_petr

04-01-2009 18:13:43

Good evening men,
after long time, I send us full report again about support of rt2500pci in Master Mode with recent kernel and recent hostpad.

IMHO block stopper fails
a) MGMT (TX callback) fail ... no visible AP SSID on client (mode managed) machine on the other side
b) unknown vendor specific information element ignored (vendor OUI 001018 len=9)
c) Error for wireless request "Set ESSID" (8B1A)
SET failed on device wlan0 ; Operation not supported.
d) Error for wireless request "Set Mode" (8B06)
SET failed on device wlan0 ; Invalid argument.
e) wlan0 No scan results
!!! but there is 8 other APs around !!!
f) no ESSID string in iwconfig output

Steps to reproduce
1) download GIT trees (kernel + hostapd)
rt2x00.sh

2) generate configs
config_kernel.txt
config_hostpad.txt

3) patch hostapd
patch hostapd to ignore the lack of acknowledgement http//eznemegy.blog.hu/2008/12/14/usin ... th_hostapd

4) make and install kernel + hostapd

5) reboot PC with new kernel

6) launch hostapd
hostapd.txt

7) catch full reports for comunity
dmesg.txt
hostapd.txt
ifconfig.txt
iwconfg_errors.txt
iwconfig.txt
lshw.txt
lsmod.txt
rt2x00_regdump.txt (by rt2x00_regdump.sh)
uname.txt
WiFi.txt

Thank you for comments, Petr Novák.

klaussm

25-02-2009 18:57:16

I also see the "MGMT (TX callback) fail" with an rt2500pci card on the git version of 2.6.29 from today, using the git version of hostapd. Symptoms are the same, I cannot see the SSID from other machines, and simply setting the SSID on the machines never results in association with hostapd.

If any debug information is needed, I'll happily provide it.

dopaminble

04-03-2009 14:56:56


a) MGMT (TX callback) fail ... no visible AP SSID on client (mode managed) machine on the other side
b) unknown vendor specific information element ignored (vendor OUI 001018 len=9)
[/quote2n3cpbfd]
Same problem here.


c) Error for wireless request "Set ESSID" (8B1A)
SET failed on device wlan0 ; Operation not supported.
[/quote2n3cpbfd]
This happens only if the card is in "master" - mode


d) Error for wireless request "Set Mode" (8B06)
SET failed on device wlan0 ; Invalid argument.
[/quote2n3cpbfd]
I think thats right, setting the card to master is not supported by iwconfig. (hostap only)


e) wlan0 No scan results
!!! but there is 8 other APs around !!!
[/quote2n3cpbfd]
i think u need to be root


f) no ESSID string in iwconfig output
[/quote2n3cpbfd]
Same here, think thats the main-problem...

System
[list2n3cpbfd]
[*2n3cpbfd]Kernel 2.6.29-rc6-wl (latest git)[/*m2n3cpbfd]
[*2n3cpbfd]hostapd v0.7.0[/*m2n3cpbfd]
[*2n3cpbfd]Ralink RT2500 802.11g Cardbus/mini-PCI (rev 01)[/*m2n3cpbfd][/listu2n3cpbfd]

If more informations is needed, please tell me...

dopaminble

05-03-2009 23:10:29

I tried to make a dump with the rt2x00_regdump.sh script and hostapd running, but it only shows the following lines

[code3p1hnqn8]
kernel: 2.6.29-rc6-wl
driver: rt2500pci
version: 2.3.0
compiled: Mar 4 2009 21:52:24
dev_flags: 0x0000051f
rt chip: 0201
rf chip: 0003
revision: 00000004

register base words wordsize
csr 0 93 4
eeprom 0 256 2
bbp 0 64 1
rf 4 4 4
[/code3p1hnqn8]

where is my mistake???

IvD

06-03-2009 09:38:53

Ahh I hadn't updated my regdump script yet, latest rt2x00.git contains a new version for register dumping, but the script on my kernel.org space wasn't updated accordingly. As soon as I get home from work I'll update the script. )

IvD

06-03-2009 18:53:25

I still have to complete & test the entire set of scripts for debugfs.
I'll attach the new dumpscript, and will upload it to the kernel.org webspace when I am done with the rest of the scripts.
In any case, this script should work better for you. )

dopaminble

07-03-2009 02:55:14

@IvD

Thank you for your help, i can now run the script.
In the new script I had to change 2 lines, but I think it was a typo
line 73, 75 ${DEBUG_DIR}/$... to ${DEBUG_DIR}register[/color2q8yw4ox]/$...

for everyone else, who gets
[code2q8yw4ox]awk: not an option: --posix[/code2q8yw4ox]
You need to install "gawk" (debian apt-get install gawk), the allready installed mawk can't deal with the "--posix" option.

IvD

07-03-2009 09:15:37


Thank you for your help, i can now run the script.
In the new script I had to change 2 lines, but I think it was a typo
line 73, 75 ${DEBUG_DIR}/$... to ${DEBUG_DIR}register[/color29zj2yas]/$...
[/quote29zj2yas]

Thanks, I'll fix this in the script.


for everyone else, who gets
[code29zj2yas]awk: not an option: --posix[/code29zj2yas]
You need to install "gawk" (debian apt-get install gawk), the allready installed mawk can't deal with the "--posix" option.[/quote29zj2yas]

Hmm, perhaps I should call gawk directly or at a check if the --posix argument is needed or not.
Thanks.

Rafaello

16-04-2009 11:32:22

I see the rt2500pci driver sends incorrect beacon because of misalignment... Please compare with rt73usb driver. First 24 bytes of beacon message put to rt73usb_write_beacon are as follows
80 0 0 0 ff ff ff ff ff ff 0 e 2e cf a1 88 0 e 2e cf a1 88 10 0
Compare with the beacon on air (tcpdump output)
[quotem6y8abww]001804.557547 1.0 Mb/s 2422 MHz (0x00a0) -56dB signal antenna 2 [0x0000000e] Beacon (W2LQ) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] ESS CH 3
0x0000 0000 1800 2e48 0000 0002 7609 a000 c802 .....H....v.....
0x0010 0000 0000 0000 0000 [bm6y8abww]8000 0000 ffff ffff ................
0x0020 ffff 000e 2ecf a188 000e 2ecf a188 1003 ................
0x0030 d853 4600 0000 0000 6400 0104 0004 5732 .SF.....d.....W2
0x0040 4c51 0108 8284 8b96 0c12 1824 0301 0305 LQ.........$....[/bm6y8abww][/quotem6y8abww]I have marked bold the message contents. As you see, message starts at 24-byte offset. Now, message passed to rt2500pci_write_beacon
80 0 0 0 ff ff ff ff ff ff 0 c 43 25 60 0 0 c 43 25 60 0 10 0
Beacon on air
[quotem6y8abww]002027.928783 1.0 Mb/s 2422 MHz (0x00a0) -68dB signal antenna 2 [0x0000000e] 00ffffffffff (oui Unknown) Unknown SSAP 0xd4 > ff000c432560 (oui Unknown) Unknown DSAP 0x9c Information, send seq 0, rcv seq 0, Flags [Response], length 72
0x0000 0000 1800 2e48 0000 0002 7609 a000 bc02 .....H....v.....
0x0010 0000 0000 0000 0000 08[bm6y8abww]80 0000 00ff ffff ................
0x0020 ffff ff00 0c43 2560 0000 0c43 2560 0010 .....C%`...C%`..
0x0030 9cd5 0000 0000 0000 0064 0001 0400 0457 .........d.....W
0x0040 324c 5101 0882 848b 960c 1218 2403 0103 2LQ.........$...[/bm6y8abww][/quotem6y8abww]As you see, the message starts at 25-byte offset.

My investigations entry->skb->data is not at 4-byte boundary. The allocated skb buffer (which is page aligned) is advanced by ieee80211_tx_status_rtap_hdr size before pass to the function, which is equal to 13.
After message align in memory (memmove), the beacon looks much better
[quotem6y8abww]123159.867065 1.0 Mb/s 2422 MHz (0x00a0) -58dB signal antenna 2 [0x0000000e] Beacon (W2LQ) [1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 Mbit] ESS CH 3
0x0000 0000 1800 2e48 0000 0002 7609 a000 c602 .....H....v.....
0x0010 0000 0000 0000 0000 [bm6y8abww]8000 0000 ffff ffff ................
0x0020 ffff 000c 4325 6000 000c 4325 6000 1001 ....C%`...C%`...
0x0030 3dad 0600 0000 0000 6400 0104 0004 5732 =.......d.....W2
0x0040 4c51 0108 8284 8b96 0c12 1824 0301 0305 LQ.........$....[/bm6y8abww][/quotem6y8abww]
Anyway, even if the correct beacon is sent, connection with the AP cannot be estabilished....

Rafaello

16-04-2009 13:27:35

Success! I have managed to connect to hostap working on the rt2500pci based card. Namely, the alignment problem exists not only in beacon frame. The rt2x00mac_tx function receives a misaligned skb->data, too. After the alignment correction, the device has started to work.

klaussm

16-04-2009 13:32:33

Fantastic. If you have a patch, I'll be happy to test it later today.

Rafaello

16-04-2009 16:18:16

My patch is rather a temporary solution. It uses construct that I'm not sure is fully legal - but at least it works. It is for vanilla kernel 2.6.29.

I think a correct solution should enforce to receive already aligned messages from ieee802 level.
The driver behaves something strange, beacon is sent very frequently at hostapd startup, but at least it works. I think some additional investigations are needed for the driver.

klaussm

16-04-2009 18:22:02

I can report success with the patch also, although I understand why it really isn't ready for inclusion, but at least it shows where the problem is.

I also tested the connection by copying a file, and everything seemd ok, so thanks a lot.

Rafaello

16-04-2009 19:01:29

What about the bit rate ? On my machine connection starts at 54 Mb/s, but after a few minutes it goes down to 1 Mb/s. Although only 1m distance is between stations and reported link quality is 97/100. File transfer doesn't exceed ~170 kB/s.

Rafaello

17-04-2009 06:20:35

Strange... The bit rate depends on devices pair connected together. It looks the rt2500pci does not like Intel 3945ABG. But in pair with a second Ralink it works at much higher bit rate.

I have found only one more issue to correct. The rt2500pci_interrupt function re-schedules beacon update when beacon timer expires. This is unnecessary, it only causes problems. The RT chip generates the interrupt every time the beacon is sent to air. This occurs periodically, every 100ms or whatever is set. Because the first beacon is sent immediately after set, the interrupt occurs immediately after beacon set, too. This causes that the beacon is sent very frequently, much more frequently than the specified beacon period.

I have removed the rt2x00lib_beacondone call from rt2500pci_interrupt and it seems to work much better. As I see, the rt73usb driver does not have any periodic re-scheduling of beacon update, probably the rt2500pci driver does not need any, too.

klaussm

17-04-2009 07:09:56

My test machine is also using a 3945ABG, so I retested by copying a larger file than I tested with for the first time. The transfer rate seems to be quite consistent at at least 850KB/s (kilobytes) but peaking at 1.2MB/s, even though iwconfig on the machine consistently reports a bit rate of 2 Mb/s and a link quality between 65 and 80 (3 meters to the accesspoint and a wall between the machines).

I've dusted off an older machine of mine with an Atheros card in, and it transfers at about 2.2MB/s (but that might be CPU limited, at least the CPU usage is maxed out most of the time.... It's an old laptop). But iwconfig on that machine consistently reports 54MB/s, so yes it seems that there is an issue with the 3945ABG card. I'll try to see if I can reproduce it with my 4965AGN card later today.

lente

09-05-2009 21:56:00

I can confirm that this work as well, using the latest rt2500 git kernel & hostapd along with this patch.
I'm not entirely sure how memory alignment should be fixed (probably by not occurring at all in the first place).
I think it's quite funny that this only occurs with the rt2500pci driver, based on your description one would think that this would occur in more then 1 driver.

anyway, thanks for the patch, I hope it'll open up a way into a permanent fix.

onne

14-07-2009 16:38:12

i can confirm this patch fixes it for me, almost feels like a miracle to finally have things up and running in master mode D
Thanks a lot!

Has a "permanent" fix been found yet?

1app

05-08-2009 03:10:30

I've just tried with the latest vanilla 2.6.31-rc5 kernel and get this same error when trying to use rt2500 pci as an access point with hostapd. Is there any progress in this issue or a chance that the proposed patch in this thread would be applied to the rt2x00 driver in some form - it would be really great to be able to use vanilla kernel & rt2500 as an wlan access point!

Thanks for great driver, besides this issue it has been great (legacy never worked for me atleast correctly).