From e22c65cdc585dde35c27198b34e5bd99d8027864 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 2 Sep 2020 16:38:06 +0200 Subject: [PATCH] mt76: mt7915: simplify checks for the 802.3 offload path No multicast frames enter this path, so there is no need to check the ethernet header Signed-off-by: Felix Fietkau --- mt7915/mac.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/mt7915/mac.c b/mt7915/mac.c index 32060c6e..345a1552 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c @@ -568,8 +568,6 @@ mt7915_mac_write_txwi_8023(struct mt7915_dev *dev, __le32 *txwi, { u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; - struct ethhdr *ehdr = (struct ethhdr *)skb->data; - bool multicast = is_multicast_ether_addr(ehdr->h_dest); u8 fc_type, fc_stype; bool wmm = false; u32 val; @@ -579,15 +577,12 @@ mt7915_mac_write_txwi_8023(struct mt7915_dev *dev, __le32 *txwi, sta = container_of((void *)wcid, struct ieee80211_sta, drv_priv); wmm = sta->wme; - - if (test_bit(MT_WCID_FLAG_4ADDR, &wcid->flags)) - multicast = false; } val = FIELD_PREP(MT_TXD1_HDR_FORMAT, MT_HDR_FORMAT_802_3) | FIELD_PREP(MT_TXD1_TID, tid); - if (be16_to_cpu(ehdr->h_proto) >= ETH_P_802_3_MIN) + if (be16_to_cpu(skb->protocol) >= ETH_P_802_3_MIN) val |= MT_TXD1_ETH_802_3; txwi[1] |= cpu_to_le32(val); @@ -596,11 +591,7 @@ mt7915_mac_write_txwi_8023(struct mt7915_dev *dev, __le32 *txwi, fc_stype = wmm ? IEEE80211_STYPE_QOS_DATA >> 4 : 0; val = FIELD_PREP(MT_TXD2_FRAME_TYPE, fc_type) | - FIELD_PREP(MT_TXD2_SUB_TYPE, fc_stype) | - FIELD_PREP(MT_TXD2_MULTICAST, multicast); - - if (multicast) - val |= MT_TXD2_FIX_RATE; + FIELD_PREP(MT_TXD2_SUB_TYPE, fc_stype); txwi[2] |= cpu_to_le32(val);