developer | 031d907 | 2022-04-18 14:06:54 +0800 | [diff] [blame] | 1 | From 3f85b72dca38f56b112505b79e7f8fc4841b3f3d Mon Sep 17 00:00:00 2001 |
| 2 | From: MeiChia Chiu <MeiChia.Chiu@mediatek.com> |
| 3 | Date: Mon, 7 Mar 2022 15:18:00 +0800 |
| 4 | Subject: [PATCH] mac80211: correct legacy rates check in |
| 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 |
| 16 | index 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 | -- |
| 31 | 2.18.0 |
| 32 | |