diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-09-03 10:41:17 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 20:02:12 -0700 |
commit | 0fa0ee053aaa53939306376719450cfe56e33e3b (patch) | |
tree | dcfa68400c09f079f260d1df9db2e47e4be2f2ea /drivers/net/pcmcia/axnet_cs.c | |
parent | 7ab0f2736bfe137a82a7084bbfb5f809da95cabd (diff) |
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>
Diffstat (limited to 'drivers/net/pcmcia/axnet_cs.c')
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 4f2fef6cf6d..3131a59a8d3 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -37,6 +37,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/crc32.h> +#include <linux/mii.h> #include "../8390.h" #include <pcmcia/cs_types.h> @@ -697,16 +698,16 @@ static const struct ethtool_ops netdev_ethtool_ops = { static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { axnet_dev_t *info = PRIV(dev); - u16 *data = (u16 *)&rq->ifr_ifru; + struct mii_ioctl_data *data = if_mii(rq); unsigned int mii_addr = dev->base_addr + AXNET_MII_EEP; switch (cmd) { case SIOCGMIIPHY: - data[0] = info->phy_id; + data->phy_id = info->phy_id; case SIOCGMIIREG: /* Read MII PHY register. */ - data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f); + data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f); return 0; case SIOCSMIIREG: /* Write MII PHY register. */ - mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]); + mdio_write(mii_addr, data->phy_id, data->reg_num & 0x1f, data->val_in); return 0; } return -EOPNOTSUPP; |