Skip to content

Commit 5dcf42f

Browse files
Pradeep Kumar ChitrapuKalle Valo
authored andcommitted
ath11k: Use freq instead of channel number in rx path
As 6GHz cahnnel numbers overlap with those of 5GHz and 2GHz bands, it is necessary to use frequency when determining the band info in rx path. Signed-off-by: Pradeep Kumar Chitrapu <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 22eeadc commit 5dcf42f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,7 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
21622162
struct ieee80211_rx_status *rx_status)
21632163
{
21642164
u8 channel_num;
2165+
u32 center_freq;
21652166

21662167
rx_status->freq = 0;
21672168
rx_status->rate_idx = 0;
@@ -2172,8 +2173,11 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
21722173
rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
21732174

21742175
channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc);
2176+
center_freq = ath11k_dp_rx_h_msdu_start_freq(rx_desc) >> 16;
21752177

2176-
if (channel_num >= 1 && channel_num <= 14) {
2178+
if (center_freq >= 5935 && center_freq <= 7105) {
2179+
rx_status->band = NL80211_BAND_6GHZ;
2180+
} else if (channel_num >= 1 && channel_num <= 14) {
21772181
rx_status->band = NL80211_BAND_2GHZ;
21782182
} else if (channel_num >= 36 && channel_num <= 173) {
21792183
rx_status->band = NL80211_BAND_5GHZ;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3833,6 +3833,7 @@ static int ath11k_pull_mgmt_rx_params_tlv(struct ath11k_base *ab,
38333833
}
38343834

38353835
hdr->pdev_id = ev->pdev_id;
3836+
hdr->chan_freq = ev->chan_freq;
38363837
hdr->channel = ev->channel;
38373838
hdr->snr = ev->snr;
38383839
hdr->rate = ev->rate;
@@ -5204,7 +5205,9 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
52045205
if (rx_ev.status & WMI_RX_STATUS_ERR_MIC)
52055206
status->flag |= RX_FLAG_MMIC_ERROR;
52065207

5207-
if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
5208+
if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ) {
5209+
status->band = NL80211_BAND_6GHZ;
5210+
} else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
52085211
status->band = NL80211_BAND_2GHZ;
52095212
} else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH11K_MAX_5G_CHAN) {
52105213
status->band = NL80211_BAND_5GHZ;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,6 +4228,7 @@ struct wmi_pdev_temperature_event {
42284228
#define WLAN_MGMT_TXRX_HOST_MAX_ANTENNA 4
42294229

42304230
struct mgmt_rx_event_params {
4231+
u32 chan_freq;
42314232
u32 channel;
42324233
u32 snr;
42334234
u8 rssi_ctl[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA];
@@ -4257,6 +4258,7 @@ struct wmi_mgmt_rx_hdr {
42574258
u32 rx_tsf_l32;
42584259
u32 rx_tsf_u32;
42594260
u32 pdev_id;
4261+
u32 chan_freq;
42604262
} __packed;
42614263

42624264
#define MAX_ANTENNA_EIGHT 8

0 commit comments

Comments
 (0)