Re: [PATCH net-next 2/2] net: phy: DP83822: Add ability to advertise Fiber connection

From: Andrew Lunn
Date: Thu May 14 2020 - 15:11:06 EST


> +static int dp83822_config_init(struct phy_device *phydev)
> +{
> + struct dp83822_private *dp83822 = phydev->priv;
> + int err = 0;
> +
> + if (dp83822->fx_enabled) {
> + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
> + phydev->supported);
> + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
> + phydev->advertising);
> +
> + /* Auto negotiation is not available in fiber mode */
> + phydev->autoneg = AUTONEG_DISABLE;
> + phydev->speed = SPEED_100;
> + phydev->duplex = DUPLEX_FULL;

Hi Dan

This is normally determined by reading the ability registers,
genphy_read_abilities(). When strapped to fibre mode, does it still
indicate all the usual copper capabilities, which it can not actually
do?

Andrew