blob: f5fbc82f163bfb2605e2d67e8a28d3dd33193ca0 [file] [log] [blame]
developer031d9072022-04-18 14:06:54 +08001From 3f85b72dca38f56b112505b79e7f8fc4841b3f3d Mon Sep 17 00:00:00 2001
2From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
3Date: Mon, 7 Mar 2022 15:18:00 +0800
4Subject: [PATCH] mac80211: correct legacy rates check in
5 ieee80211_calc_rx_airtime
6
7There are no legacy rates on 60GHz or sub-1Ghz band, so modify the check.
8
9Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
10Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
11---
12 net/mac80211/airtime.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c
16index 26d2f8ba7029..c0e58eb7c7fb 100644
17--- a/net/mac80211/airtime.c
18+++ b/net/mac80211/airtime.c
19@@ -477,7 +477,9 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
20 bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
21 bool cck;
22
23- if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
24+ /* on 60GHz or sub-1Ghz band, there are no legacy rates */
25+ if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ ||
26+ status->band == NL80211_BAND_S1GHZ))
27 return 0;
28
29 sband = hw->wiphy->bands[status->band];
30--
312.18.0
32