summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-09-21 16:43:59 -0700
committerDavid S. Miller <davem@davemloft.net>2018-09-21 20:01:19 -0700
commit55a4d2eac327fca4b22544f98d86d6e7b7981913 (patch)
tree0b20714f23e2af84e5c7478a563fd43d4cdf6dba
parent2cae8c07cb8c03a98aecbb8c7fb14c1922772adb (diff)
downloadlinux-55a4d2eac327fca4b22544f98d86d6e7b7981913.tar.bz2
net: dsa: b53: Also include SGMII for mac_config and mac_link_state
In both 802.3z and SGMII modes we need to configure the MAC accordingly to flip between Fiber and SGMII modes, and we need to read the MAC status from the SGMII in-band control word. Fixes: 0e01491de646 ("net: dsa: b53: Add SerDes support") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/b53/b53_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index dbf5b86a07fe..700d86dd5e13 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1172,8 +1172,9 @@ int b53_phylink_mac_link_state(struct dsa_switch *ds, int port,
struct b53_device *dev = ds->priv;
int ret = -EOPNOTSUPP;
- if (phy_interface_mode_is_8023z(state->interface) &&
- dev->ops->serdes_link_state)
+ if ((phy_interface_mode_is_8023z(state->interface) ||
+ state->interface == PHY_INTERFACE_MODE_SGMII) &&
+ dev->ops->serdes_link_state)
ret = dev->ops->serdes_link_state(dev, port, state);
return ret;
@@ -1195,8 +1196,9 @@ void b53_phylink_mac_config(struct dsa_switch *ds, int port,
return;
}
- if (phy_interface_mode_is_8023z(state->interface) &&
- dev->ops->serdes_config)
+ if ((phy_interface_mode_is_8023z(state->interface) ||
+ state->interface == PHY_INTERFACE_MODE_SGMII) &&
+ dev->ops->serdes_config)
dev->ops->serdes_config(dev, port, mode, state);
}
EXPORT_SYMBOL(b53_phylink_mac_config);