c1e74ceeeb5bf9f5fe1ef6447ff74a9edd02bca8
[openwrt/staging/ldir.git] /
1 From 3ec762fb13c7e7273800b94c80db1c2cc37590d1 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Wed, 2 Feb 2022 01:03:23 +0100
4 Subject: [PATCH 04/16] net: dsa: tag_qca: move define to include linux/dsa
5
6 Move tag_qca define to include dir linux/dsa as the qca8k require access
7 to the tagger define to support in-band mdio read/write using ethernet
8 packet.
9
10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
11 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
12 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 include/linux/dsa/tag_qca.h | 21 +++++++++++++++++++++
16 net/dsa/tag_qca.c | 16 +---------------
17 2 files changed, 22 insertions(+), 15 deletions(-)
18 create mode 100644 include/linux/dsa/tag_qca.h
19
20 --- /dev/null
21 +++ b/include/linux/dsa/tag_qca.h
22 @@ -0,0 +1,21 @@
23 +/* SPDX-License-Identifier: GPL-2.0 */
24 +
25 +#ifndef __TAG_QCA_H
26 +#define __TAG_QCA_H
27 +
28 +#define QCA_HDR_LEN 2
29 +#define QCA_HDR_VERSION 0x2
30 +
31 +#define QCA_HDR_RECV_VERSION GENMASK(15, 14)
32 +#define QCA_HDR_RECV_PRIORITY GENMASK(13, 11)
33 +#define QCA_HDR_RECV_TYPE GENMASK(10, 6)
34 +#define QCA_HDR_RECV_FRAME_IS_TAGGED BIT(3)
35 +#define QCA_HDR_RECV_SOURCE_PORT GENMASK(2, 0)
36 +
37 +#define QCA_HDR_XMIT_VERSION GENMASK(15, 14)
38 +#define QCA_HDR_XMIT_PRIORITY GENMASK(13, 11)
39 +#define QCA_HDR_XMIT_CONTROL GENMASK(10, 8)
40 +#define QCA_HDR_XMIT_FROM_CPU BIT(7)
41 +#define QCA_HDR_XMIT_DP_BIT GENMASK(6, 0)
42 +
43 +#endif /* __TAG_QCA_H */
44 --- a/net/dsa/tag_qca.c
45 +++ b/net/dsa/tag_qca.c
46 @@ -5,24 +5,10 @@
47
48 #include <linux/etherdevice.h>
49 #include <linux/bitfield.h>
50 +#include <linux/dsa/tag_qca.h>
51
52 #include "dsa_priv.h"
53
54 -#define QCA_HDR_LEN 2
55 -#define QCA_HDR_VERSION 0x2
56 -
57 -#define QCA_HDR_RECV_VERSION GENMASK(15, 14)
58 -#define QCA_HDR_RECV_PRIORITY GENMASK(13, 11)
59 -#define QCA_HDR_RECV_TYPE GENMASK(10, 6)
60 -#define QCA_HDR_RECV_FRAME_IS_TAGGED BIT(3)
61 -#define QCA_HDR_RECV_SOURCE_PORT GENMASK(2, 0)
62 -
63 -#define QCA_HDR_XMIT_VERSION GENMASK(15, 14)
64 -#define QCA_HDR_XMIT_PRIORITY GENMASK(13, 11)
65 -#define QCA_HDR_XMIT_CONTROL GENMASK(10, 8)
66 -#define QCA_HDR_XMIT_FROM_CPU BIT(7)
67 -#define QCA_HDR_XMIT_DP_BIT GENMASK(6, 0)
68 -
69 static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
70 {
71 struct dsa_port *dp = dsa_slave_to_port(dev);