diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 88d54d3efcef..73d43c53015a 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/netdevice.h> | 36 | #include <linux/netdevice.h> |
37 | #include <linux/tcp.h> | 37 | #include <linux/tcp.h> |
38 | #include <linux/ipv6.h> | 38 | #include <linux/ipv6.h> |
39 | #include <linux/slab.h> | ||
39 | #include <net/checksum.h> | 40 | #include <net/checksum.h> |
40 | #include <net/ip6_checksum.h> | 41 | #include <net/ip6_checksum.h> |
41 | #include <linux/mii.h> | 42 | #include <linux/mii.h> |
@@ -660,6 +661,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
660 | i = 0; | 661 | i = 0; |
661 | } | 662 | } |
662 | 663 | ||
664 | if (i == tx_ring->next_to_use) | ||
665 | break; | ||
663 | eop = tx_ring->buffer_info[i].next_to_watch; | 666 | eop = tx_ring->buffer_info[i].next_to_watch; |
664 | eop_desc = E1000_TX_DESC(*tx_ring, eop); | 667 | eop_desc = E1000_TX_DESC(*tx_ring, eop); |
665 | } | 668 | } |
@@ -2289,8 +2292,6 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) | |||
2289 | ew32(TCTL, tctl); | 2292 | ew32(TCTL, tctl); |
2290 | 2293 | ||
2291 | e1000e_config_collision_dist(hw); | 2294 | e1000e_config_collision_dist(hw); |
2292 | |||
2293 | adapter->tx_queue_len = adapter->netdev->tx_queue_len; | ||
2294 | } | 2295 | } |
2295 | 2296 | ||
2296 | /** | 2297 | /** |
@@ -2877,7 +2878,6 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
2877 | del_timer_sync(&adapter->watchdog_timer); | 2878 | del_timer_sync(&adapter->watchdog_timer); |
2878 | del_timer_sync(&adapter->phy_info_timer); | 2879 | del_timer_sync(&adapter->phy_info_timer); |
2879 | 2880 | ||
2880 | netdev->tx_queue_len = adapter->tx_queue_len; | ||
2881 | netif_carrier_off(netdev); | 2881 | netif_carrier_off(netdev); |
2882 | adapter->link_speed = 0; | 2882 | adapter->link_speed = 0; |
2883 | adapter->link_duplex = 0; | 2883 | adapter->link_duplex = 0; |
@@ -3588,21 +3588,15 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3588 | "link gets many collisions.\n"); | 3588 | "link gets many collisions.\n"); |
3589 | } | 3589 | } |
3590 | 3590 | ||
3591 | /* | 3591 | /* adjust timeout factor according to speed/duplex */ |
3592 | * tweak tx_queue_len according to speed/duplex | ||
3593 | * and adjust the timeout factor | ||
3594 | */ | ||
3595 | netdev->tx_queue_len = adapter->tx_queue_len; | ||
3596 | adapter->tx_timeout_factor = 1; | 3592 | adapter->tx_timeout_factor = 1; |
3597 | switch (adapter->link_speed) { | 3593 | switch (adapter->link_speed) { |
3598 | case SPEED_10: | 3594 | case SPEED_10: |
3599 | txb2b = 0; | 3595 | txb2b = 0; |
3600 | netdev->tx_queue_len = 10; | ||
3601 | adapter->tx_timeout_factor = 16; | 3596 | adapter->tx_timeout_factor = 16; |
3602 | break; | 3597 | break; |
3603 | case SPEED_100: | 3598 | case SPEED_100: |
3604 | txb2b = 0; | 3599 | txb2b = 0; |
3605 | netdev->tx_queue_len = 100; | ||
3606 | adapter->tx_timeout_factor = 10; | 3600 | adapter->tx_timeout_factor = 10; |
3607 | break; | 3601 | break; |
3608 | } | 3602 | } |