aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-04-14 23:19:41 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-14 23:19:41 -0400
commit8fc65162a8f25929be80c8d6321a3479e92b5aae (patch)
treecfad5c32408bbdc59a43db16c88f2bea7face7a5
parent2acab771b7e676125cb8c96b61dcdefe9ba67e57 (diff)
parent99a1f9e88694b406b7c334153bacb56adfcf8388 (diff)
Merge branch '7.0.38-k2' of git://66.93.40.222/srv/git/netdev-2.6
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/net/e1000/Makefile1
-rw-r--r--drivers/net/e1000/e1000.h6
-rw-r--r--drivers/net/e1000/e1000_ethtool.c3
-rw-r--r--drivers/net/e1000/e1000_hw.c3
-rw-r--r--drivers/net/e1000/e1000_hw.h3
-rw-r--r--drivers/net/e1000/e1000_main.c198
-rw-r--r--drivers/net/e1000/e1000_osdep.h3
-rw-r--r--drivers/net/e1000/e1000_param.c3
9 files changed, 118 insertions, 108 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 6d3c401ccdb6..b6dc07f1d63d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1395,6 +1395,8 @@ P: Jesse Brandeburg
1395M: jesse.brandeburg@intel.com 1395M: jesse.brandeburg@intel.com
1396P: Jeff Kirsher 1396P: Jeff Kirsher
1397M: jeffrey.t.kirsher@intel.com 1397M: jeffrey.t.kirsher@intel.com
1398P: Auke Kok
1399M: auke-jan.h.kok@intel.com
1398W: http://sourceforge.net/projects/e1000/ 1400W: http://sourceforge.net/projects/e1000/
1399S: Supported 1401S: Supported
1400 1402
@@ -1407,6 +1409,8 @@ P: Jesse Brandeburg
1407M: jesse.brandeburg@intel.com 1409M: jesse.brandeburg@intel.com
1408P: Jeff Kirsher 1410P: Jeff Kirsher
1409M: jeffrey.t.kirsher@intel.com 1411M: jeffrey.t.kirsher@intel.com
1412P: Auke Kok
1413M: auke-jan.h.kok@intel.com
1410W: http://sourceforge.net/projects/e1000/ 1414W: http://sourceforge.net/projects/e1000/
1411S: Supported 1415S: Supported
1412 1416
@@ -1419,6 +1423,8 @@ P: John Ronciak
1419M: john.ronciak@intel.com 1423M: john.ronciak@intel.com
1420P: Jesse Brandeburg 1424P: Jesse Brandeburg
1421M: jesse.brandeburg@intel.com 1425M: jesse.brandeburg@intel.com
1426P: Auke Kok
1427M: auke-jan.h.kok@intel.com
1422W: http://sourceforge.net/projects/e1000/ 1428W: http://sourceforge.net/projects/e1000/
1423S: Supported 1429S: Supported
1424 1430
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index ca9f89552da3..92823ac89d42 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -22,6 +22,7 @@
22# 22#
23# Contact Information: 23# Contact Information:
24# Linux NICS <linux.nics@intel.com> 24# Linux NICS <linux.nics@intel.com>
25# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26# 27#
27################################################################################ 28################################################################################
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 281de41d030a..2bc34fbfa69c 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
@@ -114,6 +115,8 @@ struct e1000_adapter;
114/* Supported Rx Buffer Sizes */ 115/* Supported Rx Buffer Sizes */
115#define E1000_RXBUFFER_128 128 /* Used for packet split */ 116#define E1000_RXBUFFER_128 128 /* Used for packet split */
116#define E1000_RXBUFFER_256 256 /* Used for packet split */ 117#define E1000_RXBUFFER_256 256 /* Used for packet split */
118#define E1000_RXBUFFER_512 512
119#define E1000_RXBUFFER_1024 1024
117#define E1000_RXBUFFER_2048 2048 120#define E1000_RXBUFFER_2048 2048
118#define E1000_RXBUFFER_4096 4096 121#define E1000_RXBUFFER_4096 4096
119#define E1000_RXBUFFER_8192 8192 122#define E1000_RXBUFFER_8192 8192
@@ -334,7 +337,6 @@ struct e1000_adapter {
334 boolean_t have_msi; 337 boolean_t have_msi;
335#endif 338#endif
336 /* to not mess up cache alignment, always add to the bottom */ 339 /* to not mess up cache alignment, always add to the bottom */
337 boolean_t txb2b;
338#ifdef NETIF_F_TSO 340#ifdef NETIF_F_TSO
339 boolean_t tso_force; 341 boolean_t tso_force;
340#endif 342#endif
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index ecccca35c6f4..e48dc578fde2 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 523c2c9fc0ac..4c796e54b840 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 150e45e30f87..03d07ebde4f7 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index add8dc4aa7b0..82d443ba3612 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
@@ -74,9 +75,9 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
74#else 75#else
75#define DRIVERNAPI "-NAPI" 76#define DRIVERNAPI "-NAPI"
76#endif 77#endif
77#define DRV_VERSION "7.0.33-k2"DRIVERNAPI 78#define DRV_VERSION "7.0.38-k2"DRIVERNAPI
78char e1000_driver_version[] = DRV_VERSION; 79char e1000_driver_version[] = DRV_VERSION;
79static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation."; 80static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
80 81
81/* e1000_pci_tbl - PCI Device ID Table 82/* e1000_pci_tbl - PCI Device ID Table
82 * 83 *
@@ -208,8 +209,8 @@ static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
208static void e1000_tx_timeout(struct net_device *dev); 209static void e1000_tx_timeout(struct net_device *dev);
209static void e1000_reset_task(struct net_device *dev); 210static void e1000_reset_task(struct net_device *dev);
210static void e1000_smartspeed(struct e1000_adapter *adapter); 211static void e1000_smartspeed(struct e1000_adapter *adapter);
211static inline int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, 212static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
212 struct sk_buff *skb); 213 struct sk_buff *skb);
213 214
214static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); 215static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
215static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); 216static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
@@ -291,7 +292,7 @@ module_exit(e1000_exit_module);
291 * @adapter: board private structure 292 * @adapter: board private structure
292 **/ 293 **/
293 294
294static inline void 295static void
295e1000_irq_disable(struct e1000_adapter *adapter) 296e1000_irq_disable(struct e1000_adapter *adapter)
296{ 297{
297 atomic_inc(&adapter->irq_sem); 298 atomic_inc(&adapter->irq_sem);
@@ -305,7 +306,7 @@ e1000_irq_disable(struct e1000_adapter *adapter)
305 * @adapter: board private structure 306 * @adapter: board private structure
306 **/ 307 **/
307 308
308static inline void 309static void
309e1000_irq_enable(struct e1000_adapter *adapter) 310e1000_irq_enable(struct e1000_adapter *adapter)
310{ 311{
311 if (likely(atomic_dec_and_test(&adapter->irq_sem))) { 312 if (likely(atomic_dec_and_test(&adapter->irq_sem))) {
@@ -349,7 +350,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
349 * 350 *
350 **/ 351 **/
351 352
352static inline void 353static void
353e1000_release_hw_control(struct e1000_adapter *adapter) 354e1000_release_hw_control(struct e1000_adapter *adapter)
354{ 355{
355 uint32_t ctrl_ext; 356 uint32_t ctrl_ext;
@@ -359,6 +360,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
359 switch (adapter->hw.mac_type) { 360 switch (adapter->hw.mac_type) {
360 case e1000_82571: 361 case e1000_82571:
361 case e1000_82572: 362 case e1000_82572:
363 case e1000_80003es2lan:
362 ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT); 364 ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
363 E1000_WRITE_REG(&adapter->hw, CTRL_EXT, 365 E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
364 ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD); 366 ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
@@ -383,7 +385,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
383 * 385 *
384 **/ 386 **/
385 387
386static inline void 388static void
387e1000_get_hw_control(struct e1000_adapter *adapter) 389e1000_get_hw_control(struct e1000_adapter *adapter)
388{ 390{
389 uint32_t ctrl_ext; 391 uint32_t ctrl_ext;
@@ -392,6 +394,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
392 switch (adapter->hw.mac_type) { 394 switch (adapter->hw.mac_type) {
393 case e1000_82571: 395 case e1000_82571:
394 case e1000_82572: 396 case e1000_82572:
397 case e1000_80003es2lan:
395 ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT); 398 ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
396 E1000_WRITE_REG(&adapter->hw, CTRL_EXT, 399 E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
397 ctrl_ext | E1000_CTRL_EXT_DRV_LOAD); 400 ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
@@ -419,7 +422,7 @@ e1000_up(struct e1000_adapter *adapter)
419 uint16_t mii_reg; 422 uint16_t mii_reg;
420 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg); 423 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
421 if (mii_reg & MII_CR_POWER_DOWN) 424 if (mii_reg & MII_CR_POWER_DOWN)
422 e1000_phy_reset(&adapter->hw); 425 e1000_phy_hw_reset(&adapter->hw);
423 } 426 }
424 427
425 e1000_set_multi(netdev); 428 e1000_set_multi(netdev);
@@ -970,8 +973,8 @@ e1000_sw_init(struct e1000_adapter *adapter)
970 973
971 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); 974 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
972 975
973 adapter->rx_buffer_len = E1000_RXBUFFER_2048; 976 adapter->rx_buffer_len = MAXIMUM_ETHERNET_FRAME_SIZE;
974 adapter->rx_ps_bsize0 = E1000_RXBUFFER_256; 977 adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
975 hw->max_frame_size = netdev->mtu + 978 hw->max_frame_size = netdev->mtu +
976 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; 979 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
977 hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE; 980 hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
@@ -1179,7 +1182,7 @@ e1000_close(struct net_device *netdev)
1179 * @start: address of beginning of memory 1182 * @start: address of beginning of memory
1180 * @len: length of memory 1183 * @len: length of memory
1181 **/ 1184 **/
1182static inline boolean_t 1185static boolean_t
1183e1000_check_64k_bound(struct e1000_adapter *adapter, 1186e1000_check_64k_bound(struct e1000_adapter *adapter,
1184 void *start, unsigned long len) 1187 void *start, unsigned long len)
1185{ 1188{
@@ -1597,14 +1600,21 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
1597 rctl |= E1000_RCTL_LPE; 1600 rctl |= E1000_RCTL_LPE;
1598 1601
1599 /* Setup buffer sizes */ 1602 /* Setup buffer sizes */
1600 if (adapter->hw.mac_type >= e1000_82571) { 1603 rctl &= ~E1000_RCTL_SZ_4096;
1601 /* We can now specify buffers in 1K increments. 1604 rctl |= E1000_RCTL_BSEX;
1602 * BSIZE and BSEX are ignored in this case. */ 1605 switch (adapter->rx_buffer_len) {
1603 rctl |= adapter->rx_buffer_len << 0x11; 1606 case E1000_RXBUFFER_256:
1604 } else { 1607 rctl |= E1000_RCTL_SZ_256;
1605 rctl &= ~E1000_RCTL_SZ_4096; 1608 rctl &= ~E1000_RCTL_BSEX;
1606 rctl |= E1000_RCTL_BSEX; 1609 break;
1607 switch (adapter->rx_buffer_len) { 1610 case E1000_RXBUFFER_512:
1611 rctl |= E1000_RCTL_SZ_512;
1612 rctl &= ~E1000_RCTL_BSEX;
1613 break;
1614 case E1000_RXBUFFER_1024:
1615 rctl |= E1000_RCTL_SZ_1024;
1616 rctl &= ~E1000_RCTL_BSEX;
1617 break;
1608 case E1000_RXBUFFER_2048: 1618 case E1000_RXBUFFER_2048:
1609 default: 1619 default:
1610 rctl |= E1000_RCTL_SZ_2048; 1620 rctl |= E1000_RCTL_SZ_2048;
@@ -1619,7 +1629,6 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
1619 case E1000_RXBUFFER_16384: 1629 case E1000_RXBUFFER_16384:
1620 rctl |= E1000_RCTL_SZ_16384; 1630 rctl |= E1000_RCTL_SZ_16384;
1621 break; 1631 break;
1622 }
1623 } 1632 }
1624 1633
1625#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT 1634#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
@@ -1713,7 +1722,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
1713 if (hw->mac_type >= e1000_82571) { 1722 if (hw->mac_type >= e1000_82571) {
1714 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); 1723 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
1715 /* Reset delay timers after every interrupt */ 1724 /* Reset delay timers after every interrupt */
1716 ctrl_ext |= E1000_CTRL_EXT_CANC; 1725 ctrl_ext |= E1000_CTRL_EXT_INT_TIMER_CLR;
1717#ifdef CONFIG_E1000_NAPI 1726#ifdef CONFIG_E1000_NAPI
1718 /* Auto-Mask interrupts upon ICR read. */ 1727 /* Auto-Mask interrupts upon ICR read. */
1719 ctrl_ext |= E1000_CTRL_EXT_IAME; 1728 ctrl_ext |= E1000_CTRL_EXT_IAME;
@@ -1805,7 +1814,7 @@ e1000_free_all_tx_resources(struct e1000_adapter *adapter)
1805 e1000_free_tx_resources(adapter, &adapter->tx_ring[i]); 1814 e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
1806} 1815}
1807 1816
1808static inline void 1817static void
1809e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, 1818e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
1810 struct e1000_buffer *buffer_info) 1819 struct e1000_buffer *buffer_info)
1811{ 1820{
@@ -2245,6 +2254,7 @@ e1000_watchdog_task(struct e1000_adapter *adapter)
2245 2254
2246 if (link) { 2255 if (link) {
2247 if (!netif_carrier_ok(netdev)) { 2256 if (!netif_carrier_ok(netdev)) {
2257 boolean_t txb2b = 1;
2248 e1000_get_speed_and_duplex(&adapter->hw, 2258 e1000_get_speed_and_duplex(&adapter->hw,
2249 &adapter->link_speed, 2259 &adapter->link_speed,
2250 &adapter->link_duplex); 2260 &adapter->link_duplex);
@@ -2258,23 +2268,22 @@ e1000_watchdog_task(struct e1000_adapter *adapter)
2258 * and adjust the timeout factor */ 2268 * and adjust the timeout factor */
2259 netdev->tx_queue_len = adapter->tx_queue_len; 2269 netdev->tx_queue_len = adapter->tx_queue_len;
2260 adapter->tx_timeout_factor = 1; 2270 adapter->tx_timeout_factor = 1;
2261 adapter->txb2b = 1;
2262 switch (adapter->link_speed) { 2271 switch (adapter->link_speed) {
2263 case SPEED_10: 2272 case SPEED_10:
2264 adapter->txb2b = 0; 2273 txb2b = 0;
2265 netdev->tx_queue_len = 10; 2274 netdev->tx_queue_len = 10;
2266 adapter->tx_timeout_factor = 8; 2275 adapter->tx_timeout_factor = 8;
2267 break; 2276 break;
2268 case SPEED_100: 2277 case SPEED_100:
2269 adapter->txb2b = 0; 2278 txb2b = 0;
2270 netdev->tx_queue_len = 100; 2279 netdev->tx_queue_len = 100;
2271 /* maybe add some timeout factor ? */ 2280 /* maybe add some timeout factor ? */
2272 break; 2281 break;
2273 } 2282 }
2274 2283
2275 if ((adapter->hw.mac_type == e1000_82571 || 2284 if ((adapter->hw.mac_type == e1000_82571 ||
2276 adapter->hw.mac_type == e1000_82572) && 2285 adapter->hw.mac_type == e1000_82572) &&
2277 adapter->txb2b == 0) { 2286 txb2b == 0) {
2278#define SPEED_MODE_BIT (1 << 21) 2287#define SPEED_MODE_BIT (1 << 21)
2279 uint32_t tarc0; 2288 uint32_t tarc0;
2280 tarc0 = E1000_READ_REG(&adapter->hw, TARC0); 2289 tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
@@ -2398,7 +2407,7 @@ e1000_watchdog_task(struct e1000_adapter *adapter)
2398#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 2407#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
2399#define E1000_TX_FLAGS_VLAN_SHIFT 16 2408#define E1000_TX_FLAGS_VLAN_SHIFT 16
2400 2409
2401static inline int 2410static int
2402e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2411e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2403 struct sk_buff *skb) 2412 struct sk_buff *skb)
2404{ 2413{
@@ -2478,7 +2487,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2478 return FALSE; 2487 return FALSE;
2479} 2488}
2480 2489
2481static inline boolean_t 2490static boolean_t
2482e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2491e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2483 struct sk_buff *skb) 2492 struct sk_buff *skb)
2484{ 2493{
@@ -2514,7 +2523,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2514#define E1000_MAX_TXD_PWR 12 2523#define E1000_MAX_TXD_PWR 12
2515#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR) 2524#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR)
2516 2525
2517static inline int 2526static int
2518e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2527e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2519 struct sk_buff *skb, unsigned int first, unsigned int max_per_txd, 2528 struct sk_buff *skb, unsigned int first, unsigned int max_per_txd,
2520 unsigned int nr_frags, unsigned int mss) 2529 unsigned int nr_frags, unsigned int mss)
@@ -2623,7 +2632,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2623 return count; 2632 return count;
2624} 2633}
2625 2634
2626static inline void 2635static void
2627e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2636e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2628 int tx_flags, int count) 2637 int tx_flags, int count)
2629{ 2638{
@@ -2687,7 +2696,7 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2687#define E1000_FIFO_HDR 0x10 2696#define E1000_FIFO_HDR 0x10
2688#define E1000_82547_PAD_LEN 0x3E0 2697#define E1000_82547_PAD_LEN 0x3E0
2689 2698
2690static inline int 2699static int
2691e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb) 2700e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb)
2692{ 2701{
2693 uint32_t fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head; 2702 uint32_t fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
@@ -2714,7 +2723,7 @@ no_fifo_stall_required:
2714} 2723}
2715 2724
2716#define MINIMUM_DHCP_PACKET_SIZE 282 2725#define MINIMUM_DHCP_PACKET_SIZE 282
2717static inline int 2726static int
2718e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) 2727e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
2719{ 2728{
2720 struct e1000_hw *hw = &adapter->hw; 2729 struct e1000_hw *hw = &adapter->hw;
@@ -2980,8 +2989,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
2980 2989
2981 /* Adapter-specific max frame size limits. */ 2990 /* Adapter-specific max frame size limits. */
2982 switch (adapter->hw.mac_type) { 2991 switch (adapter->hw.mac_type) {
2983 case e1000_82542_rev2_0: 2992 case e1000_undefined ... e1000_82542_rev2_1:
2984 case e1000_82542_rev2_1:
2985 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) { 2993 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
2986 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); 2994 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
2987 return -EINVAL; 2995 return -EINVAL;
@@ -3015,27 +3023,32 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
3015 break; 3023 break;
3016 } 3024 }
3017 3025
3018 3026 /* NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
3019 if (adapter->hw.mac_type > e1000_82547_rev_2) { 3027 * means we reserve 2 more, this pushes us to allocate from the next
3020 adapter->rx_buffer_len = max_frame; 3028 * larger slab size
3021 E1000_ROUNDUP(adapter->rx_buffer_len, 1024); 3029 * i.e. RXBUFFER_2048 --> size-4096 slab */
3022 } else { 3030
3023 if(unlikely((adapter->hw.mac_type < e1000_82543) && 3031 if (max_frame <= E1000_RXBUFFER_256)
3024 (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) { 3032 adapter->rx_buffer_len = E1000_RXBUFFER_256;
3025 DPRINTK(PROBE, ERR, "Jumbo Frames not supported " 3033 else if (max_frame <= E1000_RXBUFFER_512)
3026 "on 82542\n"); 3034 adapter->rx_buffer_len = E1000_RXBUFFER_512;
3027 return -EINVAL; 3035 else if (max_frame <= E1000_RXBUFFER_1024)
3028 } else { 3036 adapter->rx_buffer_len = E1000_RXBUFFER_1024;
3029 if(max_frame <= E1000_RXBUFFER_2048) 3037 else if (max_frame <= E1000_RXBUFFER_2048)
3030 adapter->rx_buffer_len = E1000_RXBUFFER_2048; 3038 adapter->rx_buffer_len = E1000_RXBUFFER_2048;
3031 else if(max_frame <= E1000_RXBUFFER_4096) 3039 else if (max_frame <= E1000_RXBUFFER_4096)
3032 adapter->rx_buffer_len = E1000_RXBUFFER_4096; 3040 adapter->rx_buffer_len = E1000_RXBUFFER_4096;
3033 else if(max_frame <= E1000_RXBUFFER_8192) 3041 else if (max_frame <= E1000_RXBUFFER_8192)
3034 adapter->rx_buffer_len = E1000_RXBUFFER_8192; 3042 adapter->rx_buffer_len = E1000_RXBUFFER_8192;
3035 else if(max_frame <= E1000_RXBUFFER_16384) 3043 else if (max_frame <= E1000_RXBUFFER_16384)
3036 adapter->rx_buffer_len = E1000_RXBUFFER_16384; 3044 adapter->rx_buffer_len = E1000_RXBUFFER_16384;
3037 } 3045
3038 } 3046 /* adjust allocation if LPE protects us, and we aren't using SBP */
3047#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
3048 if (!adapter->hw.tbi_compatibility_on &&
3049 ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) ||
3050 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
3051 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
3039 3052
3040 netdev->mtu = new_mtu; 3053 netdev->mtu = new_mtu;
3041 3054
@@ -3163,7 +3176,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
3163 adapter->stats.crcerrs + adapter->stats.algnerrc + 3176 adapter->stats.crcerrs + adapter->stats.algnerrc +
3164 adapter->stats.ruc + adapter->stats.roc + 3177 adapter->stats.ruc + adapter->stats.roc +
3165 adapter->stats.cexterr; 3178 adapter->stats.cexterr;
3166 adapter->net_stats.rx_dropped = 0;
3167 adapter->net_stats.rx_length_errors = adapter->stats.ruc + 3179 adapter->net_stats.rx_length_errors = adapter->stats.ruc +
3168 adapter->stats.roc; 3180 adapter->stats.roc;
3169 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; 3181 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
@@ -3389,13 +3401,15 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
3389 3401
3390 tx_ring->next_to_clean = i; 3402 tx_ring->next_to_clean = i;
3391 3403
3392 spin_lock(&tx_ring->tx_lock); 3404#define TX_WAKE_THRESHOLD 32
3393
3394 if (unlikely(cleaned && netif_queue_stopped(netdev) && 3405 if (unlikely(cleaned && netif_queue_stopped(netdev) &&
3395 netif_carrier_ok(netdev))) 3406 netif_carrier_ok(netdev))) {
3396 netif_wake_queue(netdev); 3407 spin_lock(&tx_ring->tx_lock);
3397 3408 if (netif_queue_stopped(netdev) &&
3398 spin_unlock(&tx_ring->tx_lock); 3409 (E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))
3410 netif_wake_queue(netdev);
3411 spin_unlock(&tx_ring->tx_lock);
3412 }
3399 3413
3400 if (adapter->detect_tx_hung) { 3414 if (adapter->detect_tx_hung) {
3401 /* Detect a transmit hang in hardware, this serializes the 3415 /* Detect a transmit hang in hardware, this serializes the
@@ -3443,7 +3457,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
3443 * @sk_buff: socket buffer with received data 3457 * @sk_buff: socket buffer with received data
3444 **/ 3458 **/
3445 3459
3446static inline void 3460static void
3447e1000_rx_checksum(struct e1000_adapter *adapter, 3461e1000_rx_checksum(struct e1000_adapter *adapter,
3448 uint32_t status_err, uint32_t csum, 3462 uint32_t status_err, uint32_t csum,
3449 struct sk_buff *skb) 3463 struct sk_buff *skb)
@@ -3567,10 +3581,12 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3567 flags); 3581 flags);
3568 length--; 3582 length--;
3569 } else { 3583 } else {
3570 dev_kfree_skb_irq(skb); 3584 /* recycle */
3585 buffer_info->skb = skb;
3571 goto next_desc; 3586 goto next_desc;
3572 } 3587 }
3573 } 3588 } else
3589 skb_put(skb, length);
3574 3590
3575 /* code added for copybreak, this should improve 3591 /* code added for copybreak, this should improve
3576 * performance for small packets with large amounts 3592 * performance for small packets with large amounts
@@ -3675,6 +3691,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3675 i = rx_ring->next_to_clean; 3691 i = rx_ring->next_to_clean;
3676 rx_desc = E1000_RX_DESC_PS(*rx_ring, i); 3692 rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
3677 staterr = le32_to_cpu(rx_desc->wb.middle.status_error); 3693 staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
3694 buffer_info = &rx_ring->buffer_info[i];
3678 3695
3679 while (staterr & E1000_RXD_STAT_DD) { 3696 while (staterr & E1000_RXD_STAT_DD) {
3680 buffer_info = &rx_ring->buffer_info[i]; 3697 buffer_info = &rx_ring->buffer_info[i];
@@ -3735,7 +3752,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3735 3752
3736 /* page alloc/put takes too long and effects small packet 3753 /* page alloc/put takes too long and effects small packet
3737 * throughput, so unsplit small packets and save the alloc/put*/ 3754 * throughput, so unsplit small packets and save the alloc/put*/
3738 if (l1 && ((length + l1) < E1000_CB_LENGTH)) { 3755 if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) {
3739 u8 *vaddr; 3756 u8 *vaddr;
3740 /* there is no documentation about how to call 3757 /* there is no documentation about how to call
3741 * kmap_atomic, so we can't hold the mapping 3758 * kmap_atomic, so we can't hold the mapping
@@ -3768,6 +3785,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3768 ps_page->ps_page[j] = NULL; 3785 ps_page->ps_page[j] = NULL;
3769 skb->len += length; 3786 skb->len += length;
3770 skb->data_len += length; 3787 skb->data_len += length;
3788 skb->truesize += length;
3771 } 3789 }
3772 3790
3773copydone: 3791copydone:
@@ -4515,21 +4533,13 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4515 4533
4516 E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); 4534 E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN);
4517 E1000_WRITE_REG(&adapter->hw, WUFC, wufc); 4535 E1000_WRITE_REG(&adapter->hw, WUFC, wufc);
4518 retval = pci_enable_wake(pdev, PCI_D3hot, 1); 4536 pci_enable_wake(pdev, PCI_D3hot, 1);
4519 if (retval) 4537 pci_enable_wake(pdev, PCI_D3cold, 1);
4520 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4521 retval = pci_enable_wake(pdev, PCI_D3cold, 1);
4522 if (retval)
4523 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
4524 } else { 4538 } else {
4525 E1000_WRITE_REG(&adapter->hw, WUC, 0); 4539 E1000_WRITE_REG(&adapter->hw, WUC, 0);
4526 E1000_WRITE_REG(&adapter->hw, WUFC, 0); 4540 E1000_WRITE_REG(&adapter->hw, WUFC, 0);
4527 retval = pci_enable_wake(pdev, PCI_D3hot, 0); 4541 pci_enable_wake(pdev, PCI_D3hot, 0);
4528 if (retval) 4542 pci_enable_wake(pdev, PCI_D3cold, 0);
4529 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4530 retval = pci_enable_wake(pdev, PCI_D3cold, 0);
4531 if (retval)
4532 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
4533 } 4543 }
4534 4544
4535 if (adapter->hw.mac_type >= e1000_82540 && 4545 if (adapter->hw.mac_type >= e1000_82540 &&
@@ -4538,13 +4548,8 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4538 if (manc & E1000_MANC_SMBUS_EN) { 4548 if (manc & E1000_MANC_SMBUS_EN) {
4539 manc |= E1000_MANC_ARP_EN; 4549 manc |= E1000_MANC_ARP_EN;
4540 E1000_WRITE_REG(&adapter->hw, MANC, manc); 4550 E1000_WRITE_REG(&adapter->hw, MANC, manc);
4541 retval = pci_enable_wake(pdev, PCI_D3hot, 1); 4551 pci_enable_wake(pdev, PCI_D3hot, 1);
4542 if (retval) 4552 pci_enable_wake(pdev, PCI_D3cold, 1);
4543 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4544 retval = pci_enable_wake(pdev, PCI_D3cold, 1);
4545 if (retval)
4546 DPRINTK(PROBE, ERR,
4547 "Error enabling D3 cold wake\n");
4548 } 4553 }
4549 } 4554 }
4550 4555
@@ -4554,9 +4559,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4554 4559
4555 pci_disable_device(pdev); 4560 pci_disable_device(pdev);
4556 4561
4557 retval = pci_set_power_state(pdev, pci_choose_state(pdev, state)); 4562 pci_set_power_state(pdev, pci_choose_state(pdev, state));
4558 if (retval)
4559 DPRINTK(PROBE, ERR, "Error in setting power state\n");
4560 4563
4561 return 0; 4564 return 0;
4562} 4565}
@@ -4567,22 +4570,15 @@ e1000_resume(struct pci_dev *pdev)
4567{ 4570{
4568 struct net_device *netdev = pci_get_drvdata(pdev); 4571 struct net_device *netdev = pci_get_drvdata(pdev);
4569 struct e1000_adapter *adapter = netdev_priv(netdev); 4572 struct e1000_adapter *adapter = netdev_priv(netdev);
4570 int retval;
4571 uint32_t manc, ret_val; 4573 uint32_t manc, ret_val;
4572 4574
4573 retval = pci_set_power_state(pdev, PCI_D0); 4575 pci_set_power_state(pdev, PCI_D0);
4574 if (retval)
4575 DPRINTK(PROBE, ERR, "Error in setting power state\n");
4576 e1000_pci_restore_state(adapter); 4576 e1000_pci_restore_state(adapter);
4577 ret_val = pci_enable_device(pdev); 4577 ret_val = pci_enable_device(pdev);
4578 pci_set_master(pdev); 4578 pci_set_master(pdev);
4579 4579
4580 retval = pci_enable_wake(pdev, PCI_D3hot, 0); 4580 pci_enable_wake(pdev, PCI_D3hot, 0);
4581 if (retval) 4581 pci_enable_wake(pdev, PCI_D3cold, 0);
4582 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4583 retval = pci_enable_wake(pdev, PCI_D3cold, 0);
4584 if (retval)
4585 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
4586 4582
4587 e1000_reset(adapter); 4583 e1000_reset(adapter);
4588 E1000_WRITE_REG(&adapter->hw, WUS, ~0); 4584 E1000_WRITE_REG(&adapter->hw, WUS, ~0);
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index 9790db974dc1..048d052be29d 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index e0a4d37d1b85..e55f8969a0fb 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/