Skip to content

Commit b856150

Browse files
blocktrrondavem330
authored andcommitted
net: phy: at803x: mask 1000 Base-X link mode
AR8031/AR8033 have different status registers for copper and fiber operation. However, the extended status register is the same for both operation modes. As a result of that, ESTATUS_1000_XFULL is set to 1 even when operating in copper TP mode. Remove this mode from the supported link modes, as this driver currently only supports copper operation. Signed-off-by: David Bauer <mail@david-bauer.net> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f9beb95 commit b856150

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

drivers/net/phy/at803x.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,34 @@ static void at803x_remove(struct phy_device *phydev)
610610
regulator_disable(priv->vddio);
611611
}
612612

613+
static int at803x_get_features(struct phy_device *phydev)
614+
{
615+
int err;
616+
617+
err = genphy_read_abilities(phydev);
618+
if (err)
619+
return err;
620+
621+
if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID))
622+
return 0;
623+
624+
/* AR8031/AR8033 have different status registers
625+
* for copper and fiber operation. However, the
626+
* extended status register is the same for both
627+
* operation modes.
628+
*
629+
* As a result of that, ESTATUS_1000_XFULL is set
630+
* to 1 even when operating in copper TP mode.
631+
*
632+
* Remove this mode from the supported link modes,
633+
* as this driver currently only supports copper
634+
* operation.
635+
*/
636+
linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
637+
phydev->supported);
638+
return 0;
639+
}
640+
613641
static int at803x_smarteee_config(struct phy_device *phydev)
614642
{
615643
struct at803x_priv *priv = phydev->priv;
@@ -1225,7 +1253,7 @@ static struct phy_driver at803x_driver[] = {
12251253
.resume = at803x_resume,
12261254
.read_page = at803x_read_page,
12271255
.write_page = at803x_write_page,
1228-
/* PHY_GBIT_FEATURES */
1256+
.get_features = at803x_get_features,
12291257
.read_status = at803x_read_status,
12301258
.config_intr = &at803x_config_intr,
12311259
.handle_interrupt = at803x_handle_interrupt,

0 commit comments

Comments
 (0)