aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-07-11 18:17:02 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 19:34:33 -0400
commit6479884509e6cd30c6708fbf05fafc0d1fc85f7a (patch)
tree261e980073b9984611d950f7e9f043141b52612e /drivers/net/e1000/e1000_main.c
parentcdc18a670923d01a762d66be582bfe763772d441 (diff)
e1000: neaten function declarations
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c307
1 files changed, 116 insertions, 191 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cf12b05cd011..9a20ba39346b 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -232,8 +232,7 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
232 * loaded. All it does is register with the PCI subsystem. 232 * loaded. All it does is register with the PCI subsystem.
233 **/ 233 **/
234 234
235static int __init 235static int __init e1000_init_module(void)
236e1000_init_module(void)
237{ 236{
238 int ret; 237 int ret;
239 printk(KERN_INFO "%s - version %s\n", 238 printk(KERN_INFO "%s - version %s\n",
@@ -261,8 +260,7 @@ module_init(e1000_init_module);
261 * from memory. 260 * from memory.
262 **/ 261 **/
263 262
264static void __exit 263static void __exit e1000_exit_module(void)
265e1000_exit_module(void)
266{ 264{
267 pci_unregister_driver(&e1000_driver); 265 pci_unregister_driver(&e1000_driver);
268} 266}
@@ -311,8 +309,7 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
311 * @adapter: board private structure 309 * @adapter: board private structure
312 **/ 310 **/
313 311
314static void 312static void e1000_irq_disable(struct e1000_adapter *adapter)
315e1000_irq_disable(struct e1000_adapter *adapter)
316{ 313{
317 E1000_WRITE_REG(&adapter->hw, IMC, ~0); 314 E1000_WRITE_REG(&adapter->hw, IMC, ~0);
318 E1000_WRITE_FLUSH(&adapter->hw); 315 E1000_WRITE_FLUSH(&adapter->hw);
@@ -324,15 +321,13 @@ e1000_irq_disable(struct e1000_adapter *adapter)
324 * @adapter: board private structure 321 * @adapter: board private structure
325 **/ 322 **/
326 323
327static void 324static void e1000_irq_enable(struct e1000_adapter *adapter)
328e1000_irq_enable(struct e1000_adapter *adapter)
329{ 325{
330 E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); 326 E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
331 E1000_WRITE_FLUSH(&adapter->hw); 327 E1000_WRITE_FLUSH(&adapter->hw);
332} 328}
333 329
334static void 330static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
335e1000_update_mng_vlan(struct e1000_adapter *adapter)
336{ 331{
337 struct net_device *netdev = adapter->netdev; 332 struct net_device *netdev = adapter->netdev;
338 u16 vid = adapter->hw.mng_cookie.vlan_id; 333 u16 vid = adapter->hw.mng_cookie.vlan_id;
@@ -366,8 +361,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
366 * 361 *
367 **/ 362 **/
368 363
369static void 364static void e1000_release_hw_control(struct e1000_adapter *adapter)
370e1000_release_hw_control(struct e1000_adapter *adapter)
371{ 365{
372 u32 ctrl_ext; 366 u32 ctrl_ext;
373 u32 swsm; 367 u32 swsm;
@@ -403,8 +397,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
403 * 397 *
404 **/ 398 **/
405 399
406static void 400static void e1000_get_hw_control(struct e1000_adapter *adapter)
407e1000_get_hw_control(struct e1000_adapter *adapter)
408{ 401{
409 u32 ctrl_ext; 402 u32 ctrl_ext;
410 u32 swsm; 403 u32 swsm;
@@ -429,8 +422,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
429 } 422 }
430} 423}
431 424
432static void 425static void e1000_init_manageability(struct e1000_adapter *adapter)
433e1000_init_manageability(struct e1000_adapter *adapter)
434{ 426{
435 if (adapter->en_mng_pt) { 427 if (adapter->en_mng_pt) {
436 u32 manc = E1000_READ_REG(&adapter->hw, MANC); 428 u32 manc = E1000_READ_REG(&adapter->hw, MANC);
@@ -456,8 +448,7 @@ e1000_init_manageability(struct e1000_adapter *adapter)
456 } 448 }
457} 449}
458 450
459static void 451static void e1000_release_manageability(struct e1000_adapter *adapter)
460e1000_release_manageability(struct e1000_adapter *adapter)
461{ 452{
462 if (adapter->en_mng_pt) { 453 if (adapter->en_mng_pt) {
463 u32 manc = E1000_READ_REG(&adapter->hw, MANC); 454 u32 manc = E1000_READ_REG(&adapter->hw, MANC);
@@ -591,8 +582,7 @@ out:
591 return; 582 return;
592} 583}
593 584
594void 585void e1000_down(struct e1000_adapter *adapter)
595e1000_down(struct e1000_adapter *adapter)
596{ 586{
597 struct net_device *netdev = adapter->netdev; 587 struct net_device *netdev = adapter->netdev;
598 588
@@ -620,8 +610,7 @@ e1000_down(struct e1000_adapter *adapter)
620 e1000_clean_all_rx_rings(adapter); 610 e1000_clean_all_rx_rings(adapter);
621} 611}
622 612
623void 613void e1000_reinit_locked(struct e1000_adapter *adapter)
624e1000_reinit_locked(struct e1000_adapter *adapter)
625{ 614{
626 WARN_ON(in_interrupt()); 615 WARN_ON(in_interrupt());
627 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) 616 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
@@ -631,8 +620,7 @@ e1000_reinit_locked(struct e1000_adapter *adapter)
631 clear_bit(__E1000_RESETTING, &adapter->flags); 620 clear_bit(__E1000_RESETTING, &adapter->flags);
632} 621}
633 622
634void 623void e1000_reset(struct e1000_adapter *adapter)
635e1000_reset(struct e1000_adapter *adapter)
636{ 624{
637 u32 pba = 0, tx_space, min_tx_space, min_rx_space; 625 u32 pba = 0, tx_space, min_tx_space, min_rx_space;
638 u16 fc_high_water_mark = E1000_FC_HIGH_DIFF; 626 u16 fc_high_water_mark = E1000_FC_HIGH_DIFF;
@@ -1231,8 +1219,7 @@ err_dma:
1231 * memory. 1219 * memory.
1232 **/ 1220 **/
1233 1221
1234static void __devexit 1222static void __devexit e1000_remove(struct pci_dev *pdev)
1235e1000_remove(struct pci_dev *pdev)
1236{ 1223{
1237 struct net_device *netdev = pci_get_drvdata(pdev); 1224 struct net_device *netdev = pci_get_drvdata(pdev);
1238 struct e1000_adapter *adapter = netdev_priv(netdev); 1225 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -1283,8 +1270,7 @@ e1000_remove(struct pci_dev *pdev)
1283 * OS network device settings (MTU size). 1270 * OS network device settings (MTU size).
1284 **/ 1271 **/
1285 1272
1286static int __devinit 1273static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1287e1000_sw_init(struct e1000_adapter *adapter)
1288{ 1274{
1289 struct e1000_hw *hw = &adapter->hw; 1275 struct e1000_hw *hw = &adapter->hw;
1290 struct net_device *netdev = adapter->netdev; 1276 struct net_device *netdev = adapter->netdev;
@@ -1377,8 +1363,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
1377 * intended for Multiqueue, but should work fine with a single queue. 1363 * intended for Multiqueue, but should work fine with a single queue.
1378 **/ 1364 **/
1379 1365
1380static int __devinit 1366static int __devinit e1000_alloc_queues(struct e1000_adapter *adapter)
1381e1000_alloc_queues(struct e1000_adapter *adapter)
1382{ 1367{
1383 adapter->tx_ring = kcalloc(adapter->num_tx_queues, 1368 adapter->tx_ring = kcalloc(adapter->num_tx_queues,
1384 sizeof(struct e1000_tx_ring), GFP_KERNEL); 1369 sizeof(struct e1000_tx_ring), GFP_KERNEL);
@@ -1419,8 +1404,7 @@ e1000_alloc_queues(struct e1000_adapter *adapter)
1419 * and the stack is notified that the interface is ready. 1404 * and the stack is notified that the interface is ready.
1420 **/ 1405 **/
1421 1406
1422static int 1407static int e1000_open(struct net_device *netdev)
1423e1000_open(struct net_device *netdev)
1424{ 1408{
1425 struct e1000_adapter *adapter = netdev_priv(netdev); 1409 struct e1000_adapter *adapter = netdev_priv(netdev);
1426 int err; 1410 int err;
@@ -1503,8 +1487,7 @@ err_setup_tx:
1503 * hardware, and all transmit and receive resources are freed. 1487 * hardware, and all transmit and receive resources are freed.
1504 **/ 1488 **/
1505 1489
1506static int 1490static int e1000_close(struct net_device *netdev)
1507e1000_close(struct net_device *netdev)
1508{ 1491{
1509 struct e1000_adapter *adapter = netdev_priv(netdev); 1492 struct e1000_adapter *adapter = netdev_priv(netdev);
1510 1493
@@ -1540,9 +1523,8 @@ e1000_close(struct net_device *netdev)
1540 * @start: address of beginning of memory 1523 * @start: address of beginning of memory
1541 * @len: length of memory 1524 * @len: length of memory
1542 **/ 1525 **/
1543static bool 1526static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
1544e1000_check_64k_bound(struct e1000_adapter *adapter, 1527 unsigned long len)
1545 void *start, unsigned long len)
1546{ 1528{
1547 unsigned long begin = (unsigned long) start; 1529 unsigned long begin = (unsigned long) start;
1548 unsigned long end = begin + len; 1530 unsigned long end = begin + len;
@@ -1565,9 +1547,8 @@ e1000_check_64k_bound(struct e1000_adapter *adapter,
1565 * Return 0 on success, negative on failure 1547 * Return 0 on success, negative on failure
1566 **/ 1548 **/
1567 1549
1568static int 1550static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
1569e1000_setup_tx_resources(struct e1000_adapter *adapter, 1551 struct e1000_tx_ring *txdr)
1570 struct e1000_tx_ring *txdr)
1571{ 1552{
1572 struct pci_dev *pdev = adapter->pdev; 1553 struct pci_dev *pdev = adapter->pdev;
1573 int size; 1554 int size;
@@ -1641,8 +1622,7 @@ setup_tx_desc_die:
1641 * Return 0 on success, negative on failure 1622 * Return 0 on success, negative on failure
1642 **/ 1623 **/
1643 1624
1644int 1625int e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
1645e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
1646{ 1626{
1647 int i, err = 0; 1627 int i, err = 0;
1648 1628
@@ -1668,8 +1648,7 @@ e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
1668 * Configure the Tx unit of the MAC after a reset. 1648 * Configure the Tx unit of the MAC after a reset.
1669 **/ 1649 **/
1670 1650
1671static void 1651static void e1000_configure_tx(struct e1000_adapter *adapter)
1672e1000_configure_tx(struct e1000_adapter *adapter)
1673{ 1652{
1674 u64 tdba; 1653 u64 tdba;
1675 struct e1000_hw *hw = &adapter->hw; 1654 struct e1000_hw *hw = &adapter->hw;
@@ -1782,9 +1761,8 @@ e1000_configure_tx(struct e1000_adapter *adapter)
1782 * Returns 0 on success, negative on failure 1761 * Returns 0 on success, negative on failure
1783 **/ 1762 **/
1784 1763
1785static int 1764static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
1786e1000_setup_rx_resources(struct e1000_adapter *adapter, 1765 struct e1000_rx_ring *rxdr)
1787 struct e1000_rx_ring *rxdr)
1788{ 1766{
1789 struct pci_dev *pdev = adapter->pdev; 1767 struct pci_dev *pdev = adapter->pdev;
1790 int size, desc_len; 1768 int size, desc_len;
@@ -1887,8 +1865,7 @@ setup_rx_desc_die:
1887 * Return 0 on success, negative on failure 1865 * Return 0 on success, negative on failure
1888 **/ 1866 **/
1889 1867
1890int 1868int e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
1891e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
1892{ 1869{
1893 int i, err = 0; 1870 int i, err = 0;
1894 1871
@@ -1913,8 +1890,7 @@ e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
1913 **/ 1890 **/
1914#define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \ 1891#define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \
1915 (((S) & (PAGE_SIZE - 1)) ? 1 : 0)) 1892 (((S) & (PAGE_SIZE - 1)) ? 1 : 0))
1916static void 1893static void e1000_setup_rctl(struct e1000_adapter *adapter)
1917e1000_setup_rctl(struct e1000_adapter *adapter)
1918{ 1894{
1919 u32 rctl, rfctl; 1895 u32 rctl, rfctl;
1920 u32 psrctl = 0; 1896 u32 psrctl = 0;
@@ -2031,8 +2007,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
2031 * Configure the Rx unit of the MAC after a reset. 2007 * Configure the Rx unit of the MAC after a reset.
2032 **/ 2008 **/
2033 2009
2034static void 2010static void e1000_configure_rx(struct e1000_adapter *adapter)
2035e1000_configure_rx(struct e1000_adapter *adapter)
2036{ 2011{
2037 u64 rdba; 2012 u64 rdba;
2038 struct e1000_hw *hw = &adapter->hw; 2013 struct e1000_hw *hw = &adapter->hw;
@@ -2131,9 +2106,8 @@ e1000_configure_rx(struct e1000_adapter *adapter)
2131 * Free all transmit software resources 2106 * Free all transmit software resources
2132 **/ 2107 **/
2133 2108
2134static void 2109static void e1000_free_tx_resources(struct e1000_adapter *adapter,
2135e1000_free_tx_resources(struct e1000_adapter *adapter, 2110 struct e1000_tx_ring *tx_ring)
2136 struct e1000_tx_ring *tx_ring)
2137{ 2111{
2138 struct pci_dev *pdev = adapter->pdev; 2112 struct pci_dev *pdev = adapter->pdev;
2139 2113
@@ -2154,8 +2128,7 @@ e1000_free_tx_resources(struct e1000_adapter *adapter,
2154 * Free all transmit software resources 2128 * Free all transmit software resources
2155 **/ 2129 **/
2156 2130
2157void 2131void e1000_free_all_tx_resources(struct e1000_adapter *adapter)
2158e1000_free_all_tx_resources(struct e1000_adapter *adapter)
2159{ 2132{
2160 int i; 2133 int i;
2161 2134
@@ -2163,9 +2136,8 @@ e1000_free_all_tx_resources(struct e1000_adapter *adapter)
2163 e1000_free_tx_resources(adapter, &adapter->tx_ring[i]); 2136 e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
2164} 2137}
2165 2138
2166static void 2139static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
2167e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, 2140 struct e1000_buffer *buffer_info)
2168 struct e1000_buffer *buffer_info)
2169{ 2141{
2170 if (buffer_info->dma) { 2142 if (buffer_info->dma) {
2171 pci_unmap_page(adapter->pdev, 2143 pci_unmap_page(adapter->pdev,
@@ -2187,9 +2159,8 @@ e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
2187 * @tx_ring: ring to be cleaned 2159 * @tx_ring: ring to be cleaned
2188 **/ 2160 **/
2189 2161
2190static void 2162static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
2191e1000_clean_tx_ring(struct e1000_adapter *adapter, 2163 struct e1000_tx_ring *tx_ring)
2192 struct e1000_tx_ring *tx_ring)
2193{ 2164{
2194 struct e1000_buffer *buffer_info; 2165 struct e1000_buffer *buffer_info;
2195 unsigned long size; 2166 unsigned long size;
@@ -2222,8 +2193,7 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter,
2222 * @adapter: board private structure 2193 * @adapter: board private structure
2223 **/ 2194 **/
2224 2195
2225static void 2196static void e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
2226e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
2227{ 2197{
2228 int i; 2198 int i;
2229 2199
@@ -2239,9 +2209,8 @@ e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
2239 * Free all receive software resources 2209 * Free all receive software resources
2240 **/ 2210 **/
2241 2211
2242static void 2212static void e1000_free_rx_resources(struct e1000_adapter *adapter,
2243e1000_free_rx_resources(struct e1000_adapter *adapter, 2213 struct e1000_rx_ring *rx_ring)
2244 struct e1000_rx_ring *rx_ring)
2245{ 2214{
2246 struct pci_dev *pdev = adapter->pdev; 2215 struct pci_dev *pdev = adapter->pdev;
2247 2216
@@ -2266,8 +2235,7 @@ e1000_free_rx_resources(struct e1000_adapter *adapter,
2266 * Free all receive software resources 2235 * Free all receive software resources
2267 **/ 2236 **/
2268 2237
2269void 2238void e1000_free_all_rx_resources(struct e1000_adapter *adapter)
2270e1000_free_all_rx_resources(struct e1000_adapter *adapter)
2271{ 2239{
2272 int i; 2240 int i;
2273 2241
@@ -2281,9 +2249,8 @@ e1000_free_all_rx_resources(struct e1000_adapter *adapter)
2281 * @rx_ring: ring to free buffers from 2249 * @rx_ring: ring to free buffers from
2282 **/ 2250 **/
2283 2251
2284static void 2252static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
2285e1000_clean_rx_ring(struct e1000_adapter *adapter, 2253 struct e1000_rx_ring *rx_ring)
2286 struct e1000_rx_ring *rx_ring)
2287{ 2254{
2288 struct e1000_buffer *buffer_info; 2255 struct e1000_buffer *buffer_info;
2289 struct e1000_ps_page *ps_page; 2256 struct e1000_ps_page *ps_page;
@@ -2340,8 +2307,7 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter,
2340 * @adapter: board private structure 2307 * @adapter: board private structure
2341 **/ 2308 **/
2342 2309
2343static void 2310static void e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
2344e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
2345{ 2311{
2346 int i; 2312 int i;
2347 2313
@@ -2352,8 +2318,7 @@ e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
2352/* The 82542 2.0 (revision 2) needs to have the receive unit in reset 2318/* The 82542 2.0 (revision 2) needs to have the receive unit in reset
2353 * and memory write and invalidate disabled for certain operations 2319 * and memory write and invalidate disabled for certain operations
2354 */ 2320 */
2355static void 2321static void e1000_enter_82542_rst(struct e1000_adapter *adapter)
2356e1000_enter_82542_rst(struct e1000_adapter *adapter)
2357{ 2322{
2358 struct net_device *netdev = adapter->netdev; 2323 struct net_device *netdev = adapter->netdev;
2359 u32 rctl; 2324 u32 rctl;
@@ -2370,8 +2335,7 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter)
2370 e1000_clean_all_rx_rings(adapter); 2335 e1000_clean_all_rx_rings(adapter);
2371} 2336}
2372 2337
2373static void 2338static void e1000_leave_82542_rst(struct e1000_adapter *adapter)
2374e1000_leave_82542_rst(struct e1000_adapter *adapter)
2375{ 2339{
2376 struct net_device *netdev = adapter->netdev; 2340 struct net_device *netdev = adapter->netdev;
2377 u32 rctl; 2341 u32 rctl;
@@ -2401,8 +2365,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter)
2401 * Returns 0 on success, negative on failure 2365 * Returns 0 on success, negative on failure
2402 **/ 2366 **/
2403 2367
2404static int 2368static int e1000_set_mac(struct net_device *netdev, void *p)
2405e1000_set_mac(struct net_device *netdev, void *p)
2406{ 2369{
2407 struct e1000_adapter *adapter = netdev_priv(netdev); 2370 struct e1000_adapter *adapter = netdev_priv(netdev);
2408 struct sockaddr *addr = p; 2371 struct sockaddr *addr = p;
@@ -2452,8 +2415,7 @@ e1000_set_mac(struct net_device *netdev, void *p)
2452 * promiscuous mode, and all-multi behavior. 2415 * promiscuous mode, and all-multi behavior.
2453 **/ 2416 **/
2454 2417
2455static void 2418static void e1000_set_rx_mode(struct net_device *netdev)
2456e1000_set_rx_mode(struct net_device *netdev)
2457{ 2419{
2458 struct e1000_adapter *adapter = netdev_priv(netdev); 2420 struct e1000_adapter *adapter = netdev_priv(netdev);
2459 struct e1000_hw *hw = &adapter->hw; 2421 struct e1000_hw *hw = &adapter->hw;
@@ -2552,8 +2514,7 @@ e1000_set_rx_mode(struct net_device *netdev)
2552/* Need to wait a few seconds after link up to get diagnostic information from 2514/* Need to wait a few seconds after link up to get diagnostic information from
2553 * the phy */ 2515 * the phy */
2554 2516
2555static void 2517static void e1000_update_phy_info(unsigned long data)
2556e1000_update_phy_info(unsigned long data)
2557{ 2518{
2558 struct e1000_adapter *adapter = (struct e1000_adapter *) data; 2519 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
2559 e1000_phy_get_info(&adapter->hw, &adapter->phy_info); 2520 e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
@@ -2564,8 +2525,7 @@ e1000_update_phy_info(unsigned long data)
2564 * @data: pointer to adapter cast into an unsigned long 2525 * @data: pointer to adapter cast into an unsigned long
2565 **/ 2526 **/
2566 2527
2567static void 2528static void e1000_82547_tx_fifo_stall(unsigned long data)
2568e1000_82547_tx_fifo_stall(unsigned long data)
2569{ 2529{
2570 struct e1000_adapter *adapter = (struct e1000_adapter *) data; 2530 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
2571 struct net_device *netdev = adapter->netdev; 2531 struct net_device *netdev = adapter->netdev;
@@ -2605,8 +2565,7 @@ e1000_82547_tx_fifo_stall(unsigned long data)
2605 * e1000_watchdog - Timer Call-back 2565 * e1000_watchdog - Timer Call-back
2606 * @data: pointer to adapter cast into an unsigned long 2566 * @data: pointer to adapter cast into an unsigned long
2607 **/ 2567 **/
2608static void 2568static void e1000_watchdog(unsigned long data)
2609e1000_watchdog(unsigned long data)
2610{ 2569{
2611 struct e1000_adapter *adapter = (struct e1000_adapter *) data; 2570 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
2612 struct net_device *netdev = adapter->netdev; 2571 struct net_device *netdev = adapter->netdev;
@@ -2806,9 +2765,7 @@ enum latency_range {
2806 * @bytes: the number of bytes during this measurement interval 2765 * @bytes: the number of bytes during this measurement interval
2807 **/ 2766 **/
2808static unsigned int e1000_update_itr(struct e1000_adapter *adapter, 2767static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
2809 u16 itr_setting, 2768 u16 itr_setting, int packets, int bytes)
2810 int packets,
2811 int bytes)
2812{ 2769{
2813 unsigned int retval = itr_setting; 2770 unsigned int retval = itr_setting;
2814 struct e1000_hw *hw = &adapter->hw; 2771 struct e1000_hw *hw = &adapter->hw;
@@ -2926,9 +2883,8 @@ set_itr_now:
2926#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 2883#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
2927#define E1000_TX_FLAGS_VLAN_SHIFT 16 2884#define E1000_TX_FLAGS_VLAN_SHIFT 16
2928 2885
2929static int 2886static int e1000_tso(struct e1000_adapter *adapter,
2930e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2887 struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
2931 struct sk_buff *skb)
2932{ 2888{
2933 struct e1000_context_desc *context_desc; 2889 struct e1000_context_desc *context_desc;
2934 struct e1000_buffer *buffer_info; 2890 struct e1000_buffer *buffer_info;
@@ -2999,9 +2955,8 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2999 return false; 2955 return false;
3000} 2956}
3001 2957
3002static bool 2958static bool e1000_tx_csum(struct e1000_adapter *adapter,
3003e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2959 struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
3004 struct sk_buff *skb)
3005{ 2960{
3006 struct e1000_context_desc *context_desc; 2961 struct e1000_context_desc *context_desc;
3007 struct e1000_buffer *buffer_info; 2962 struct e1000_buffer *buffer_info;
@@ -3038,10 +2993,11 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3038#define E1000_MAX_TXD_PWR 12 2993#define E1000_MAX_TXD_PWR 12
3039#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR) 2994#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR)
3040 2995
3041static int 2996static int e1000_tx_map(struct e1000_adapter *adapter,
3042e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2997 struct e1000_tx_ring *tx_ring,
3043 struct sk_buff *skb, unsigned int first, unsigned int max_per_txd, 2998 struct sk_buff *skb, unsigned int first,
3044 unsigned int nr_frags, unsigned int mss) 2999 unsigned int max_per_txd, unsigned int nr_frags,
3000 unsigned int mss)
3045{ 3001{
3046 struct e1000_buffer *buffer_info; 3002 struct e1000_buffer *buffer_info;
3047 unsigned int len = skb->len; 3003 unsigned int len = skb->len;
@@ -3145,9 +3101,9 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3145 return count; 3101 return count;
3146} 3102}
3147 3103
3148static void 3104static void e1000_tx_queue(struct e1000_adapter *adapter,
3149e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 3105 struct e1000_tx_ring *tx_ring, int tx_flags,
3150 int tx_flags, int count) 3106 int count)
3151{ 3107{
3152 struct e1000_tx_desc *tx_desc = NULL; 3108 struct e1000_tx_desc *tx_desc = NULL;
3153 struct e1000_buffer *buffer_info; 3109 struct e1000_buffer *buffer_info;
@@ -3212,8 +3168,8 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3212#define E1000_FIFO_HDR 0x10 3168#define E1000_FIFO_HDR 0x10
3213#define E1000_82547_PAD_LEN 0x3E0 3169#define E1000_82547_PAD_LEN 0x3E0
3214 3170
3215static int 3171static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
3216e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb) 3172 struct sk_buff *skb)
3217{ 3173{
3218 u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head; 3174 u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
3219 u32 skb_fifo_len = skb->len + E1000_FIFO_HDR; 3175 u32 skb_fifo_len = skb->len + E1000_FIFO_HDR;
@@ -3239,8 +3195,8 @@ no_fifo_stall_required:
3239} 3195}
3240 3196
3241#define MINIMUM_DHCP_PACKET_SIZE 282 3197#define MINIMUM_DHCP_PACKET_SIZE 282
3242static int 3198static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
3243e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) 3199 struct sk_buff *skb)
3244{ 3200{
3245 struct e1000_hw *hw = &adapter->hw; 3201 struct e1000_hw *hw = &adapter->hw;
3246 u16 length, offset; 3202 u16 length, offset;
@@ -3304,8 +3260,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev,
3304} 3260}
3305 3261
3306#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) 3262#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
3307static int 3263static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3308e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3309{ 3264{
3310 struct e1000_adapter *adapter = netdev_priv(netdev); 3265 struct e1000_adapter *adapter = netdev_priv(netdev);
3311 struct e1000_tx_ring *tx_ring; 3266 struct e1000_tx_ring *tx_ring;
@@ -3482,8 +3437,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3482 * @netdev: network interface device structure 3437 * @netdev: network interface device structure
3483 **/ 3438 **/
3484 3439
3485static void 3440static void e1000_tx_timeout(struct net_device *netdev)
3486e1000_tx_timeout(struct net_device *netdev)
3487{ 3441{
3488 struct e1000_adapter *adapter = netdev_priv(netdev); 3442 struct e1000_adapter *adapter = netdev_priv(netdev);
3489 3443
@@ -3492,8 +3446,7 @@ e1000_tx_timeout(struct net_device *netdev)
3492 schedule_work(&adapter->reset_task); 3446 schedule_work(&adapter->reset_task);
3493} 3447}
3494 3448
3495static void 3449static void e1000_reset_task(struct work_struct *work)
3496e1000_reset_task(struct work_struct *work)
3497{ 3450{
3498 struct e1000_adapter *adapter = 3451 struct e1000_adapter *adapter =
3499 container_of(work, struct e1000_adapter, reset_task); 3452 container_of(work, struct e1000_adapter, reset_task);
@@ -3509,8 +3462,7 @@ e1000_reset_task(struct work_struct *work)
3509 * The statistics are actually updated from the timer callback. 3462 * The statistics are actually updated from the timer callback.
3510 **/ 3463 **/
3511 3464
3512static struct net_device_stats * 3465static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
3513e1000_get_stats(struct net_device *netdev)
3514{ 3466{
3515 struct e1000_adapter *adapter = netdev_priv(netdev); 3467 struct e1000_adapter *adapter = netdev_priv(netdev);
3516 3468
@@ -3526,8 +3478,7 @@ e1000_get_stats(struct net_device *netdev)
3526 * Returns 0 on success, negative on failure 3478 * Returns 0 on success, negative on failure
3527 **/ 3479 **/
3528 3480
3529static int 3481static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3530e1000_change_mtu(struct net_device *netdev, int new_mtu)
3531{ 3482{
3532 struct e1000_adapter *adapter = netdev_priv(netdev); 3483 struct e1000_adapter *adapter = netdev_priv(netdev);
3533 int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; 3484 int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
@@ -3620,8 +3571,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
3620 * @adapter: board private structure 3571 * @adapter: board private structure
3621 **/ 3572 **/
3622 3573
3623void 3574void e1000_update_stats(struct e1000_adapter *adapter)
3624e1000_update_stats(struct e1000_adapter *adapter)
3625{ 3575{
3626 struct e1000_hw *hw = &adapter->hw; 3576 struct e1000_hw *hw = &adapter->hw;
3627 struct pci_dev *pdev = adapter->pdev; 3577 struct pci_dev *pdev = adapter->pdev;
@@ -3794,8 +3744,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
3794 * @data: pointer to a network interface device structure 3744 * @data: pointer to a network interface device structure
3795 **/ 3745 **/
3796 3746
3797static irqreturn_t 3747static irqreturn_t e1000_intr_msi(int irq, void *data)
3798e1000_intr_msi(int irq, void *data)
3799{ 3748{
3800 struct net_device *netdev = data; 3749 struct net_device *netdev = data;
3801 struct e1000_adapter *adapter = netdev_priv(netdev); 3750 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3856,8 +3805,7 @@ e1000_intr_msi(int irq, void *data)
3856 * @data: pointer to a network interface device structure 3805 * @data: pointer to a network interface device structure
3857 **/ 3806 **/
3858 3807
3859static irqreturn_t 3808static irqreturn_t e1000_intr(int irq, void *data)
3860e1000_intr(int irq, void *data)
3861{ 3809{
3862 struct net_device *netdev = data; 3810 struct net_device *netdev = data;
3863 struct e1000_adapter *adapter = netdev_priv(netdev); 3811 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3954,8 +3902,7 @@ e1000_intr(int irq, void *data)
3954 * @adapter: board private structure 3902 * @adapter: board private structure
3955 **/ 3903 **/
3956 3904
3957static int 3905static int e1000_clean(struct napi_struct *napi, int budget)
3958e1000_clean(struct napi_struct *napi, int budget)
3959{ 3906{
3960 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); 3907 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
3961 struct net_device *poll_dev = adapter->netdev; 3908 struct net_device *poll_dev = adapter->netdev;
@@ -3997,9 +3944,8 @@ e1000_clean(struct napi_struct *napi, int budget)
3997 * @adapter: board private structure 3944 * @adapter: board private structure
3998 **/ 3945 **/
3999 3946
4000static bool 3947static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
4001e1000_clean_tx_irq(struct e1000_adapter *adapter, 3948 struct e1000_tx_ring *tx_ring)
4002 struct e1000_tx_ring *tx_ring)
4003{ 3949{
4004 struct net_device *netdev = adapter->netdev; 3950 struct net_device *netdev = adapter->netdev;
4005 struct e1000_tx_desc *tx_desc, *eop_desc; 3951 struct e1000_tx_desc *tx_desc, *eop_desc;
@@ -4111,10 +4057,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4111 * @sk_buff: socket buffer with received data 4057 * @sk_buff: socket buffer with received data
4112 **/ 4058 **/
4113 4059
4114static void 4060static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
4115e1000_rx_checksum(struct e1000_adapter *adapter, 4061 u32 csum, struct sk_buff *skb)
4116 u32 status_err, u32 csum,
4117 struct sk_buff *skb)
4118{ 4062{
4119 u16 status = (u16)status_err; 4063 u16 status = (u16)status_err;
4120 u8 errors = (u8)(status_err >> 24); 4064 u8 errors = (u8)(status_err >> 24);
@@ -4158,15 +4102,13 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
4158 * e1000_clean_rx_irq - Send received data up the network stack; legacy 4102 * e1000_clean_rx_irq - Send received data up the network stack; legacy
4159 * @adapter: board private structure 4103 * @adapter: board private structure
4160 **/ 4104 **/
4161
4162static bool
4163#ifdef CONFIG_E1000_NAPI 4105#ifdef CONFIG_E1000_NAPI
4164e1000_clean_rx_irq(struct e1000_adapter *adapter, 4106static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
4165 struct e1000_rx_ring *rx_ring, 4107 struct e1000_rx_ring *rx_ring,
4166 int *work_done, int work_to_do) 4108 int *work_done, int work_to_do)
4167#else 4109#else
4168e1000_clean_rx_irq(struct e1000_adapter *adapter, 4110static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
4169 struct e1000_rx_ring *rx_ring) 4111 struct e1000_rx_ring *rx_ring)
4170#endif 4112#endif
4171{ 4113{
4172 struct net_device *netdev = adapter->netdev; 4114 struct net_device *netdev = adapter->netdev;
@@ -4330,14 +4272,13 @@ next_desc:
4330 * @adapter: board private structure 4272 * @adapter: board private structure
4331 **/ 4273 **/
4332 4274
4333static bool
4334#ifdef CONFIG_E1000_NAPI 4275#ifdef CONFIG_E1000_NAPI
4335e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, 4276static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4336 struct e1000_rx_ring *rx_ring, 4277 struct e1000_rx_ring *rx_ring,
4337 int *work_done, int work_to_do) 4278 int *work_done, int work_to_do)
4338#else 4279#else
4339e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, 4280static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4340 struct e1000_rx_ring *rx_ring) 4281 struct e1000_rx_ring *rx_ring)
4341#endif 4282#endif
4342{ 4283{
4343 union e1000_rx_desc_packet_split *rx_desc, *next_rxd; 4284 union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
@@ -4517,10 +4458,9 @@ next_desc:
4517 * @adapter: address of board private structure 4458 * @adapter: address of board private structure
4518 **/ 4459 **/
4519 4460
4520static void 4461static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
4521e1000_alloc_rx_buffers(struct e1000_adapter *adapter, 4462 struct e1000_rx_ring *rx_ring,
4522 struct e1000_rx_ring *rx_ring, 4463 int cleaned_count)
4523 int cleaned_count)
4524{ 4464{
4525 struct net_device *netdev = adapter->netdev; 4465 struct net_device *netdev = adapter->netdev;
4526 struct pci_dev *pdev = adapter->pdev; 4466 struct pci_dev *pdev = adapter->pdev;
@@ -4628,10 +4568,9 @@ map_skb:
4628 * @adapter: address of board private structure 4568 * @adapter: address of board private structure
4629 **/ 4569 **/
4630 4570
4631static void 4571static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
4632e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, 4572 struct e1000_rx_ring *rx_ring,
4633 struct e1000_rx_ring *rx_ring, 4573 int cleaned_count)
4634 int cleaned_count)
4635{ 4574{
4636 struct net_device *netdev = adapter->netdev; 4575 struct net_device *netdev = adapter->netdev;
4637 struct pci_dev *pdev = adapter->pdev; 4576 struct pci_dev *pdev = adapter->pdev;
@@ -4726,8 +4665,7 @@ no_buffers:
4726 * @adapter: 4665 * @adapter:
4727 **/ 4666 **/
4728 4667
4729static void 4668static void e1000_smartspeed(struct e1000_adapter *adapter)
4730e1000_smartspeed(struct e1000_adapter *adapter)
4731{ 4669{
4732 u16 phy_status; 4670 u16 phy_status;
4733 u16 phy_ctrl; 4671 u16 phy_ctrl;
@@ -4783,8 +4721,7 @@ e1000_smartspeed(struct e1000_adapter *adapter)
4783 * @cmd: 4721 * @cmd:
4784 **/ 4722 **/
4785 4723
4786static int 4724static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4787e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4788{ 4725{
4789 switch (cmd) { 4726 switch (cmd) {
4790 case SIOCGMIIPHY: 4727 case SIOCGMIIPHY:
@@ -4803,8 +4740,8 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4803 * @cmd: 4740 * @cmd:
4804 **/ 4741 **/
4805 4742
4806static int 4743static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
4807e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) 4744 int cmd)
4808{ 4745{
4809 struct e1000_adapter *adapter = netdev_priv(netdev); 4746 struct e1000_adapter *adapter = netdev_priv(netdev);
4810 struct mii_ioctl_data *data = if_mii(ifr); 4747 struct mii_ioctl_data *data = if_mii(ifr);
@@ -4897,8 +4834,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4897 return E1000_SUCCESS; 4834 return E1000_SUCCESS;
4898} 4835}
4899 4836
4900void 4837void e1000_pci_set_mwi(struct e1000_hw *hw)
4901e1000_pci_set_mwi(struct e1000_hw *hw)
4902{ 4838{
4903 struct e1000_adapter *adapter = hw->back; 4839 struct e1000_adapter *adapter = hw->back;
4904 int ret_val = pci_set_mwi(adapter->pdev); 4840 int ret_val = pci_set_mwi(adapter->pdev);
@@ -4907,30 +4843,26 @@ e1000_pci_set_mwi(struct e1000_hw *hw)
4907 DPRINTK(PROBE, ERR, "Error in setting MWI\n"); 4843 DPRINTK(PROBE, ERR, "Error in setting MWI\n");
4908} 4844}
4909 4845
4910void 4846void e1000_pci_clear_mwi(struct e1000_hw *hw)
4911e1000_pci_clear_mwi(struct e1000_hw *hw)
4912{ 4847{
4913 struct e1000_adapter *adapter = hw->back; 4848 struct e1000_adapter *adapter = hw->back;
4914 4849
4915 pci_clear_mwi(adapter->pdev); 4850 pci_clear_mwi(adapter->pdev);
4916} 4851}
4917 4852
4918int 4853int e1000_pcix_get_mmrbc(struct e1000_hw *hw)
4919e1000_pcix_get_mmrbc(struct e1000_hw *hw)
4920{ 4854{
4921 struct e1000_adapter *adapter = hw->back; 4855 struct e1000_adapter *adapter = hw->back;
4922 return pcix_get_mmrbc(adapter->pdev); 4856 return pcix_get_mmrbc(adapter->pdev);
4923} 4857}
4924 4858
4925void 4859void e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
4926e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
4927{ 4860{
4928 struct e1000_adapter *adapter = hw->back; 4861 struct e1000_adapter *adapter = hw->back;
4929 pcix_set_mmrbc(adapter->pdev, mmrbc); 4862 pcix_set_mmrbc(adapter->pdev, mmrbc);
4930} 4863}
4931 4864
4932s32 4865s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
4933e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
4934{ 4866{
4935 struct e1000_adapter *adapter = hw->back; 4867 struct e1000_adapter *adapter = hw->back;
4936 u16 cap_offset; 4868 u16 cap_offset;
@@ -4944,14 +4876,13 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
4944 return E1000_SUCCESS; 4876 return E1000_SUCCESS;
4945} 4877}
4946 4878
4947void 4879void e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value)
4948e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value)
4949{ 4880{
4950 outl(value, port); 4881 outl(value, port);
4951} 4882}
4952 4883
4953static void 4884static void e1000_vlan_rx_register(struct net_device *netdev,
4954e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) 4885 struct vlan_group *grp)
4955{ 4886{
4956 struct e1000_adapter *adapter = netdev_priv(netdev); 4887 struct e1000_adapter *adapter = netdev_priv(netdev);
4957 u32 ctrl, rctl; 4888 u32 ctrl, rctl;
@@ -4993,8 +4924,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
4993 e1000_irq_enable(adapter); 4924 e1000_irq_enable(adapter);
4994} 4925}
4995 4926
4996static void 4927static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
4997e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
4998{ 4928{
4999 struct e1000_adapter *adapter = netdev_priv(netdev); 4929 struct e1000_adapter *adapter = netdev_priv(netdev);
5000 u32 vfta, index; 4930 u32 vfta, index;
@@ -5010,8 +4940,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
5010 e1000_write_vfta(&adapter->hw, index, vfta); 4940 e1000_write_vfta(&adapter->hw, index, vfta);
5011} 4941}
5012 4942
5013static void 4943static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
5014e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
5015{ 4944{
5016 struct e1000_adapter *adapter = netdev_priv(netdev); 4945 struct e1000_adapter *adapter = netdev_priv(netdev);
5017 u32 vfta, index; 4946 u32 vfta, index;
@@ -5037,8 +4966,7 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
5037 e1000_write_vfta(&adapter->hw, index, vfta); 4966 e1000_write_vfta(&adapter->hw, index, vfta);
5038} 4967}
5039 4968
5040static void 4969static void e1000_restore_vlan(struct e1000_adapter *adapter)
5041e1000_restore_vlan(struct e1000_adapter *adapter)
5042{ 4970{
5043 e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp); 4971 e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
5044 4972
@@ -5052,8 +4980,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter)
5052 } 4980 }
5053} 4981}
5054 4982
5055int 4983int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
5056e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
5057{ 4984{
5058 adapter->hw.autoneg = 0; 4985 adapter->hw.autoneg = 0;
5059 4986
@@ -5089,8 +5016,7 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
5089 return 0; 5016 return 0;
5090} 5017}
5091 5018
5092static int 5019static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
5093e1000_suspend(struct pci_dev *pdev, pm_message_t state)
5094{ 5020{
5095 struct net_device *netdev = pci_get_drvdata(pdev); 5021 struct net_device *netdev = pci_get_drvdata(pdev);
5096 struct e1000_adapter *adapter = netdev_priv(netdev); 5022 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -5187,8 +5113,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
5187} 5113}
5188 5114
5189#ifdef CONFIG_PM 5115#ifdef CONFIG_PM
5190static int 5116static int e1000_resume(struct pci_dev *pdev)
5191e1000_resume(struct pci_dev *pdev)
5192{ 5117{
5193 struct net_device *netdev = pci_get_drvdata(pdev); 5118 struct net_device *netdev = pci_get_drvdata(pdev);
5194 struct e1000_adapter *adapter = netdev_priv(netdev); 5119 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -5242,8 +5167,7 @@ static void e1000_shutdown(struct pci_dev *pdev)
5242 * without having to re-enable interrupts. It's not called while 5167 * without having to re-enable interrupts. It's not called while
5243 * the interrupt routine is executing. 5168 * the interrupt routine is executing.
5244 */ 5169 */
5245static void 5170static void e1000_netpoll(struct net_device *netdev)
5246e1000_netpoll(struct net_device *netdev)
5247{ 5171{
5248 struct e1000_adapter *adapter = netdev_priv(netdev); 5172 struct e1000_adapter *adapter = netdev_priv(netdev);
5249 5173
@@ -5264,7 +5188,8 @@ e1000_netpoll(struct net_device *netdev)
5264 * This function is called after a PCI bus error affecting 5188 * This function is called after a PCI bus error affecting
5265 * this device has been detected. 5189 * this device has been detected.
5266 */ 5190 */
5267static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) 5191static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
5192 pci_channel_state_t state)
5268{ 5193{
5269 struct net_device *netdev = pci_get_drvdata(pdev); 5194 struct net_device *netdev = pci_get_drvdata(pdev);
5270 struct e1000_adapter *adapter = netdev->priv; 5195 struct e1000_adapter *adapter = netdev->priv;