Skip to content

Commit f3ccc87

Browse files
Pradeep Kumar Chitrapugregkh
authored andcommitted
ath11k: fix packet drops due to incorrect 6 GHz freq value in rx status
[ Upstream commit 9d6ae1f ] Frequency in rx status is being filled incorrectly in the 6 GHz band as channel number received is invalid in this case which is causing packet drops. So fix that. Fixes: 5dcf42f ("ath11k: Use freq instead of channel number in rx path") Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210722102054.43419-2-jouni@codeaurora.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3b087c2 commit f3ccc87

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

drivers/net/wireless/ath/ath11k/dp_rx.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,8 +2337,10 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
23372337
channel_num = meta_data;
23382338
center_freq = meta_data >> 16;
23392339

2340-
if (center_freq >= 5935 && center_freq <= 7105) {
2340+
if (center_freq >= ATH11K_MIN_6G_FREQ &&
2341+
center_freq <= ATH11K_MAX_6G_FREQ) {
23412342
rx_status->band = NL80211_BAND_6GHZ;
2343+
rx_status->freq = center_freq;
23422344
} else if (channel_num >= 1 && channel_num <= 14) {
23432345
rx_status->band = NL80211_BAND_2GHZ;
23442346
} else if (channel_num >= 36 && channel_num <= 173) {
@@ -2356,8 +2358,9 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
23562358
rx_desc, sizeof(struct hal_rx_desc));
23572359
}
23582360

2359-
rx_status->freq = ieee80211_channel_to_frequency(channel_num,
2360-
rx_status->band);
2361+
if (rx_status->band != NL80211_BAND_6GHZ)
2362+
rx_status->freq = ieee80211_channel_to_frequency(channel_num,
2363+
rx_status->band);
23612364

23622365
ath11k_dp_rx_h_rate(ar, rx_desc, rx_status);
23632366
}

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6127,8 +6127,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
61276127
if (rx_ev.status & WMI_RX_STATUS_ERR_MIC)
61286128
status->flag |= RX_FLAG_MMIC_ERROR;
61296129

6130-
if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ) {
6130+
if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ &&
6131+
rx_ev.chan_freq <= ATH11K_MAX_6G_FREQ) {
61316132
status->band = NL80211_BAND_6GHZ;
6133+
status->freq = rx_ev.chan_freq;
61326134
} else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
61336135
status->band = NL80211_BAND_2GHZ;
61346136
} else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH11K_MAX_5G_CHAN) {
@@ -6149,8 +6151,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
61496151

61506152
sband = &ar->mac.sbands[status->band];
61516153

6152-
status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
6153-
status->band);
6154+
if (status->band != NL80211_BAND_6GHZ)
6155+
status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
6156+
status->band);
6157+
61546158
status->signal = rx_ev.snr + ATH11K_DEFAULT_NOISE_FLOOR;
61556159
status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100);
61566160

0 commit comments

Comments
 (0)