aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2020-07-24 18:01:54 +0200
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2020-07-30 16:24:01 +0100
commitc891aa456ccb1c9d0ce50e841d82a3013fae72f8 (patch)
treefd3bb88b60c1b58720413d2515ec903d8896bfe5
parentc7fc5d285db57b5afe35faad194cc7c5d7e2e782 (diff)
wcn36xx: Fix warning due to bad rate_idxwcn3680-additions
The rate_idx is the index of the bitrate in the supported rate table. However the 5Ghz band has a smaller legacy bitrate table than 2.4Ghz since it does not have the DSSS bitrates (1, 2, 5.5, 11). So in 5Ghz band the index should adjusted accrodingly (-4). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> [bod: Made sure fix is only applied if the rate_idx > n_bitrates] Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r--drivers/net/wireless/ath/wcn36xx/txrx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c
index 564130d6b8cb..e20dbe0271f8 100644
--- a/drivers/net/wireless/ath/wcn36xx/txrx.c
+++ b/drivers/net/wireless/ath/wcn36xx/txrx.c
@@ -123,6 +123,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
const struct wcn36xx_rate *rate;
struct ieee80211_hdr *hdr;
struct wcn36xx_rx_bd *bd;
+ struct ieee80211_supported_band *sband;
u16 fc, sn;
/*
@@ -163,6 +164,14 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
status.enc_flags = rate->encoding_flags;
status.bw = rate->bw;
status.rate_idx = rate->mcs_or_legacy_index;
+ sband = wcn->hw->wiphy->bands[status.band];
+
+ if (status.band == NL80211_BAND_5GHZ &&
+ status.encoding == RX_ENC_LEGACY &&
+ status.rate_idx >= sband->n_bitrates) {
+ /* no dsss rates in 5Ghz rates table */
+ status.rate_idx -= 4;
+ }
} else {
status.encoding = 0;
status.bw = 0;