* @napi: NAPI structure
* @msg_enable: device state flags
* @lock: device lock
- * @phy: attached PHY
* @mdio: MDIO bus for PHY access
* @phy_id: address of attached PHY
*/
spinlock_t lock;
- struct phy_device *phy;
struct mii_bus *mdio;
struct clk *clk;
s8 phy_id;
return err;
}
- priv->phy = phy;
phy->advertising &= ~(ADVERTISED_1000baseT_Full |
ADVERTISED_1000baseT_Half);
phy->supported &= ~(SUPPORTED_1000baseT_Full |
netif_start_queue(dev);
}
- phy_start(priv->phy);
+ phy_start(dev->phydev);
napi_enable(&priv->napi);
if (netif_msg_ifup(priv)) {
napi_disable(&priv->napi);
- if (priv->phy)
- phy_stop(priv->phy);
+ if (dev->phydev)
+ phy_stop(dev->phydev);
ethoc_disable_rx_and_tx(priv);
free_irq(dev->irq, dev);
if (!phy)
return -ENODEV;
} else {
- phy = priv->phy;
+ phy = dev->phydev;
}
return phy_mii_ioctl(phy, ifr, cmd);
static int ethoc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
- struct ethoc *priv = netdev_priv(dev);
- struct phy_device *phydev = priv->phy;
+ struct phy_device *phydev = dev->phydev;
if (!phydev)
return -EOPNOTSUPP;
static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
- struct ethoc *priv = netdev_priv(dev);
- struct phy_device *phydev = priv->phy;
+ struct phy_device *phydev = dev->phydev;
if (!phydev)
return -EOPNOTSUPP;
if (netdev) {
netif_napi_del(&priv->napi);
- phy_disconnect(priv->phy);
- priv->phy = NULL;
+ phy_disconnect(netdev->phydev);
if (priv->mdio) {
mdiobus_unregister(priv->mdio);