diff options
author | Jiri Pirko <jiri@resnulli.us> | 2014-06-06 14:17:01 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-07 01:24:07 +0200 |
commit | d4f3cd49d2800dc037724efa9b33c485a1cc23d3 (patch) | |
tree | d04f2c9e6a07b9d8224be2cd303f6d3566993cad /drivers/s390 | |
parent | net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate (diff) | |
download | linux-d4f3cd49d2800dc037724efa9b33c485a1cc23d3.tar.xz linux-d4f3cd49d2800dc037724efa9b33c485a1cc23d3.zip |
net: use ethtool_cmd_speed_set helper to set ethtool speed value
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 549e9fd5bfdc..18ddb249c917 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -5726,6 +5726,7 @@ int qeth_core_ethtool_get_settings(struct net_device *netdev, struct qeth_card *card = netdev->ml_priv; enum qeth_link_types link_type; struct carrier_info carrier_info; + u32 speed; if ((card->info.type == QETH_CARD_TYPE_IQD) || (card->info.guestlan)) link_type = QETH_LINK_TYPE_10GBIT_ETH; @@ -5740,28 +5741,29 @@ int qeth_core_ethtool_get_settings(struct net_device *netdev, case QETH_LINK_TYPE_FAST_ETH: case QETH_LINK_TYPE_LANE_ETH100: qeth_set_ecmd_adv_sup(ecmd, SPEED_100, PORT_TP); - ecmd->speed = SPEED_100; + speed = SPEED_100; ecmd->port = PORT_TP; break; case QETH_LINK_TYPE_GBIT_ETH: case QETH_LINK_TYPE_LANE_ETH1000: qeth_set_ecmd_adv_sup(ecmd, SPEED_1000, PORT_FIBRE); - ecmd->speed = SPEED_1000; + speed = SPEED_1000; ecmd->port = PORT_FIBRE; break; case QETH_LINK_TYPE_10GBIT_ETH: qeth_set_ecmd_adv_sup(ecmd, SPEED_10000, PORT_FIBRE); - ecmd->speed = SPEED_10000; + speed = SPEED_10000; ecmd->port = PORT_FIBRE; break; default: qeth_set_ecmd_adv_sup(ecmd, SPEED_10, PORT_TP); - ecmd->speed = SPEED_10; + speed = SPEED_10; ecmd->port = PORT_TP; } + ethtool_cmd_speed_set(ecmd, speed); /* Check if we can obtain more accurate information. */ /* If QUERY_CARD_INFO command is not supported or fails, */ @@ -5806,18 +5808,19 @@ int qeth_core_ethtool_get_settings(struct net_device *netdev, switch (carrier_info.port_speed) { case CARD_INFO_PORTS_10M: - ecmd->speed = SPEED_10; + speed = SPEED_10; break; case CARD_INFO_PORTS_100M: - ecmd->speed = SPEED_100; + speed = SPEED_100; break; case CARD_INFO_PORTS_1G: - ecmd->speed = SPEED_1000; + speed = SPEED_1000; break; case CARD_INFO_PORTS_10G: - ecmd->speed = SPEED_10000; + speed = SPEED_10000; break; } + ethtool_cmd_speed_set(ecmd, speed); return 0; } |