mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-10 00:26:34 +00:00
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>
This commit is contained in:
parent
1e72e6f885
commit
60045cbfc0
2 changed files with 7 additions and 3 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue