/* This fucntion returns 1 when there is Error Attention in the Host Attention Register and returns 0 otherwise.  */
static int lpfc_sli_eratt_read(struct lpfc_hba *phba)
/* This fucntion returns 1 when there is Error Attention in the Host Attention Register and returns 0 otherwise.  */
static int lpfc_sli_eratt_read(struct lpfc_hba *phba)
{
	uint32_t ha_copy;
	ha_copy = readl(phba->HAregaddr);
	if (ha_copy & HA_ERATT) {
		lpfc_sli_read_hs(phba);
		if ((HS_FFER1 & phba->work_hs) &&
		    ((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 |
		     HS_FFER6 | HS_FFER7) & phba->work_hs)) {
			phba->hba_flag |= DEFER_ERATT;
			writel(0, phba->HCregaddr);
			readl(phba->HCregaddr);
		}
		phba->work_ha |= HA_ERATT;
		phba->hba_flag |= HBA_ERATT_HANDLED;
		return 1;
	}
	return 0;
}