cc5cdf9233c20f83f8fc4be383423c7a8ca02f11
[openwrt/staging/jogo.git] / package / kernel / mac80211 / patches / ath / 555-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch
1 From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
2 Date: Fri, 2 Nov 2018 21:49:57 +0100
3 Subject: [PATCH] ath9k: dynack: check da->enabled first in sampling
4 routines
5
6 Check da->enabled flag first in ath_dynack_sample_tx_ts and
7 ath_dynack_sample_ack_ts routines in order to avoid useless
8 processing
9
10 Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
11 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
12 ---
13
14 --- a/drivers/net/wireless/ath/ath9k/dynack.c
15 +++ b/drivers/net/wireless/ath/ath9k/dynack.c
16 @@ -178,7 +178,7 @@ void ath_dynack_sample_tx_ts(struct ath_
17 u32 dur = ts->duration;
18 u8 ridx;
19
20 - if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled)
21 + if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK))
22 return;
23
24 spin_lock_bh(&da->qlock);
25 @@ -251,7 +251,7 @@ void ath_dynack_sample_ack_ts(struct ath
26 struct ath_common *common = ath9k_hw_common(ah);
27 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
28
29 - if (!ath_dynack_bssidmask(ah, hdr->addr1) || !da->enabled)
30 + if (!da->enabled || !ath_dynack_bssidmask(ah, hdr->addr1))
31 return;
32
33 spin_lock_bh(&da->qlock);