Commit 37b5e57b authored by MeiChia Chiu's avatar MeiChia Chiu Committed by Felix Fietkau
Browse files

mt76: connac: add 6 GHz support for wtbl and starec configuration



Since there are no HT & VHT IEs being sent in 6ghz,
some capabilities judgement and parsing for wtbl &
starec configuration should be modified to reflect such changes.

Reviewed-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarMoney Wang <Money.Wang@mediatek.com>
Signed-off-by: default avatarMeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 3f71ff08
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -905,18 +905,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
	struct tlv *tlv;
	u32 flags = 0;

	if (sta->ht_cap.ht_supported) {
	if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
		tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
						     wtbl_tlv, sta_wtbl);
		ht = (struct wtbl_ht *)tlv;
		ht->ldpc = ht_ldpc &&
			   !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);

		if (sta->ht_cap.ht_supported) {
			ht->af = sta->ht_cap.ampdu_factor;
			ht->mm = sta->ht_cap.ampdu_density;
		} else {
			ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
					       IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
			ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
					       IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
		}

		ht->ht = true;
	}

	if (sta->vht_cap.vht_supported) {
	if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
		struct wtbl_vht *vht;
		u8 af;

@@ -1242,7 +1251,7 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,

		if (he_cap && he_cap->has_he)
			mode |= PHY_MODE_AX_24G;
	} else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) {
	} else if (band == NL80211_BAND_5GHZ) {
		mode |= PHY_MODE_A;

		if (ht_cap->ht_supported)
@@ -1251,8 +1260,11 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
		if (vht_cap->vht_supported)
			mode |= PHY_MODE_AC;

		if (he_cap && he_cap->has_he && band == NL80211_BAND_5GHZ)
		if (he_cap && he_cap->has_he)
			mode |= PHY_MODE_AX_5G;
	} else if (band == NL80211_BAND_6GHZ) {
		mode |= PHY_MODE_A | PHY_MODE_AN |
			PHY_MODE_AC | PHY_MODE_AX_5G;
	}

	return mode;