@@ -987,6 +987,9 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
987987 struct sta_rec_ht * ht ;
988988 struct tlv * tlv ;
989989
990+ if (!sta -> ht_cap .ht_supported )
991+ return ;
992+
990993 tlv = mt76_connac_mcu_add_tlv (skb , STA_REC_HT , sizeof (* ht ));
991994
992995 ht = (struct sta_rec_ht * )tlv ;
@@ -1267,6 +1270,9 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
12671270 };
12681271 bool ebf ;
12691272
1273+ if (!(sta -> ht_cap .ht_supported || sta -> he_cap .has_he ))
1274+ return ;
1275+
12701276 ebf = mt7915_is_ebf_supported (phy , vif , sta , false);
12711277 if (!ebf && !dev -> ibf )
12721278 return ;
@@ -1327,6 +1333,9 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
13271333 struct tlv * tlv ;
13281334 u8 nrow = 0 ;
13291335
1336+ if (!(sta -> vht_cap .vht_supported || sta -> he_cap .has_he ))
1337+ return ;
1338+
13301339 if (!mt7915_is_ebf_supported (phy , vif , sta , true))
13311340 return ;
13321341
@@ -1621,6 +1630,10 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
16211630 if (sta -> he_cap .has_he ) {
16221631 ra -> supp_mode |= MODE_HE ;
16231632 cap |= STA_CAP_HE ;
1633+
1634+ if (sta -> he_6ghz_capa .capa )
1635+ ra -> af = le16_get_bits (sta -> he_6ghz_capa .capa ,
1636+ IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP );
16241637 }
16251638
16261639 ra -> sta_cap = cpu_to_le32 (cap );
@@ -1643,7 +1656,7 @@ int mt7915_mcu_add_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif,
16431656 * once dev->rc_work changes the settings driver should also
16441657 * update sta_rec_he here.
16451658 */
1646- if (sta -> he_cap . has_he && changed )
1659+ if (changed )
16471660 mt7915_mcu_sta_he_tlv (skb , sta , vif );
16481661
16491662 /* sta_rec_ra accommodates BW, NSS and only MCS range format
@@ -1712,7 +1725,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
17121725 goto out ;
17131726
17141727 /* tag order is in accordance with firmware dependency. */
1715- if (sta && sta -> ht_cap . ht_supported ) {
1728+ if (sta ) {
17161729 /* starec bfer */
17171730 mt7915_mcu_sta_bfer_tlv (dev , skb , vif , sta );
17181731 /* starec ht */
@@ -1729,7 +1742,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
17291742 return ret ;
17301743 }
17311744
1732- if (sta && sta -> ht_cap . ht_supported ) {
1745+ if (sta ) {
17331746 /* starec amsdu */
17341747 mt7915_mcu_sta_amsdu_tlv (dev , skb , vif , sta );
17351748 /* starec he */
@@ -2772,6 +2785,11 @@ int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
27722785
27732786int mt7915_mcu_set_chan_info (struct mt7915_phy * phy , int cmd )
27742787{
2788+ static const u8 ch_band [] = {
2789+ [NL80211_BAND_2GHZ ] = 0 ,
2790+ [NL80211_BAND_5GHZ ] = 1 ,
2791+ [NL80211_BAND_6GHZ ] = 2 ,
2792+ };
27752793 struct mt7915_dev * dev = phy -> dev ;
27762794 struct cfg80211_chan_def * chandef = & phy -> mt76 -> chandef ;
27772795 int freq1 = chandef -> center_freq1 ;
@@ -2799,7 +2817,7 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
27992817 .tx_streams_num = hweight8 (phy -> mt76 -> antenna_mask ),
28002818 .rx_streams = phy -> mt76 -> antenna_mask ,
28012819 .band_idx = phy -> band_idx ,
2802- .channel_band = chandef -> chan -> band ,
2820+ .channel_band = ch_band [ chandef -> chan -> band ] ,
28032821 };
28042822
28052823#ifdef CONFIG_NL80211_TESTMODE
@@ -3461,6 +3479,8 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
34613479 case MT_PHY_TYPE_OFDM :
34623480 if (mphy -> chandef .chan -> band == NL80211_BAND_5GHZ )
34633481 sband = & mphy -> sband_5g .sband ;
3482+ else if (mphy -> chandef .chan -> band == NL80211_BAND_6GHZ )
3483+ sband = & mphy -> sband_6g .sband ;
34643484 else
34653485 sband = & mphy -> sband_2g .sband ;
34663486
0 commit comments