From c4351826bef5347cc80cc7206b8a42fbbbb26601 Mon Sep 17 00:00:00 2001 From: MeiChia Chiu Date: Tue, 8 Mar 2022 10:16:45 +0800 Subject: [PATCH] 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 Signed-off-by: MeiChia Chiu Link: https://lore.kernel.org/r/20220308021645.16272-1-MeiChia.Chiu@mediatek.com [Ghz -> GHz] Signed-off-by: Johannes Berg [cherry picked from commit 022143d0c52b6e63d49ffc3542dc9d3ae15a5178] Signed-off-by: Jaehoon Chung Change-Id: I83bba0992b6f1d54bd3565cd8a1c819d15c2f60d --- net/mac80211/airtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c index 758ef63..8555a0e 100644 --- a/net/mac80211/airtime.c +++ b/net/mac80211/airtime.c @@ -480,7 +480,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]; -- 2.7.4