Commit 69b3c59f authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: use phy_mii_ioctl

Switch to using phy_mii_ioctl().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd84957e
...@@ -4283,31 +4283,12 @@ static int rtl_set_mac_address(struct net_device *dev, void *p) ...@@ -4283,31 +4283,12 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
return 0; return 0;
} }
static int rtl_xmii_ioctl(struct rtl8169_private *tp,
struct mii_ioctl_data *data, int cmd)
{
switch (cmd) {
case SIOCGMIIPHY:
data->phy_id = 32; /* Internal PHY */
return 0;
case SIOCGMIIREG:
data->val_out = rtl_readphy(tp, data->reg_num & 0x1f);
return 0;
case SIOCSMIIREG:
rtl_writephy(tp, data->reg_num & 0x1f, data->val_in);
return 0;
}
return -EOPNOTSUPP;
}
static int rtl8169_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int rtl8169_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
struct rtl8169_private *tp = netdev_priv(dev); if (!netif_running(dev))
struct mii_ioctl_data *data = if_mii(ifr); return -ENODEV;
return netif_running(dev) ? rtl_xmii_ioctl(tp, data, cmd) : -ENODEV; return phy_mii_ioctl(dev->phydev, ifr, cmd);
} }
static void rtl_init_mdio_ops(struct rtl8169_private *tp) static void rtl_init_mdio_ops(struct rtl8169_private *tp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment