@@ -1080,10 +1080,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
10801080
10811081static void
10821082mt7996_set_stream_he_txbf_caps (struct mt7996_phy * phy ,
1083- struct ieee80211_sta_he_cap * he_cap , int vif )
1083+ struct ieee80211_sta_he_cap * he_cap , int vif ,
1084+ enum nl80211_band band )
10841085{
10851086 struct ieee80211_he_cap_elem * elem = & he_cap -> he_cap_elem ;
10861087 int sts = hweight16 (phy -> mt76 -> chainmask );
1088+ bool non_2g = band != NL80211_BAND_2GHZ ;
10871089 u8 c ;
10881090
10891091#ifdef CONFIG_MAC80211_MESH
@@ -1113,10 +1115,10 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
11131115
11141116 if (is_mt7996 (phy -> mt76 -> dev ))
11151117 c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
1116- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 ;
1118+ ( IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 * non_2g ) ;
11171119 else
11181120 c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 |
1119- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 ;
1121+ ( IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 * non_2g ) ;
11201122
11211123 elem -> phy_cap_info [4 ] |= c ;
11221124
@@ -1142,8 +1144,9 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
11421144
11431145 c = FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK ,
11441146 sts - 1 ) |
1145- FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK ,
1146- sts - 1 );
1147+ (FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK ,
1148+ sts - 1 ) * non_2g );
1149+
11471150 elem -> phy_cap_info [5 ] |= c ;
11481151
11491152 if (vif != NL80211_IFTYPE_AP )
@@ -1155,8 +1158,10 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
11551158 IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB ;
11561159 elem -> phy_cap_info [6 ] |= c ;
11571160
1158- c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ |
1159- IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ ;
1161+ c = 0 ;
1162+ if (non_2g )
1163+ c |= IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ |
1164+ IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ ;
11601165 elem -> phy_cap_info [7 ] |= c ;
11611166}
11621167
@@ -1262,12 +1267,12 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band,
12621267 he_mcs -> rx_mcs_160 = cpu_to_le16 (mcs_map );
12631268 he_mcs -> tx_mcs_160 = cpu_to_le16 (mcs_map );
12641269
1265- mt7996_set_stream_he_txbf_caps (phy , he_cap , iftype );
1270+ mt7996_set_stream_he_txbf_caps (phy , he_cap , iftype , band );
12661271
12671272 memset (he_cap -> ppe_thres , 0 , sizeof (he_cap -> ppe_thres ));
12681273 if (he_cap_elem -> phy_cap_info [6 ] &
12691274 IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT ) {
1270- mt76_connac_gen_ppe_thresh (he_cap -> ppe_thres , nss );
1275+ mt76_connac_gen_ppe_thresh (he_cap -> ppe_thres , nss , band );
12711276 } else {
12721277 he_cap_elem -> phy_cap_info [9 ] |=
12731278 u8_encode_bits (IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US ,
@@ -1326,13 +1331,20 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
13261331
13271332 eht_cap_elem -> phy_cap_info [1 ] =
13281333 u8_encode_bits (u8_get_bits (val , GENMASK (2 , 1 )),
1329- IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK ) |
1330- u8_encode_bits (val ,
1331- IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK );
1334+ IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK );
13321335
13331336 eht_cap_elem -> phy_cap_info [2 ] =
1334- u8_encode_bits (sts - 1 , IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK ) |
1335- u8_encode_bits (sts - 1 , IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK );
1337+ u8_encode_bits (sts - 1 , IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK );
1338+
1339+ if (band != NL80211_BAND_2GHZ ) {
1340+ eht_cap_elem -> phy_cap_info [1 ] |=
1341+ u8_encode_bits (val ,
1342+ IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK );
1343+
1344+ eht_cap_elem -> phy_cap_info [2 ] |=
1345+ u8_encode_bits (sts - 1 ,
1346+ IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK );
1347+ }
13361348
13371349 if (band == NL80211_BAND_6GHZ ) {
13381350 eht_cap_elem -> phy_cap_info [0 ] |=
@@ -1393,8 +1405,13 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
13931405
13941406 eht_cap_elem -> phy_cap_info [7 ] =
13951407 IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ |
1408+ IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ ;
1409+
1410+ if (band == NL80211_BAND_2GHZ )
1411+ return ;
1412+
1413+ eht_cap_elem -> phy_cap_info [7 ] |=
13961414 IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ |
1397- IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ |
13981415 IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ ;
13991416
14001417 if (band != NL80211_BAND_6GHZ )
0 commit comments