Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

MeiChia Chiu and committed by
Johannes Berg
022143d0 2916b7a9

+3 -1
+3 -1
net/mac80211/airtime.c
··· 472 472 bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE; 473 473 bool cck; 474 474 475 - if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ)) 475 + /* on 60GHz or sub-1GHz band, there are no legacy rates */ 476 + if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ || 477 + status->band == NL80211_BAND_S1GHZ)) 476 478 return 0; 477 479 478 480 sband = hw->wiphy->bands[status->band];