diff options
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; |