/* This function is called after a PCI bus error affecting this device has been detected.  */
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
/* This function is called after a PCI bus error affecting this device has been detected.  */
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	netif_device_detach(netdev);
	if (state == pci_channel_io_perm_failure)
		return PCI_ERS_RESULT_DISCONNECT;
	if (netif_running(netdev))
		e1000_down(adapter);
	pci_disable_device(pdev);
	return PCI_ERS_RESULT_NEED_RESET;
}