aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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 38961ef91d3d..6b1bc1c8f7e2 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -254,6 +254,13 @@ struct dsa_switch {
struct dsa_port ports[];
};
+static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
+{
+ u32 m = ds->enabled_port_mask | ds->dsa_port_mask | ds->cpu_port_mask;
+
+ return !(m & BIT(p));
+}
+
static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
{
return !!(ds->cpu_port_mask & (1 << p));