summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2020-06-18 16:46:08 +0300
committerDavid S. Miller <davem@davemloft.net>2020-06-20 06:17:15 +0300
commit320ed3bf900075614c43499dc01db8d25717b986 (patch)
treee4e04ee83eedd2d513ae8b2004108cfd401a6712 /drivers/net/phy/phylink.c
parent5ba33cf4839266f059a6e2342c005709cc6cf256 (diff)
downloadlinux-320ed3bf900075614c43499dc01db8d25717b986.tar.xz
net: phy: split devices_in_package
We have two competing requirements for the devices_in_package field. We want to use it as a bit array indicating which MMDs are present, but we also want to know if the Clause 22 registers are present. Since "devices in package" is a term used in the 802.3 specification, keep this as the as-specified values read from the PHY, and introduce a new member "mmds_present" to indicate which MMDs are actually present in the PHY, derived from the "devices in package" value. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 0ab65fb75258..7ce787c227b3 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1638,11 +1638,11 @@ static int phylink_phy_read(struct phylink *pl, unsigned int phy_id,
case MII_BMSR:
case MII_PHYSID1:
case MII_PHYSID2:
- devad = __ffs(phydev->c45_ids.devices_in_package);
+ devad = __ffs(phydev->c45_ids.mmds_present);
break;
case MII_ADVERTISE:
case MII_LPA:
- if (!(phydev->c45_ids.devices_in_package & MDIO_DEVS_AN))
+ if (!(phydev->c45_ids.mmds_present & MDIO_DEVS_AN))
return -EINVAL;
devad = MDIO_MMD_AN;
if (reg == MII_ADVERTISE)
@@ -1678,11 +1678,11 @@ static int phylink_phy_write(struct phylink *pl, unsigned int phy_id,
case MII_BMSR:
case MII_PHYSID1:
case MII_PHYSID2:
- devad = __ffs(phydev->c45_ids.devices_in_package);
+ devad = __ffs(phydev->c45_ids.mmds_present);
break;
case MII_ADVERTISE:
case MII_LPA:
- if (!(phydev->c45_ids.devices_in_package & MDIO_DEVS_AN))
+ if (!(phydev->c45_ids.mmds_present & MDIO_DEVS_AN))
return -EINVAL;
devad = MDIO_MMD_AN;
if (reg == MII_ADVERTISE)