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 <net/dsa.h>
9 #include <linux/types.h>
10 
11 int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto);
12 
13 void dsa_tag_8021q_unregister(struct dsa_switch *ds);
14 
15 int dsa_tag_8021q_bridge_join(struct dsa_switch *ds, int port,
16 			      struct dsa_bridge bridge);
17 
18 void dsa_tag_8021q_bridge_leave(struct dsa_switch *ds, int port,
19 				struct dsa_bridge bridge);
20 
21 u16 dsa_tag_8021q_bridge_vid(unsigned int bridge_num);
22 
23 u16 dsa_tag_8021q_standalone_vid(const struct dsa_port *dp);
24 
25 int dsa_8021q_rx_switch_id(u16 vid);
26 
27 int dsa_8021q_rx_source_port(u16 vid);
28 
29 bool vid_is_dsa_8021q(u16 vid);
30 
31 #endif /* _NET_DSA_8021Q_H */
32