Commit cfdf6b19 authored by Benjamin Li's avatar Benjamin Li Committed by Kalle Valo
Browse files

wcn36xx: fix RX BD rate mapping for 5GHz legacy rates



The linear mapping between the BD rate field and the driver's 5GHz
legacy rates table (wcn_5ghz_rates) does not only apply for the latter
four rates -- it applies to all eight rates.

Fixes: 6ea131ac ("wcn36xx: Fix warning due to bad rate_idx")
Signed-off-by: default avatarBenjamin Li <benl@squareup.com>
Tested-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211104010548.1107405-3-benl@squareup.com
parent c9c5608f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -272,7 +272,6 @@ 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;

	/*
@@ -350,12 +349,11 @@ 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];
		status.nss = 1;

		if (status.band == NL80211_BAND_5GHZ &&
		    status.encoding == RX_ENC_LEGACY &&
		    status.rate_idx >= sband->n_bitrates) {
		    status.rate_idx >= 4) {
			/* no dsss rates in 5Ghz rates table */
			status.rate_idx -= 4;
		}