Skip to content

Commit 6f4d703

Browse files
Pradeep Kumar ChitrapuKalle Valo
authored andcommitted
ath11k: support SMPS configuration for 6 GHz
Parse SMPS configuration from IEs and configure. Without this, SMPS is not enabled for 6 GHz band. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1 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 c3a7d7e commit 6f4d703

File tree

1 file changed

+21
-10
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+21
-10
lines changed

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,11 +2069,16 @@ static void ath11k_peer_assoc_h_smps(struct ieee80211_sta *sta,
20692069
const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
20702070
int smps;
20712071

2072-
if (!ht_cap->ht_supported)
2072+
if (!ht_cap->ht_supported && !sta->he_6ghz_capa.capa)
20732073
return;
20742074

2075-
smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
2076-
smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
2075+
if (ht_cap->ht_supported) {
2076+
smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
2077+
smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
2078+
} else {
2079+
smps = FIELD_GET(IEEE80211_HE_6GHZ_CAP_SM_PS,
2080+
le16_to_cpu(sta->he_6ghz_capa.capa));
2081+
}
20772082

20782083
switch (smps) {
20792084
case WLAN_HT_CAP_SM_PS_STATIC:
@@ -2361,15 +2366,20 @@ static void ath11k_peer_assoc_prepare(struct ath11k *ar,
23612366

23622367
static int ath11k_setup_peer_smps(struct ath11k *ar, struct ath11k_vif *arvif,
23632368
const u8 *addr,
2364-
const struct ieee80211_sta_ht_cap *ht_cap)
2369+
const struct ieee80211_sta_ht_cap *ht_cap,
2370+
u16 he_6ghz_capa)
23652371
{
23662372
int smps;
23672373

2368-
if (!ht_cap->ht_supported)
2374+
if (!ht_cap->ht_supported && !he_6ghz_capa)
23692375
return 0;
23702376

2371-
smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
2372-
smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
2377+
if (ht_cap->ht_supported) {
2378+
smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS;
2379+
smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT;
2380+
} else {
2381+
smps = FIELD_GET(IEEE80211_HE_6GHZ_CAP_SM_PS, he_6ghz_capa);
2382+
}
23732383

23742384
if (smps >= ARRAY_SIZE(ath11k_smps_map))
23752385
return -EINVAL;
@@ -2422,7 +2432,8 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,
24222432
}
24232433

24242434
ret = ath11k_setup_peer_smps(ar, arvif, bss_conf->bssid,
2425-
&ap_sta->ht_cap);
2435+
&ap_sta->ht_cap,
2436+
le16_to_cpu(ap_sta->he_6ghz_capa.capa));
24262437
if (ret) {
24272438
ath11k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n",
24282439
arvif->vdev_id, ret);
@@ -3714,7 +3725,7 @@ static int ath11k_station_assoc(struct ath11k *ar,
37143725
return 0;
37153726

37163727
ret = ath11k_setup_peer_smps(ar, arvif, sta->addr,
3717-
&sta->ht_cap);
3728+
&sta->ht_cap, le16_to_cpu(sta->he_6ghz_capa.capa));
37183729
if (ret) {
37193730
ath11k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n",
37203731
arvif->vdev_id, ret);
@@ -7661,7 +7672,7 @@ static int __ath11k_mac_register(struct ath11k *ar)
76617672
* for each band for a dual band capable radio. It will be tricky to
76627673
* handle it when the ht capability different for each band.
76637674
*/
7664-
if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)
7675+
if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
76657676
ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
76667677

76677678
ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;

0 commit comments

Comments
 (0)