1 /* SPDX-License-Identifier: GPL-2.0
5 #ifndef _NET_DSA_8021Q_H
6 #define _NET_DSA_8021Q_H
8 #include <linux/types.h>
15 struct dsa_8021q_crosschip_link {
16 struct list_head list;
18 struct dsa_switch *other_ds;
23 #define DSA_8021Q_N_SUBVLAN 8
25 #if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
27 int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
30 int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
31 struct dsa_switch *other_ds,
33 struct list_head *crosschip_links);
35 int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
36 struct dsa_switch *other_ds,
38 struct list_head *crosschip_links);
40 struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
43 u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
45 u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
47 u16 dsa_8021q_rx_vid_subvlan(struct dsa_switch *ds, int port, u16 subvlan);
49 int dsa_8021q_rx_switch_id(u16 vid);
51 int dsa_8021q_rx_source_port(u16 vid);
53 u16 dsa_8021q_rx_subvlan(u16 vid);
55 bool vid_is_dsa_8021q(u16 vid);
59 int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
65 int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
66 struct dsa_switch *other_ds,
68 struct list_head *crosschip_links)
73 int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
74 struct dsa_switch *other_ds,
76 struct list_head *crosschip_links)
81 struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
87 u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port)
92 u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
97 u16 dsa_8021q_rx_vid_subvlan(struct dsa_switch *ds, int port, u16 subvlan)
102 int dsa_8021q_rx_switch_id(u16 vid)
107 int dsa_8021q_rx_source_port(u16 vid)
112 u16 dsa_8021q_rx_subvlan(u16 vid)
117 bool vid_is_dsa_8021q(u16 vid)
122 #endif /* IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q) */
124 #endif /* _NET_DSA_8021Q_H */