1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 14 Dec 2016 20:06:08 +0100
3 Subject: [PATCH] mac80211: minstrel_ht: move short preamble check out of
6 Test short preamble support in minstrel_ht_update_caps instead of
7 looking at the per-packet flag. Makes the code more efficient.
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 --- a/net/mac80211/rc80211_minstrel_ht.c
13 +++ b/net/mac80211/rc80211_minstrel_ht.c
15 #include <linux/ieee80211.h>
16 #include <net/mac80211.h>
18 +#include "sta_info.h"
19 #include "rc80211_minstrel.h"
20 #include "rc80211_minstrel_ht.h"
22 @@ -1049,22 +1050,6 @@ minstrel_get_sample_rate(struct minstrel
26 -minstrel_ht_check_cck_shortpreamble(struct minstrel_priv *mp,
27 - struct minstrel_ht_sta *mi, bool val)
29 - u8 supported = mi->supported[MINSTREL_CCK_GROUP];
31 - if (!supported || !mi->cck_supported_short)
34 - if (supported & (mi->cck_supported_short << (val * 4)))
37 - supported ^= mi->cck_supported_short | (mi->cck_supported_short << 4);
38 - mi->supported[MINSTREL_CCK_GROUP] = supported;
42 minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
43 struct ieee80211_tx_rate_control *txrc)
45 @@ -1087,7 +1072,6 @@ minstrel_ht_get_rate(void *priv, struct
46 minstrel_aggr_check(sta, txrc->skb);
48 info->flags |= mi->tx_flags;
49 - minstrel_ht_check_cck_shortpreamble(mp, mi, txrc->short_preamble);
51 #ifdef CPTCFG_MAC80211_DEBUGFS
52 if (mp->fixed_rate_idx != -1)
53 @@ -1168,6 +1152,7 @@ minstrel_ht_update_caps(void *priv, stru
54 struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
55 u16 ht_cap = sta->ht_cap.cap;
56 struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
57 + struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
61 @@ -1302,6 +1287,9 @@ minstrel_ht_update_caps(void *priv, stru
65 + if (test_sta_flag(sinfo, WLAN_STA_SHORT_PREAMBLE))
66 + mi->cck_supported_short |= mi->cck_supported_short << 4;
68 /* create an initial rate table with the lowest supported rates */
69 minstrel_ht_update_stats(mp, mi);
70 minstrel_ht_update_rates(mp, mi);