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/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 @@ | |||
80 | #include <linux/if_arp.h> | 80 | #include <linux/if_arp.h> |
81 | #include <linux/ioport.h> | 81 | #include <linux/ioport.h> |
82 | #include <linux/bitops.h> | 82 | #include <linux/bitops.h> |
83 | #include <linux/mii.h> | ||
83 | 84 | ||
84 | #include <pcmcia/cs_types.h> | 85 | #include <pcmcia/cs_types.h> |
85 | #include <pcmcia/cs.h> | 86 | #include <pcmcia/cs.h> |
@@ -1558,24 +1559,26 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1558 | { | 1559 | { |
1559 | local_info_t *local = netdev_priv(dev); | 1560 | local_info_t *local = netdev_priv(dev); |
1560 | unsigned int ioaddr = dev->base_addr; | 1561 | unsigned int ioaddr = dev->base_addr; |
1561 | u16 *data = (u16 *)&rq->ifr_ifru; | 1562 | struct mii_ioctl_data *data = if_mii(rq); |
1562 | 1563 | ||
1563 | DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n", | 1564 | DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n", |
1564 | dev->name, rq->ifr_ifrn.ifrn_name, cmd, | 1565 | dev->name, rq->ifr_ifrn.ifrn_name, cmd, |
1565 | data[0], data[1], data[2], data[3]); | 1566 | data->phy_id, data->reg_num, data->val_in, data->val_out); |
1566 | 1567 | ||
1567 | if (!local->mohawk) | 1568 | if (!local->mohawk) |
1568 | return -EOPNOTSUPP; | 1569 | return -EOPNOTSUPP; |
1569 | 1570 | ||
1570 | switch(cmd) { | 1571 | switch(cmd) { |
1571 | case SIOCGMIIPHY: /* Get the address of the PHY in use. */ | 1572 | case SIOCGMIIPHY: /* Get the address of the PHY in use. */ |
1572 | data[0] = 0; /* we have only this address */ | 1573 | data->phy_id = 0; /* we have only this address */ |
1573 | /* fall through */ | 1574 | /* fall through */ |
1574 | case SIOCGMIIREG: /* Read the specified MII register. */ | 1575 | case SIOCGMIIREG: /* Read the specified MII register. */ |
1575 | data[3] = mii_rd(ioaddr, data[0] & 0x1f, data[1] & 0x1f); | 1576 | data->val_out = mii_rd(ioaddr, data->phy_id & 0x1f, |
1577 | data->reg_num & 0x1f); | ||
1576 | break; | 1578 | break; |
1577 | case SIOCSMIIREG: /* Write the specified MII register */ | 1579 | case SIOCSMIIREG: /* Write the specified MII register */ |
1578 | mii_wr(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2], 16); | 1580 | mii_wr(ioaddr, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in, |
1581 | 16); | ||
1579 | break; | 1582 | break; |
1580 | default: | 1583 | default: |
1581 | return -EOPNOTSUPP; | 1584 | return -EOPNOTSUPP; |