aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r--drivers/net/e1000e/ethtool.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 62421ce96311..875d769531fd 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -249,7 +249,7 @@ static int e1000_set_settings(struct net_device *netdev,
249 ADVERTISED_Autoneg; 249 ADVERTISED_Autoneg;
250 ecmd->advertising = hw->phy.autoneg_advertised; 250 ecmd->advertising = hw->phy.autoneg_advertised;
251 if (adapter->fc_autoneg) 251 if (adapter->fc_autoneg)
252 hw->fc.original_type = e1000_fc_default; 252 hw->fc.requested_mode = e1000_fc_default;
253 } else { 253 } else {
254 if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) { 254 if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
255 clear_bit(__E1000_RESETTING, &adapter->state); 255 clear_bit(__E1000_RESETTING, &adapter->state);
@@ -279,11 +279,11 @@ static void e1000_get_pauseparam(struct net_device *netdev,
279 pause->autoneg = 279 pause->autoneg =
280 (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); 280 (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
281 281
282 if (hw->fc.type == e1000_fc_rx_pause) { 282 if (hw->fc.current_mode == e1000_fc_rx_pause) {
283 pause->rx_pause = 1; 283 pause->rx_pause = 1;
284 } else if (hw->fc.type == e1000_fc_tx_pause) { 284 } else if (hw->fc.current_mode == e1000_fc_tx_pause) {
285 pause->tx_pause = 1; 285 pause->tx_pause = 1;
286 } else if (hw->fc.type == e1000_fc_full) { 286 } else if (hw->fc.current_mode == e1000_fc_full) {
287 pause->rx_pause = 1; 287 pause->rx_pause = 1;
288 pause->tx_pause = 1; 288 pause->tx_pause = 1;
289 } 289 }
@@ -301,19 +301,8 @@ static int e1000_set_pauseparam(struct net_device *netdev,
301 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 301 while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
302 msleep(1); 302 msleep(1);
303 303
304 if (pause->rx_pause && pause->tx_pause)
305 hw->fc.type = e1000_fc_full;
306 else if (pause->rx_pause && !pause->tx_pause)
307 hw->fc.type = e1000_fc_rx_pause;
308 else if (!pause->rx_pause && pause->tx_pause)
309 hw->fc.type = e1000_fc_tx_pause;
310 else if (!pause->rx_pause && !pause->tx_pause)
311 hw->fc.type = e1000_fc_none;
312
313 hw->fc.original_type = hw->fc.type;
314
315 if (adapter->fc_autoneg == AUTONEG_ENABLE) { 304 if (adapter->fc_autoneg == AUTONEG_ENABLE) {
316 hw->fc.type = e1000_fc_default; 305 hw->fc.requested_mode = e1000_fc_default;
317 if (netif_running(adapter->netdev)) { 306 if (netif_running(adapter->netdev)) {
318 e1000e_down(adapter); 307 e1000e_down(adapter);
319 e1000e_up(adapter); 308 e1000e_up(adapter);
@@ -321,6 +310,17 @@ static int e1000_set_pauseparam(struct net_device *netdev,
321 e1000e_reset(adapter); 310 e1000e_reset(adapter);
322 } 311 }
323 } else { 312 } else {
313 if (pause->rx_pause && pause->tx_pause)
314 hw->fc.requested_mode = e1000_fc_full;
315 else if (pause->rx_pause && !pause->tx_pause)
316 hw->fc.requested_mode = e1000_fc_rx_pause;
317 else if (!pause->rx_pause && pause->tx_pause)
318 hw->fc.requested_mode = e1000_fc_tx_pause;
319 else if (!pause->rx_pause && !pause->tx_pause)
320 hw->fc.requested_mode = e1000_fc_none;
321
322 hw->fc.current_mode = hw->fc.requested_mode;
323
324 retval = ((hw->phy.media_type == e1000_media_type_fiber) ? 324 retval = ((hw->phy.media_type == e1000_media_type_fiber) ?
325 hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw)); 325 hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw));
326 } 326 }