src/dpdk/drivers/common/iavf/iavf_adminq.c
enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
{
	enum iavf_status ret_code;

	/* verify input for valid configuration */
	if ((hw->aq.num_arq_entries == 0) ||
	    (hw->aq.num_asq_entries == 0) ||
	    (hw->aq.arq_buf_size == 0) ||
	    (hw->aq.asq_buf_size == 0)) {
		ret_code = IAVF_ERR_CONFIG;
		goto init_adminq_exit;
	}
	iavf_init_spinlock(&hw->aq.asq_spinlock);
	iavf_init_spinlock(&hw->aq.arq_spinlock);

	/* Set up register offsets */
	iavf_adminq_init_regs(hw);

	/* setup ASQ command write back timeout */
	hw->aq.asq_cmd_timeout = IAVF_ASQ_CMD_TIMEOUT;

	/* allocate the ASQ */
	ret_code = iavf_init_asq(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_destroy_spinlocks;

	/* allocate the ARQ */
	ret_code = iavf_init_arq(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_asq;

	/* success! */
	goto init_adminq_exit;

init_adminq_free_asq:
	iavf_shutdown_asq(hw);
init_adminq_destroy_spinlocks:
	iavf_destroy_spinlock(&hw->aq.asq_spinlock);
	iavf_destroy_spinlock(&hw->aq.arq_spinlock);

init_adminq_exit:
	return ret_code;
}
/**
 *  iavf_init_adminq - main initialization routine for Admin Queue
 *  @hw: pointer to the hardware structure
 *
 *  Prior to calling this function, drivers *MUST* set the following fields
 *  in the hw->aq structure:
 *     - hw->aq.num_asq_entries
 *     - hw->aq.num_arq_entries
 *     - hw->aq.arq_buf_size
 *     - hw->aq.asq_buf_size
 **/
main initialization routine for Admin Queue
@hw: pointer to the hardware structure


main initialization routine for Admin Queue @hw : pointer to the hardware structure
enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
{
	enum iavf_status ret_code;
	if ((hw->aq.num_arq_entries == 0) ||
	    (hw->aq.num_asq_entries == 0) ||
	    (hw->aq.arq_buf_size == 0) ||
	    (hw->aq.asq_buf_size == 0)) {
		ret_code = IAVF_ERR_CONFIG;
		goto init_adminq_exit;
	}
	iavf_init_spinlock(&hw->aq.asq_spinlock);
	iavf_init_spinlock(&hw->aq.arq_spinlock);
	iavf_adminq_init_regs(hw);
	hw->aq.asq_cmd_timeout = IAVF_ASQ_CMD_TIMEOUT;
	ret_code = iavf_init_asq(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_destroy_spinlocks;
	ret_code = iavf_init_arq(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_asq;
	goto init_adminq_exit;
init_adminq_free_asq:
	iavf_shutdown_asq(hw);
init_adminq_destroy_spinlocks:
	iavf_destroy_spinlock(&hw->aq.asq_spinlock);
	iavf_destroy_spinlock(&hw->aq.arq_spinlock);
init_adminq_exit:
	return ret_code;
}
enum iavf_status iavf_init_adminq ( struct iavf_hw * hw ) { enum iavf_status ret_code ; if ( ( hw -> aq . num_arq_entries == 0 ) || ( hw -> aq . num_asq_entries == 0 ) || ( hw -> aq . arq_buf_size == 0 ) || ( hw -> aq . asq_buf_size == 0 ) ) { ret_code = IAVF_ERR_CONFIG ; goto init_adminq_exit ; } iavf_init_spinlock ( & hw -> aq . asq_spinlock ) ; iavf_init_spinlock ( & hw -> aq . arq_spinlock ) ; iavf_adminq_init_regs ( hw ) ; hw -> aq . asq_cmd_timeout = IAVF_ASQ_CMD_TIMEOUT ; ret_code = iavf_init_asq ( hw ) ; if ( ret_code != IAVF_SUCCESS ) goto init_adminq_destroy_spinlocks ; ret_code = iavf_init_arq ( hw ) ; if ( ret_code != IAVF_SUCCESS ) goto init_adminq_free_asq ; goto init_adminq_exit ; init_adminq_free_asq : iavf_shutdown_asq ( hw ) ; init_adminq_destroy_spinlocks : iavf_destroy_spinlock ( & hw -> aq . asq_spinlock ) ; iavf_destroy_spinlock ( & hw -> aq . arq_spinlock ) ; init_adminq_exit : return ret_code ; }
iavf_init_adminq - main initialization routine for Admin Queue
  @hw: pointer to the hardware structure
iavf_init_adminq - main initialization routine for Admin Queue @hw : pointer to the hardware structure
/* verify input for valid configuration */ /* Set up register offsets */ /* setup ASQ command write back timeout */ /* allocate the ASQ */ /* allocate the ARQ */ /* success! */