Skip to content

Commit 37b5e57

Browse files
MeiChia Chiunbd168
authored andcommitted
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: Ryder Lee <[email protected]> Signed-off-by: Money Wang <[email protected]> Signed-off-by: MeiChia Chiu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 3f71ff0 commit 37b5e57

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -905,18 +905,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
905905
struct tlv *tlv;
906906
u32 flags = 0;
907907

908-
if (sta->ht_cap.ht_supported) {
908+
if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
909909
tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
910910
wtbl_tlv, sta_wtbl);
911911
ht = (struct wtbl_ht *)tlv;
912912
ht->ldpc = ht_ldpc &&
913913
!!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
914-
ht->af = sta->ht_cap.ampdu_factor;
915-
ht->mm = sta->ht_cap.ampdu_density;
914+
915+
if (sta->ht_cap.ht_supported) {
916+
ht->af = sta->ht_cap.ampdu_factor;
917+
ht->mm = sta->ht_cap.ampdu_density;
918+
} else {
919+
ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
920+
IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
921+
ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
922+
IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
923+
}
924+
916925
ht->ht = true;
917926
}
918927

919-
if (sta->vht_cap.vht_supported) {
928+
if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
920929
struct wtbl_vht *vht;
921930
u8 af;
922931

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

12431252
if (he_cap && he_cap->has_he)
12441253
mode |= PHY_MODE_AX_24G;
1245-
} else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) {
1254+
} else if (band == NL80211_BAND_5GHZ) {
12461255
mode |= PHY_MODE_A;
12471256

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

1254-
if (he_cap && he_cap->has_he && band == NL80211_BAND_5GHZ)
1263+
if (he_cap && he_cap->has_he)
12551264
mode |= PHY_MODE_AX_5G;
1265+
} else if (band == NL80211_BAND_6GHZ) {
1266+
mode |= PHY_MODE_A | PHY_MODE_AN |
1267+
PHY_MODE_AC | PHY_MODE_AX_5G;
12561268
}
12571269

12581270
return mode;

0 commit comments

Comments
 (0)