wifi: ath12k: fix ar->supports_6ghz usage during hw register

In the ath12k_mac_hw_register() function's context, ar is an iterator
variable, and there is no assurance that the last ar will be the one with
6 GHz enabled. Therefore, checking directly ar->supports_6ghz outside the
loop is not appropriate.

Additionally, 6 GHz lacks HT capabilities. To obtain the super set of
HT capabilities across all grouped radios, 6 GHz should be excluded.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-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: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241209185421.376381-9-kvalo@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Aditya Kumar Singh
2024-12-09 20:54:20 +02:00
committed by Jeff Johnson
parent 78cf6fd165
commit 72c24b1b77

View File

@@ -10723,7 +10723,10 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
if (ret)
goto err_cleanup_unregister;
ht_cap &= ht_cap_info;
/* 6 GHz does not support HT Cap, hence do not consider it */
if (!ar->supports_6ghz)
ht_cap &= ht_cap_info;
wiphy->max_ap_assoc_sta += ar->max_num_stations;
/* Advertise the max antenna support of all radios, driver can handle
@@ -10787,7 +10790,7 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
ieee80211_hw_set(hw, SUPPORTS_TX_FRAG);
ieee80211_hw_set(hw, REPORTS_LOW_ACK);
if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) {
if ((ht_cap & WMI_HT_CAP_ENABLED) || is_6ghz) {
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER);
@@ -10803,7 +10806,7 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
* handle it when the ht capability different for each band.
*/
if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
(ar->supports_6ghz && ab->hw_params->supports_dynamic_smps_6ghz))
(is_6ghz && ab->hw_params->supports_dynamic_smps_6ghz))
wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;