developer | 77ffbda | 2022-12-16 04:36:08 +0800 | [diff] [blame] | 1 | From a0d208456ae062aa982e29df3f77ae5f5f63d37f Mon Sep 17 00:00:00 2001 |
developer | 031d907 | 2022-04-18 14:06:54 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <MeiChia.Chiu@mediatek.com> |
| 3 | Date: Mon, 7 Mar 2022 15:18:00 +0800 |
developer | 77ffbda | 2022-12-16 04:36:08 +0800 | [diff] [blame] | 4 | Subject: [PATCH 903/915] mac80211: mtk: correct legacy rates check in |
developer | 031d907 | 2022-04-18 14:06:54 +0800 | [diff] [blame] | 5 | ieee80211_calc_rx_airtime |
| 6 | |
| 7 | There are no legacy rates on 60GHz or sub-1Ghz band, so modify the check. |
| 8 | |
| 9 | Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> |
| 10 | Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com> |
| 11 | --- |
| 12 | net/mac80211/airtime.c | 4 +++- |
| 13 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 16 | index 26d2f8b..c0e58eb 100644 |
developer | 031d907 | 2022-04-18 14:06:54 +0800 | [diff] [blame] | 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 | -- |
developer | a09ec1d | 2022-11-26 11:00:33 +0800 | [diff] [blame] | 31 | 2.36.1 |
developer | 031d907 | 2022-04-18 14:06:54 +0800 | [diff] [blame] | 32 | |