/* Restart the card from scratch, as if from a cold-boot. Implementation resembles the first-half of the e1000_resume routine.  */
static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
/* Restart the card from scratch, as if from a cold-boot. Implementation resembles the first-half of the e1000_resume routine.  */
static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	struct e1000_hw *hw = &adapter->hw;
	int err;
	if (adapter->need_ioport)
		err = pci_enable_device(pdev);
	else
		err = pci_enable_device_mem(pdev);
	if (err) {
		printk(KERN_ERR "e1000: Cannot re-enable PCI device after reset.\n");
		return PCI_ERS_RESULT_DISCONNECT;
	}
	pci_set_master(pdev);
	pci_enable_wake(pdev, PCI_D3hot, 0);
	pci_enable_wake(pdev, PCI_D3cold, 0);
	e1000_reset(adapter);
	ew32(WUS, ~0);
	return PCI_ERS_RESULT_RECOVERED;
}