Skip to content

Commit 9d6ae1f

Browse files
Pradeep Kumar ChitrapuKalle Valo
authored andcommitted
ath11k: fix packet drops due to incorrect 6 GHz freq value in rx status
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 <[email protected]> Signed-off-by: Jouni Malinen <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4a9550f commit 9d6ae1f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

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

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

2396-
if (center_freq >= 5935 && center_freq <= 7105) {
2396+
if (center_freq >= ATH11K_MIN_6G_FREQ &&
2397+
center_freq <= ATH11K_MAX_6G_FREQ) {
23972398
rx_status->band = NL80211_BAND_6GHZ;
2399+
rx_status->freq = center_freq;
23982400
} else if (channel_num >= 1 && channel_num <= 14) {
23992401
rx_status->band = NL80211_BAND_2GHZ;
24002402
} else if (channel_num >= 36 && channel_num <= 173) {
@@ -2412,8 +2414,9 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
24122414
rx_desc, sizeof(struct hal_rx_desc));
24132415
}
24142416

2415-
rx_status->freq = ieee80211_channel_to_frequency(channel_num,
2416-
rx_status->band);
2417+
if (rx_status->band != NL80211_BAND_6GHZ)
2418+
rx_status->freq = ieee80211_channel_to_frequency(channel_num,
2419+
rx_status->band);
24172420

24182421
ath11k_dp_rx_h_rate(ar, rx_desc, rx_status);
24192422
}

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

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

6187-
if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ) {
6187+
if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ &&
6188+
rx_ev.chan_freq <= ATH11K_MAX_6G_FREQ) {
61886189
status->band = NL80211_BAND_6GHZ;
6190+
status->freq = rx_ev.chan_freq;
61896191
} else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
61906192
status->band = NL80211_BAND_2GHZ;
61916193
} else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH11K_MAX_5G_CHAN) {
@@ -6206,8 +6208,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
62066208

62076209
sband = &ar->mac.sbands[status->band];
62086210

6209-
status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
6210-
status->band);
6211+
if (status->band != NL80211_BAND_6GHZ)
6212+
status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
6213+
status->band);
6214+
62116215
status->signal = rx_ev.snr + ATH11K_DEFAULT_NOISE_FLOOR;
62126216
status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100);
62136217

0 commit comments

Comments
 (0)