ath9k patches
cover ath9k patches
From: Sujith Manoharan <[email protected]>
MCC fixes. Please review.
Sujith Manoharan (5):
ath9k: Assign offchannel duration properly
ath9k: Fix Notice of Absence issues
ath9k: Clear offchannel duration properly
ath9k: Fix channel switch time duration
ath9k: Fix beacon miss handling
drivers/net/wireless/ath/ath9k/ath9k.h | 8 +- drivers/net/wireless/ath/ath9k/channel.c | 143 ++++++++++++++++++++++--------- 2 files changed, 109 insertions(+), 42 deletions(-)
Signature · 1 line
2.1.0
RFC 1/5 ath9k: Assign offchannel duration properly
From: Sujith Manoharan <[email protected]>
In multi-channel mode, an offchannel request will be deferred if both contexts are active. The duration of the offchannel operation is calculated but is not stored in the scheduler state. Fix this.
--- drivers/net/wireless/ath/ath9k/channel.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/channel.c +7 -2
@@ -588,10 +588,15 @@ static void ath_chanctx_switch(struct ath_softc *sc, struct ath_chanctx *ctx,if (test_bit (ATH_OP_MULTI_CHANNEL , &common->op_flags) && (sc->cur_chan != ctx) && (ctx == &sc->offchannel.chan)) { - sc->sched.offchannel_pending = true; - sc->sched.wait_switch = true;if (chandef) ctx->chandef = *chandef; + + sc->sched.offchannel_pending = true; + sc->sched.wait_switch = true; + sc->sched.offchannel_duration = +jiffies_to_usecs (sc->offchannel.duration) + + sc->sched.channel_switch_time; +spin_unlock_bh (&sc->chan_lock);ath_dbg (common,CHAN_CTX ,"Set offchannel_pending to true\n" );
Signature · 1 line
2.1.0
RFC 2/5 ath9k: Fix Notice of Absence issues
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
* The index has to incremented only when advertising a new NoA schedule.
* Switch to non-periodic NoA when starting a scan operation and multiple channel contexts are active.
* Make sure that periodic NoA is advertised again when scan ends. Since the offchannel timer moves the offchannel state to IDLE after the GO operating channel becomes active, use a flag "force_noa_update" to update the NoA contents.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 7 ++- drivers/net/wireless/ath/ath9k/channel.c | 105 ++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 37 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +5 -2
@@ -379,6 +379,7 @@ struct ath_chanctx_sched {bool beacon_pending;bool offchannel_pending;bool wait_switch; +bool force_noa_update;enum ath_chanctx_state state;u8 beacon_miss;
@@ -595,8 +596,10 @@ struct ath_vif {u32 offchannel_start;u32 offchannel_duration; -u32 periodic_noa_start; -u32 periodic_noa_duration; +/* These are used for both periodic and one-shot */ +u32 noa_start; +u32 noa_duration; +bool periodic_noa; };struct ath9k_vif_iter_data {
drivers/net/wireless/ath/ath9k/channel.c +70 -35
149 lines not on this page · raw message
Signature · 1 line
2.1.0
RFC 3/5 ath9k: Clear offchannel duration properly
In reply to Sujith ManoharanFrom: 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.
--- drivers/net/wireless/ath/ath9k/channel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/channel.c +4 -1
@@ -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 ;
Signature · 1 line
2.1.0
RFC 4/5 ath9k: Fix channel switch time duration
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Since the NoA duration is the maximum time the GO interface can be offline, it needs to include the time take to switch channels in the HW.
--- drivers/net/wireless/ath/ath9k/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/channel.c +1 -1
@@ -419,7 +419,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif, avp->noa_index++; avp->noa_start = tsf_time; avp->noa_duration = -TU_TO_USEC (cur_conf->beacon_interval) /2 - +TU_TO_USEC (cur_conf->beacon_interval) /2 + sc->sched.channel_switch_time;if (test_bit (ATH_OP_SCANNING , &common->op_flags))
Signature · 1 line
2.1.0
RFC 5/5 ath9k: Fix beacon miss handling
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The NoA duration for a GO is half the beacon interval and a concurrent context like a STA can be active only for that duration, before switching back to the GO's operating channel.
Currently, when multiple beacons are missed, the dwell time for the STA context is extended to improve the chances of receiving a beacon. But the NoA is not updated and this will cause problems since the GO is offline for a period that is longer than the advertised duration.
Fix this by ensuring that the NoA is updated first before extending the time slot for the STA context. Also make sure that non-periodic NoA is used for a one-time, longer absence period.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/channel.c | 44 +++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
@@ -380,6 +380,7 @@ struct ath_chanctx_sched {bool offchannel_pending;bool wait_switch;bool force_noa_update; +bool extend_absence;enum ath_chanctx_state state;u8 beacon_miss;
drivers/net/wireless/ath/ath9k/channel.c +32 -12
69 lines not on this page · raw message
Signature · 1 line
2.1.0