wifi: mt76: mt7996: adjust HW capabilities for mt7990
authorPeter Chiu <chui-hao.chiu@mediatek.com>
Wed, 9 Apr 2025 14:07:47 +0000 (22:07 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 May 2025 12:49:38 +0000 (14:49 +0200)
This is a preliminary patch to support mt7990 chipset.

Co-developed-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Link: https://patch.msgid.link/20250409140750.724437-8-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7996/init.c
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

index a4c2986fcffd094e7d0a911544c3dfe172523d38..9a8b10c50f72465270342c720fa277227092bb68 100644 (file)
@@ -440,6 +440,9 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
        hw->queues = 4;
        hw->max_rx_aggregation_subframes = max_subframes;
        hw->max_tx_aggregation_subframes = max_subframes;
+       if (is_mt7990(mdev) && dev->has_eht)
+               hw->max_tx_aggregation_subframes = 512;
+
        hw->netdev_features = NETIF_F_RXCSUM;
        if (mtk_wed_device_active(wed))
                hw->netdev_features |= NETIF_F_HW_TC;
@@ -1064,10 +1067,10 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
        *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
                IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
 
-       if (is_mt7996(phy->mt76->dev))
-               *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 3);
-       else
+       if (is_mt7992(phy->mt76->dev))
                *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 4);
+       else
+               *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 3);
 
        *cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK |
                  IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
index 2dd33f303a065401818af867d01259ecbe14bf05..92b01ed82e7e7b610dc7185284e5bfb70cc6eaeb 100644 (file)
@@ -14,7 +14,7 @@
 #define MT7996_MAX_RADIOS              3
 #define MT7996_MAX_INTERFACES          19      /* per-band */
 #define MT7996_MAX_WMM_SETS            4
-#define MT7996_WTBL_BMC_SIZE           (is_mt7992(&dev->mt76) ? 32 : 64)
+#define MT7996_WTBL_BMC_SIZE           (is_mt7996(&dev->mt76) ? 64 : 32)
 #define MT7996_WTBL_RESERVED           (mt7996_wtbl_size(dev) - 1)
 #define MT7996_WTBL_STA                        (MT7996_WTBL_RESERVED - \
                                         mt7996_max_interface_num(dev))
@@ -482,7 +482,7 @@ mt7996_phy3(struct mt7996_dev *dev)
 static inline bool
 mt7996_band_valid(struct mt7996_dev *dev, u8 band)
 {
-       if (is_mt7992(&dev->mt76))
+       if (!is_mt7996(&dev->mt76))
                return band <= MT_BAND1;
 
        return band <= MT_BAND2;