diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-04-29 04:05:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-29 20:32:30 -0400 |
commit | 68e7f45e118f98b77cfa007aa2d97b5dac69fe6b (patch) | |
tree | d2e05579a0fc1f5a28bce8ff09ac6863d1907186 /drivers/net/sfc/efx.c | |
parent | 1b1c2e95103ce391c2ea39a9460968fcb73deb30 (diff) |
sfc: Use generic MDIO functions and definitions
Make use of the newly-added generic MDIO clause 45 support and remove
redundant definitions.
Add an 'efx_' prefix to the remaining driver-specific MDIO functions
and remove arguments which are redundant with efx->mdio.prtad.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r-- | drivers/net/sfc/efx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 7269a426051c..d3e240b736c7 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1300,10 +1300,16 @@ out_requeue: | |||
1300 | static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) | 1300 | static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) |
1301 | { | 1301 | { |
1302 | struct efx_nic *efx = netdev_priv(net_dev); | 1302 | struct efx_nic *efx = netdev_priv(net_dev); |
1303 | struct mii_ioctl_data *data = if_mii(ifr); | ||
1303 | 1304 | ||
1304 | EFX_ASSERT_RESET_SERIALISED(efx); | 1305 | EFX_ASSERT_RESET_SERIALISED(efx); |
1305 | 1306 | ||
1306 | return generic_mii_ioctl(&efx->mii, if_mii(ifr), cmd, NULL); | 1307 | /* Convert phy_id from older PRTAD/DEVAD format */ |
1308 | if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) && | ||
1309 | (data->phy_id & 0xfc00) == 0x0400) | ||
1310 | data->phy_id ^= MDIO_PHY_ID_C45 | 0x0400; | ||
1311 | |||
1312 | return mdio_mii_ioctl(&efx->mdio, data, cmd); | ||
1307 | } | 1313 | } |
1308 | 1314 | ||
1309 | /************************************************************************** | 1315 | /************************************************************************** |
@@ -1945,7 +1951,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type, | |||
1945 | mutex_init(&efx->mac_lock); | 1951 | mutex_init(&efx->mac_lock); |
1946 | efx->mac_op = &efx_dummy_mac_operations; | 1952 | efx->mac_op = &efx_dummy_mac_operations; |
1947 | efx->phy_op = &efx_dummy_phy_operations; | 1953 | efx->phy_op = &efx_dummy_phy_operations; |
1948 | efx->mii.dev = net_dev; | 1954 | efx->mdio.dev = net_dev; |
1949 | INIT_WORK(&efx->phy_work, efx_phy_work); | 1955 | INIT_WORK(&efx->phy_work, efx_phy_work); |
1950 | INIT_WORK(&efx->mac_work, efx_mac_work); | 1956 | INIT_WORK(&efx->mac_work, efx_mac_work); |
1951 | atomic_set(&efx->netif_stop_count, 1); | 1957 | atomic_set(&efx->netif_stop_count, 1); |