Commit 00e48201 authored by Johannes Berg's avatar Johannes Berg

wifi: iwlwifi: mvm: add EHT A-MPDU size exponent support

Add support for reading the EHT MAC capabilities A-MPDU
size exponent field, as indicated by the draft spec.

Also clarify the existing code a bit and add comments
so it's clearer to understand what's going on here.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.c5e00045d90f.I7520787fca8f8430a564adedf975d069ad8c5417@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d51173c1
......@@ -60,22 +60,27 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta,
if (WARN_ON(!link_sta))
return 0;
if (link_sta->ht_cap.ht_supported)
/* Note that we always use only legacy & highest supported PPDUs, so
* of Draft P802.11be D.30 Table 10-12a--Fields used for calculating
* the maximum A-MPDU size of various PPDU types in different bands,
* we only need to worry about the highest supported PPDU type here.
*/
if (link_sta->ht_cap.ht_supported) {
agg_size = link_sta->ht_cap.ampdu_factor;
mpdu_dens = link_sta->ht_cap.ampdu_density;
}
if (link_conf->chandef.chan->band ==
NL80211_BAND_6GHZ) {
if (link_conf->chandef.chan->band == NL80211_BAND_6GHZ) {
/* overwrite HT values on 6 GHz */
mpdu_dens = le16_get_bits(link_sta->he_6ghz_capa.capa,
IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
agg_size = le16_get_bits(link_sta->he_6ghz_capa.capa,
IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
} else if (link_sta->vht_cap.vht_supported) {
agg_size = link_sta->vht_cap.cap &
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK;
agg_size >>=
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT;
} else if (link_sta->ht_cap.ht_supported) {
agg_size = link_sta->ht_cap.ampdu_factor;
/* if VHT supported overwrite HT value */
agg_size = u32_get_bits(link_sta->vht_cap.cap,
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK);
}
/* D6.0 10.12.2 A-MPDU length limit rules
......@@ -91,6 +96,10 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta,
u8_get_bits(link_sta->he_cap.he_cap_elem.mac_cap_info[3],
IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK);
if (link_sta->eht_cap.has_eht)
agg_size += u8_get_bits(link_sta->eht_cap.eht_cap_elem.mac_cap_info[1],
IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK);
/* Limit to max A-MPDU supported by FW */
agg_size = min_t(u32, agg_size,
STA_FLG_MAX_AGG_SIZE_4M >> STA_FLG_MAX_AGG_SIZE_SHIFT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment