From: Sujith Manoharan <[email protected]>

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 <[email protected]>
---
 drivers/net/wireless/ath/ath9k/channel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/channel.c 
b/drivers/net/wireless/ath/ath9k/channel.c
index ab3d29d..09ff8a6 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -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;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to