diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-08-10 16:13:56 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-11 14:44:58 +0100 |
commit | a72808b65834e99534f6c5c7134c201c72fe92aa (patch) | |
tree | 86986d9a367b3af440a2567c6294769ffd49eeb0 /net/dsa/tag_lan9303.c | |
parent | 5d928ff4865641309e39e9ec8eec1022f8a0c0ac (diff) | |
download | linux-a72808b65834e99534f6c5c7134c201c72fe92aa.tar.bz2 |
net: dsa: create a helper for locating EtherType DSA headers on TX
Create a similar helper for locating the offset to the DSA header
relative to skb->data, and make the existing EtherType header taggers to
use it.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_lan9303.c')
-rw-r--r-- | net/dsa/tag_lan9303.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c index d06951273127..cb548188f813 100644 --- a/net/dsa/tag_lan9303.c +++ b/net/dsa/tag_lan9303.c @@ -64,7 +64,8 @@ static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device *dev) /* make room between MACs and Ether-Type */ dsa_alloc_etype_header(skb, LAN9303_TAG_LEN); - lan9303_tag = (__be16 *)(skb->data + 2 * ETH_ALEN); + lan9303_tag = dsa_etype_header_pos_tx(skb); + tag = lan9303_xmit_use_arl(dp, skb->data) ? LAN9303_TAG_TX_USE_ALR : dp->index | LAN9303_TAG_TX_STP_OVERRIDE; |