diff options
author | Andrew Lunn <andrew@lunn.ch> | 2015-08-17 23:52:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-18 23:17:21 +0200 |
commit | 60045cbfc0b291dae8dd5b929d67b87c5ea954d4 (patch) | |
tree | 7053a2ad7bef68e758e0a9923ef632eccddcd61a /include | |
parent | net: dsa: Allow multi hop routes to be expressed (diff) | |
download | linux-60045cbfc0b291dae8dd5b929d67b87c5ea954d4.tar.xz linux-60045cbfc0b291dae8dd5b929d67b87c5ea954d4.zip |
net: dsa: Add dsa_is_dsa_port() helper
Add an inline helper for determining is a port is a DSA port.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/dsa.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index bd9b76502458..b34d812bc5d0 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -171,6 +171,11 @@ static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) return !!(ds->index == ds->dst->cpu_switch && p == ds->dst->cpu_port); } +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_port_initialized(struct dsa_switch *ds, int p) { return ds->phys_port_mask & (1 << p) && ds->ports[p]; |