aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2006-03-02 21:46:29 -0500
committerroot <root@jk-desktop.jf.intel.com>2006-03-02 21:46:29 -0500
commit0f15a8fae8b8558f5a9b0fec770846c487c779f6 (patch)
treecacee876371cfbcb33e8e5a5410359f4d21b67ef /drivers/net/e1000/e1000_main.c
parent30320be88fb9cae888eacf1f1eaae95a03720128 (diff)
e1000: Added driver comments and whitespace changes. Modified long lines of code to ensure they would not wrap beyond 80 characters.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c101
1 files changed, 39 insertions, 62 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b572a1218c81..9adaf5fa9d48 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -29,6 +29,23 @@
29#include "e1000.h" 29#include "e1000.h"
30 30
31/* Change Log 31/* Change Log
32 * 7.0.33 3-Feb-2006
33 * o Added another fix for the pass false carrier bit
34 * 7.0.32 24-Jan-2006
35 * o Need to rebuild with noew version number for the pass false carrier
36 * fix in e1000_hw.c
37 * 7.0.30 18-Jan-2006
38 * o fixup for tso workaround to disable it for pci-x
39 * o fix mem leak on 82542
40 * o fixes for 10 Mb/s connections and incorrect stats
41 * 7.0.28 01/06/2006
42 * o hardware workaround to only set "speed mode" bit for 1G link.
43 * 7.0.26 12/23/2005
44 * o wake on lan support modified for device ID 10B5
45 * o fix dhcp + vlan issue not making it to the iAMT firmware
46 * 7.0.24 12/9/2005
47 * o New hardware support for the Gigabit NIC embedded in the south bridge
48 * o Fixes to the recycling logic (skb->tail) from IBM LTC
32 * 6.3.9 12/16/2005 49 * 6.3.9 12/16/2005
33 * o incorporate fix for recycled skbs from IBM LTC 50 * o incorporate fix for recycled skbs from IBM LTC
34 * 6.3.7 11/18/2005 51 * 6.3.7 11/18/2005
@@ -46,54 +63,8 @@
46 * rx_buffer_len 63 * rx_buffer_len
47 * 6.3.1 9/19/05 64 * 6.3.1 9/19/05
48 * o Use adapter->tx_timeout_factor in Tx Hung Detect logic 65 * o Use adapter->tx_timeout_factor in Tx Hung Detect logic
49 (e1000_clean_tx_irq) 66 * (e1000_clean_tx_irq)
50 * o Support for 8086:10B5 device (Quad Port) 67 * o Support for 8086:10B5 device (Quad Port)
51 * 6.2.14 9/15/05
52 * o In AMT enabled configurations, set/reset DRV_LOAD bit on interface
53 * open/close
54 * 6.2.13 9/14/05
55 * o Invoke e1000_check_mng_mode only for 8257x controllers since it
56 * accesses the FWSM that is not supported in other controllers
57 * 6.2.12 9/9/05
58 * o Add support for device id E1000_DEV_ID_82546GB_QUAD_COPPER
59 * o set RCTL:SECRC only for controllers newer than 82543.
60 * o When the n/w interface comes down reset DRV_LOAD bit to notify f/w.
61 * This code was moved from e1000_remove to e1000_close
62 * 6.2.10 9/6/05
63 * o Fix error in updating RDT in el1000_alloc_rx_buffers[_ps] -- one off.
64 * o Enable fc by default on 82573 controllers (do not read eeprom)
65 * o Fix rx_errors statistic not to include missed_packet_count
66 * o Fix rx_dropped statistic not to include missed_packet_count
67 (Padraig Brady)
68 * 6.2.9 8/30/05
69 * o Remove call to update statistics from the controller ib e1000_get_stats
70 * 6.2.8 8/30/05
71 * o Improved algorithm for rx buffer allocation/rdt update
72 * o Flow control watermarks relative to rx PBA size
73 * o Simplified 'Tx Hung' detect logic
74 * 6.2.7 8/17/05
75 * o Report rx buffer allocation failures and tx timeout counts in stats
76 * 6.2.6 8/16/05
77 * o Implement workaround for controller erratum -- linear non-tso packet
78 * following a TSO gets written back prematurely
79 * 6.2.5 8/15/05
80 * o Set netdev->tx_queue_len based on link speed/duplex settings.
81 * o Fix net_stats.rx_fifo_errors <p@draigBrady.com>
82 * o Do not power off PHY if SoL/IDER session is active
83 * 6.2.4 8/10/05
84 * o Fix loopback test setup/cleanup for 82571/3 controllers
85 * o Fix parsing of outgoing packets (e1000_transfer_dhcp_info) to treat
86 * all packets as raw
87 * o Prevent operations that will cause the PHY to be reset if SoL/IDER
88 * sessions are active and log a message
89 * 6.2.2 7/21/05
90 * o used fixed size descriptors for all MTU sizes, reduces memory load
91 * 6.1.2 4/13/05
92 * o Fixed ethtool diagnostics
93 * o Enabled flow control to take default eeprom settings
94 * o Added stats_lock around e1000_read_phy_reg commands to avoid concurrent
95 * calls, one from mii_ioctl and other from within update_stats while
96 * processing MIIREG ioctl.
97 */ 68 */
98 69
99char e1000_driver_name[] = "e1000"; 70char e1000_driver_name[] = "e1000";
@@ -178,13 +149,13 @@ int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
178void e1000_free_all_tx_resources(struct e1000_adapter *adapter); 149void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
179void e1000_free_all_rx_resources(struct e1000_adapter *adapter); 150void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
180static int e1000_setup_tx_resources(struct e1000_adapter *adapter, 151static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
181 struct e1000_tx_ring *txdr); 152 struct e1000_tx_ring *txdr);
182static int e1000_setup_rx_resources(struct e1000_adapter *adapter, 153static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
183 struct e1000_rx_ring *rxdr); 154 struct e1000_rx_ring *rxdr);
184static void e1000_free_tx_resources(struct e1000_adapter *adapter, 155static void e1000_free_tx_resources(struct e1000_adapter *adapter,
185 struct e1000_tx_ring *tx_ring); 156 struct e1000_tx_ring *tx_ring);
186static void e1000_free_rx_resources(struct e1000_adapter *adapter, 157static void e1000_free_rx_resources(struct e1000_adapter *adapter,
187 struct e1000_rx_ring *rx_ring); 158 struct e1000_rx_ring *rx_ring);
188void e1000_update_stats(struct e1000_adapter *adapter); 159void e1000_update_stats(struct e1000_adapter *adapter);
189 160
190/* Local Function Prototypes */ 161/* Local Function Prototypes */
@@ -1727,6 +1698,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
1727 uint32_t rdlen, rctl, rxcsum, ctrl_ext; 1698 uint32_t rdlen, rctl, rxcsum, ctrl_ext;
1728 1699
1729 if (adapter->rx_ps_pages) { 1700 if (adapter->rx_ps_pages) {
1701 /* this is a 32 byte descriptor */
1730 rdlen = adapter->rx_ring[0].count * 1702 rdlen = adapter->rx_ring[0].count *
1731 sizeof(union e1000_rx_desc_packet_split); 1703 sizeof(union e1000_rx_desc_packet_split);
1732 adapter->clean_rx = e1000_clean_rx_irq_ps; 1704 adapter->clean_rx = e1000_clean_rx_irq_ps;
@@ -2576,9 +2548,9 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2576 /* Workaround for Controller erratum -- 2548 /* Workaround for Controller erratum --
2577 * descriptor for non-tso packet in a linear SKB that follows a 2549 * descriptor for non-tso packet in a linear SKB that follows a
2578 * tso gets written back prematurely before the data is fully 2550 * tso gets written back prematurely before the data is fully
2579 * DMAd to the controller */ 2551 * DMA'd to the controller */
2580 if (!skb->data_len && tx_ring->last_tx_tso && 2552 if (!skb->data_len && tx_ring->last_tx_tso &&
2581 !skb_shinfo(skb)->tso_size) { 2553 !skb_shinfo(skb)->tso_size) {
2582 tx_ring->last_tx_tso = 0; 2554 tx_ring->last_tx_tso = 0;
2583 size -= 4; 2555 size -= 4;
2584 } 2556 }
@@ -2866,7 +2838,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2866#ifdef NETIF_F_TSO 2838#ifdef NETIF_F_TSO
2867 /* Controller Erratum workaround */ 2839 /* Controller Erratum workaround */
2868 if (!skb->data_len && tx_ring->last_tx_tso && 2840 if (!skb->data_len && tx_ring->last_tx_tso &&
2869 !skb_shinfo(skb)->tso_size) 2841 !skb_shinfo(skb)->tso_size)
2870 count++; 2842 count++;
2871#endif 2843#endif
2872 2844
@@ -2889,7 +2861,9 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2889 if (adapter->pcix_82544) 2861 if (adapter->pcix_82544)
2890 count += nr_frags; 2862 count += nr_frags;
2891 2863
2892 if (adapter->hw.tx_pkt_filtering && (adapter->hw.mac_type == e1000_82573) ) 2864
2865 if (adapter->hw.tx_pkt_filtering &&
2866 (adapter->hw.mac_type == e1000_82573))
2893 e1000_transfer_dhcp_info(adapter, skb); 2867 e1000_transfer_dhcp_info(adapter, skb);
2894 2868
2895 local_irq_save(flags); 2869 local_irq_save(flags);
@@ -3892,7 +3866,6 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
3892 goto map_skb; 3866 goto map_skb;
3893 } 3867 }
3894 3868
3895
3896 if (unlikely(!skb)) { 3869 if (unlikely(!skb)) {
3897 /* Better luck next round */ 3870 /* Better luck next round */
3898 adapter->alloc_rx_buff_failed++; 3871 adapter->alloc_rx_buff_failed++;
@@ -4445,8 +4418,8 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
4445} 4418}
4446 4419
4447#ifdef CONFIG_PM 4420#ifdef CONFIG_PM
4448/* these functions save and restore 16 or 64 dwords (64-256 bytes) of config 4421/* Save/restore 16 or 64 dwords of PCI config space depending on which
4449 * space versus the 64 bytes that pci_[save|restore]_state handle 4422 * bus we're on (PCI(X) vs. PCI-E)
4450 */ 4423 */
4451#define PCIE_CONFIG_SPACE_LEN 256 4424#define PCIE_CONFIG_SPACE_LEN 256
4452#define PCI_CONFIG_SPACE_LEN 64 4425#define PCI_CONFIG_SPACE_LEN 64
@@ -4456,6 +4429,7 @@ e1000_pci_save_state(struct e1000_adapter *adapter)
4456 struct pci_dev *dev = adapter->pdev; 4429 struct pci_dev *dev = adapter->pdev;
4457 int size; 4430 int size;
4458 int i; 4431 int i;
4432
4459 if (adapter->hw.mac_type >= e1000_82571) 4433 if (adapter->hw.mac_type >= e1000_82571)
4460 size = PCIE_CONFIG_SPACE_LEN; 4434 size = PCIE_CONFIG_SPACE_LEN;
4461 else 4435 else
@@ -4479,8 +4453,10 @@ e1000_pci_restore_state(struct e1000_adapter *adapter)
4479 struct pci_dev *dev = adapter->pdev; 4453 struct pci_dev *dev = adapter->pdev;
4480 int size; 4454 int size;
4481 int i; 4455 int i;
4456
4482 if (adapter->config_space == NULL) 4457 if (adapter->config_space == NULL)
4483 return; 4458 return;
4459
4484 if (adapter->hw.mac_type >= e1000_82571) 4460 if (adapter->hw.mac_type >= e1000_82571)
4485 size = PCIE_CONFIG_SPACE_LEN; 4461 size = PCIE_CONFIG_SPACE_LEN;
4486 else 4462 else
@@ -4508,8 +4484,8 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4508 e1000_down(adapter); 4484 e1000_down(adapter);
4509 4485
4510#ifdef CONFIG_PM 4486#ifdef CONFIG_PM
4511 /* implement our own version of pci_save_state(pdev) because pci 4487 /* Implement our own version of pci_save_state(pdev) because pci-
4512 * express adapters have larger 256 byte config spaces */ 4488 * express adapters have 256-byte config spaces. */
4513 retval = e1000_pci_save_state(adapter); 4489 retval = e1000_pci_save_state(adapter);
4514 if (retval) 4490 if (retval)
4515 return retval; 4491 return retval;
@@ -4566,7 +4542,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4566 retval = pci_enable_wake(pdev, PCI_D3hot, 0); 4542 retval = pci_enable_wake(pdev, PCI_D3hot, 0);
4567 if (retval) 4543 if (retval)
4568 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); 4544 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4569 retval = pci_enable_wake(pdev, PCI_D3cold, 0); /* 4 == D3 cold */ 4545 retval = pci_enable_wake(pdev, PCI_D3cold, 0);
4570 if (retval) 4546 if (retval)
4571 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); 4547 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
4572 } 4548 }
@@ -4582,7 +4558,8 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4582 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); 4558 DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
4583 retval = pci_enable_wake(pdev, PCI_D3cold, 1); 4559 retval = pci_enable_wake(pdev, PCI_D3cold, 1);
4584 if (retval) 4560 if (retval)
4585 DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); 4561 DPRINTK(PROBE, ERR,
4562 "Error enabling D3 cold wake\n");
4586 } 4563 }
4587 } 4564 }
4588 4565