diff mbox series

[4/4] wifi: mt76: declare netdev support for scatter/gather on 7915e and 7921e

Message ID 20221003093206.86323-4-nbd@nbd.name
State New
Headers show
Series [1/4] Revert "mt76: use IEEE80211_OFFLOAD_ENCAP_ENABLED instead of MT_DRV_AMSDU_OFFLOAD" | expand

Commit Message

Felix Fietkau Oct. 3, 2022, 9:32 a.m. UTC
This helps with locally generated TCP traffic to avoid unnecessary data
copying. Also bump the maximum number of fragments to the limit imposed
by the firmware txp struct.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 5 +++--
 drivers/net/wireless/mediatek/mt76/mt7921/init.c | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index d3011965451d..ff49d3837b9e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -330,7 +330,8 @@  mt7915_init_wiphy(struct ieee80211_hw *hw)
 	hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
 	hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
 	hw->netdev_features = NETIF_F_RXCSUM |
-			      NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+			      NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+			      NETIF_F_SG;
 
 	hw->radiotap_timestamp.units_pos =
 		IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US;
@@ -368,7 +369,7 @@  mt7915_init_wiphy(struct ieee80211_hw *hw)
 	ieee80211_hw_set(hw, WANT_MONITOR_VIF);
 	ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
 
-	hw->max_tx_fragments = 4;
+	hw->max_tx_fragments = 6;
 
 	if (phy->mt76->cap.has_2ghz) {
 		phy->mt76->sband_2g.sband.ht_cap.cap |=
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index b607f0a51c68..9543584abfb5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -57,6 +57,8 @@  mt7921_init_wiphy(struct ieee80211_hw *hw)
 	hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
 	hw->netdev_features = NETIF_F_RXCSUM |
 			      NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+	if (mt76_is_mmio(&dev->mt76))
+		hw->netdev_features |= NETIF_F_SG;
 
 	hw->radiotap_timestamp.units_pos =
 		IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US;
@@ -104,7 +106,7 @@  mt7921_init_wiphy(struct ieee80211_hw *hw)
 	if (dev->pm.enable)
 		ieee80211_hw_set(hw, CONNECTION_MONITOR);
 
-	hw->max_tx_fragments = 4;
+	hw->max_tx_fragments = 6;
 
 	return 0;
 }