From: Pradeep Kumar Chitrapu Date: Wed, 12 Jun 2024 22:53:36 +0000 (-0700) Subject: wifi: ath12k: fix legacy peer association due to missing HT or 6 GHz capabilities X-Git-Tag: v6.11-rc1~163^2~49^2~44^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3005c63a3673eaf3202b2e0c951e5092539bf758;p=thirdparty%2Fkernel%2Fstable.git wifi: ath12k: fix legacy peer association due to missing HT or 6 GHz capabilities Currently SMPS configuration failed when the Information Elements (IEs) did not contain HT or 6 GHz capabilities. This caused legacy peer association to fail as legacy peers do not have HT or 6 GHz capabilities. Fix this by not returning an error when SMPS configuration fails due to the absence of HT or 6 GHz capabilities. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Fixes: f0e61dc7ecf9 ("wifi: ath12k: refactor SMPS configuration") Reported-by: Aditya Kumar Singh Reported-by: Zachary Smith Closes: https://lore.kernel.org/all/CAM=znoFPcXrn5GhDmDmo50Syic3-hXpWvD+vkv8KX5o_ZTo8kQ@mail.gmail.com/ Signed-off-by: Pradeep Kumar Chitrapu Reported-by: Aditya Kumar Singh Signed-off-by: Kalle Valo Link: https://patch.msgid.link/20240612225336.2303119-1-quic_pradeepc@quicinc.com --- diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 2a4ca73dfc22c..af19870eb8c05 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -2257,9 +2257,6 @@ 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 && !he_6ghz_capa->capa) - return -EOPNOTSUPP; - if (ht_cap->ht_supported) *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS); else @@ -2279,6 +2276,9 @@ static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta, const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap; int smps; + if (!ht_cap->ht_supported && !he_6ghz_capa->capa) + return; + if (ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps)) return; @@ -2758,6 +2758,9 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif, { int smps, ret = 0; + if (!ht_cap->ht_supported && !he_6ghz_capa) + return 0; + ret = ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps); if (ret < 0) return ret;