diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c index fd60123f..e1554e88 100644 --- a/mt76_connac_mac.c +++ b/mt76_connac_mac.c @@ -337,6 +337,9 @@ mt76_connac2_mac_write_txwi_8023(__le32 *txwi, struct sk_buff *skb, wmm = sta->wme; } + val = FIELD_PREP(MT_TXD0_ETH_TYPE_OFFSET, 10); + txwi[0] |= cpu_to_le32(val); + val = FIELD_PREP(MT_TXD1_HDR_FORMAT, MT_HDR_FORMAT_802_3) | FIELD_PREP(MT_TXD1_TID, tid); @@ -356,6 +359,8 @@ mt76_connac2_mac_write_txwi_8023(__le32 *txwi, struct sk_buff *skb, val = FIELD_PREP(MT_TXD7_TYPE, fc_type) | FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype); + if (skb->ip_summed == CHECKSUM_PARTIAL) + val |= MT_TXD7_IP_SUM | MT_TXD7_UDP_TCP_SUM; txwi[7] |= cpu_to_le32(val); } diff --git a/mt7915/init.c b/mt7915/init.c index e56c562b..4b15257d 100644 --- a/mt7915/init.c +++ b/mt7915/init.c @@ -329,7 +329,9 @@ mt7915_init_wiphy(struct ieee80211_hw *hw) hw->queues = 4; 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_SG; + hw->netdev_features = NETIF_F_RXCSUM | NETIF_F_SG | + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | + NETIF_F_GSO_SOFTWARE; hw->radiotap_timestamp.units_pos = IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US; diff --git a/mt7915/main.c b/mt7915/main.c index fe5ec166..998696ad 100644 --- a/mt7915/main.c +++ b/mt7915/main.c @@ -248,9 +248,13 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, mtxq->wcid = idx; } + vif->netdev_features &= ~NETIF_F_GSO_SOFTWARE; if (vif->type != NL80211_IFTYPE_AP && - (!mvif->mt76.omac_idx || mvif->mt76.omac_idx > 3)) + (!mvif->mt76.omac_idx || mvif->mt76.omac_idx > 3)) { vif->offload_flags = 0; + vif->netdev_features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); + } + vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR; mt7915_init_bitrate_mask(vif); diff --git a/mt7921/init.c b/mt7921/init.c index 5b2905d1..6de5b1c4 100644 --- a/mt7921/init.c +++ b/mt7921/init.c @@ -55,7 +55,9 @@ mt7921_init_wiphy(struct ieee80211_hw *hw) hw->queues = 4; hw->max_rx_aggregation_subframes = 256; hw->max_tx_aggregation_subframes = 256; - hw->netdev_features = NETIF_F_RXCSUM; + hw->netdev_features = NETIF_F_RXCSUM | + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | + NETIF_F_GSO_SOFTWARE; if (mt76_is_mmio(&dev->mt76)) hw->netdev_features |= NETIF_F_SG; diff --git a/mt7921/main.c b/mt7921/main.c index 00085b12..867b9bf9 100644 --- a/mt7921/main.c +++ b/mt7921/main.c @@ -352,6 +352,7 @@ static int mt7921_add_interface(struct ieee80211_hw *hw, } vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER; + vif->netdev_features &= ~NETIF_F_GSO_SOFTWARE; out: mt7921_mutex_release(dev); diff --git a/tx.c b/tx.c index 65e2b7c1..e34de1c0 100644 --- a/tx.c +++ b/tx.c @@ -312,16 +312,18 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, struct mt76_queue *q; int qid = skb_get_queue_mapping(skb); - if (mt76_testmode_enabled(phy)) { - ieee80211_free_txskb(phy->hw, skb); - return; - } + if (mt76_testmode_enabled(phy)) + goto free; if (WARN_ON(qid >= MT_TXQ_PSD)) { qid = MT_TXQ_BE; skb_set_queue_mapping(skb, qid); } + if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) + goto free; + if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && !ieee80211_is_data(hdr->frame_control) && @@ -340,6 +342,10 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, __mt76_tx_queue_skb(phy, qid, skb, wcid, sta, NULL); dev->queue_ops->kick(dev, q); spin_unlock_bh(&q->lock); + return; + +free: + ieee80211_free_txskb(phy->hw, skb); } EXPORT_SYMBOL_GPL(mt76_tx);