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/ibm_newemac | |
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/ibm_newemac')
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 8a95234d419c..1d7d7fef414f 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2209,7 +2209,7 @@ static const struct ethtool_ops emac_ethtool_ops = { | |||
2209 | static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | 2209 | static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) |
2210 | { | 2210 | { |
2211 | struct emac_instance *dev = netdev_priv(ndev); | 2211 | struct emac_instance *dev = netdev_priv(ndev); |
2212 | uint16_t *data = (uint16_t *) & rq->ifr_ifru; | 2212 | struct mii_ioctl_data *data = if_mii(rq); |
2213 | 2213 | ||
2214 | DBG(dev, "ioctl %08x" NL, cmd); | 2214 | DBG(dev, "ioctl %08x" NL, cmd); |
2215 | 2215 | ||
@@ -2218,14 +2218,16 @@ static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
2218 | 2218 | ||
2219 | switch (cmd) { | 2219 | switch (cmd) { |
2220 | case SIOCGMIIPHY: | 2220 | case SIOCGMIIPHY: |
2221 | data[0] = dev->phy.address; | 2221 | data->phy_id = dev->phy.address; |
2222 | /* Fall through */ | 2222 | /* Fall through */ |
2223 | case SIOCGMIIREG: | 2223 | case SIOCGMIIREG: |
2224 | data[3] = emac_mdio_read(ndev, dev->phy.address, data[1]); | 2224 | data->val_out = emac_mdio_read(ndev, dev->phy.address, |
2225 | data->reg_num); | ||
2225 | return 0; | 2226 | return 0; |
2226 | 2227 | ||
2227 | case SIOCSMIIREG: | 2228 | case SIOCSMIIREG: |
2228 | emac_mdio_write(ndev, dev->phy.address, data[1], data[2]); | 2229 | emac_mdio_write(ndev, dev->phy.address, data->reg_num, |
2230 | data->val_in); | ||
2229 | return 0; | 2231 | return 0; |
2230 | default: | 2232 | default: |
2231 | return -EOPNOTSUPP; | 2233 | return -EOPNOTSUPP; |