phy: Add an mdio_device structure
Not all devices attached to an MDIO bus are phys. So add an mdio_device structure to represent the generic parts of an mdio device, and place this structure into the phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e7f4dc3536
commit
e5a03bfd87
@@ -864,8 +864,8 @@ static int smsc911x_phy_loopbacktest(struct net_device *dev)
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
/* Set PHY to 10/FD, no ANEG, and loopback mode */
|
||||
smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR,
|
||||
BMCR_LOOPBACK | BMCR_FULLDPLX);
|
||||
smsc911x_mii_write(phy_dev->mdio.bus, phy_dev->mdio.addr,
|
||||
MII_BMCR, BMCR_LOOPBACK | BMCR_FULLDPLX);
|
||||
|
||||
/* Enable MAC tx/rx, FD */
|
||||
spin_lock_irqsave(&pdata->mac_lock, flags);
|
||||
@@ -893,7 +893,7 @@ static int smsc911x_phy_loopbacktest(struct net_device *dev)
|
||||
spin_unlock_irqrestore(&pdata->mac_lock, flags);
|
||||
|
||||
/* Cancel PHY loopback mode */
|
||||
smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR, 0);
|
||||
smsc911x_mii_write(phy_dev->mdio.bus, phy_dev->mdio.addr, MII_BMCR, 0);
|
||||
|
||||
smsc911x_reg_write(pdata, TX_CFG, 0);
|
||||
smsc911x_reg_write(pdata, RX_CFG, 0);
|
||||
@@ -1021,7 +1021,7 @@ static int smsc911x_mii_probe(struct net_device *dev)
|
||||
}
|
||||
|
||||
SMSC_TRACE(pdata, probe, "PHY: addr %d, phy_id 0x%08X",
|
||||
phydev->addr, phydev->phy_id);
|
||||
phydev->mdio.addr, phydev->phy_id);
|
||||
|
||||
ret = phy_connect_direct(dev, phydev, &smsc911x_phy_adjust_link,
|
||||
pdata->config.phy_interface);
|
||||
@@ -1988,7 +1988,8 @@ smsc911x_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
|
||||
}
|
||||
|
||||
for (i = 0; i <= 31; i++)
|
||||
data[j++] = smsc911x_mii_read(phy_dev->bus, phy_dev->addr, i);
|
||||
data[j++] = smsc911x_mii_read(phy_dev->mdio.bus,
|
||||
phy_dev->mdio.addr, i);
|
||||
}
|
||||
|
||||
static void smsc911x_eeprom_enable_access(struct smsc911x_data *pdata)
|
||||
|
Reference in New Issue
Block a user