diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-09-03 06:41:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 23:02:12 -0400 |
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 4f2fef6cf6dc..3131a59a8d32 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/netdevice.h> | 37 | #include <linux/netdevice.h> |
38 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
39 | #include <linux/crc32.h> | 39 | #include <linux/crc32.h> |
40 | #include <linux/mii.h> | ||
40 | #include "../8390.h" | 41 | #include "../8390.h" |
41 | 42 | ||
42 | #include <pcmcia/cs_types.h> | 43 | #include <pcmcia/cs_types.h> |
@@ -697,16 +698,16 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
697 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 698 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
698 | { | 699 | { |
699 | axnet_dev_t *info = PRIV(dev); | 700 | axnet_dev_t *info = PRIV(dev); |
700 | u16 *data = (u16 *)&rq->ifr_ifru; | 701 | struct mii_ioctl_data *data = if_mii(rq); |
701 | unsigned int mii_addr = dev->base_addr + AXNET_MII_EEP; | 702 | unsigned int mii_addr = dev->base_addr + AXNET_MII_EEP; |
702 | switch (cmd) { | 703 | switch (cmd) { |
703 | case SIOCGMIIPHY: | 704 | case SIOCGMIIPHY: |
704 | data[0] = info->phy_id; | 705 | data->phy_id = info->phy_id; |
705 | case SIOCGMIIREG: /* Read MII PHY register. */ | 706 | case SIOCGMIIREG: /* Read MII PHY register. */ |
706 | data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f); | 707 | data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f); |
707 | return 0; | 708 | return 0; |
708 | case SIOCSMIIREG: /* Write MII PHY register. */ | 709 | case SIOCSMIIREG: /* Write MII PHY register. */ |
709 | mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]); | 710 | mdio_write(mii_addr, data->phy_id, data->reg_num & 0x1f, data->val_in); |
710 | return 0; | 711 | return 0; |
711 | } | 712 | } |
712 | return -EOPNOTSUPP; | 713 | return -EOPNOTSUPP; |