/* This callback is called by the PCI subsystem whenever a PCI bus error is detected.  */
static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev, enum pci_channel_state state)
/* This callback is called by the PCI subsystem whenever a PCI bus error is detected.  */
static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev, enum pci_channel_state state)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct ixgb_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))
		ixgb_down(adapter, true);
	pci_disable_device(pdev);
	return PCI_ERS_RESULT_NEED_RESET;
}