/* This routine will get the first valid Event Queue Entry from @q, update the queue's internal hba index, and return the EQE. If no valid EQEs are in the Queue (no more work to do), or the Queue is full of EQEs that have been processed, but not popped back to the HBA then this routine will return NULL.  */
static struct lpfc_eqe* lpfc_sli4_eq_get(struct lpfc_queue *q)
/* This routine will get the first valid Event Queue Entry from @q, update the queue's internal hba index, and return the EQE. If no valid EQEs are in the Queue (no more work to do), or the Queue is full of EQEs that have been processed, but not popped back to the HBA then this routine will return NULL.  */
static struct lpfc_eqe* lpfc_sli4_eq_get(struct lpfc_queue *q)
{
	struct lpfc_eqe *eqe = q->qe[q->hba_index].eqe;
	if (!bf_get(lpfc_eqe_valid, eqe))
		return NULL;
	if (((q->hba_index + 1) % q->entry_count) == q->host_index)
		return NULL;
	q->hba_index = ((q->hba_index + 1) % q->entry_count);
	return eqe;
}