diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-02-15 15:02:09 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-03-06 09:21:45 +0100 |
commit | 7f406cd16a0f0965c761ea02bc1f03154b06bbfb (patch) | |
tree | c71ef752c99d8703ce28e3df6a2ba165436dd913 /net/mac80211/sta_info.h | |
parent | 0c1eca4e2f96000077900e0108fff23994c73486 (diff) |
mac80211: encode rate type (legacy, HT, VHT) with fewer bits
We don't really need three different bits for each, since the
types are mutually exclusive. Use just two bits for it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r-- | net/mac80211/sta_info.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index cc413f52108e..8949266d7bc3 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -728,9 +728,10 @@ void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta); unsigned long ieee80211_sta_last_active(struct sta_info *sta); #define STA_STATS_RATE_INVALID 0 -#define STA_STATS_RATE_VHT 0x8000 -#define STA_STATS_RATE_HT 0x4000 -#define STA_STATS_RATE_LEGACY 0x2000 +#define STA_STATS_RATE_TYPE_MASK 0xC000 +#define STA_STATS_RATE_TYPE_LEGACY 0x4000 +#define STA_STATS_RATE_TYPE_HT 0x8000 +#define STA_STATS_RATE_TYPE_VHT 0xC000 #define STA_STATS_RATE_SGI 0x1000 #define STA_STATS_RATE_BW_SHIFT 9 #define STA_STATS_RATE_BW_MASK (0x7 << STA_STATS_RATE_BW_SHIFT) @@ -756,11 +757,11 @@ static inline u16 sta_stats_encode_rate(struct ieee80211_rx_status *s) r |= STA_STATS_RATE_SGI; if (s->flag & RX_FLAG_VHT) - r |= STA_STATS_RATE_VHT | (s->vht_nss << 4); + r |= STA_STATS_RATE_TYPE_VHT | (s->vht_nss << 4); else if (s->flag & RX_FLAG_HT) - r |= STA_STATS_RATE_HT; + r |= STA_STATS_RATE_TYPE_HT; else - r |= STA_STATS_RATE_LEGACY | (s->band << 4); + r |= STA_STATS_RATE_TYPE_LEGACY | (s->band << 4); return r; } |