diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-05-10 21:44:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-12 01:34:23 +0200 |
commit | cb9b9020fca5fd34ab2e21fb36fc2c7a85329426 (patch) | |
tree | 3fb853c7ca7c68cdae61344267b44aef362c9382 /drivers/net/dsa/mv88e6xxx.c | |
parent | net: dsa: mv88e6xxx: abstract VTU/STU data access (diff) | |
download | linux-cb9b9020fca5fd34ab2e21fb36fc2c7a85329426.tar.xz linux-cb9b9020fca5fd34ab2e21fb36fc2c7a85329426.zip |
net: dsa: mv88e6xxx: add STU capability
Some switch models have a STU (per VLAN port state database). Add a new
capability flag to switches info, instead of checking their family.
Also if the 6165 family has an STU, it must have a VTU, so add the
MV88E6XXX_FLAG_VTU to its family flags.
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 'drivers/net/dsa/mv88e6xxx.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 92be27d5db3a..835126e90afd 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -453,16 +453,6 @@ static bool mv88e6xxx_has_fid_reg(struct mv88e6xxx_priv_state *ps) return false; } -static bool mv88e6xxx_has_stu(struct mv88e6xxx_priv_state *ps) -{ - /* Does the device have STU and dedicated SID registers for VTU ops? */ - if (mv88e6xxx_6097_family(ps) || mv88e6xxx_6165_family(ps) || - mv88e6xxx_6351_family(ps) || mv88e6xxx_6352_family(ps)) - return true; - - return false; -} - /* We expect the switch to perform auto negotiation if there is a real * phy. However, in the case of a fixed link phy, we force the port * settings from the fixed link settings. @@ -1599,7 +1589,7 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_priv_state *ps, next.fid |= ret & 0xf; } - if (mv88e6xxx_has_stu(ps)) { + if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_STU)) { ret = _mv88e6xxx_reg_read(ps, REG_GLOBAL, GLOBAL_VTU_SID); if (ret < 0) @@ -1686,7 +1676,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_priv_state *ps, if (ret < 0) return ret; - if (mv88e6xxx_has_stu(ps)) { + if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_STU)) { reg = entry->sid & GLOBAL_VTU_SID_MASK; ret = _mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_VTU_SID, reg); if (ret < 0) |