1 /* SPDX-License-Identifier: GPL-2.0
2 * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
3 */
4
5 #ifndef _NET_DSA_8021Q_H
6 #define _NET_DSA_8021Q_H
7
8 #include <linux/types.h>
9
10 struct dsa_switch;
11 struct sk_buff;
12 struct net_device;
13 struct packet_type;
14
15 #if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
16
17 int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
18 bool enabled);
19
20 struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
21 u16 tpid, u16 tci);
22
23 u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
24
25 u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
26
27 int dsa_8021q_rx_switch_id(u16 vid);
28
29 int dsa_8021q_rx_source_port(u16 vid);
30
31 #else
32
dsa_port_setup_8021q_tagging(struct dsa_switch * ds,int index,bool enabled)33 int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
34 bool enabled)
35 {
36 return 0;
37 }
38
dsa_8021q_xmit(struct sk_buff * skb,struct net_device * netdev,u16 tpid,u16 tci)39 struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
40 u16 tpid, u16 tci)
41 {
42 return NULL;
43 }
44
dsa_8021q_tx_vid(struct dsa_switch * ds,int port)45 u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port)
46 {
47 return 0;
48 }
49
dsa_8021q_rx_vid(struct dsa_switch * ds,int port)50 u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
51 {
52 return 0;
53 }
54
dsa_8021q_rx_switch_id(u16 vid)55 int dsa_8021q_rx_switch_id(u16 vid)
56 {
57 return 0;
58 }
59
dsa_8021q_rx_source_port(u16 vid)60 int dsa_8021q_rx_source_port(u16 vid)
61 {
62 return 0;
63 }
64
65 #endif /* IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q) */
66
67 #endif /* _NET_DSA_8021Q_H */
68