src/dpdk/drivers/net/ice/base/ice_common.c
static enum ice_status
ice_discover_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_caps)
{
	enum ice_status status;
	u32 cap_count = 0;
	void *cbuf;

	cbuf = ice_malloc(hw, ICE_AQ_MAX_BUF_LEN);
	if (!cbuf)
		return ICE_ERR_NO_MEMORY;

	/* Although the driver doesn't know the number of capabilities the
	 * device will return, we can simply send a 4KB buffer, the maximum
	 * possible size that firmware can return.
	 */
	cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem);

	status = ice_aq_list_caps(hw, cbuf, ICE_AQ_MAX_BUF_LEN, &cap_count,
				  ice_aqc_opc_list_func_caps, NULL);
	if (!status)
		ice_parse_func_caps(hw, func_caps, cbuf, cap_count);
	ice_free(hw, cbuf);

	return status;
}
/**
 * ice_discover_func_caps - Read and extract function capabilities
 * @hw: pointer to the hardware structure
 * @func_caps: pointer to function capabilities structure
 *
 * Read the function capabilities and extract them into the func_caps structure
 * for later use.
 */
Read and extract function capabilities
@hw: pointer to the hardware structure
@func_caps: pointer to function capabilities structure

Read the function capabilities and extract them into the func_caps structure
for later use.
Read and extract function capabilities @hw : pointer to the hardware structure @func_caps : pointer to function capabilities structure Read the function capabilities and extract them into the func_caps structure for later use .
static enum ice_status
ice_discover_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_caps)
{
	enum ice_status status;
	u32 cap_count = 0;
	void *cbuf;
	cbuf = ice_malloc(hw, ICE_AQ_MAX_BUF_LEN);
	if (!cbuf)
		return ICE_ERR_NO_MEMORY;
	cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem);
	status = ice_aq_list_caps(hw, cbuf, ICE_AQ_MAX_BUF_LEN, &cap_count,
				  ice_aqc_opc_list_func_caps, NULL);
	if (!status)
		ice_parse_func_caps(hw, func_caps, cbuf, cap_count);
	ice_free(hw, cbuf);
	return status;
}
static enum ice_status ice_discover_func_caps ( struct ice_hw * hw , struct ice_hw_func_caps * func_caps ) { enum ice_status status ; u32 cap_count = 0 ; void * cbuf ; cbuf = ice_malloc ( hw , ICE_AQ_MAX_BUF_LEN ) ; if ( ! cbuf ) return ICE_ERR_NO_MEMORY ; cap_count = ICE_AQ_MAX_BUF_LEN / sizeof ( struct ice_aqc_list_caps_elem ) ; status = ice_aq_list_caps ( hw , cbuf , ICE_AQ_MAX_BUF_LEN , & cap_count , ice_aqc_opc_list_func_caps , NULL ) ; if ( ! status ) ice_parse_func_caps ( hw , func_caps , cbuf , cap_count ) ; ice_free ( hw , cbuf ) ; return status ; }
ice_discover_func_caps - Read and extract function capabilities
 @hw: pointer to the hardware structure
 @func_caps: pointer to function capabilities structure
ice_discover_func_caps - Read and extract function capabilities @hw : pointer to the hardware structure @func_caps : pointer to function capabilities structure
/* Although the driver doesn't know the number of capabilities the
	 * device will return, we can simply send a 4KB buffer, the maximum
	 * possible size that firmware can return.
	 */