Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / include / linux / dsa / 8021q.h
CommitLineData
f9bbe447
VO
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
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
f9bbe447
VO
23u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
24
25u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
26
27int dsa_8021q_rx_switch_id(u16 vid);
28
29int dsa_8021q_rx_source_port(u16 vid);
30
31#else
32
33int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
34 bool enabled)
35{
36 return 0;
37}
38
39struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
40 u16 tpid, u16 tci)
41{
42 return NULL;
43}
44
f9bbe447
VO
45u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port)
46{
47 return 0;
48}
49
50u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
51{
52 return 0;
53}
54
55int dsa_8021q_rx_switch_id(u16 vid)
56{
57 return 0;
58}
59
60int 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 */