add 6GHz radio support in ath11k driver
v5 cover add 6GHz radio support in ath11k driver
This patch series adds 6GHz frequency listing in ath11k driver and mac80211 registration for the 6GHz band. Also, extends some of wmi command tlvs for supporting 6GHz.
changes in v5:
- latest 6ghz patches on mac80211 expects driver not to pass ht/vht caps for 6GHZ band at device registration. so fix that.
changes in v4:
- drop helper function to identify psc channel as different version is already merged.
changes in v3:
- cfg80211: remove PSC channel flag and instead add helper function.
- Address differences in 6GHZ frequencies between IEEE P802.11ax/D6.0 and IEEE P802.11ax/D6.1
changes in v2:
- Fixed ath11k_phymode to be set in 6GHZ band
Pradeep Kumar Chitrapu (8):
ath11k: add 6G frequency list supported by driver
ath11k: add support for 6GHz radio in driver
ath11k: Use freq instead of channel number in rx path
ath11k: extend peer_assoc_cmd for 6GHz band
ath11k: set psc channel flag when sending channel list to firmware.
ath11k: Add 6G scan dwell time parameter in scan request command
ath11k: Send multiple scan_chan_list messages if required
ath11k: Add support for 6g scan hint
drivers/net/wireless/ath/ath11k/core.h | 6 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 164 +++++++++++++-- drivers/net/wireless/ath/ath11k/reg.c | 4 + drivers/net/wireless/ath/ath11k/wmi.c | 269 +++++++++++++++++------- drivers/net/wireless/ath/ath11k/wmi.h | 40 +++- 6 files changed, 390 insertions(+), 99 deletions(-)
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v5 1/8 ath11k: add 6G frequency list supported by driver
This patch adds support for 6GHz frequency listing.
---
v5:
- no change
v4:
- no change
v3:
- update channel starting frequency from 5945 to 5950 as per IEEE P802.11ax/D6.1
drivers/net/wireless/ath/ath11k/mac.c | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +71 -0
@@ -33,6 +33,15 @@ .max_power = 30, \ } +#define CHAN6G (_channel, _freq, _flags) { \ + .band = NL80211_BAND_6GHZ, \ + .hw_value = (_channel), \ + .center_freq = (_freq), \ + .flags = (_flags), \ + .max_antenna_gain = 0, \ + .max_power = 30, \ +} +/* frame mode values are mapped as per enum ath11k_hw_txrx_mode */ static unsigned int ath11k_frame_mode =ATH11K_HW_TXRX_NATIVE_WIFI ;module_param_named (frame_mode, ath11k_frame_mode, uint,0644 );
@@ -86,6 +95,68 @@ static const struct ieee80211_channel ath11k_5ghz_channels[] = { CHAN5G(173, 5865, 0), }; +static const struct ieee80211_channel ath11k_6ghz_channels[] = { +CHAN6G (1 ,5955 ,0 ), +CHAN6G (5 ,5975 ,0 ), +CHAN6G (9 ,5995 ,0 ), +CHAN6G (13 ,6015 ,0 ), +CHAN6G (17 ,6035 ,0 ), +CHAN6G (21 ,6055 ,0 ), +CHAN6G (25 ,6075 ,0 ), +CHAN6G (29 ,6095 ,0 ), +CHAN6G (33 ,6115 ,0 ), +CHAN6G (37 ,6135 ,0 ), +CHAN6G (41 ,6155 ,0 ), +CHAN6G (45 ,6175 ,0 ), +CHAN6G (49 ,6195 ,0 ), +CHAN6G (53 ,6215 ,0 ), +CHAN6G (57 ,6235 ,0 ), +CHAN6G (61 ,6255 ,0 ), +CHAN6G (65 ,6275 ,0 ), +CHAN6G (69 ,6295 ,0 ), +CHAN6G (73 ,6315 ,0 ), +CHAN6G (77 ,6335 ,0 ), +CHAN6G (81 ,6355 ,0 ), +CHAN6G (85 ,6375 ,0 ), +CHAN6G (89 ,6395 ,0 ), +CHAN6G (93 ,6415 ,0 ), +CHAN6G (97 ,6435 ,0 ), +CHAN6G (101 ,6455 ,0 ), +CHAN6G (105 ,6475 ,0 ), +CHAN6G (109 ,6495 ,0 ), +CHAN6G (113 ,6515 ,0 ), +CHAN6G (117 ,6535 ,0 ), +CHAN6G (121 ,6555 ,0 ), +CHAN6G (125 ,6575 ,0 ), +CHAN6G (129 ,6595 ,0 ), +CHAN6G (133 ,6615 ,0 ), +CHAN6G (137 ,6635 ,0 ), +CHAN6G (141 ,6655 ,0 ), +CHAN6G (145 ,6675 ,0 ), +CHAN6G (149 ,6695 ,0 ), +CHAN6G (153 ,6715 ,0 ), +CHAN6G (157 ,6735 ,0 ), +CHAN6G (161 ,6755 ,0 ), +CHAN6G (165 ,6775 ,0 ), +CHAN6G (169 ,6795 ,0 ), +CHAN6G (173 ,6815 ,0 ), +CHAN6G (177 ,6835 ,0 ), +CHAN6G (181 ,6855 ,0 ), +CHAN6G (185 ,6875 ,0 ), +CHAN6G (189 ,6895 ,0 ), +CHAN6G (193 ,6915 ,0 ), +CHAN6G (197 ,6935 ,0 ), +CHAN6G (201 ,6955 ,0 ), +CHAN6G (205 ,6975 ,0 ), +CHAN6G (209 ,6995 ,0 ), +CHAN6G (213 ,7015 ,0 ), +CHAN6G (217 ,7035 ,0 ), +CHAN6G (221 ,7055 ,0 ), +CHAN6G (225 ,7075 ,0 ), +CHAN6G (229 ,7095 ,0 ), +CHAN6G (233 ,7115 ,0 ), +}; +static struct ieee80211_rate ath11k_legacy_rates[] = { { .bitrate =10 , .hw_value =ATH11K_HW_RATE_CCK_LP_1M },
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 1/8] ath11k: add 6G frequency list supported by driver
Quoted 4 lines · Pradeep Kumar Chitrapu
This patch adds support for 6GHz frequency listing.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This patchset had new warnings which I fixed in the pending branch:
drivers/net/wireless/ath/ath11k/dp_rx.c:2178: braces {} should be used on all arms of this statement drivers/net/wireless/ath/ath11k/mac.c:3749: Blank lines aren't necessary before a close brace '}' drivers/net/wireless/ath/ath11k/mac.c:4197: Blank lines aren't necessary before a close brace '}'
Signature · 9 lines
https://patchwork.kernel.org/patch/11584701/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 1/8] ath11k: add 6G frequency list supported by driver
In reply to Pradeep Kumar ChitrapuQuoted 4 lines · Pradeep Kumar Chitrapu
This patch adds support for 6GHz frequency listing.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This patchset had new warnings which I fixed in the pending branch:
drivers/net/wireless/ath/ath11k/dp_rx.c:2178: braces {} should be used on all arms of this statement drivers/net/wireless/ath/ath11k/mac.c:3749: Blank lines aren't necessary before a close brace '}' drivers/net/wireless/ath/ath11k/mac.c:4197: Blank lines aren't necessary before a close brace '}'
Signature · 3 lines
https://patchwork.kernel.org/patch/11584701/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH v5 1/8] ath11k: add 6G frequency list supported by driver
In reply to Pradeep Kumar ChitrapuQuoted 4 lines · Pradeep Kumar Chitrapu
This patch adds support for 6GHz frequency listing.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>Signed-off-by Kalle Valo <[email protected]>
8 patches applied to ath-next branch of ath.git, thanks.
c5625abaf826 ath11k: add 6G frequency list supported by driver 22eeadcdeab6 ath11k: add support for 6GHz radio in driver 5dcf42f8b79d ath11k: Use freq instead of channel number in rx path 91270d709b21 ath11k: extend peer_assoc_cmd for 6GHz band d387503df0cd ath11k: set psc channel flag when sending channel list to firmware. 194b8ea1ce5a ath11k: Add 6G scan dwell time parameter in scan request command bff621fd113f ath11k: Send multiple scan_chan_list messages if required 74601ecfef6e ath11k: Add support for 6g scan hint
Signature · 3 lines
https://patchwork.kernel.org/patch/11584701/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH v5 1/8] ath11k: add 6G frequency list supported by driver
In reply to Pradeep Kumar ChitrapuQuoted 4 lines · Pradeep Kumar Chitrapu
This patch adds support for 6GHz frequency listing.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>Signed-off-by Kalle Valo <[email protected]>
8 patches applied to ath-next branch of ath.git, thanks.
c5625abaf826 ath11k: add 6G frequency list supported by driver 22eeadcdeab6 ath11k: add support for 6GHz radio in driver 5dcf42f8b79d ath11k: Use freq instead of channel number in rx path 91270d709b21 ath11k: extend peer_assoc_cmd for 6GHz band d387503df0cd ath11k: set psc channel flag when sending channel list to firmware. 194b8ea1ce5a ath11k: Add 6G scan dwell time parameter in scan request command bff621fd113f ath11k: Send multiple scan_chan_list messages if required 74601ecfef6e ath11k: Add support for 6g scan hint
Signature · 9 lines
https://patchwork.kernel.org/patch/11584701/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v5 2/8 ath11k: add support for 6GHz radio in driver
In reply to Pradeep Kumar ChitrapuThis patch adds 6GHz band support and mac80211 registration for the 6G phy radio.
---
v5:
- do not add ht/vht caps in 6ghz band.
v3:
- update 6GHz starting frequency as defined in IEEE P802.11ax/D6.1
drivers/net/wireless/ath/ath11k/core.h | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 93 +++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 16 ++++- 3 files changed, 94 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +5 -1
@@ -353,7 +353,10 @@ struct ath11k_sta {#endif }; -#define ATH11K_NUM_CHANS 41 +#define ATH11K_MIN_5G_FREQ 4150 +#define ATH11K_MIN_6G_FREQ 5945 +#define ATH11K_MAX_6G_FREQ 7115 +#define ATH11K_NUM_CHANS 100#define ATH11K_MAX_5G_CHAN 173enum ath11k_state {
@@ -431,6 +434,7 @@ struct ath11k {u32 vht_cap_info;struct ath11k_he ar_he;enum ath11k_state state; +bool supports_6ghz;struct {struct completion started;struct completion completed;
drivers/net/wireless/ath/ath11k/mac.c +75 -18
155 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.c +14 -2
@@ -368,6 +368,17 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(struct ath11k_pdev_wmi *wmi_handle,memcpy (&cap_band->he_ppet, &mac_phy_caps->he_ppet5g,sizeof (struct ath11k_ppe_threshold )); + cap_band = &pdev_cap->band[NL80211_BAND_6GHZ ]; + cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; + cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; + cap_band->he_cap_info[0 ] = mac_phy_caps->he_cap_info_5g; + cap_band->he_cap_info[1 ] = mac_phy_caps->he_cap_info_5g_ext; + cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; +memcpy (cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, +sizeof (u32) *PSOC_HOST_MAX_PHY_SIZE ); +memcpy (&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, +sizeof (struct ath11k_ppe_threshold )); +return 0 ; }
@@ -5206,9 +5217,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb) goto exit; } -if (rx_ev.phy_mode ==MODE_11B && status->band ==NL80211_BAND_5GHZ ) +if (rx_ev.phy_mode ==MODE_11B && + (status->band ==NL80211_BAND_5GHZ || status->band ==NL80211_BAND_6GHZ ))ath11k_dbg (ab,ATH11K_DBG_WMI , -"wmi mgmt rx 11b (CCK) on 5GHz\n" ); +"wmi mgmt rx 11b (CCK) on 5/6GHz, band = %d\n" , status->band); sband = &ar->mac.sbands[status->band];
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver
Quoted 15 lines · Pradeep Kumar Chitrapu
This patch adds 6GHz band support and mac80211 registration for the 6G phy radio.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>---
v5:
- do not add ht/vht caps in 6ghz band.
v3:
- update 6GHz starting frequency as defined in IEEE P802.11ax/D6.1drivers/net/wireless/ath/ath11k/core.h | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 93 +++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 16 ++++- 3 files changed, 94 insertions(+), 21 deletions(-)
[...]
drivers/net/wireless/ath/ath11k/mac.c static void ath11k_mac_setup_ht_vht_cap(struct ath11k *ar, · line 3500
Quoted 11 lines
drivers/net/wireless/ath/ath11k/mac.c +1
-1@@ -3482,7 +3494,7 @@ static void ath11k_mac_setup_ht_vht_cap(structath11k *ar, rate_cap_rx_chainmask); } -if (cap->supported_bands &WMI_HOST_WLAN_5G_CAP ) { +if (cap->supported_bands &WMI_HOST_WLAN_5G_CAP && !ar->supports_6ghz) { band = &ar->mac.sbands[NL80211_BAND_5GHZ ];drivers/net/wireless/ath/ath11k/mac.c +0
-0ht_cap = cap->band[NL80211_BAND_5GHZ ].ht_cap_info;if (ht_cap_info)
After this change, when 6G is support, it removed HT/VHT of 5G band from "iw list", when connect to an 11AX AP of 5G, it used non-HT. caused together with this commit 75e296e9b22aef6fa467523ace87ef623dac1fad(mac80211: simplify and improve HT/VHT/HE disable code)
+ /* disable HT/VHT/HE if we don't support them */
+ if (!sband->ht_cap.ht_supported) {
+ ifmgd->flags |= IEEE80211_STA_DISABLE_HT; + ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
+ }
after remove this change in ath11k, it become correct to HE iw wls1 station dump:
rx bitrate: 149.7 MBit/s HE-MCS 6 HE-NSS 2 HE-GI 0 HE-DCM 0
[...]
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver
Quoted 41 lines · Wen Gong
Quoted 16 lines · Pradeep Kumar Chitrapu
This patch adds 6GHz band support and mac80211 registration for the 6G phy radio.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>---
v5:
- do not add ht/vht caps in 6ghz band.
v3:
- update 6GHz starting frequency as defined in IEEE P802.11ax/D6.1drivers/net/wireless/ath/ath11k/core.h | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 93 +++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 16 ++++- 3 files changed, 94 insertions(+), 21 deletions(-)[...]
drivers/net/wireless/ath/ath11k/mac.c static void ath11k_mac_setup_ht_vht_cap(struct ath11k *ar, · line 3500
Quoted 11 lines
drivers/net/wireless/ath/ath11k/mac.c +1
-1@@ -3482,7 +3494,7 @@ static void ath11k_mac_setup_ht_vht_cap(structath11k *ar, rate_cap_rx_chainmask); } -if (cap->supported_bands &WMI_HOST_WLAN_5G_CAP ) { +if (cap->supported_bands &WMI_HOST_WLAN_5G_CAP && !ar->supports_6ghz) { band = &ar->mac.sbands[NL80211_BAND_5GHZ ];drivers/net/wireless/ath/ath11k/mac.c +0
-0ht_cap = cap->band[NL80211_BAND_5GHZ ].ht_cap_info;if (ht_cap_info)After this change, when 6G is support, it removed HT/VHT of 5G band from "iw list", when connect to an 11AX AP of 5G, it used non-HT. caused together with this commit 75e296e9b22aef6fa467523ace87ef623dac1fad(mac80211: simplify and improve HT/VHT/HE disable code)
(quoted diff) +6
-0+ /* disable HT/VHT/HE if we don't support them */ + if (!sband->ht_cap.ht_supported) { + ifmgd->flags |= IEEE80211_STA_DISABLE_HT; + ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + ifmgd->flags |= IEEE80211_STA_DISABLE_HE; + }
Quoted 4 lines
after remove this change in ath11k, it become correct to HE iw wls1 station dump:
rx bitrate: 149.7 MBit/s HE-MCS 6 HE-NSS 2 HE-GI 0 HE-DCM 0
Hi Pradeep Kumar Chitrapu,
For QCA6390, it is single_pdev, the pdev support all 2G/5G/6G, Is it have 3 pdev/ath11k in your chip for 2G/5G/6G?
And the pdev/ath11k of 6G have WMI_HOST_WLAN_5G_CAP of cap->supported_bands?
Quoted 1 line
[...]
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver
Quoted 20 lines
Quoted 20 lines
drivers/net/wireless/ath/ath11k/mac.c static void ath11k_mac_setup_ht_vht_cap(struct ath11k *ar, · line 3500
Quoted 8 lines
(quoted diff) +1
-1- if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP) { + if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP &&!ar->supports_6ghz) {
drivers/net/wireless/ath/ath11k/mac.c +0
-0band = &ar->mac.sbands[NL80211_BAND_5GHZ ]; ht_cap = cap->band[NL80211_BAND_5GHZ ].ht_cap_info;if (ht_cap_info)After this change, when 6G is support, it removed HT/VHT of 5G band from "iw list", when connect to an 11AX AP of 5G, it used non-HT. caused together with this commit 75e296e9b22aef6fa467523ace87ef623dac1fad(mac80211: simplify and improve HT/VHT/HE disable code)
(quoted diff) +6
-0+ /* disable HT/VHT/HE if we don't support them */ + if (!sband->ht_cap.ht_supported) { + ifmgd->flags |= IEEE80211_STA_DISABLE_HT; + ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + ifmgd->flags |= IEEE80211_STA_DISABLE_HE; + }
Quoted 3 lines
Quoted 3 lines
after remove this change in ath11k, it become correct to HE iw wls1 station dump:
rx bitrate: 149.7 MBit/s HE-MCS 6 HE-NSS 2 HE-GI 0 HE-DCM 0
Hi Wen,
Quoted 6 lines
Quoted 1 line
Hi Pradeep Kumar Chitrapu,
For QCA6390, it issingle_pdev, the pdev support all 2G/5G/6G, Is it have 3 pdev/ath11k in your chip for 2G/5G/6G?
And the pdev/ath11k of 6G haveWMI_HOST_WLAN_5G_CAPofcap->supported_bands?Quoted 1 line
[...]
Yes, ath11k receives WMI_HOST_WLAN_5G_CAP from firmware for 6G as well.
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver
Quoted 19 lines · Pradeep Kumar Chitrapu
Quoted 19 lines
Quoted 19 lines
drivers/net/wireless/ath/ath11k/mac.c static void ath11k_mac_setup_ht_vht_cap(struct ath11k *ar, · line 3500
Quoted 7 lines
(quoted diff) +1
-1- if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP) { + if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP &&!ar->supports_6ghz) {
drivers/net/wireless/ath/ath11k/mac.c +0
-0band = &ar->mac.sbands[NL80211_BAND_5GHZ ]; ht_cap = cap->band[NL80211_BAND_5GHZ ].ht_cap_info;if (ht_cap_info)After this change, when 6G is support, it removed HT/VHT of 5G band from "iw list", when connect to an 11AX AP of 5G, it used non-HT. caused together with this commit 75e296e9b22aef6fa467523ace87ef623dac1fad(mac80211: simplify and improve HT/VHT/HE disable code)
(quoted diff) +6
-0+ /* disable HT/VHT/HE if we don't support them */ + if (!sband->ht_cap.ht_supported) { + ifmgd->flags |= IEEE80211_STA_DISABLE_HT; + ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; + ifmgd->flags |= IEEE80211_STA_DISABLE_HE; + }
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
after remove this change in ath11k, it become correct to HE iw wls1 station dump:
rx bitrate: 149.7 MBit/s HE-MCS 6 HE-NSS 2 HE-GI 0 HE-DCM 0Hi Wen,
yes, I have it.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Hi Pradeep Kumar Chitrapu,
For QCA6390, it issingle_pdev, the pdev support all 2G/5G/6G, Is it have 3 pdev/ath11k in your chip for 2G/5G/6G?
And the pdev/ath11k of 6G haveWMI_HOST_WLAN_5G_CAPofcap->supported_bands?Quoted 1 line
[...]
Yes, ath11k receives
WMI_HOST_WLAN_5G_CAPfrom firmware for 6G as well.
Ok, so it need to add logic for single_pdev for it(single_pdev is added in https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/drivers/net/wireless/ath/ath11k?id=5f859bc02c7bc7a4094bfba0b4ed145edd7661f2, it is later than your 6G patches), maybe I will add it later.
Re: [PATCH v5 2/8] ath11k: add support for 6GHz radio in driver
In reply to Pradeep Kumar ChitrapuQuoted 15 lines · Pradeep Kumar Chitrapu
This patch adds 6GHz band support and mac80211 registration for the 6G phy radio.
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>---
v5:
- do not add ht/vht caps in 6ghz band.
v3:
- update 6GHz starting frequency as defined in IEEE P802.11ax/D6.1drivers/net/wireless/ath/ath11k/core.h | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 93 +++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 16 ++++- 3 files changed, 94 insertions(+), 21 deletions(-)
[...]
Quoted 14 lines
drivers/net/wireless/ath/ath11k/wmi.c +3
-0@@ -368,6 +368,17 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(struct ath11k_pdev_wmi *wmi_handle,memcpy (&cap_band->he_ppet, &mac_phy_caps->he_ppet5g,sizeof (struct ath11k_ppe_threshold )); + cap_band = &pdev_cap->band[NL80211_BAND_6GHZ ]; + cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; + cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g;
drivers/net/wireless/ath/ath11k/wmi.c ath11k_pull_mac_phy_cap_svc_ready_ext(struct · line 384
Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +8
-0+ cap_band->he_cap_info[0 ] = mac_phy_caps->he_cap_info_5g; + cap_band->he_cap_info[1 ] = mac_phy_caps->he_cap_info_5g_ext; + cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; +memcpy (cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, +sizeof (u32) *PSOC_HOST_MAX_PHY_SIZE ); +memcpy (&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, +sizeof (struct ath11k_ppe_threshold )); +return 0 ; }
I want to move this under below check(if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) ),
becuase single_pdev introduced(https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/drivers/net/wireless/ath/ath11k?id=5f859bc02c7bc7a4094bfba0b4ed145edd7661f2)
Is it will distrub your original logic?
[...]
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v5 3/8 ath11k: Use freq instead of channel number in rx path
In reply to Pradeep Kumar ChitrapuAs 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.
--- 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(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +5 -1
@@ -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 ;
drivers/net/wireless/ath/ath11k/wmi.c +4 -1
@@ -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 ;
drivers/net/wireless/ath/ath11k/wmi.h +2 -0
@@ -4228,6 +4228,7 @@ struct wmi_pdev_temperature_event {#define WLAN_MGMT_TXRX_HOST_MAX_ANTENNA 4struct 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
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v5 4/8 ath11k: extend peer_assoc_cmd for 6GHz band
In reply to Pradeep Kumar ChitrapuThis adds support required for configuring min_data_rate of 6GHz oper IE and peer_he_caps_6ghz in peer assoc command. The Minimum Rate field indicates the minimum rate, in units of 1 Mb/s, that the non-AP STA is allowed to use for sending PPDUs as defined in IEEE P802.11ax™/D6.0.
--- drivers/net/wireless/ath/ath11k/wmi.c | 2 ++ drivers/net/wireless/ath/ath11k/wmi.h | 5 +++++ 2 files changed, 7 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +2 -0
@@ -1789,6 +1789,7 @@ int ath11k_wmi_send_peer_assoc_cmd(struct ath11k *ar, cmd->peer_he_cap_info = param->peer_he_cap_macinfo[0 ]; cmd->peer_he_cap_info_ext = param->peer_he_cap_macinfo[1 ]; cmd->peer_he_cap_info_internal = param->peer_he_cap_macinfo_internal; + cmd->peer_he_caps_6ghz = param->peer_he_caps_6ghz; cmd->peer_he_ops = param->peer_he_ops;memcpy (&cmd->peer_he_cap_phy, ¶m->peer_he_cap_phyinfo,sizeof (param->peer_he_cap_phyinfo));
@@ -1842,6 +1843,7 @@ int ath11k_wmi_send_peer_assoc_cmd(struct ath11k *ar,/* HE Rates */ cmd->peer_he_mcs = param->peer_he_mcs_count; + cmd->min_data_rate = param->min_data_rate; ptr +=sizeof (*mcs);
drivers/net/wireless/ath/ath11k/wmi.h +5 -0
@@ -1011,6 +1011,7 @@ enum wmi_tlv_vdev_param {WMI_VDEV_PARAM_FILS_MAX_CHANNEL_GUARD_TIME ,WMI_VDEV_PARAM_BA_MODE =0x7e ,WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE =0x87 , +WMI_VDEV_PARAM_6GHZ_PARAMS =0x99 ,WMI_VDEV_PARAM_PROTOTYPE =0x8000 ,WMI_VDEV_PARAM_BSS_COLOR , WMI_VDEV_PARAM_SET_HEMU_MODE,
@@ -3444,6 +3445,7 @@ struct peer_assoc_params {u32 tx_max_rate;u32 tx_mcs_set;u8 vht_capable; +u8 min_data_rate;u32 tx_max_mcs_nss;u32 peer_bw_rxnss_override;bool is_pmf_enabled;
@@ -3472,6 +3474,7 @@ struct peer_assoc_params {bool he_flag;u32 peer_he_cap_macinfo[2 ];u32 peer_he_cap_macinfo_internal; +u32 peer_he_caps_6ghz;u32 peer_he_ops;u32 peer_he_cap_phyinfo[WMI_HOST_MAX_HECAP_PHY_SIZE ];u32 peer_he_mcs_count;
@@ -3509,6 +3512,8 @@ struct wmi_peer_assoc_complete_cmd {u32 peer_he_mcs;u32 peer_he_cap_info_ext;u32 peer_he_cap_info_internal; +u32 min_data_rate; +u32 peer_he_caps_6ghz; } __packed;struct wmi_stop_scan_cmd {
Signature · 1 line
2.17.1
PATCH v5 5/8 ath11k: set psc channel flag when sending channel list to firmware.
In reply to Pradeep Kumar ChitrapuIf 6 ghz channel is a Preferred Scanning Channel(PSC), mark the channel flag accordingly when updating channel list to firmware. This will be used when making scanning decision in 6GHz channels.
--- drivers/net/wireless/ath/ath11k/reg.c | 4 ++++ drivers/net/wireless/ath/ath11k/wmi.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/reg.c +4 -0
@@ -161,6 +161,10 @@ int ath11k_reg_update_chan_list(struct ath11k *ar)else ch->phy_mode =MODE_11A ; +if (channel->band ==NL80211_BAND_6GHZ && +cfg80211_channel_is_psc (channel)) + ch->psc_channel = true; + ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n", i, params->nallchans,
drivers/net/wireless/ath/ath11k/wmi.h +2 -1
@@ -2520,7 +2520,8 @@ struct channel_param { allow_ht:1, allow_vht:1, allow_he:1, - set_agile:1; + set_agile:1, + psc_channel:1;u32 phy_mode;u32 cfreq1;u32 cfreq2;
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v5 6/8 ath11k: Add 6G scan dwell time parameter in scan request command
In reply to Pradeep Kumar ChitrapuAdd 6G scan active and passive dwell time parameter to scan request.
--- drivers/net/wireless/ath/ath11k/wmi.c | 4 ++++ drivers/net/wireless/ath/ath11k/wmi.h | 5 +++++ 2 files changed, 9 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +4 -0
@@ -1899,6 +1899,8 @@ void ath11k_wmi_start_scan_init(struct ath11k *ar, arg->dwell_time_active =50 ; arg->dwell_time_active_2g =0 ; arg->dwell_time_passive =150 ; + arg->dwell_time_active_6g =40 ; + arg->dwell_time_passive_6g =30 ; arg->min_rest_time =50 ; arg->max_rest_time =500 ; arg->repeat_probe_time =0 ;
@@ -2045,6 +2047,8 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, cmd->dwell_time_active = params->dwell_time_active; cmd->dwell_time_active_2g = params->dwell_time_active_2g; cmd->dwell_time_passive = params->dwell_time_passive; + cmd->dwell_time_active_6g = params->dwell_time_active_6g; + cmd->dwell_time_passive_6g = params->dwell_time_passive_6g; cmd->min_rest_time = params->min_rest_time; cmd->max_rest_time = params->max_rest_time; cmd->repeat_probe_time = params->repeat_probe_time;
drivers/net/wireless/ath/ath11k/wmi.h +5 -0
@@ -3061,6 +3061,9 @@ struct wmi_start_scan_cmd {u32 num_vendor_oui;u32 scan_ctrl_flags_ext;u32 dwell_time_active_2g; +u32 dwell_time_active_6g; +u32 dwell_time_passive_6g; +u32 scan_start_offset; } __packed;#define WMI_SCAN_FLAG_PASSIVE 0x1
@@ -3127,6 +3130,8 @@ struct scan_req_params {u32 dwell_time_active;u32 dwell_time_active_2g;u32 dwell_time_passive; +u32 dwell_time_active_6g; +u32 dwell_time_passive_6g;u32 min_rest_time;u32 max_rest_time;u32 repeat_probe_time;
Signature · 1 line
2.17.1
PATCH v5 7/8 ath11k: Send multiple scan_chan_list messages if required
In reply to Pradeep Kumar ChitrapuWith addition of 6Ghz channels, it is possible that wmi buffer size can exceed the maximum wmi buffer size. So iterate over the channel list, and send multiple messages till channel list is empty.
Also mark PSC channel flag for 6GHz channels accordingly.
--- drivers/net/wireless/ath/ath11k/wmi.c | 170 ++++++++++++++------------ drivers/net/wireless/ath/ath11k/wmi.h | 3 + 2 files changed, 98 insertions(+), 75 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +95 -75
@@ -2194,91 +2194,111 @@ int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar,struct channel_param *tchan_info;struct wmi_tlv *tlv;void *ptr; -int i, ret, len; +int i, ret =0 , len; +u16 num_send_chans, num_sends =0 , max_chan_limit =0 ;u32 *reg1, *reg2; - len =sizeof (*cmd) +TLV_HDR_SIZE + -sizeof (*chan_info) * chan_list->nallchans; - - skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); -if (!skb) -return -ENOMEM ; - - cmd = (struct wmi_scan_chan_list_cmd *)skb->data; - cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_SCAN_CHAN_LIST_CMD ) | -FIELD_PREP (WMI_TLV_LEN ,sizeof (*cmd) -TLV_HDR_SIZE ); - -ath11k_dbg (ar->ab,ATH11K_DBG_WMI , -"WMI no.of chan = %d len = %d\n" , chan_list->nallchans, len); - cmd->pdev_id = chan_list->pdev_id; - cmd->num_scan_chans = chan_list->nallchans; - - ptr = skb->data +sizeof (*cmd); - - len =sizeof (*chan_info) * chan_list->nallchans; - tlv = ptr; - tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_STRUCT ) | -FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); - ptr +=TLV_HDR_SIZE ; - tchan_info = &chan_list->ch_param[0 ]; +while (chan_list->nallchans) { + len =sizeof (*cmd) +TLV_HDR_SIZE ; + max_chan_limit = + (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / +sizeof (*chan_info); + +if (chan_list->nallchans > max_chan_limit) + num_send_chans = max_chan_limit; +else + num_send_chans = chan_list->nallchans; + + chan_list->nallchans -= num_send_chans; + len +=sizeof (*chan_info) * num_send_chans; + + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); +if (!skb) +return -ENOMEM ; -for (i =0 ; i < chan_list->nallchans; ++i) { - chan_info = ptr; -memset (chan_info,0 ,sizeof (*chan_info)); - len =sizeof (*chan_info); - chan_info->tlv_header =FIELD_PREP (WMI_TLV_TAG , -WMI_TAG_CHANNEL ) | -FIELD_PREP (WMI_TLV_LEN , - len -TLV_HDR_SIZE ); - - reg1 = &chan_info->reg_info_1; - reg2 = &chan_info->reg_info_2; - chan_info->mhz = tchan_info->mhz; - chan_info->band_center_freq1 = tchan_info->cfreq1; - chan_info->band_center_freq2 = tchan_info->cfreq2; - -if (tchan_info->is_chan_passive) - chan_info->info |=WMI_CHAN_INFO_PASSIVE ; -if (tchan_info->allow_he) - chan_info->info |=WMI_CHAN_INFO_ALLOW_HE ; -else if (tchan_info->allow_vht) - chan_info->info |=WMI_CHAN_INFO_ALLOW_VHT ; -else if (tchan_info->allow_ht) - chan_info->info |=WMI_CHAN_INFO_ALLOW_HT ; -if (tchan_info->half_rate) - chan_info->info |=WMI_CHAN_INFO_HALF_RATE ; -if (tchan_info->quarter_rate) - chan_info->info |=WMI_CHAN_INFO_QUARTER_RATE ; - - chan_info->info |=FIELD_PREP (WMI_CHAN_INFO_MODE , - tchan_info->phy_mode); - *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MIN_PWR , - tchan_info->minpower); - *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MAX_PWR , - tchan_info->maxpower); - *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MAX_REG_PWR , - tchan_info->maxregpower); - *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_REG_CLS , - tchan_info->reg_class_id); - *reg2 |=FIELD_PREP (WMI_CHAN_REG_INFO2_ANT_MAX , - tchan_info->antennamax); + cmd = (struct wmi_scan_chan_list_cmd *)skb->data; + cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_SCAN_CHAN_LIST_CMD ) | +FIELD_PREP (WMI_TLV_LEN ,sizeof (*cmd) -TLV_HDR_SIZE ); + cmd->pdev_id = chan_list->pdev_id; + cmd->num_scan_chans = num_send_chans; +if (num_sends) + cmd->flags |=WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG ;ath11k_dbg (ar->ab,ATH11K_DBG_WMI , -"WMI chan scan list chan[%d] = %u\n" , - i, chan_info->mhz); +"WMI no.of chan = %d len = %d pdev_id = %d num_sends = %d\n" , + num_send_chans, len, cmd->pdev_id, num_sends); - ptr +=sizeof (*chan_info); + ptr = skb->data +sizeof (*cmd); - tchan_info++; - } + len =sizeof (*chan_info) * num_send_chans; + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); + ptr +=TLV_HDR_SIZE ; - ret =ath11k_wmi_cmd_send (wmi, skb,WMI_SCAN_CHAN_LIST_CMDID ); -if (ret) { -ath11k_warn (ar->ab,"failed to send WMI_SCAN_CHAN_LIST cmd\n" ); -dev_kfree_skb (skb); - } +for (i =0 ; i < num_send_chans; ++i) { + chan_info = ptr; +memset (chan_info,0 ,sizeof (*chan_info)); + len =sizeof (*chan_info); + chan_info->tlv_header =FIELD_PREP (WMI_TLV_TAG , +WMI_TAG_CHANNEL ) | +FIELD_PREP (WMI_TLV_LEN , + len -TLV_HDR_SIZE ); + + reg1 = &chan_info->reg_info_1; + reg2 = &chan_info->reg_info_2; + chan_info->mhz = tchan_info->mhz; + chan_info->band_center_freq1 = tchan_info->cfreq1; + chan_info->band_center_freq2 = tchan_info->cfreq2; + +if (tchan_info->is_chan_passive) + chan_info->info |=WMI_CHAN_INFO_PASSIVE ; +if (tchan_info->allow_he) + chan_info->info |=WMI_CHAN_INFO_ALLOW_HE ; +else if (tchan_info->allow_vht) + chan_info->info |=WMI_CHAN_INFO_ALLOW_VHT ; +else if (tchan_info->allow_ht) + chan_info->info |=WMI_CHAN_INFO_ALLOW_HT ; +if (tchan_info->half_rate) + chan_info->info |=WMI_CHAN_INFO_HALF_RATE ; +if (tchan_info->quarter_rate) + chan_info->info |=WMI_CHAN_INFO_QUARTER_RATE ; +if (tchan_info->psc_channel) + chan_info->info |=WMI_CHAN_INFO_PSC ; + + chan_info->info |=FIELD_PREP (WMI_CHAN_INFO_MODE , + tchan_info->phy_mode); + *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MIN_PWR , + tchan_info->minpower); + *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MAX_PWR , + tchan_info->maxpower); + *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_MAX_REG_PWR , + tchan_info->maxregpower); + *reg1 |=FIELD_PREP (WMI_CHAN_REG_INFO1_REG_CLS , + tchan_info->reg_class_id); + *reg2 |=FIELD_PREP (WMI_CHAN_REG_INFO2_ANT_MAX , + tchan_info->antennamax); + +ath11k_dbg (ar->ab,ATH11K_DBG_WMI , +"WMI chan scan list chan[%d] = %u, chan_info->info %8x\n" , + i, chan_info->mhz, chan_info->info); + + ptr +=sizeof (*chan_info); + + tchan_info++; + } + ret =ath11k_wmi_cmd_send (wmi, skb,WMI_SCAN_CHAN_LIST_CMDID ); +if (ret) { +ath11k_warn (ar->ab,"failed to send WMI_SCAN_CHAN_LIST cmd\n" ); +dev_kfree_skb (skb); + goto end; + } + + num_sends++; + } +end:return ret; }
drivers/net/wireless/ath/ath11k/wmi.h +3 -0
@@ -54,6 +54,8 @@ struct wmi_tlv {#define WLAN_SCAN_PARAMS_MAX_BSSID 4#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256 +#define WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG 1 +#define WMI_BA_MODE_BUFFER_SIZE_256 3/* * HW mode config type replicated from FW header
@@ -3271,6 +3273,7 @@ struct wmi_bcn_send_from_host_cmd {#define WMI_CHAN_INFO_QUARTER_RATE BIT(15)#define WMI_CHAN_INFO_DFS_FREQ2 BIT(16)#define WMI_CHAN_INFO_ALLOW_HE BIT(17) +#define WMI_CHAN_INFO_PSC BIT(18)#define WMI_CHAN_REG_INFO1_MIN_PWR GENMASK(7, 0)#define WMI_CHAN_REG_INFO1_MAX_PWR GENMASK(15, 8)
Signature · 7 lines
2.17.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH v5 7/8] ath11k: Send multiple scan_chan_list messages if required
Quoted 24 lines · Pradeep Kumar Chitrapu
With addition of 6Ghz channels, it is possible that wmi buffer size can exceed the maximum wmi buffer size. So iterate over the channel list, and send multiple messages till channel list is empty.
Also mark PSC channel flag for 6GHz channels accordingly.Signed-off-by Pradeep Kumar Chitrapu <[email protected]>--- drivers/net/wireless/ath/ath11k/wmi.c | 170 ++++++++++++++------------ drivers/net/wireless/ath/ath11k/wmi.h | 3 + 2 files changed, 98 insertions(+), 75 deletions(-)drivers/net/wireless/ath/ath11k/wmi.c +2
-1@@ -2194,91 +2194,111 @@ int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar,struct channel_param *tchan_info;struct wmi_tlv *tlv;void *ptr; -int i, ret, len; +int i, ret =0 , len; +u16 num_send_chans, num_sends =0 , max_chan_limit =0 ;u32 *reg1, *reg2;
[...]
drivers/net/wireless/ath/ath11k/wmi.c int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar, · line 2303
Quoted 12 lines
drivers/net/wireless/ath/ath11k/wmi.c +10
-0+ ret =ath11k_wmi_cmd_send (wmi, skb,WMI_SCAN_CHAN_LIST_CMDID ); +if (ret) { +ath11k_warn (ar->ab,"failed to send WMI_SCAN_CHAN_LIST cmd\n" ); +dev_kfree_skb (skb); + goto end; + } + + num_sends++; + } +end:return ret; }
The end label is useless, I removed that and replaced the goto with 'return ret'. And I replaced the return in the end to 'return 0' which made it possible to not initialise the ret variable. Please check my changes in the pending branch (which I will push shortly).
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH v5 8/8 ath11k: Add support for 6g scan hint
In reply to Pradeep Kumar ChitrapuAdd support for 6Ghz short ssid and bssid hint mechanism as part of scan command.
--- drivers/net/wireless/ath/ath11k/wmi.c | 72 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 22 ++++++++ 2 files changed, 94 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +72 -0
@@ -2005,6 +2005,8 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar,int i, ret, len;u32 *tmp_ptr;u8 extraie_len_with_pad =0 ; +struct hint_short_ssid *s_ssid =NULL ; +struct hint_bssid *hint_bssid =NULL ; len =sizeof (*cmd);
@@ -2026,6 +2028,14 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar,roundup (params->extraie.len,sizeof (u32)); len += extraie_len_with_pad; +if (params->num_hint_bssid) + len +=TLV_HDR_SIZE + + params->num_hint_bssid *sizeof (struct hint_bssid ); + +if (params->num_hint_s_ssid) + len +=TLV_HDR_SIZE + + params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len);if (!skb)return -ENOMEM ;
@@ -2126,6 +2136,68 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, ptr += extraie_len_with_pad; +if (params->num_hint_s_ssid) { + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + ptr += len; + } + +if (params->num_hint_bssid) { + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } + + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_s_ssid) { + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + } + ptr += len; + + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_bssid) { + hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } + ret =ath11k_wmi_cmd_send (wmi, skb,WMI_START_SCAN_CMDID );if (ret) {
drivers/net/wireless/ath/ath11k/wmi.h +22 -0
@@ -50,6 +50,14 @@ struct wmi_tlv {#define WMI_MAX_MEM_REQS 32#define ATH11K_MAX_HW_LISTEN_INTERVAL 5 +#define WLAN_SCAN_MAX_HINT_S_SSID 10 +#define WLAN_SCAN_MAX_HINT_BSSID 10 +#define MAX_RNR_BSS 5 + +#define WLAN_SCAN_MAX_HINT_S_SSID 10 +#define WLAN_SCAN_MAX_HINT_BSSID 10 +#define MAX_RNR_BSS 5 +#define WLAN_SCAN_PARAMS_MAX_SSID 16#define WLAN_SCAN_PARAMS_MAX_BSSID 4#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
@@ -3105,6 +3113,16 @@ enum { ((flag) |= (((mode) <<WMI_SCAN_DWELL_MODE_SHIFT ) & \ WMI_SCAN_DWELL_MODE_MASK)) +struct hint_short_ssid { +u32 freq_flags; +u32 short_ssid; +}; + +struct hint_bssid { +u32 freq_flags; +struct wmi_mac_addr bssid; +}; +struct scan_req_params {u32 scan_id;u32 scan_req_id;
@@ -3184,6 +3202,10 @@ struct scan_req_params {struct element_info extraie;struct element_info htcap;struct element_info vhtcap; +u32 num_hint_s_ssid; +u32 num_hint_bssid; +struct hint_short_ssid hint_s_ssid[WLAN_SCAN_MAX_HINT_S_SSID ]; +struct hint_bssid hint_bssid[WLAN_SCAN_MAX_HINT_BSSID ]; };struct wmi_ssid_arg {
Signature · 1 line
2.17.1
Re: [PATCH v5 8/8] ath11k: Add support for 6g scan hint
On 2020-06-03 08:17, Pradeep Kumar Chitrapu wrote:
...
Quoted 57 lines
drivers/net/wireless/ath/ath11k/wmi.c +52
-0@@ -2126,6 +2136,68 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, ptr += extraie_len_with_pad; +if (params->num_hint_s_ssid) { + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + ptr += len; + } + +if (params->num_hint_bssid) { + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } + + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_s_ssid) { + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + } + ptr += len; + + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_bssid) {
drivers/net/wireless/ath/ath11k/wmi.c int ath11k_wmi_send_scan_start_cmd(struct ath11k · line 2201
Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +10
-0+ hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } +
It handle num_hint_bssid/ num_hint_s_ssid twice, and lead skb overflow and lead crash Removed one then not crash by my test.
[ 333.887631] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe
[ 333.887633] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb len:372,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a318c
[ 333.887635] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300
[ 333.887638] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe
[ 333.887640] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb len:376,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3188
[ 333.887642] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300
[ 333.887644] ath11k_pci 0000:05:00.0: htc ep 2 consumed 1 credits (total 1)
[ 333.887649] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 write_index 6, skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe
[ 333.887650] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 skb len:384,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3180
[ 333.887652] ath11k_pci 0000:05:00.0: ath11k_ce_send shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300
[ 333.887654] ath11k_pci 0000:05:00.0: wmi cmd send 0x3001 ret 0
[ 333.887729] general protection fault, probably for non-canonical address 0x2e676e69746e756f: 0000 [#1] SMP PTI
[ 333.887734] CPU: 1 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G
W OE 5.8.0-rc1+ #3
[ 333.887735] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011
[ 333.887741] RIP: 0010:skb_release_data+0x66/0x170
[ 333.887744] Code: 41 0f c1 44 24 20 39 c2 0f 85 ff 00 00 00 31 db 41 80 7c 24 02 00 48 89 fd 74 39 48 63 c3 48 83 c0 03 48 c1 e0 04 49 8b 3c 04 <48> 8b 47 08 48 8d 50 ff a8 01 48 0f 45 fa 66 66 66 66 90 f0 ff 4f
[ 333.887746] RSP: 0018:ffffb3204010ce48 EFLAGS: 00010206
[ 333.887748] RAX: 0000000000000030 RBX: 0000000000000000 RCX: 000000000000466e
[ 333.887749] RDX: 0000000000000011 RSI: 0000000000000001 RDI: 2e676e69746e756f
[ 333.887751] RBP: ffff921f6fd85400 R08: ffff921f7e5dc9b8 R09: ffff921f7e5cb000
[ 333.887752] R10: 000000000000000c R11: 0000000000001142 R12: ffff921f6d7a3300
[ 333.887754] R13: 0000000000000013 R14: ffff921f68d41658 R15: ffff921f68d42e68
[ 333.887756] FS: 0000000000000000(0000) GS:ffff921f7a240000(0000) knlGS:0000000000000000
[ 333.887757] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 333.887759] CR2: 00007f73be694b58 CR3: 000000008f40a004 CR4: 00000000000606e0
[ 333.887760] Call Trace:
[ 333.887763] <IRQ>
[ 333.887766] consume_skb+0x27/0xb0
[ 333.887780] ath11k_ce_send_done_cb+0x2a2/0x2c0 [ath11k]
[ 333.887789] ath11k_ce_per_engine_service+0x50/0x3b0 [ath11k]
[ 333.887796] ? ath11k_info+0x56/0x60 [ath11k]
[ 333.887799] ? __irq_put_desc_unlock+0x18/0x50
[ 333.887802] ath11k_pci_ce_tasklet+0x2f/0x50 [ath11k_pci]
[ 333.887806] tasklet_action_common.isra.21+0xee/0x110
[ 333.887809] __do_softirq+0xfd/0x2bb
[ 333.887814] asm_call_on_stack+0x12/0x20
[ 333.887815] </IRQ>
[ 333.887819] do_softirq_own_stack+0x39/0x50
[ 333.887821] irq_exit_rcu+0x9e/0xa0
[ 333.887825] common_interrupt+0xa4/0x140
[ 333.887828] asm_common_interrupt+0x1e/0x40
[ 333.887832] RIP: 0010:cpuidle_enter_state+0xc6/0x420
[ 333.887834] Code: 90 31 ff e8 0c 6a 8c ff 80 7c 24 0f 00 74 17 9c 58 66 66 90 66 90 f6 c4 02 0f 85 24 03 00 00 31 ff e8 5e 87 92 ff fb 66 66 90 <66> 66 90 45 85 e4 0f 88 c3 02 00 00 49 63 d4 4c 2b 7c 24 10 48 8d
[ 333.887836] RSP: 0018:ffffb320400a7e78 EFLAGS: 00000246
[ 333.887838] RAX: ffff921f7a26bfc0 RBX: ffff921f7a275900 RCX: 000000000000001f
[ 333.887840] RDX: 0000000000000000 RSI: 00000000316404ec RDI: 0000000000000000
[ 333.887842] RBP: ffffffff9a4e9c60 R08: fffffff8ac800705 R09: 0000000000000433
[ 333.887843] R10: ffff921f7a26af04 R11: 0000000000000018 R12: 0000000000000005
[ 333.887844] R13: 0000000000000005 R14: ffffffff9a4e9c60 R15: 0000004dbd4170fb
[ 333.887848] ? cpuidle_enter_state+0xa4/0x420
[ 333.887850] cpuidle_enter+0x29/0x40
[ 333.887852] do_idle+0x1d8/0x260
[ 333.887854] cpu_startup_entry+0x19/0x20
[ 333.887857] start_secondary+0x141/0x170
[ 333.887860] secondary_startup_64+0xb6/0xc0
[ 333.887862] Modules linked in: ath11k_pci(OE) ath11k(OE) qmi_helpers qrtr_mhi mhi qrtr ns rfcomm ccm bnep nouveau intel_rapl_msr intel_rapl_common snd_hda_codec_conexant snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp i915 coretemp kvm_intel kvm iwldvm uvcvideo wmi_bmof irqbypass snd_hda_codec_hdmi mac80211 mxm_wmi videobuf2_vmalloc ttm videobuf2_memops videobuf2_v4l2 input_leds joydev drm_kms_helper videobuf2_common videodev snd_hda_intel crct10dif_pclmul serio_raw snd_intel_dspcfg crc32_pclmul mc thinkpad_acpi ghash_clmulni_intel snd_hda_codec aesni_intel snd_hda_core snd_hwdep crypto_simd snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi cryptd snd_seq libarc4 snd_seq_device glue_helper nvram snd_timer drm ledtrig_audio btusb iwlwifi lpc_ich btrtl btbcm btintel snd bluetooth i2c_algo_bit fb_sys_fops syscopyarea sysfillrect cfg80211 sysimgblt ecdh_generic ecc mei_me mei soundcore wmi video mac_hid parport_pc ppdev lp parport autofs4 ahci sdhci_pci firewire_ohci e1000e cqhci
[ 333.887898] psmouse ptp firewire_core libahci sdhci crc_itu_t pps_core...
Re: [PATCH v5 8/8] ath11k: Add support for 6g scan hint
Quoted 135 lines · Wen Gong
On 2020-06-03 08:17, Pradeep Kumar Chitrapu wrote:
...Quoted 57 lines
drivers/net/wireless/ath/ath11k/wmi.c +52
-0@@ -2126,6 +2136,68 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, ptr += extraie_len_with_pad; +if (params->num_hint_s_ssid) { + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + ptr += len; + } + +if (params->num_hint_bssid) { + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } + + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_s_ssid) { + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + } + ptr += len; + + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_bssid) {drivers/net/wireless/ath/ath11k/wmi.c int ath11k_wmi_send_scan_start_cmd(struct · line 2201
Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +10
-0+ hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } +It handle num_hint_bssid/
num_hint_s_ssidtwice, and lead skb overflow and lead crash
Removed one then not crash by my test.[ 333.887631] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887633] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb len:372,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a318c [ 333.887635] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887638] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887640] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb len:376,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3188 [ 333.887642] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887644] ath11k_pci 0000:05:00.0: htc ep 2 consumed 1 credits (total 1) [ 333.887649] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 write_index 6, skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887650] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 skb len:384,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3180 [ 333.887652] ath11k_pci 0000:05:00.0: ath11k_ce_send shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887654] ath11k_pci 0000:05:00.0: wmi cmd send 0x3001 ret 0 [ 333.887729] general protection fault, probably for non-canonical address 0x2e676e69746e756f: 0000 [#1] SMP PTI [ 333.887734] CPU: 1 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G W OE 5.8.0-rc1+ #3 [ 333.887735] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011 [ 333.887741] RIP: 0010:skb_release_data+0x66/0x170 [ 333.887744] Code: 41 0f c1 44 24 20 39 c2 0f 85 ff 00 00 00 31 db 41 80 7c 24 02 00 48 89 fd 74 39 48 63 c3 48 83 c0 03 48 c1 e0 04 49 8b 3c 04 <48> 8b 47 08 48 8d 50 ff a8 01 48 0f 45 fa 66 66 66 66 90 f0 ff 4f [ 333.887746] RSP: 0018:ffffb3204010ce48 EFLAGS: 00010206 [ 333.887748] RAX: 0000000000000030 RBX: 0000000000000000 RCX: 000000000000466e [ 333.887749] RDX: 0000000000000011 RSI: 0000000000000001 RDI: 2e676e69746e756f [ 333.887751] RBP: ffff921f6fd85400 R08: ffff921f7e5dc9b8 R09: ffff921f7e5cb000 [ 333.887752] R10: 000000000000000c R11: 0000000000001142 R12: ffff921f6d7a3300 [ 333.887754] R13: 0000000000000013 R14: ffff921f68d41658 R15: ffff921f68d42e68 [ 333.887756] FS: 0000000000000000(0000) GS:ffff921f7a240000(0000) knlGS:0000000000000000 [ 333.887757] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 333.887759] CR2: 00007f73be694b58 CR3: 000000008f40a004 CR4: 00000000000606e0 [ 333.887760] Call Trace: [ 333.887763] <IRQ> [ 333.887766] consume_skb+0x27/0xb0 [ 333.887780] ath11k_ce_send_done_cb+0x2a2/0x2c0 [ath11k] [ 333.887789] ath11k_ce_per_engine_service+0x50/0x3b0 [ath11k] [ 333.887796] ? ath11k_info+0x56/0x60 [ath11k] [ 333.887799] ? __irq_put_desc_unlock+0x18/0x50 [ 333.887802] ath11k_pci_ce_tasklet+0x2f/0x50 [ath11k_pci] [ 333.887806] tasklet_action_common.isra.21+0xee/0x110
Quoted 8 lines
[ 333.887809] __do_softirq+0xfd/0x2bb [ 333.887814] asm_call_on_stack+0x12/0x20 [ 333.887815] </IRQ> [ 333.887819] do_softirq_own_stack+0x39/0x50 [ 333.887821] irq_exit_rcu+0x9e/0xa0 [ 333.887825] common_interrupt+0xa4/0x140 [ 333.887828] asm_common_interrupt+0x1e/0x40 [ 333.887832] RIP: 0010:cpuidle_enter_state+0xc6/0x420
Pradeep, do you have a fix for this crash?
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH v5 8/8] ath11k: Add support for 6g scan hint
In reply to Wen GongQuoted 135 lines · Wen Gong
On 2020-06-03 08:17, Pradeep Kumar Chitrapu wrote:
...Quoted 57 lines
drivers/net/wireless/ath/ath11k/wmi.c +52
-0@@ -2126,6 +2136,68 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, ptr += extraie_len_with_pad; +if (params->num_hint_s_ssid) { + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + ptr += len; + } + +if (params->num_hint_bssid) { + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; + hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } + + len = params->num_hint_s_ssid *sizeof (struct hint_short_ssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_s_ssid) { + s_ssid = ptr; +for (i =0 ; i < params->num_hint_s_ssid; ++i) { + s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; + s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; + s_ssid++; + } + } + ptr += len; + + len = params->num_hint_bssid *sizeof (struct hint_bssid ); + tlv = ptr; + tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_FIXED_STRUCT ) | +FIELD_PREP (WMI_TLV_LEN , len); + ptr +=TLV_HDR_SIZE ; +if (params->num_hint_bssid) {drivers/net/wireless/ath/ath11k/wmi.c int ath11k_wmi_send_scan_start_cmd(struct · line 2201
Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +10
-0+ hint_bssid = ptr; +for (i =0 ; i < params->num_hint_bssid; ++i) { + hint_bssid->freq_flags = + params->hint_bssid[i].freq_flags; +ether_addr_copy (¶ms->hint_bssid[i].bssid.addr[0 ], + &hint_bssid->bssid.addr[0 ]); + hint_bssid++; + } + } +It handle num_hint_bssid/
num_hint_s_ssidtwice, and lead skb overflow and lead crash
Removed one then not crash by my test.[ 333.887631] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887633] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 skb len:372,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a318c [ 333.887635] ath11k_pci 0000:05:00.0: ath11k_wmi_send_scan_start_cmd 2 shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887638] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887640] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait 1 skb len:376,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3188 [ 333.887642] ath11k_pci 0000:05:00.0: ath11k_wmi_cmd_send_nowait shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887644] ath11k_pci 0000:05:00.0: htc ep 2 consumed 1 credits (total 1) [ 333.887649] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 write_index 6, skb null 0 ,pK:ffff921f6fd85400,llx:ffff921f6fd85400,px:ffff921f6fd85400,p:000000008d8d8abe [ 333.887650] ath11k_pci 0000:05:00.0: ath11k_ce_send 1 skb len:384,end:448,tail:448,head:ffff921f6d7a3140,data:ffff921f6d7a3180 [ 333.887652] ath11k_pci 0000:05:00.0: ath11k_ce_send shinfo nr_frags 19 null 0,pk:ffff921f6d7a3300,llx:ffff921f6d7a3300 [ 333.887654] ath11k_pci 0000:05:00.0: wmi cmd send 0x3001 ret 0 [ 333.887729] general protection fault, probably for non-canonical address 0x2e676e69746e756f: 0000 [#1] SMP PTI [ 333.887734] CPU: 1 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G W OE 5.8.0-rc1+ #3 [ 333.887735] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011 [ 333.887741] RIP: 0010:skb_release_data+0x66/0x170 [ 333.887744] Code: 41 0f c1 44 24 20 39 c2 0f 85 ff 00 00 00 31 db 41 80 7c 24 02 00 48 89 fd 74 39 48 63 c3 48 83 c0 03 48 c1 e0 04 49 8b 3c 04 <48> 8b 47 08 48 8d 50 ff a8 01 48 0f 45 fa 66 66 66 66 90 f0 ff 4f [ 333.887746] RSP: 0018:ffffb3204010ce48 EFLAGS: 00010206 [ 333.887748] RAX: 0000000000000030 RBX: 0000000000000000 RCX: 000000000000466e [ 333.887749] RDX: 0000000000000011 RSI: 0000000000000001 RDI: 2e676e69746e756f [ 333.887751] RBP: ffff921f6fd85400 R08: ffff921f7e5dc9b8 R09: ffff921f7e5cb000 [ 333.887752] R10: 000000000000000c R11: 0000000000001142 R12: ffff921f6d7a3300 [ 333.887754] R13: 0000000000000013 R14: ffff921f68d41658 R15: ffff921f68d42e68 [ 333.887756] FS: 0000000000000000(0000) GS:ffff921f7a240000(0000) knlGS:0000000000000000 [ 333.887757] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 333.887759] CR2: 00007f73be694b58 CR3: 000000008f40a004 CR4: 00000000000606e0 [ 333.887760] Call Trace: [ 333.887763] <IRQ> [ 333.887766] consume_skb+0x27/0xb0 [ 333.887780] ath11k_ce_send_done_cb+0x2a2/0x2c0 [ath11k] [ 333.887789] ath11k_ce_per_engine_service+0x50/0x3b0 [ath11k] [ 333.887796] ? ath11k_info+0x56/0x60 [ath11k] [ 333.887799] ? __irq_put_desc_unlock+0x18/0x50 [ 333.887802] ath11k_pci_ce_tasklet+0x2f/0x50 [ath11k_pci] [ 333.887806] tasklet_action_common.isra.21+0xee/0x110
Quoted 8 lines
[ 333.887809] __do_softirq+0xfd/0x2bb [ 333.887814] asm_call_on_stack+0x12/0x20 [ 333.887815] </IRQ> [ 333.887819] do_softirq_own_stack+0x39/0x50 [ 333.887821] irq_exit_rcu+0x9e/0xa0 [ 333.887825] common_interrupt+0xa4/0x140 [ 333.887828] asm_common_interrupt+0x1e/0x40 [ 333.887832] RIP: 0010:cpuidle_enter_state+0xc6/0x420
Pradeep, do you have a fix for this crash?
Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 7 lines · Pradeep Kumar Chitrapu
This patch series adds 6GHz frequency listing in ath11k driver and mac80211 registration for the 6GHz band. Also, extends some of wmi command tlvs for supporting 6GHz.
changes in v5:
- latest 6ghz patches on mac80211 expects driver not to pass ht/vht caps for 6GHZ band at device registration. so fix that.
What are the dependencies for this patch? Is everything that is in mac80211-next as of today enough?
Also what I do with Rajkumar's patch:
[PATCH] ath11k: build HE 6 GHz capability
Should I apply it before or after this patchset?
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Pradeep Kumar Chitrapu
This patch series adds 6GHz frequency listing in ath11k driver and mac80211 registration for the 6GHz band. Also, extends some of wmi command tlvs for supporting 6GHz.
Quoted 6 lines
Quoted 3 lines
changes in v5:
- latest 6ghz patches on mac80211 expects driver not to pass ht/vht caps for 6GHZ band at device registration. so fix that.What are the dependencies for this patch? Is everything that is in mac80211-next as of today enough?
Yes Kalle. current mac80211-next is enough.
Quoted 6 lines
Also what I do with Rajkumar's patch:
[PATCH] ath11k: build HE 6 GHz capability
Should I apply it before or after this patchset?
Although there is no compile dependency with above patchset, there will be 6ghz functionality dependency with above. So, IMO, its better to apply after this patch set.
Thanks
Pradeep
Quoted 21 lines · Pradeep Kumar Chitrapu
Quoted 8 lines · Kalle Valo
Quoted 6 lines · Pradeep Kumar Chitrapu
This patch series adds 6GHz frequency listing in ath11k driver and mac80211
registration for the 6GHz band. Also, extends some of wmi command tlvs for
supporting 6GHz.Quoted 6 lines
Quoted 3 lines
changes in v5:
- latest 6ghz patches on mac80211 expects driver not to pass ht/vht caps for 6GHZ band at device registration. so fix that.What are the dependencies for this patch? Is everything that is in mac80211-next as of today enough?
Yes Kalle. current mac80211-next is enough.
Quoted 3 lines
Also what I do with Rajkumar's patch:
Quoted 7 lines
Quoted 3 lines
[PATCH] ath11k: build HE 6 GHz capability
Should I apply it before or after this patchset?
Although there is no compile dependency with above patchset, there will be 6ghz functionality dependency with above. So, IMO, its better to apply after this patch set.
Ok, thanks.
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches