2024-04-25 22:21:19

by Pradeep Kumar Chitrapu

[permalink] [raw]
Subject: [PATCH V4 0/6] bug fixes and enhancements to 6 GHz band support

In 6 GHz band, add support for
1. channel 2.
2. Fix packet drop issues.
3. AMPDU aggregation
4. SMPS configuration

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

changes in V4:
- add back missed changes between V2 and V3 - details below
- add acked-by tag for patches 1/6, 2/6, 3/6, 4/6
- add back missed tested-by tags per patch in V3
- Add back missed patch portion to handle disabling SMPS
configuration in 6GHz for WCN7850 in 6 GHz band in 6/6.
- capitilize smps to SMPS in patch 5/6

changes in v3:
- address review comments for fixing ath12k-check issues.

changes in v2:
- Disable smps for WCN7850 after review comment from Boachen
- Added Tested-on tag for WCN7850

Pradeep Kumar Chitrapu (6):
wifi: ath12k: add channel 2 into 6 GHz channel list
wifi: ath12k: Correct 6 GHz frequency value in rx status
wifi: ath12k: fix survey dump collection in 6 GHz
wifi: ath12k: add 6 GHz params in peer assoc command
wifi: ath12k: refactor SMPS configuration
wifi: ath12k: support SMPS configuration for 6 GHz

drivers/net/wireless/ath/ath12k/core.h | 2 +-
drivers/net/wireless/ath/ath12k/dp_rx.c | 9 +-
drivers/net/wireless/ath/ath12k/hw.c | 3 +
drivers/net/wireless/ath/ath12k/hw.h | 1 +
drivers/net/wireless/ath/ath12k/mac.c | 122 ++++++++++++++++++++----
drivers/net/wireless/ath/ath12k/wmi.c | 10 +-
6 files changed, 122 insertions(+), 25 deletions(-)


base-commit: bf99bc7423e18aa3475ef00a7a6fb773c31ce6df
--
2.17.1



2024-04-25 22:21:20

by Pradeep Kumar Chitrapu

[permalink] [raw]
Subject: [PATCH V4 2/6] wifi: ath12k: Correct 6 GHz frequency value in rx status

The frequency in the rx status is currently being filled
incorrectly for the 6 GHz band. The channel number received is
invalid in this case, resulting in packet drops. Fix this
issue by correcting the frequency calculation.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
Acked-by: Jeff Johnson <[email protected]>
---
drivers/net/wireless/ath/ath12k/dp_rx.c | 9 ++++++---
drivers/net/wireless/ath/ath12k/wmi.c | 10 +++++++---
2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index 75df622f25d8..e5fb5cb000f0 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -2383,8 +2383,10 @@ void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc,
channel_num = meta_data;
center_freq = meta_data >> 16;

- if (center_freq >= 5935 && center_freq <= 7105) {
+ if (center_freq >= ATH12K_MIN_6G_FREQ &&
+ center_freq <= ATH12K_MAX_6G_FREQ) {
rx_status->band = NL80211_BAND_6GHZ;
+ rx_status->freq = center_freq;
} else if (channel_num >= 1 && channel_num <= 14) {
rx_status->band = NL80211_BAND_2GHZ;
} else if (channel_num >= 36 && channel_num <= 173) {
@@ -2402,8 +2404,9 @@ void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc,
rx_desc, sizeof(*rx_desc));
}

- rx_status->freq = ieee80211_channel_to_frequency(channel_num,
- rx_status->band);
+ if (rx_status->band != NL80211_BAND_6GHZ)
+ rx_status->freq = ieee80211_channel_to_frequency(channel_num,
+ rx_status->band);

ath12k_dp_rx_h_rate(ar, rx_desc, rx_status);
}
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 7a52d2082b79..e88ec9e1201a 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -6022,8 +6022,10 @@ static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb)
if (rx_ev.status & WMI_RX_STATUS_ERR_MIC)
status->flag |= RX_FLAG_MMIC_ERROR;

- if (rx_ev.chan_freq >= ATH12K_MIN_6G_FREQ) {
+ if (rx_ev.chan_freq >= ATH12K_MIN_6G_FREQ &&
+ rx_ev.chan_freq <= ATH12K_MAX_6G_FREQ) {
status->band = NL80211_BAND_6GHZ;
+ status->freq = rx_ev.chan_freq;
} else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) {
status->band = NL80211_BAND_2GHZ;
} else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH12K_MAX_5G_CHAN) {
@@ -6044,8 +6046,10 @@ static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb)

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

- status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
- status->band);
+ if (status->band != NL80211_BAND_6GHZ)
+ status->freq = ieee80211_channel_to_frequency(rx_ev.channel,
+ status->band);
+
status->signal = rx_ev.snr + ATH12K_DEFAULT_NOISE_FLOOR;
status->rate_idx = ath12k_mac_bitrate_to_idx(sband, rx_ev.rate / 100);

--
2.17.1


2024-04-25 22:21:37

by Pradeep Kumar Chitrapu

[permalink] [raw]
Subject: [PATCH V4 6/6] wifi: ath12k: support SMPS configuration for 6 GHz

Parse SMPS configuration from IEs and configure. Without this,
SMPS is not enabled for 6 GHz band. This is disabled for
WCN7850 as hardware does not support it.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
---
drivers/net/wireless/ath/ath12k/hw.c | 3 +++
drivers/net/wireless/ath/ath12k/hw.h | 1 +
drivers/net/wireless/ath/ath12k/mac.c | 26 ++++++++++++++++++--------
3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index f4c827015821..a53643931c0f 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -926,6 +926,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_sta_ps = false,

.acpi_guid = NULL,
+ .supports_dynamic_smps_6ghz = true,
},
{
.name = "wcn7850 hw2.0",
@@ -1001,6 +1002,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_sta_ps = true,

.acpi_guid = &wcn7850_uuid,
+ .supports_dynamic_smps_6ghz = false,
},
{
.name = "qcn9274 hw2.0",
@@ -1071,6 +1073,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_sta_ps = false,

.acpi_guid = NULL,
+ .supports_dynamic_smps_6ghz = true,
},
};

diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h
index 3f450ee93f34..e040c3925074 100644
--- a/drivers/net/wireless/ath/ath12k/hw.h
+++ b/drivers/net/wireless/ath/ath12k/hw.h
@@ -215,6 +215,7 @@ struct ath12k_hw_params {
bool supports_sta_ps;

const guid_t *acpi_guid;
+ bool supports_dynamic_smps_6ghz;
};

struct ath12k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index d4bae41a32d4..b81475eb0e9e 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2087,12 +2087,17 @@ static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar,
}

static int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *ht_cap,
+ const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
int *smps)
{
- if (!ht_cap->ht_supported)
+ if (!ht_cap->ht_supported && !he_6ghz_capa->capa)
return -EOPNOTSUPP;

- *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS);
+ if (ht_cap->ht_supported)
+ *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS);
+ else
+ *smps = le16_get_bits(he_6ghz_capa->capa,
+ IEEE80211_HE_6GHZ_CAP_SM_PS);

if (*smps >= ARRAY_SIZE(ath12k_smps_map))
return -EINVAL;
@@ -2103,10 +2108,11 @@ static int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *ht_cap,
static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta,
struct ath12k_wmi_peer_assoc_arg *arg)
{
+ const struct ieee80211_he_6ghz_capa *he_6ghz_capa = &sta->deflink.he_6ghz_capa;
const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
int smps;

- if (ath12k_get_smps_from_capa(ht_cap, &smps))
+ if (ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps))
return;

switch (smps) {
@@ -2580,11 +2586,12 @@ static void ath12k_peer_assoc_prepare(struct ath12k *ar,

static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif,
const u8 *addr,
- const struct ieee80211_sta_ht_cap *ht_cap)
+ const struct ieee80211_sta_ht_cap *ht_cap,
+ const struct ieee80211_he_6ghz_capa *he_6ghz_capa)
{
int smps, ret = 0;

- ret = ath12k_get_smps_from_capa(ht_cap, &smps);
+ ret = ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps);
if (ret < 0)
return ret;

