1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:24 +0530
3 Subject: [PATCH] ath9k: Use a helper function to set NoA
5 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
8 --- a/drivers/net/wireless/ath/ath9k/channel.c
9 +++ b/drivers/net/wireless/ath/ath9k/channel.c
10 @@ -392,6 +392,39 @@ static void ath_chanctx_offchannel_noa(s
11 avp->noa_duration = 0;
14 +static void ath_chanctx_set_periodic_noa(struct ath_softc *sc,
15 + struct ath_vif *avp,
16 + struct ath_beacon_config *cur_conf,
20 + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
23 + avp->noa_start = tsf_time;
25 + if (sc->sched.extend_absence)
26 + avp->noa_duration = (3 * beacon_int / 2) +
27 + sc->sched.channel_switch_time;
30 + TU_TO_USEC(cur_conf->beacon_interval) / 2 +
31 + sc->sched.channel_switch_time;
33 + if (test_bit(ATH_OP_SCANNING, &common->op_flags) ||
34 + sc->sched.extend_absence)
35 + avp->periodic_noa = false;
37 + avp->periodic_noa = true;
39 + ath_dbg(common, CHAN_CTX,
40 + "noa_duration: %d, noa_start: %d, noa_index: %d, periodic: %d\n",
47 void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
48 enum ath_chanctx_event ev)
50 @@ -521,31 +554,9 @@ void ath_chanctx_event(struct ath_softc
54 - (!avp->noa_duration || sc->sched.force_noa_update)) {
56 - avp->noa_start = tsf_time;
58 - if (sc->sched.extend_absence)
59 - avp->noa_duration = (3 * beacon_int / 2) +
60 - sc->sched.channel_switch_time;
63 - TU_TO_USEC(cur_conf->beacon_interval) / 2 +
64 - sc->sched.channel_switch_time;
66 - if (test_bit(ATH_OP_SCANNING, &common->op_flags) ||
67 - sc->sched.extend_absence)
68 - avp->periodic_noa = false;
70 - avp->periodic_noa = true;
72 - ath_dbg(common, CHAN_CTX,
73 - "noa_duration: %d, noa_start: %d, noa_index: %d, periodic: %d\n",
79 + (!avp->noa_duration || sc->sched.force_noa_update))
80 + ath_chanctx_set_periodic_noa(sc, avp, cur_conf,
81 + tsf_time, beacon_int);
83 if (ctx->active && sc->sched.force_noa_update)
84 sc->sched.force_noa_update = false;