aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/pcnet_cs.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-09-03 06:41:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-03 23:02:12 -0400
commit0fa0ee053aaa53939306376719450cfe56e33e3b (patch)
treedcfa68400c09f079f260d1df9db2e47e4be2f2ea /drivers/net/pcmcia/pcnet_cs.c
parent7ab0f2736bfe137a82a7084bbfb5f809da95cabd (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/pcnet_cs.c')
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 8996b45ffffb..90a94d215831 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -40,6 +40,7 @@
40#include <linux/netdevice.h> 40#include <linux/netdevice.h>
41#include <linux/log2.h> 41#include <linux/log2.h>
42#include <linux/etherdevice.h> 42#include <linux/etherdevice.h>
43#include <linux/mii.h>
43#include "../8390.h" 44#include "../8390.h"
44 45
45#include <pcmcia/cs_types.h> 46#include <pcmcia/cs_types.h>
@@ -1191,7 +1192,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
1191static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1192static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1192{ 1193{
1193 pcnet_dev_t *info = PRIV(dev); 1194 pcnet_dev_t *info = PRIV(dev);
1194 u16 *data = (u16 *)&rq->ifr_ifru; 1195 struct mii_ioctl_data *data = if_mii(rq);
1195 unsigned int mii_addr = dev->base_addr + DLINK_GPIO; 1196 unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
1196 1197
1197 if (!(info->flags & (IS_DL10019|IS_DL10022))) 1198 if (!(info->flags & (IS_DL10019|IS_DL10022)))
@@ -1199,12 +1200,12 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1199 1200
1200 switch (cmd) { 1201 switch (cmd) {
1201 case SIOCGMIIPHY: 1202 case SIOCGMIIPHY:
1202 data[0] = info->phy_id; 1203 data->phy_id = info->phy_id;
1203 case SIOCGMIIREG: /* Read MII PHY register. */ 1204 case SIOCGMIIREG: /* Read MII PHY register. */
1204 data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f); 1205 data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f);
1205 return 0; 1206 return 0;
1206 case SIOCSMIIREG: /* Write MII PHY register. */ 1207 case SIOCSMIIREG: /* Write MII PHY register. */
1207 mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]); 1208 mdio_write(mii_addr, data->phy_id, data->reg_num & 0x1f, data->val_in);
1208 return 0; 1209 return 0;
1209 } 1210 }
1210 return -EOPNOTSUPP; 1211 return -EOPNOTSUPP;