1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:25 +0530
3 Subject: [PATCH] ath9k: Use a helper function for bmiss
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 @@ -366,6 +366,31 @@ static void ath_chanctx_setup_timer(stru
11 "Setup chanctx timer with timeout: %d ms\n", jiffies_to_msecs(tsf_time));
14 +static void ath_chanctx_handle_bmiss(struct ath_softc *sc,
15 + struct ath_chanctx *ctx,
16 + struct ath_vif *avp)
19 + * Clear the extend_absence flag if it had been
20 + * set during the previous beacon transmission,
21 + * since we need to revert to the normal NoA
24 + if (ctx->active && sc->sched.extend_absence) {
25 + avp->noa_duration = 0;
26 + sc->sched.extend_absence = false;
29 + /* If at least two consecutive beacons were missed on the STA
30 + * chanctx, stay on the STA channel for one extra beacon period,
31 + * to resync the timer properly.
33 + if (ctx->active && sc->sched.beacon_miss >= 2) {
34 + avp->noa_duration = 0;
35 + sc->sched.extend_absence = true;
39 static void ath_chanctx_offchannel_noa(struct ath_softc *sc,
40 struct ath_chanctx *ctx,
42 @@ -524,25 +549,7 @@ void ath_chanctx_event(struct ath_softc
47 - * Clear the extend_absence flag if it had been
48 - * set during the previous beacon transmission,
49 - * since we need to revert to the normal NoA
52 - if (ctx->active && sc->sched.extend_absence) {
53 - avp->noa_duration = 0;
54 - sc->sched.extend_absence = false;
57 - /* If at least two consecutive beacons were missed on the STA
58 - * chanctx, stay on the STA channel for one extra beacon period,
59 - * to resync the timer properly.
61 - if (ctx->active && sc->sched.beacon_miss >= 2) {
62 - avp->noa_duration = 0;
63 - sc->sched.extend_absence = true;
65 + ath_chanctx_handle_bmiss(sc, ctx, avp);
67 /* Prevent wrap-around issues */
68 if (avp->noa_duration && tsf_time - avp->noa_start > BIT(30))