mac80211: set CLEAR_PS for pspolled frames
authorChristian Lamparter <chunkeey@web.de>
Sat, 18 Apr 2009 17:39:15 +0000 (19:39 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:57:16 +0000 (16:57 -0400)
This patch sets IEEE80211_TX_CTL_CLEAR_PS_FILT for outgoing
frames for a half-wake station.

this is necessary if one wants to get ps-poll working properly with a p54 ap.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/tx.c

index 3fb04a86444d959d980f5e7d3e0ce1a2c779a63a..f336cc731df63c7bc840025abe7c3a71df032b3a 100644 (file)
@@ -409,8 +409,24 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
                       sta->sta.addr);
        }
 #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
-       clear_sta_flags(sta, WLAN_STA_PSPOLL);
+       if (test_and_clear_sta_flags(sta, WLAN_STA_PSPOLL)) {
+               /*
+                * The sleeping station with pending data is now snoozing.
+                * It queried us for its buffered frames and will go back
+                * to deep sleep once it got everything.
+                *
+                * inform the driver, in case the hardware does powersave
+                * frame filtering and keeps a station  blacklist on its own
+                * (e.g: p54), so that frames can be delivered unimpeded.
+                *
+                * Note: It should be save to disable the filter now.
+                * As, it is really unlikely that we still have any pending
+                * frame for this station in the hw's buffers/fifos left,
+                * that is not rejected with a unsuccessful tx_status yet.
+                */
 
+               info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+       }
        return TX_CONTINUE;
 }