/* Will return a pointer to the entry on the top of the queue requested that we are a consumer of, and return the address of the queue entry. It does not change the state of the queue.  */
int aac_consumer_get(struct aac_dev *dev, struct aac_queue *q, struct aac_entry **entry)
/* Will return a pointer to the entry on the top of the queue requested that we are a consumer of, and return the address of the queue entry. It does not change the state of the queue.  */
int aac_consumer_get(struct aac_dev *dev, struct aac_queue *q, struct aac_entry **entry)
{
	u32 index;
	int status;
	if (le32_to_cpu(*q->headers.producer) == le32_to_cpu(*q->headers.consumer)) {
		status = 0;
	} else {
		if (le32_to_cpu(*q->headers.consumer) >= q->entries)
			index = 0;
		else
			index = le32_to_cpu(*q->headers.consumer);
		*entry = q->base + index;
		status = 1;
	}
	return(status);
}