ath9k: Clear NoA schedule properly
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Fri, 17 Oct 2014 02:10:14 +0000 (07:40 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Oct 2014 18:16:15 +0000 (14:16 -0400)
When an active context transitions to inactive
state, the NoA schedule needs to be removed
for the context that has beaconing enabled.
Not doing this will affect p2p clients.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/channel.c

index 709facca8acde450cdfd090948508e0c3b174bbd..74a5c27ba63f8042f3924647507ad1f2953f4fd2 100644 (file)
@@ -356,6 +356,21 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
                                "Move chanctx state from WAIT_FOR_TIMER to WAIT_FOR_BEACON\n");
                }
 
+               /*
+                * When a context becomes inactive, for example,
+                * disassociation of a station context, the NoA
+                * attribute needs to be removed from subsequent
+                * beacons.
+                */
+               if (!ctx->active && avp->noa_duration &&
+                   sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON) {
+                       avp->noa_duration = 0;
+                       avp->periodic_noa = false;
+
+                       ath_dbg(common, CHAN_CTX,
+                               "Clearing NoA schedule\n");
+               }
+
                if (sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON)
                        break;