src/dpdk/drivers/common/iavf/iavf_adminq.c
u16 iavf_clean_asq(struct iavf_hw *hw)
{
	struct iavf_adminq_ring *asq = &(hw->aq.asq);
	struct iavf_asq_cmd_details *details;
	u16 ntc = asq->next_to_clean;
	struct iavf_aq_desc desc_cb;
	struct iavf_aq_desc *desc;

	desc = IAVF_ADMINQ_DESC(*asq, ntc);
	details = IAVF_ADMINQ_DETAILS(*asq, ntc);
	while (rd32(hw, hw->aq.asq.head) != ntc) {
		iavf_debug(hw, IAVF_DEBUG_AQ_MESSAGE,
			   "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head));

		if (details->callback) {
			IAVF_ADMINQ_CALLBACK cb_func =
					(IAVF_ADMINQ_CALLBACK)details->callback;
			iavf_memcpy(&desc_cb, desc, sizeof(struct iavf_aq_desc),
				    IAVF_DMA_TO_DMA);
			cb_func(hw, &desc_cb);
		}
		iavf_memset(desc, 0, sizeof(*desc), IAVF_DMA_MEM);
		iavf_memset(details, 0, sizeof(*details), IAVF_NONDMA_MEM);
		ntc++;
		if (ntc == asq->count)
			ntc = 0;
		desc = IAVF_ADMINQ_DESC(*asq, ntc);
		details = IAVF_ADMINQ_DETAILS(*asq, ntc);
	}

	asq->next_to_clean = ntc;

	return IAVF_DESC_UNUSED(asq);
}
/**
 *  iavf_clean_asq - cleans Admin send queue
 *  @hw: pointer to the hardware structure
 *
 *  returns the number of free desc
 **/
cleans Admin send queue
@hw: pointer to the hardware structure

returns the number of free desc
cleans Admin send queue @hw : pointer to the hardware structure returns the number of free desc
u16 iavf_clean_asq(struct iavf_hw *hw)
{
	struct iavf_adminq_ring *asq = &(hw->aq.asq);
	struct iavf_asq_cmd_details *details;
	u16 ntc = asq->next_to_clean;
	struct iavf_aq_desc desc_cb;
	struct iavf_aq_desc *desc;
	desc = IAVF_ADMINQ_DESC(*asq, ntc);
	details = IAVF_ADMINQ_DETAILS(*asq, ntc);
	while (rd32(hw, hw->aq.asq.head) != ntc) {
		iavf_debug(hw, IAVF_DEBUG_AQ_MESSAGE,
			   "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head));
		if (details->callback) {
			IAVF_ADMINQ_CALLBACK cb_func =
					(IAVF_ADMINQ_CALLBACK)details->callback;
			iavf_memcpy(&desc_cb, desc, sizeof(struct iavf_aq_desc),
				    IAVF_DMA_TO_DMA);
			cb_func(hw, &desc_cb);
		}
		iavf_memset(desc, 0, sizeof(*desc), IAVF_DMA_MEM);
		iavf_memset(details, 0, sizeof(*details), IAVF_NONDMA_MEM);
		ntc++;
		if (ntc == asq->count)
			ntc = 0;
		desc = IAVF_ADMINQ_DESC(*asq, ntc);
		details = IAVF_ADMINQ_DETAILS(*asq, ntc);
	}
	asq->next_to_clean = ntc;
	return IAVF_DESC_UNUSED(asq);
}
u16 iavf_clean_asq ( struct iavf_hw * hw ) { struct iavf_adminq_ring * asq = & ( hw -> aq . asq ) ; struct iavf_asq_cmd_details * details ; u16 ntc = asq -> next_to_clean ; struct iavf_aq_desc desc_cb ; struct iavf_aq_desc * desc ; desc = IAVF_ADMINQ_DESC ( * asq , ntc ) ; details = IAVF_ADMINQ_DETAILS ( * asq , ntc ) ; while ( rd32 ( hw , hw -> aq . asq . head ) != ntc ) { iavf_debug ( hw , IAVF_DEBUG_AQ_MESSAGE , " \n " , ntc , rd32 ( hw , hw -> aq . asq . head ) ) ; if ( details -> callback ) { IAVF_ADMINQ_CALLBACK cb_func = ( IAVF_ADMINQ_CALLBACK ) details -> callback ; iavf_memcpy ( & desc_cb , desc , sizeof ( struct iavf_aq_desc ) , IAVF_DMA_TO_DMA ) ; cb_func ( hw , & desc_cb ) ; } iavf_memset ( desc , 0 , sizeof ( * desc ) , IAVF_DMA_MEM ) ; iavf_memset ( details , 0 , sizeof ( * details ) , IAVF_NONDMA_MEM ) ; ntc ++ ; if ( ntc == asq -> count ) ntc = 0 ; desc = IAVF_ADMINQ_DESC ( * asq , ntc ) ; details = IAVF_ADMINQ_DETAILS ( * asq , ntc ) ; } asq -> next_to_clean = ntc ; return IAVF_DESC_UNUSED ( asq ) ; }
iavf_clean_asq - cleans Admin send queue
  @hw: pointer to the hardware structure
iavf_clean_asq - cleans Admin send queue @hw : pointer to the hardware structure