ath9k: Clear offchannel duration properly
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 10 Sep 2014 13:45:58 +0000 (19:15 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 11 Sep 2014 19:27:39 +0000 (15:27 -0400)
Clearing the offchannel duration value in the
scheduler unconditionally breaks NoA when
multiple contexts are active and an offchannel
request is deferred, for example, in a scan run.

Fix this by clearing the duration only if there
is no pending offchannel request.

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 ab3d29d2ee9f1a4a4661282849d964293b3d29c9..09ff8a6e89666e2789a41ce2f10392bedb4c64ea 100644 (file)
@@ -1065,7 +1065,10 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
        sc->cur_chan = sc->next_chan;
        sc->cur_chan->stopped = false;
        sc->next_chan = NULL;
-       sc->sched.offchannel_duration = 0;
+
+       if (!sc->sched.offchannel_pending)
+               sc->sched.offchannel_duration = 0;
+
        if (sc->sched.state != ATH_CHANCTX_STATE_FORCE_ACTIVE)
                sc->sched.state = ATH_CHANCTX_STATE_IDLE;