diff options
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 43d6d8b4429a..1b33f89df4d5 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -17,15 +17,14 @@ | |||
17 | #include "ethtool.h" | 17 | #include "ethtool.h" |
18 | #include "falcon.h" | 18 | #include "falcon.h" |
19 | #include "spi.h" | 19 | #include "spi.h" |
20 | #include "mac.h" | ||
21 | 20 | ||
22 | const char *efx_loopback_mode_names[] = { | 21 | const char *efx_loopback_mode_names[] = { |
23 | [LOOPBACK_NONE] = "NONE", | 22 | [LOOPBACK_NONE] = "NONE", |
24 | [LOOPBACK_MAC] = "MAC", | 23 | [LOOPBACK_GMAC] = "GMAC", |
25 | [LOOPBACK_XGMII] = "XGMII", | 24 | [LOOPBACK_XGMII] = "XGMII", |
26 | [LOOPBACK_XGXS] = "XGXS", | 25 | [LOOPBACK_XGXS] = "XGXS", |
27 | [LOOPBACK_XAUI] = "XAUI", | 26 | [LOOPBACK_XAUI] = "XAUI", |
28 | [LOOPBACK_PHY] = "PHY", | 27 | [LOOPBACK_GPHY] = "GPHY", |
29 | [LOOPBACK_PHYXS] = "PHYXS", | 28 | [LOOPBACK_PHYXS] = "PHYXS", |
30 | [LOOPBACK_PCS] = "PCS", | 29 | [LOOPBACK_PCS] = "PCS", |
31 | [LOOPBACK_PMAPMD] = "PMA/PMD", | 30 | [LOOPBACK_PMAPMD] = "PMA/PMD", |
@@ -200,13 +199,15 @@ int efx_ethtool_get_settings(struct net_device *net_dev, | |||
200 | struct ethtool_cmd *ecmd) | 199 | struct ethtool_cmd *ecmd) |
201 | { | 200 | { |
202 | struct efx_nic *efx = netdev_priv(net_dev); | 201 | struct efx_nic *efx = netdev_priv(net_dev); |
203 | int rc; | ||
204 | 202 | ||
205 | mutex_lock(&efx->mac_lock); | 203 | mutex_lock(&efx->mac_lock); |
206 | rc = falcon_xmac_get_settings(efx, ecmd); | 204 | efx->phy_op->get_settings(efx, ecmd); |
207 | mutex_unlock(&efx->mac_lock); | 205 | mutex_unlock(&efx->mac_lock); |
208 | 206 | ||
209 | return rc; | 207 | /* Falcon GMAC does not support 1000Mbps HD */ |
208 | ecmd->supported &= ~SUPPORTED_1000baseT_Half; | ||
209 | |||
210 | return 0; | ||
210 | } | 211 | } |
211 | 212 | ||
212 | /* This must be called with rtnl_lock held. */ | 213 | /* This must be called with rtnl_lock held. */ |
@@ -216,8 +217,15 @@ int efx_ethtool_set_settings(struct net_device *net_dev, | |||
216 | struct efx_nic *efx = netdev_priv(net_dev); | 217 | struct efx_nic *efx = netdev_priv(net_dev); |
217 | int rc; | 218 | int rc; |
218 | 219 | ||
220 | /* Falcon GMAC does not support 1000Mbps HD */ | ||
221 | if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) { | ||
222 | EFX_LOG(efx, "rejecting unsupported 1000Mbps HD" | ||
223 | " setting\n"); | ||
224 | return -EINVAL; | ||
225 | } | ||
226 | |||
219 | mutex_lock(&efx->mac_lock); | 227 | mutex_lock(&efx->mac_lock); |
220 | rc = falcon_xmac_set_settings(efx, ecmd); | 228 | rc = efx->phy_op->set_settings(efx, ecmd); |
221 | mutex_unlock(&efx->mac_lock); | 229 | mutex_unlock(&efx->mac_lock); |
222 | if (!rc) | 230 | if (!rc) |
223 | efx_reconfigure_port(efx); | 231 | efx_reconfigure_port(efx); |
@@ -362,10 +370,6 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx, | |||
362 | EFX_PORT_NAME, "phy", NULL); | 370 | EFX_PORT_NAME, "phy", NULL); |
363 | 371 | ||
364 | /* Loopback tests */ | 372 | /* Loopback tests */ |
365 | efx_fill_test(n++, strings, data, &tests->loopback_speed, | ||
366 | EFX_PORT_NAME, "loopback.speed", NULL); | ||
367 | efx_fill_test(n++, strings, data, &tests->loopback_full_duplex, | ||
368 | EFX_PORT_NAME, "loopback.full_duplex", NULL); | ||
369 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { | 373 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { |
370 | if (!(efx->loopback_modes & (1 << mode))) | 374 | if (!(efx->loopback_modes & (1 << mode))) |
371 | continue; | 375 | continue; |
@@ -671,22 +675,14 @@ static int efx_ethtool_set_pauseparam(struct net_device *net_dev, | |||
671 | { | 675 | { |
672 | struct efx_nic *efx = netdev_priv(net_dev); | 676 | struct efx_nic *efx = netdev_priv(net_dev); |
673 | enum efx_fc_type flow_control = efx->flow_control; | 677 | enum efx_fc_type flow_control = efx->flow_control; |
674 | int rc; | ||
675 | 678 | ||
676 | flow_control &= ~(EFX_FC_RX | EFX_FC_TX | EFX_FC_AUTO); | 679 | flow_control &= ~(EFX_FC_RX | EFX_FC_TX | EFX_FC_AUTO); |
677 | flow_control |= pause->rx_pause ? EFX_FC_RX : 0; | 680 | flow_control |= pause->rx_pause ? EFX_FC_RX : 0; |
678 | flow_control |= pause->tx_pause ? EFX_FC_TX : 0; | 681 | flow_control |= pause->tx_pause ? EFX_FC_TX : 0; |
679 | flow_control |= pause->autoneg ? EFX_FC_AUTO : 0; | 682 | flow_control |= pause->autoneg ? EFX_FC_AUTO : 0; |
680 | 683 | ||
681 | /* Try to push the pause parameters */ | 684 | efx_reconfigure_port(efx); |
682 | mutex_lock(&efx->mac_lock); | 685 | return 0; |
683 | rc = falcon_xmac_set_pause(efx, flow_control); | ||
684 | mutex_unlock(&efx->mac_lock); | ||
685 | |||
686 | if (!rc) | ||
687 | efx_reconfigure_port(efx); | ||
688 | |||
689 | return rc; | ||
690 | } | 686 | } |
691 | 687 | ||
692 | static void efx_ethtool_get_pauseparam(struct net_device *net_dev, | 688 | static void efx_ethtool_get_pauseparam(struct net_device *net_dev, |