netdev: Convert MDIO ioctl implementation to use struct mii_ioctl_data
A few drivers still access the arguments to MDIO ioctls as an array of u16. Convert them to use struct mii_ioctl_data. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7ab0f2736b
commit
0fa0ee053a
@ -2209,7 +2209,7 @@ static const struct ethtool_ops emac_ethtool_ops = {
|
||||
static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
|
||||
{
|
||||
struct emac_instance *dev = netdev_priv(ndev);
|
||||
uint16_t *data = (uint16_t *) & rq->ifr_ifru;
|
||||
struct mii_ioctl_data *data = if_mii(rq);
|
||||
|
||||
DBG(dev, "ioctl %08x" NL, cmd);
|
||||
|
||||
@ -2218,14 +2218,16 @@ static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
|
||||
|
||||
switch (cmd) {
|
||||
case SIOCGMIIPHY:
|
||||
data[0] = dev->phy.address;
|
||||
data->phy_id = dev->phy.address;
|
||||
/* Fall through */
|
||||
case SIOCGMIIREG:
|
||||
data[3] = emac_mdio_read(ndev, dev->phy.address, data[1]);
|
||||
data->val_out = emac_mdio_read(ndev, dev->phy.address,
|
||||
data->reg_num);
|
||||
return 0;
|
||||
|
||||
case SIOCSMIIREG:
|
||||
emac_mdio_write(ndev, dev->phy.address, data[1], data[2]);
|
||||
emac_mdio_write(ndev, dev->phy.address, data->reg_num,
|
||||
data->val_in);
|
||||
return 0;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
|
Reference in New Issue
Block a user