mac80211: correct legacy rates check in ieee80211_calc_rx_airtime 41/298741/1 accepted/tizen_8.0_unified accepted/tizen/8.0/unified/20231005.094531 accepted/tizen/unified/20230918.154730 tizen_8.0_m2_release
authorMeiChia Chiu <MeiChia.Chiu@mediatek.com>
Tue, 8 Mar 2022 02:16:45 +0000 (10:16 +0800)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 13 Sep 2023 05:45:10 +0000 (14:45 +0900)
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>
[cherry picked from commit 022143d0c52b6e63d49ffc3542dc9d3ae15a5178]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I83bba0992b6f1d54bd3565cd8a1c819d15c2f60d

net/mac80211/airtime.c

index 758ef63..8555a0e 100644 (file)
@@ -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];