Skip to content

Commit c3a7d7e

Browse files
Pradeep Kumar ChitrapuKalle Valo
authored andcommitted
ath11k: add 6 GHz params in peer assoc command
Currently A-MPDU aggregation parameters are not being configured during peer association for 6 GHz band. Hence, extract these parameters from station's capabilities received in association request and send to firmware. Without this, A-MPDU aggregation is not happening in 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 62b8963 commit c3a7d7e

File tree

1 file changed

+49
-1
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+49
-1
lines changed

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

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,53 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
20162016
arg->peer_bw_rxnss_override);
20172017
}
20182018

2019+
static void ath11k_peer_assoc_h_he_6ghz(struct ath11k *ar,
2020+
struct ieee80211_vif *vif,
2021+
struct ieee80211_sta *sta,
2022+
struct peer_assoc_params *arg)
2023+
{
2024+
const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
2025+
struct cfg80211_chan_def def;
2026+
enum nl80211_band band;
2027+
u8 ampdu_factor;
2028+
2029+
if (WARN_ON(ath11k_mac_vif_chan(vif, &def)))
2030+
return;
2031+
2032+
band = def.chan->band;
2033+
2034+
if (!arg->he_flag || band != NL80211_BAND_6GHZ || !sta->he_6ghz_capa.capa)
2035+
return;
2036+
2037+
if (sta->bandwidth == IEEE80211_STA_RX_BW_80)
2038+
arg->bw_80 = true;
2039+
2040+
if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
2041+
arg->bw_160 = true;
2042+
2043+
arg->peer_he_caps_6ghz = le16_to_cpu(sta->he_6ghz_capa.capa);
2044+
arg->peer_mpdu_density =
2045+
ath11k_parse_mpdudensity(FIELD_GET(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START,
2046+
arg->peer_he_caps_6ghz));
2047+
2048+
/* From IEEE Std 802.11ax-2021 - Section 10.12.2: An HE STA shall be capable of
2049+
* receiving A-MPDU where the A-MPDU pre-EOF padding length is up to the value
2050+
* indicated by the Maximum A-MPDU Length Exponent Extension field in the HE
2051+
* Capabilities element and the Maximum A-MPDU Length Exponent field in HE 6 GHz
2052+
* Band Capabilities element in the 6 GHz band.
2053+
*
2054+
* Here, we are extracting the Max A-MPDU Exponent Extension from HE caps and
2055+
* factor is the Maximum A-MPDU Length Exponent from HE 6 GHZ Band capability.
2056+
*/
2057+
ampdu_factor = FIELD_GET(IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK,
2058+
he_cap->he_cap_elem.mac_cap_info[3]) +
2059+
FIELD_GET(IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP,
2060+
arg->peer_he_caps_6ghz);
2061+
2062+
arg->peer_max_mpdu = (1u << (IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR +
2063+
ampdu_factor)) - 1;
2064+
}
2065+
20192066
static void ath11k_peer_assoc_h_smps(struct ieee80211_sta *sta,
20202067
struct peer_assoc_params *arg)
20212068
{
@@ -2305,6 +2352,7 @@ static void ath11k_peer_assoc_prepare(struct ath11k *ar,
23052352
ath11k_peer_assoc_h_ht(ar, vif, sta, arg);
23062353
ath11k_peer_assoc_h_vht(ar, vif, sta, arg);
23072354
ath11k_peer_assoc_h_he(ar, vif, sta, arg);
2355+
ath11k_peer_assoc_h_he_6ghz(ar, vif, sta, arg);
23082356
ath11k_peer_assoc_h_qos(ar, vif, sta, arg);
23092357
ath11k_peer_assoc_h_smps(sta, arg);
23102358

@@ -7598,7 +7646,7 @@ static int __ath11k_mac_register(struct ath11k *ar)
75987646
if (cap->nss_ratio_enabled)
75997647
ieee80211_hw_set(ar->hw, SUPPORTS_VHT_EXT_NSS_BW);
76007648

7601-
if (ht_cap & WMI_HT_CAP_ENABLED) {
7649+
if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) {
76027650
ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION);
76037651
ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW);
76047652
ieee80211_hw_set(ar->hw, SUPPORTS_REORDERING_BUFFER);

0 commit comments

Comments
 (0)