@@ -2637,7 +2644,8 @@ static void ath12k_bss_assoc(struct ath12k *ar,
}

ret = ath12k_setup_peer_smps(ar, arvif, bss_conf->bssid,
- &ap_sta->deflink.ht_cap);
+ &ap_sta->deflink.ht_cap,
+ &ap_sta->deflink.he_6ghz_capa);
if (ret) {
ath12k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n",
arvif->vdev_id, ret);
@@ -3944,7 +3952,8 @@ static int ath12k_station_assoc(struct ath12k *ar,
return 0;

ret = ath12k_setup_peer_smps(ar, arvif, sta->addr,
- &sta->deflink.ht_cap);
+ &sta->deflink.ht_cap,
+ &sta->deflink.he_6ghz_capa);
if (ret) {
ath12k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n",
arvif->vdev_id, ret);
@@ -8766,7 +8775,8 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
* for each band for a dual band capable radio. It will be tricky to
* handle it when the ht capability different for each band.
*/
- if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)
+ if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
+ (ar->supports_6ghz && ab->hw_params->supports_dynamic_smps_6ghz))
wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;

wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
--
2.17.1


2024-04-25 22:45:07

by Pradeep Kumar Chitrapu

[permalink] [raw]
Subject: [PATCH V4 5/6] wifi: ath12k: refactor SMPS configuration

Move fetching SMPS value to a new function and use u16_get_bits
to extract smps value from capabilities. This will help in
extending the functionality when SMPS support in 6 GHz band gets
added in subsequent patches.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 32 ++++++++++++++++-----------
1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 8836dc67f7e0..d4bae41a32d4 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2086,18 +2086,29 @@ static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar,
ampdu_factor)) - 1;
}

+static int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *ht_cap,
+ int *smps)
+{
+ if (!ht_cap->ht_supported)
+ return -EOPNOTSUPP;
+
+ *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS);
+
+ if (*smps >= ARRAY_SIZE(ath12k_smps_map))
+ return -EINVAL;
+
+ return 0;
+}
+
static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta,
struct ath12k_wmi_peer_assoc_arg *arg)
{
const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
int smps;

- if (!ht_cap->ht_supported)
+ if (ath12k_get_smps_from_capa(ht_cap, &smps))
return;

- smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
- smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
-
switch (smps) {
case WLAN_HT_CAP_SM_PS_STATIC:
arg->static_mimops_flag = true;
@@ -2571,16 +2582,11 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif,
const u8 *addr,
const struct ieee80211_sta_ht_cap *ht_cap)
{
- int smps;
+ int smps, ret = 0;

- if (!ht_cap->ht_supported)
- return 0;
-
- smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
- smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
-
- if (smps >= ARRAY_SIZE(ath12k_smps_map))
- return -EINVAL;
+ ret = ath12k_get_smps_from_capa(ht_cap, &smps);
+ if (ret < 0)
+ return ret;

return ath12k_wmi_set_peer_param(ar, addr, arvif->vdev_id,
WMI_PEER_MIMO_PS_STATE,
--
2.17.1


2024-04-25 23:41:55

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH V4 5/6] wifi: ath12k: refactor SMPS configuration

On 4/25/2024 3:19 PM, Pradeep Kumar Chitrapu wrote:
> Move fetching SMPS value to a new function and use u16_get_bits
> to extract smps value from capabilities. This will help in

s/smps/SMPS/

> extending the functionality when SMPS support in 6 GHz band gets
> added in subsequent patches.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>


2024-05-08 17:31:17

by Pradeep Kumar Chitrapu

[permalink] [raw]
Subject: Re: [PATCH V4 5/6] wifi: ath12k: refactor SMPS configuration



On 4/25/2024 4:40 PM, Jeff Johnson wrote:
> On 4/25/2024 3:19 PM, Pradeep Kumar Chitrapu wrote:
>> Move fetching SMPS value to a new function and use u16_get_bits
>> to extract smps value from capabilities. This will help in
>
> s/smps/SMPS/
>
>> extending the functionality when SMPS support in 6 GHz band gets
>> added in subsequent patches.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>>
>> Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
>
Thanks Jeff..will address in next revision