/* Return codes PCI_ERS_RESULT_NEED_RESET - need to reset before recovery PCI_ERS_RESULT_DISCONNECT - device could not be recovered  */
static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
/* Return codes PCI_ERS_RESULT_NEED_RESET - need to reset before recovery PCI_ERS_RESULT_DISCONNECT - device could not be recovered  */
static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
{
	struct Scsi_Host *shost = pci_get_drvdata(pdev);
	struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
	pci_ers_result_t rc = PCI_ERS_RESULT_DISCONNECT;
	switch (phba->pci_dev_grp) {
	case LPFC_PCI_DEV_LP:
		rc = lpfc_io_error_detected_s3(pdev, state);
		break;
	case LPFC_PCI_DEV_OC:
		rc = lpfc_io_error_detected_s4(pdev, state);
		break;
	default:
		lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
				"1427 Invalid PCI device group: 0x%x\n",
				phba->pci_dev_grp);
		break;
	}
	return rc;
}