]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: insert stations before adding to driver
authorJohannes Berg <johannes.berg@intel.com>
Mon, 17 Feb 2014 19:49:03 +0000 (20:49 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 20 Feb 2014 09:34:33 +0000 (10:34 +0100)
commit1f378829a54c917072bc94cb89ed21a75eee3011
tree9930ecfd70e14e82144a229c6be80ff51a116e7f
parent4d91dd4c23b683f2397b215d7af9792a08f32a07
mac80211: insert stations before adding to driver

There's a race condition in mac80211 because we add stations
to the internal lists after adding them to the driver, which
means that (for example) the following can happen:
 1. a station connects and is added
 2. first, it is added to the driver
 3. then, it is added to the mac80211 lists

If the station goes to sleep between steps 2 and 3, and the
firmware/hardware records it as being asleep, mac80211 will
never instruct the driver to wake it up again as it never
realized it went to sleep since the RX path discarded the
frame as a "spurious class 3 frame", no station entry was
present yet.

Fix this by adding the station in software first, and only
then adding it to the driver. That way, any state that the
driver changes will be reflected properly in mac80211's
station state. The problematic part is the roll-back if the
driver fails to add the station, in that case a bit more is
needed. To not make that overly complex prevent starting BA
sessions in the meantime.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c