@@ -1080,10 +1080,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
1080
1080
1081
1081
static void
1082
1082
mt7996_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 )
1084
1085
{
1085
1086
struct ieee80211_he_cap_elem * elem = & he_cap -> he_cap_elem ;
1086
1087
int sts = hweight16 (phy -> mt76 -> chainmask );
1088
+ bool non_2g = band != NL80211_BAND_2GHZ ;
1087
1089
u8 c ;
1088
1090
1089
1091
#ifdef CONFIG_MAC80211_MESH
@@ -1113,10 +1115,10 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
1113
1115
1114
1116
if (is_mt7996 (phy -> mt76 -> dev ))
1115
1117
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 ) ;
1117
1119
else
1118
1120
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 ) ;
1120
1122
1121
1123
elem -> phy_cap_info [4 ] |= c ;
1122
1124
@@ -1142,8 +1144,9 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
1142
1144
1143
1145
c = FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK ,
1144
1146
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
+
1147
1150
elem -> phy_cap_info [5 ] |= c ;
1148
1151
1149
1152
if (vif != NL80211_IFTYPE_AP )
@@ -1155,8 +1158,10 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
1155
1158
IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB ;
1156
1159
elem -> phy_cap_info [6 ] |= c ;
1157
1160
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 ;
1160
1165
elem -> phy_cap_info [7 ] |= c ;
1161
1166
}
1162
1167
@@ -1262,12 +1267,12 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band,
1262
1267
he_mcs -> rx_mcs_160 = cpu_to_le16 (mcs_map );
1263
1268
he_mcs -> tx_mcs_160 = cpu_to_le16 (mcs_map );
1264
1269
1265
- mt7996_set_stream_he_txbf_caps (phy , he_cap , iftype );
1270
+ mt7996_set_stream_he_txbf_caps (phy , he_cap , iftype , band );
1266
1271
1267
1272
memset (he_cap -> ppe_thres , 0 , sizeof (he_cap -> ppe_thres ));
1268
1273
if (he_cap_elem -> phy_cap_info [6 ] &
1269
1274
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 );
1271
1276
} else {
1272
1277
he_cap_elem -> phy_cap_info [9 ] |=
1273
1278
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,
1326
1331
1327
1332
eht_cap_elem -> phy_cap_info [1 ] =
1328
1333
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 );
1332
1335
1333
1336
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
+ }
1336
1348
1337
1349
if (band == NL80211_BAND_6GHZ ) {
1338
1350
eht_cap_elem -> phy_cap_info [0 ] |=
@@ -1393,8 +1405,13 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
1393
1405
1394
1406
eht_cap_elem -> phy_cap_info [7 ] =
1395
1407
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 ] |=
1396
1414
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ |
1397
- IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ |
1398
1415
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ ;
1399
1416
1400
1417
if (band != NL80211_BAND_6GHZ )
0 commit comments