From 0fa0ee053aaa53939306376719450cfe56e33e3b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 3 Sep 2009 10:41:17 +0000 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/pcmcia/pcnet_cs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/net/pcmcia/pcnet_cs.c') 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 @@ #include #include #include +#include #include "../8390.h" #include @@ -1191,7 +1192,7 @@ static const struct ethtool_ops netdev_ethtool_ops = { static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { pcnet_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 + DLINK_GPIO; if (!(info->flags & (IS_DL10019|IS_DL10022))) @@ -1199,12 +1200,12 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 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; -- cgit v1.2.2