aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-26 11:22:57 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-28 00:00:09 +0900
commit057cad2c59d73b0c4a6638546f3099d6fb444094 (patch)
treed5e2c457e3000a1f2e699dac1668320c4a2f66f2 /include/net/dsa.h
parentnet: dsa: introduce dsa_user_ports helper (diff)
downloadwireguard-linux-057cad2c59d73b0c4a6638546f3099d6fb444094.tar.xz
wireguard-linux-057cad2c59d73b0c4a6638546f3099d6fb444094.zip
net: dsa: define port types
Introduce an enumerated type for ports, which will be way more explicit to identify a port type instead of digging into switch port masks. A port can be of type CPU, DSA, user, or unused by default. This is a static parsed information that cannot be changed at runtime. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index dc7728062396..8da20c4a6552 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -180,6 +180,13 @@ struct dsa_port {
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt);
+ enum {
+ DSA_PORT_TYPE_UNUSED = 0,
+ DSA_PORT_TYPE_CPU,
+ DSA_PORT_TYPE_DSA,
+ DSA_PORT_TYPE_USER,
+ } type;
+
struct dsa_switch *ds;
unsigned int index;
const char *name;