RID len mismatch/timeouts

Jouni Malinen jkmaline
Sat Apr 26 19:51:38 PDT 2003

On Sun, Feb 16, 2003 at 04:39:53PM -0500, Gerald Britton wrote:

> This seems to be a common problem with the driver over the past few months.
> I'll run through the Red Hat ifup scripts which issue a rapid sequence of
> iwconfig commands to set operating mode, essid, wep keys, etc. and then
> fire of dhclient to get an ip address.  I've seen this problem mostly with
> my minipci card (1.4.9), but I also occasionally see it with my pcmcia
> card(1.3.5):

> wlan0: hfa384x_get_rid - RID len mismatch: rid=0xfd42, len=40 (expected 6)
> wlan0: could not read CURRENTBSSID after LinkStatus event

> wlan0: hfa384x_setup_bap - timeout after

I (finally) started testing this more thoroughly. I was able to generate
an easy to repeat test case with Prism2.5 PCI cards and with the help of
PRISM2_IO_DEBUG, it was easy to find out what went wrong.

Get and set RID operations had a mutex only for the duration of BAP
access, i.e., Access Read/Write commands were not protected with the
same mutex and another get/set operation could end up using same BAP
buffer between another BAP read/write and Access command. In case of get
RID being interrupted this way by set RID, the original get RID ended up
reading the data that was being set into another RID; not the data that
was read from the real RID.

I added a mutex semaphore for get/set RID operations to make sure that
there will be no concurrent accesses. This seemed to fix all the RID len
mismatch errors I was previously seeing in the test. This removed some
setup_bap timeouts, too. Anyway, I increased BAP busy timeout to get rid
of these.

It would be nice to know whether this fix is enough to get rid of all
these issues or is there still something else causing similar problems.
I would appreciate if people who have seen these problems would test the
latest CVS snapshot and report whether it fixes the problems.

I did not see any command completion problems during my tests
("hfa384x_cmd: entry still in list?", "hfa384x_cmd: command was not
completed"). This might be related to the race condition with get/set
RID operations (and thus possible fixed now) or it might be completely
different problem.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list