net: phy: Convert to mdiobus_c45_{read|write}
Stop using the helpers to construct a special phy address which indicates C45. Instead use the C45 accessors, which will call the busses C45 specific read/write API. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
70dcf3cdc3
commit
260bdfea87
|
@ -295,20 +295,20 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
|
||||||
if (mdio_phy_id_is_c45(mii_data->phy_id)) {
|
if (mdio_phy_id_is_c45(mii_data->phy_id)) {
|
||||||
prtad = mdio_phy_id_prtad(mii_data->phy_id);
|
prtad = mdio_phy_id_prtad(mii_data->phy_id);
|
||||||
devad = mdio_phy_id_devad(mii_data->phy_id);
|
devad = mdio_phy_id_devad(mii_data->phy_id);
|
||||||
devad = mdiobus_c45_addr(devad, mii_data->reg_num);
|
mii_data->val_out = mdiobus_c45_read(
|
||||||
|
phydev->mdio.bus, prtad, devad,
|
||||||
|
mii_data->reg_num);
|
||||||
} else {
|
} else {
|
||||||
prtad = mii_data->phy_id;
|
mii_data->val_out = mdiobus_read(
|
||||||
devad = mii_data->reg_num;
|
phydev->mdio.bus, mii_data->phy_id,
|
||||||
|
mii_data->reg_num);
|
||||||
}
|
}
|
||||||
mii_data->val_out = mdiobus_read(phydev->mdio.bus, prtad,
|
|
||||||
devad);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case SIOCSMIIREG:
|
case SIOCSMIIREG:
|
||||||
if (mdio_phy_id_is_c45(mii_data->phy_id)) {
|
if (mdio_phy_id_is_c45(mii_data->phy_id)) {
|
||||||
prtad = mdio_phy_id_prtad(mii_data->phy_id);
|
prtad = mdio_phy_id_prtad(mii_data->phy_id);
|
||||||
devad = mdio_phy_id_devad(mii_data->phy_id);
|
devad = mdio_phy_id_devad(mii_data->phy_id);
|
||||||
devad = mdiobus_c45_addr(devad, mii_data->reg_num);
|
|
||||||
} else {
|
} else {
|
||||||
prtad = mii_data->phy_id;
|
prtad = mii_data->phy_id;
|
||||||
devad = mii_data->reg_num;
|
devad = mii_data->reg_num;
|
||||||
|
@ -351,7 +351,11 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mdiobus_write(phydev->mdio.bus, prtad, devad, val);
|
if (mdio_phy_id_is_c45(mii_data->phy_id))
|
||||||
|
mdiobus_c45_write(phydev->mdio.bus, prtad, devad,
|
||||||
|
mii_data->reg_num, val);
|
||||||
|
else
|
||||||
|
mdiobus_write(phydev->mdio.bus, prtad, devad, val);
|
||||||
|
|
||||||
if (prtad == phydev->mdio.addr &&
|
if (prtad == phydev->mdio.addr &&
|
||||||
devad == MII_BMCR &&
|
devad == MII_BMCR &&
|
||||||
|
|
Loading…
Reference in New Issue