src/dpdk/drivers/net/ice/base/ice_common.c
static void
ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
		    void *buf, u32 cap_count)
{
	struct ice_aqc_list_caps_elem *cap_resp;
	u32 i;

	cap_resp = (struct ice_aqc_list_caps_elem *)buf;

	ice_memset(func_p, 0, sizeof(*func_p), ICE_NONDMA_MEM);

	for (i = 0; i < cap_count; i++) {
		u16 cap = LE16_TO_CPU(cap_resp[i].cap);
		bool found;

		found = ice_parse_common_caps(hw, &func_p->common_cap,
					      &cap_resp[i], "func caps");

		switch (cap) {
		case ICE_AQC_CAPS_VSI:
			ice_parse_vsi_func_caps(hw, func_p, &cap_resp[i]);
			break;
		case ICE_AQC_CAPS_FD:
			ice_parse_fdir_func_caps(hw, func_p);
			break;
		default:
			/* Don't list common capabilities as unknown */
			if (!found)
				ice_debug(hw, ICE_DBG_INIT, "func caps: unknown capability[%d]: 0x%x\n",
					  i, cap);
			break;
		}
	}

	ice_recalc_port_limited_caps(hw, &func_p->common_cap);
}
/**
 * ice_parse_func_caps - Parse function capabilities
 * @hw: pointer to the HW struct
 * @func_p: pointer to function capabilities structure
 * @buf: buffer containing the function capability records
 * @cap_count: the number of capabilities
 *
 * Helper function to parse function (0x000A) capabilities list. For
 * capabilities shared between device and function, this relies on
 * ice_parse_common_caps.
 *
 * Loop through the list of provided capabilities and extract the relevant
 * data into the function capabilities structured.
 */
Parse function capabilities
@hw: pointer to the HW struct
@func_p: pointer to function capabilities structure
@buf: buffer containing the function capability records
@cap_count: the number of capabilities

Helper function to parse function (0x000A) capabilities list. For
capabilities shared between device and function, this relies on
ice_parse_common_caps.

Loop through the list of provided capabilities and extract the relevant
data into the function capabilities structured.
Parse function capabilities @hw : pointer to the HW struct @func_p : pointer to function capabilities structure @buf : buffer containing the function capability records @cap_count : the number of capabilities Helper function to parse function ( 0x000A ) capabilities list . For capabilities shared between device and function this relies on ice_parse_common_caps . Loop through the list of provided capabilities and extract the relevant data into the function capabilities structured .
static void
ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
		    void *buf, u32 cap_count)
{
	struct ice_aqc_list_caps_elem *cap_resp;
	u32 i;
	cap_resp = (struct ice_aqc_list_caps_elem *)buf;
	ice_memset(func_p, 0, sizeof(*func_p), ICE_NONDMA_MEM);
	for (i = 0; i < cap_count; i++) {
		u16 cap = LE16_TO_CPU(cap_resp[i].cap);
		bool found;
		found = ice_parse_common_caps(hw, &func_p->common_cap,
					      &cap_resp[i], "func caps");
		switch (cap) {
		case ICE_AQC_CAPS_VSI:
			ice_parse_vsi_func_caps(hw, func_p, &cap_resp[i]);
			break;
		case ICE_AQC_CAPS_FD:
			ice_parse_fdir_func_caps(hw, func_p);
			break;
		default:
			if (!found)
				ice_debug(hw, ICE_DBG_INIT, "func caps: unknown capability[%d]: 0x%x\n",
					  i, cap);
			break;
		}
	}
	ice_recalc_port_limited_caps(hw, &func_p->common_cap);
}
static void ice_parse_func_caps ( struct ice_hw * hw , struct ice_hw_func_caps * func_p , void * buf , u32 cap_count ) { struct ice_aqc_list_caps_elem * cap_resp ; u32 i ; cap_resp = ( struct ice_aqc_list_caps_elem * ) buf ; ice_memset ( func_p , 0 , sizeof ( * func_p ) , ICE_NONDMA_MEM ) ; for ( i = 0 ; i < cap_count ; i ++ ) { u16 cap = LE16_TO_CPU ( cap_resp [ i ] . cap ) ; bool found ; found = ice_parse_common_caps ( hw , & func_p -> common_cap , & cap_resp [ i ] , " " ) ; switch ( cap ) { case ICE_AQC_CAPS_VSI : ice_parse_vsi_func_caps ( hw , func_p , & cap_resp [ i ] ) ; break ; case ICE_AQC_CAPS_FD : ice_parse_fdir_func_caps ( hw , func_p ) ; break ; default : if ( ! found ) ice_debug ( hw , ICE_DBG_INIT , " \n " , i , cap ) ; break ; } } ice_recalc_port_limited_caps ( hw , & func_p -> common_cap ) ; }
ice_parse_func_caps - Parse function capabilities
 @hw: pointer to the HW struct
 @func_p: pointer to function capabilities structure
 @buf: buffer containing the function capability records
 @cap_count: the number of capabilities
ice_parse_func_caps - Parse function capabilities @hw : pointer to the HW struct @func_p : pointer to function capabilities structure @buf : buffer containing the function capability records @cap_count : the number of capabilities
/* Don't list common capabilities as unknown */