summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2020-06-22 01:05:59 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2020-09-02 10:00:57 +0100
commit49f6c5df59f6f4e652a1c3b5b56c489bdcffe587 (patch)
tree6a4d9dbc09e65e7fc8e30b779d243e956f2978eb
parent1286674601bad886518f17ddb5501598a01a6981 (diff)
net: dsa/bcm_sf2: fix pause mode validation
The implementation appears not to support pause modes on anything but RGMII, RGMII_TXID, MII and REVMII interface modes. Let phylink know that detail. (This may not be correct; particularly see the FIXMEs in this patch.) Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/dsa/bcm_sf2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 45e4d40d7e25..186c77007342 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -512,6 +512,7 @@ static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port,
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
+ /* FIXME: Are RGMII_RXID and RGMII_ID actually supported? */
if (!phy_interface_mode_is_rgmii(state->interface) &&
state->interface != PHY_INTERFACE_MODE_MII &&
state->interface != PHY_INTERFACE_MODE_REVMII &&
@@ -529,8 +530,13 @@ static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port,
/* Allow all the expected bits */
phylink_set(mask, Autoneg);
phylink_set_port_modes(mask);
- phylink_set(mask, Pause);
- phylink_set(mask, Asym_Pause);
+ if (state->interface == PHY_INTERFACE_MODE_RGMII ||
+ state->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
+ state->interface == PHY_INTERFACE_MODE_MII ||
+ state->interface == PHY_INTERFACE_MODE_REVMII) {
+ phylink_set(mask, Pause);
+ phylink_set(mask, Asym_Pause);
+ }
/* With the exclusion of MII and Reverse MII, we support Gigabit,
* including Half duplex
@@ -564,6 +570,7 @@ static void bcm_sf2_sw_mac_config(struct dsa_switch *ds, int port,
return;
switch (state->interface) {
+ /* FIXME: Are RGMII_RXID and RGMII_ID actually supported? */
case PHY_INTERFACE_MODE_RGMII:
id_mode_dis = 1;
/* fallthrough */
@@ -655,6 +662,7 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
else
offset = CORE_STS_OVERRIDE_GMIIP2_PORT(port);
+ /* FIXME: Are RGMII_RXID and RGMII_ID actually supported? */
if (interface == PHY_INTERFACE_MODE_RGMII ||
interface == PHY_INTERFACE_MODE_RGMII_TXID ||
interface == PHY_INTERFACE_MODE_MII ||