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/xirc2ps_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/xirc2ps_cs.c')
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 9709dd173ddc..cf8423102538 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c @@ -80,6 +80,7 @@ #include <linux/if_arp.h> #include <linux/ioport.h> #include <linux/bitops.h> +#include <linux/mii.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> @@ -1558,24 +1559,26 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { local_info_t *local = netdev_priv(dev); unsigned int ioaddr = dev->base_addr; - u16 *data = (u16 *)&rq->ifr_ifru; + struct mii_ioctl_data *data = if_mii(rq); DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n", dev->name, rq->ifr_ifrn.ifrn_name, cmd, - data[0], data[1], data[2], data[3]); + data->phy_id, data->reg_num, data->val_in, data->val_out); if (!local->mohawk) return -EOPNOTSUPP; switch(cmd) { case SIOCGMIIPHY: /* Get the address of the PHY in use. */ - data[0] = 0; /* we have only this address */ + data->phy_id = 0; /* we have only this address */ /* fall through */ case SIOCGMIIREG: /* Read the specified MII register. */ - data[3] = mii_rd(ioaddr, data[0] & 0x1f, data[1] & 0x1f); + data->val_out = mii_rd(ioaddr, data->phy_id & 0x1f, + data->reg_num & 0x1f); break; case SIOCSMIIREG: /* Write the specified MII register */ - mii_wr(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2], 16); + mii_wr(ioaddr, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in, + 16); break; default: return -EOPNOTSUPP; |