Using rt2x00 wireless driver with hostapd

Using rt2x00 wireless driver with hostapd

The problem

A few month ago i bought an rt73-base usb wifi dongle to make a low-cost access-point from my old linux box. Unfortunately i couldn’t make it work until last week, when i finally figured out the root of the problem. First of all, i used the latest rt2x00 development kernel (how to get it), and the latest hostapd from the git repository. The official howto on the rt2x00 wiki is quite good, but it didn’t work with my TL-WN321G wifi dongle, so i had to find out what’s the problem. First the hostapd started up, and the clients could associate, but when i tried to send packages, the hostapd dropped error messages in an infinite loop:

wlan0: STA 00:12:f0:76:03:b9 IEEE 802.11: association OK (aid 1) MGMT (TX callback) fail mgmt::assoc_resp cb wlan0: STA 00:12:f0:76:03:b9 IEEE 802.11: did not acknowledge association response Sending disassociation info to STA 00:12:f0:76:03:b9 MGMT (TX callback) fail unknown mgmt cb frame subtype 10

Investigation

And then it reassociates with the client, does it again and again. So after few days spent on trying to figure out what is the problem, i found some interesting posts on hostapd, and rt2x00 mailing lists on this topic. The most interesting is this thread. The discussion is about three patch, and the first one is the important one. They say, that the driver can not ackowledge the completion of sending certain frames, because of hardware limitations. So, the case is, that the driver can’t acknowledge these frames, but the hostapd wants an acknowledgement, or it won’t function function properly.

The possible solutions

There are two solutions.

• Patch the driver to acknowledge the frames even if it is not sure that they have been succesfully sent.
• Patch hostapd to ignore the lack of acknowledgement.

The second one seems to be the easier way, so i have chosen to patch hostapd.

Patching hostapd

You have to comment out two lines in the ieee802_11.c file. Search for “did not acknowledge” in the file, and comment out the “return;” command after the lines that contain the “did not acknowledge” string. So after commenting out the return lines, the two blocks look like this:

if (!ok) {
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE,
"did not acknowledge authentication response");
//return;
}

if (!ok) {
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
"did not acknowledge association response");
//return;
}

ref:http://eznemegy.blog.hu/2008/12/14/using_rt2x00_wireless_driver_with_hostapd/fullcommentlist/1