Skip to content

Commit 8fedaac

Browse files
ffainellikuba-moo
authored andcommitted
net: dsa: tag_rtl4_a: Use existing ETH_P_REALTEK constant
No functional change, uses the existing ETH_P_REALTEK constant already defined in if_ether.h. Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 89cdf9d commit 8fedaac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

net/dsa/tag_rtl4_a.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#define RTL4_A_NAME "rtl4a"
2424

2525
#define RTL4_A_HDR_LEN 4
26-
#define RTL4_A_ETHERTYPE 0x8899
2726
#define RTL4_A_PROTOCOL_SHIFT 12
2827
/*
2928
* 0x1 = Realtek Remote Control protocol (RRCP)
@@ -54,7 +53,7 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb,
5453

5554
/* Set Ethertype */
5655
p = (__be16 *)tag;
57-
*p = htons(RTL4_A_ETHERTYPE);
56+
*p = htons(ETH_P_REALTEK);
5857

5958
out = (RTL4_A_PROTOCOL_RTL8366RB << RTL4_A_PROTOCOL_SHIFT);
6059
/* The lower bits indicate the port number */
@@ -82,7 +81,7 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb,
8281
tag = dsa_etype_header_pos_rx(skb);
8382
p = (__be16 *)tag;
8483
etype = ntohs(*p);
85-
if (etype != RTL4_A_ETHERTYPE) {
84+
if (etype != ETH_P_REALTEK) {
8685
/* Not custom, just pass through */
8786
netdev_dbg(dev, "non-realtek ethertype 0x%04x\n", etype);
8887
return skb;

0 commit comments

Comments
 (0)