summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorMeiChia Chiu <MeiChia.Chiu@mediatek.com>2022-03-08 05:16:45 +0300
committerJohannes Berg <johannes.berg@intel.com>2022-03-11 13:45:36 +0300
commit022143d0c52b6e63d49ffc3542dc9d3ae15a5178 (patch)
treecbb08ff147dcf71ba3cdf914040491bf397105de /net/mac80211
parent2916b7a9c7c25ecf9be2f37e567a277e861f8e3f (diff)
downloadlinux-022143d0c52b6e63d49ffc3542dc9d3ae15a5178.tar.xz
mac80211: correct legacy rates check in ieee80211_calc_rx_airtime
There are no legacy rates on 60GHz or sub-1GHz band, so modify the check. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com> Link: https://lore.kernel.org/r/20220308021645.16272-1-MeiChia.Chiu@mediatek.com [Ghz -> GHz] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/airtime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c
index 64e8ce9760b9..2619e12c8bda 100644
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -472,7 +472,9 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
bool cck;
- if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
+ /* on 60GHz or sub-1GHz band, there are no legacy rates */
+ if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ ||
+ status->band == NL80211_BAND_S1GHZ))
return 0;
sband = hw->wiphy->bands[status->band];