From: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org,
Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Subject: [PATCH v5 3/8] ath11k: Use freq instead of channel number in rx path
Date: Tue, 2 Jun 2020 17:17:19 -0700 [thread overview]
Message-ID: <20200603001724.12161-4-pradeepc@codeaurora.org> (raw)
In-Reply-To: <20200603001724.12161-1-pradeepc@codeaurora.org>
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 <pradeepc@codeaurora.org>
---
drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +++++-
drivers/net/wireless/ath/ath11k/wmi.c | 5 ++++-
drivers/net/wireless/ath/ath11k/wmi.h | 2 ++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index a54610d75c40..c8f1ea69ea9d 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -2162,6 +2162,7 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc,
struct ieee80211_rx_status *rx_status)
{
u8 channel_num;
+ u32 center_freq;
rx_status->freq = 0;
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,
rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc);
+ center_freq = ath11k_dp_rx_h_msdu_start_freq(rx_desc) >> 16;
- if (channel_num >= 1 && channel_num <= 14) {
+ if (center_freq >= 5935 && center_freq <= 7105)
+ rx_status->band = NL80211_BAND_6GHZ;
+ else if (channel_num >= 1 && channel_num <= 14) {
rx_status->band = NL80211_BAND_2GHZ;
} else if (channel_num >= 36 && channel_num <= 173) {
rx_status->band = NL80211_BAND_5GHZ;
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 291fb274134f..500108fa59d9 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -3833,6 +3833,7 @@ static int ath11k_pull_mgmt_rx_params_tlv(struct ath11k_base *ab,
}
hdr->pdev_id = ev->pdev_id;
+ hdr->chan_freq = ev->chan_freq;
hdr->channel = ev->channel;
hdr->snr = ev->snr;
hdr->rate = ev->rate;
@@ -5204,7 +5205,9 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
if (rx_ev.status & WMI_RX_STATUS_ERR_MIC)
status->flag |= RX_FLAG_MMIC_ERROR;
- if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
+ if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ) {
+ status->band = NL80211_BAND_6GHZ;
+ } else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
status->band = NL80211_BAND_2GHZ;
} else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH11K_MAX_5G_CHAN) {
status->band = NL80211_BAND_5GHZ;
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index b9f3e559ced7..afa3c4cf90e9 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -4228,6 +4228,7 @@ struct wmi_pdev_temperature_event {
#define WLAN_MGMT_TXRX_HOST_MAX_ANTENNA 4
struct mgmt_rx_event_params {
+ u32 chan_freq;
u32 channel;
u32 snr;
u8 rssi_ctl[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA];
@@ -4257,6 +4258,7 @@ struct wmi_mgmt_rx_hdr {
u32 rx_tsf_l32;
u32 rx_tsf_u32;
u32 pdev_id;
+ u32 chan_freq;
} __packed;
#define MAX_ANTENNA_EIGHT 8
--
2.17.1
next prev parent reply other threads:[~2020-06-03 0:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 0:17 [PATCH v5 0/8] add 6GHz radio support in ath11k driver Pradeep Kumar Chitrapu
2020-06-03 0:17 ` [PATCH v5 1/8] ath11k: add 6G frequency list supported by driver Pradeep Kumar Chitrapu
2020-06-08 15:41 ` Kalle Valo
2020-06-11 5:06 ` Kalle Valo
2020-06-03 0:17 ` [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver Pradeep Kumar Chitrapu
2020-09-15 11:16 ` Wen Gong
2020-09-15 12:32 ` Wen Gong
2020-09-15 23:07 ` Pradeep Kumar Chitrapu
2020-09-16 2:33 ` Wen Gong
2020-09-16 3:56 ` Wen Gong
2020-06-03 0:17 ` Pradeep Kumar Chitrapu [this message]
2020-06-03 0:17 ` [PATCH v5 4/8] ath11k: extend peer_assoc_cmd for 6GHz band Pradeep Kumar Chitrapu
2020-06-03 0:17 ` [PATCH v5 5/8] ath11k: set psc channel flag when sending channel list to firmware Pradeep Kumar Chitrapu
2020-06-03 0:17 ` [PATCH v5 6/8] ath11k: Add 6G scan dwell time parameter in scan request command Pradeep Kumar Chitrapu
2020-06-03 0:17 ` [PATCH v5 7/8] ath11k: Send multiple scan_chan_list messages if required Pradeep Kumar Chitrapu
2020-06-09 6:37 ` Kalle Valo
2020-06-03 0:17 ` [PATCH v5 8/8] ath11k: Add support for 6g scan hint Pradeep Kumar Chitrapu
2020-08-24 3:29 ` Wen Gong
2020-09-09 8:38 ` Kalle Valo
2020-06-03 13:12 ` [PATCH v5 0/8] add 6GHz radio support in ath11k driver Kalle Valo
2020-06-03 17:50 ` Pradeep Kumar Chitrapu
2020-06-08 11:04 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200603001724.12161-4-pradeepc@codeaurora.org \
--to=pradeepc@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).