summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot2017-03-11 22:12:58 +0100
committerDavid S. Miller2017-03-13 07:54:07 +0100
commit6cd456f38207b56ba18c444d50fe49a7fe8b2a0a (patch)
treed7b16a373fa4440f89d323dddf424a62d046e0af /include/net/dsa.h
parentnet: dsa: mv88e6xxx: rename the port vector member (diff)
downloadkernel-qcow2-linux-6cd456f38207b56ba18c444d50fe49a7fe8b2a0a.tar.gz
kernel-qcow2-linux-6cd456f38207b56ba18c444d50fe49a7fe8b2a0a.tar.xz
kernel-qcow2-linux-6cd456f38207b56ba18c444d50fe49a7fe8b2a0a.zip
net: dsa: add dsa_is_normal_port helper
Introduce a dsa_is_normal_port helper to check if a given port is a normal user port as opposed to a CPU port or DSA link. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 4e13e695f025..bf0e42c2a6f7 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -248,6 +248,11 @@ static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
return !!((ds->dsa_port_mask) & (1 << p));
}
+static inline bool dsa_is_normal_port(struct dsa_switch *ds, int p)
+{
+ return !dsa_is_cpu_port(ds, p) && !dsa_is_dsa_port(ds, p);
+}
+
static inline bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
{
return ds->enabled_port_mask & (1 << p) && ds->ports[p].netdev;