aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-11-27 03:24:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-27 03:24:37 -0500
commit40a914fa72abdb9193ecad7dd82e48d952ab9d24 (patch)
treecd9bd5bcd611073a683b2329bb2771e267f98a12 /drivers/net/igb
parentf4113030e73db80bc5368a8303458008975402dd (diff)
igb: Add support for pci-e Advanced Error Reporting
Add the calls necessary to enable advanced error reporting for igb on systems with AER enabled. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb_main.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 648f5a29d490..a08921e9cbe6 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -42,6 +42,7 @@
42#include <linux/delay.h> 42#include <linux/delay.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/if_ether.h> 44#include <linux/if_ether.h>
45#include <linux/aer.h>
45#ifdef CONFIG_IGB_DCA 46#ifdef CONFIG_IGB_DCA
46#include <linux/dca.h> 47#include <linux/dca.h>
47#endif 48#endif
@@ -1049,6 +1050,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1049 if (err) 1050 if (err)
1050 goto err_pci_reg; 1051 goto err_pci_reg;
1051 1052
1053 pci_enable_pcie_error_reporting(pdev);
1054
1052 pci_set_master(pdev); 1055 pci_set_master(pdev);
1053 pci_save_state(pdev); 1056 pci_save_state(pdev);
1054 1057
@@ -1379,6 +1382,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
1379 1382
1380 free_netdev(netdev); 1383 free_netdev(netdev);
1381 1384
1385 pci_disable_pcie_error_reporting(pdev);
1386
1382 pci_disable_device(pdev); 1387 pci_disable_device(pdev);
1383} 1388}
1384 1389
@@ -4470,27 +4475,33 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
4470 struct net_device *netdev = pci_get_drvdata(pdev); 4475 struct net_device *netdev = pci_get_drvdata(pdev);
4471 struct igb_adapter *adapter = netdev_priv(netdev); 4476 struct igb_adapter *adapter = netdev_priv(netdev);
4472 struct e1000_hw *hw = &adapter->hw; 4477 struct e1000_hw *hw = &adapter->hw;
4478 pci_ers_result_t result;
4473 int err; 4479 int err;
4474 4480
4475 if (adapter->need_ioport) 4481 if (adapter->need_ioport)
4476 err = pci_enable_device(pdev); 4482 err = pci_enable_device(pdev);
4477 else 4483 else
4478 err = pci_enable_device_mem(pdev); 4484 err = pci_enable_device_mem(pdev);
4485
4479 if (err) { 4486 if (err) {
4480 dev_err(&pdev->dev, 4487 dev_err(&pdev->dev,
4481 "Cannot re-enable PCI device after reset.\n"); 4488 "Cannot re-enable PCI device after reset.\n");
4482 return PCI_ERS_RESULT_DISCONNECT; 4489 result = PCI_ERS_RESULT_DISCONNECT;
4483 } 4490 } else {
4484 pci_set_master(pdev); 4491 pci_set_master(pdev);
4485 pci_restore_state(pdev); 4492 pci_restore_state(pdev);
4486 4493
4487 pci_enable_wake(pdev, PCI_D3hot, 0); 4494 pci_enable_wake(pdev, PCI_D3hot, 0);
4488 pci_enable_wake(pdev, PCI_D3cold, 0); 4495 pci_enable_wake(pdev, PCI_D3cold, 0);
4489 4496
4490 igb_reset(adapter); 4497 igb_reset(adapter);
4491 wr32(E1000_WUS, ~0); 4498 wr32(E1000_WUS, ~0);
4499 result = PCI_ERS_RESULT_RECOVERED;
4500 }
4492 4501
4493 return PCI_ERS_RESULT_RECOVERED; 4502 pci_cleanup_aer_uncorrect_error_status(pdev);
4503
4504 return result;
4494} 4505}
4495 4506
4496/** 4507/**
@@ -4518,7 +4529,6 @@ static void igb_io_resume(struct pci_dev *pdev)
4518 /* let the f/w know that the h/w is now under the control of the 4529 /* let the f/w know that the h/w is now under the control of the
4519 * driver. */ 4530 * driver. */
4520 igb_get_hw_control(adapter); 4531 igb_get_hw_control(adapter);
4521
4522} 4532}
4523 4533
4524/* igb_main.c */ 4534/* igb_main.c */