aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
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/benet
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/benet')
-rw-r--r--drivers/net/benet/be_ethtool.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 6565f3e55b26..8e770e8275df 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -381,23 +381,23 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
381 be_link_status_update(adapter, link_up); 381 be_link_status_update(adapter, link_up);
382 /* link_speed is in units of 10 Mbps */ 382 /* link_speed is in units of 10 Mbps */
383 if (link_speed) { 383 if (link_speed) {
384 ecmd->speed = link_speed*10; 384 ethtool_cmd_speed_set(ecmd, link_speed*10);
385 } else { 385 } else {
386 switch (mac_speed) { 386 switch (mac_speed) {
387 case PHY_LINK_SPEED_10MBPS: 387 case PHY_LINK_SPEED_10MBPS:
388 ecmd->speed = SPEED_10; 388 ethtool_cmd_speed_set(ecmd, SPEED_10);
389 break; 389 break;
390 case PHY_LINK_SPEED_100MBPS: 390 case PHY_LINK_SPEED_100MBPS:
391 ecmd->speed = SPEED_100; 391 ethtool_cmd_speed_set(ecmd, SPEED_100);
392 break; 392 break;
393 case PHY_LINK_SPEED_1GBPS: 393 case PHY_LINK_SPEED_1GBPS:
394 ecmd->speed = SPEED_1000; 394 ethtool_cmd_speed_set(ecmd, SPEED_1000);
395 break; 395 break;
396 case PHY_LINK_SPEED_10GBPS: 396 case PHY_LINK_SPEED_10GBPS:
397 ecmd->speed = SPEED_10000; 397 ethtool_cmd_speed_set(ecmd, SPEED_10000);
398 break; 398 break;
399 case PHY_LINK_SPEED_ZERO: 399 case PHY_LINK_SPEED_ZERO:
400 ecmd->speed = 0; 400 ethtool_cmd_speed_set(ecmd, 0);
401 break; 401 break;
402 } 402 }
403 } 403 }
@@ -440,14 +440,14 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
440 } 440 }
441 441
442 /* Save for future use */ 442 /* Save for future use */
443 adapter->link_speed = ecmd->speed; 443 adapter->link_speed = ethtool_cmd_speed(ecmd);
444 adapter->port_type = ecmd->port; 444 adapter->port_type = ecmd->port;
445 adapter->transceiver = ecmd->transceiver; 445 adapter->transceiver = ecmd->transceiver;
446 adapter->autoneg = ecmd->autoneg; 446 adapter->autoneg = ecmd->autoneg;
447 dma_free_coherent(&adapter->pdev->dev, phy_cmd.size, phy_cmd.va, 447 dma_free_coherent(&adapter->pdev->dev, phy_cmd.size, phy_cmd.va,
448 phy_cmd.dma); 448 phy_cmd.dma);
449 } else { 449 } else {
450 ecmd->speed = adapter->link_speed; 450 ethtool_cmd_speed_set(ecmd, adapter->link_speed);
451 ecmd->port = adapter->port_type; 451 ecmd->port = adapter->port_type;
452 ecmd->transceiver = adapter->transceiver; 452 ecmd->transceiver = adapter->transceiver;
453 ecmd->autoneg = adapter->autoneg; 453 ecmd->autoneg = adapter->autoneg;