diff options
author | Vivien Didelot <vivien.didelot@gmail.com> | 2019-08-31 22:18:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-01 21:16:38 +0200 |
commit | 9db4a7257e601491cf8e0b7e7e1461f7cde294bb (patch) | |
tree | ec0642f7a92fcfd7e8bb253eec27af2b4cb1ed84 /drivers/net/dsa/mv88e6xxx/serdes.c | |
parent | net: dsa: mv88e6xxx: simplify .serdes_get_lane (diff) | |
download | linux-9db4a7257e601491cf8e0b7e7e1461f7cde294bb.tar.xz linux-9db4a7257e601491cf8e0b7e7e1461f7cde294bb.zip |
net: dsa: mv88e6xxx: implement mv88e6352_serdes_get_lane
Even though 88E6352 has no dedicated lane for SERDES interfaces, it
uses a similar code as the other .serdes_get_lane implementations to
check the port's CMODE and ensure that SERDES operations are doable.
For consistency, implement mv88e6352_serdes_get_lane for the 88E6352
and similar switches which simply returns an unused 0xff lane address.
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/serdes.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/serdes.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c index ce6d97e5caf8..9fb2773a3eb5 100644 --- a/drivers/net/dsa/mv88e6xxx/serdes.c +++ b/drivers/net/dsa/mv88e6xxx/serdes.c @@ -69,13 +69,22 @@ static int mv88e6352_serdes_power_set(struct mv88e6xxx_chip *chip, bool on) return err; } -static bool mv88e6352_port_has_serdes(struct mv88e6xxx_chip *chip, int port) +u8 mv88e6352_serdes_get_lane(struct mv88e6xxx_chip *chip, int port) { u8 cmode = chip->ports[port].cmode; + u8 lane = 0; if ((cmode == MV88E6XXX_PORT_STS_CMODE_100BASEX) || (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX) || (cmode == MV88E6XXX_PORT_STS_CMODE_SGMII)) + lane = 0xff; /* Unused */ + + return lane; +} + +static bool mv88e6352_port_has_serdes(struct mv88e6xxx_chip *chip, int port) +{ + if (mv88e6xxx_serdes_get_lane(chip, port)) return true; return false; |