aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorDavid Decotigny <decot@google.com>2011-04-27 14:32:40 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-29 17:03:01 -0400
commit707394972093e2056e1e8cc39be19cf9bcb3e7b3 (patch)
treef6dc95219bca6895adf304b79241e9d60561f8f5 /drivers/net/sfc
parent25db0338813a8915457636b1f6abe6a28fa73f8d (diff)
ethtool: cosmetic: Use ethtool ethtool_cmd_speed API
This updates the network drivers so that they don't access the ethtool_cmd::speed field directly, but use ethtool_cmd_speed() instead. For most of the drivers, these changes are purely cosmetic and don't fix any problem, such as for those 1GbE/10GbE drivers that indirectly call their own ethtool get_settings()/mii_ethtool_gset(). The changes are meant to enforce code consistency and provide robustness with future larger throughputs, at the expense of a few CPU cycles for each ethtool operation. All drivers compiled with make allyesconfig ion x86_64 have been updated. Tested: make allyesconfig on x86_64 + e1000e/bnx2x work Signed-off-by: David Decotigny <decot@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/ethtool.c2
-rw-r--r--drivers/net/sfc/mcdi_phy.c2
-rw-r--r--drivers/net/sfc/tenxpress.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 10b160a508f3..8c5e0052c44a 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -219,7 +219,7 @@ static int efx_ethtool_get_settings(struct net_device *net_dev,
219 ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; 219 ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
220 220
221 if (LOOPBACK_INTERNAL(efx)) { 221 if (LOOPBACK_INTERNAL(efx)) {
222 ecmd->speed = link_state->speed; 222 ethtool_cmd_speed_set(ecmd, link_state->speed);
223 ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF; 223 ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
224 } 224 }
225 225
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c
index 6c5fccbdeca2..6c63ab0710af 100644
--- a/drivers/net/sfc/mcdi_phy.c
+++ b/drivers/net/sfc/mcdi_phy.c
@@ -513,7 +513,7 @@ static void efx_mcdi_phy_get_settings(struct efx_nic *efx, struct ethtool_cmd *e
513 ecmd->supported = 513 ecmd->supported =
514 mcdi_to_ethtool_cap(phy_cfg->media, phy_cfg->supported_cap); 514 mcdi_to_ethtool_cap(phy_cfg->media, phy_cfg->supported_cap);
515 ecmd->advertising = efx->link_advertising; 515 ecmd->advertising = efx->link_advertising;
516 ecmd->speed = efx->link_state.speed; 516 ethtool_cmd_speed_set(ecmd, efx->link_state.speed);
517 ecmd->duplex = efx->link_state.fd; 517 ecmd->duplex = efx->link_state.fd;
518 ecmd->port = mcdi_to_ethtool_media(phy_cfg->media); 518 ecmd->port = mcdi_to_ethtool_media(phy_cfg->media);
519 ecmd->phy_address = phy_cfg->port; 519 ecmd->phy_address = phy_cfg->port;
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index 204ecdaac9ab..7b0fd89e7b85 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -460,7 +460,7 @@ tenxpress_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
460 /* In loopback, the PHY automatically brings up the correct interface, 460 /* In loopback, the PHY automatically brings up the correct interface,
461 * but doesn't advertise the correct speed. So override it */ 461 * but doesn't advertise the correct speed. So override it */
462 if (LOOPBACK_EXTERNAL(efx)) 462 if (LOOPBACK_EXTERNAL(efx))
463 ecmd->speed = SPEED_10000; 463 ethtool_cmd_speed_set(ecmd, SPEED_10000);
464} 464}
465 465
466static int tenxpress_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) 466static int tenxpress_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)