blob: 3911e058647889d029d58a9e0d0101661ac529c3 [file] [log] [blame]
Vladimir Olteanf9bbe442019-05-05 13:19:22 +03001/* 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
10struct dsa_switch;
11struct sk_buff;
12struct net_device;
13struct packet_type;
14
15#if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
16
17int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
18 bool enabled);
19
20struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
21 u16 tpid, u16 tci);
22
23struct sk_buff *dsa_8021q_rcv(struct sk_buff *skb, struct net_device *netdev,
24 struct packet_type *pt, u16 *tpid, u16 *tci);
25
26u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
27
28u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
29
30int dsa_8021q_rx_switch_id(u16 vid);
31
32int dsa_8021q_rx_source_port(u16 vid);
33
34#else
35
36int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
37 bool enabled)
38{
39 return 0;
40}
41
42struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
43 u16 tpid, u16 tci)
44{
45 return NULL;
46}
47
48struct sk_buff *dsa_8021q_rcv(struct sk_buff *skb, struct net_device *netdev,
49 struct packet_type *pt, u16 *tpid, u16 *tci)
50{
51 return NULL;
52}
53
54u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port)
55{
56 return 0;
57}
58
59u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
60{
61 return 0;
62}
63
64int dsa_8021q_rx_switch_id(u16 vid)
65{
66 return 0;
67}
68
69int dsa_8021q_rx_source_port(u16 vid)
70{
71 return 0;
72}
73
74#endif /* IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q) */
75
76#endif /* _NET_DSA_8021Q_H */