Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_flex_pipe.c
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | ice_boost_tcam_handler(u32 sect_type, void *section, u32 index, u32 *offset) | ||||
struct ice_boost_tcam_section *boost; | struct ice_boost_tcam_section *boost; | ||||
if (!section) | if (!section) | ||||
return NULL; | return NULL; | ||||
if (sect_type != ICE_SID_RXPARSER_BOOST_TCAM) | if (sect_type != ICE_SID_RXPARSER_BOOST_TCAM) | ||||
return NULL; | return NULL; | ||||
/* cppcheck-suppress nullPointer */ | |||||
if (index > ICE_MAX_BST_TCAMS_IN_BUF) | if (index > ICE_MAX_BST_TCAMS_IN_BUF) | ||||
return NULL; | return NULL; | ||||
if (offset) | if (offset) | ||||
*offset = 0; | *offset = 0; | ||||
boost = (struct ice_boost_tcam_section *)section; | boost = (struct ice_boost_tcam_section *)section; | ||||
if (index >= LE16_TO_CPU(boost->count)) | if (index >= LE16_TO_CPU(boost->count)) | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
ice_label_enum_handler(u32 __ALWAYS_UNUSED sect_type, void *section, u32 index, | ice_label_enum_handler(u32 __ALWAYS_UNUSED sect_type, void *section, u32 index, | ||||
u32 *offset) | u32 *offset) | ||||
{ | { | ||||
struct ice_label_section *labels; | struct ice_label_section *labels; | ||||
if (!section) | if (!section) | ||||
return NULL; | return NULL; | ||||
/* cppcheck-suppress nullPointer */ | |||||
if (index > ICE_MAX_LABELS_IN_BUF) | if (index > ICE_MAX_LABELS_IN_BUF) | ||||
return NULL; | return NULL; | ||||
if (offset) | if (offset) | ||||
*offset = 0; | *offset = 0; | ||||
labels = (struct ice_label_section *)section; | labels = (struct ice_label_section *)section; | ||||
if (index >= LE16_TO_CPU(labels->count)) | if (index >= LE16_TO_CPU(labels->count)) | ||||
▲ Show 20 Lines • Show All 706 Lines • ▼ Show 20 Lines | ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) | ||||
ice_buf_tbl = ice_find_buf_table(ice_seg); | ice_buf_tbl = ice_find_buf_table(ice_seg); | ||||
ice_debug(hw, ICE_DBG_PKG, "Seg buf count: %d\n", | ice_debug(hw, ICE_DBG_PKG, "Seg buf count: %d\n", | ||||
LE32_TO_CPU(ice_buf_tbl->buf_count)); | LE32_TO_CPU(ice_buf_tbl->buf_count)); | ||||
status = ice_dwnld_cfg_bufs(hw, ice_buf_tbl->buf_array, | status = ice_dwnld_cfg_bufs(hw, ice_buf_tbl->buf_array, | ||||
LE32_TO_CPU(ice_buf_tbl->buf_count)); | LE32_TO_CPU(ice_buf_tbl->buf_count)); | ||||
ice_cache_vlan_mode(hw); | ice_post_pkg_dwnld_vlan_mode_cfg(hw); | ||||
return status; | return status; | ||||
} | } | ||||
/** | /** | ||||
* ice_init_pkg_info | * ice_init_pkg_info | ||||
* @hw: pointer to the hardware structure | * @hw: pointer to the hardware structure | ||||
* @pkg_hdr: pointer to the driver's package hdr | * @pkg_hdr: pointer to the driver's package hdr | ||||
* | * | ||||
* Saves off the package details into the HW structure. | * Saves off the package details into the HW structure. | ||||
*/ | */ | ||||
static enum ice_status | static enum ice_status | ||||
ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) | ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) | ||||
{ | { | ||||
struct ice_generic_seg_hdr *seg_hdr; | struct ice_generic_seg_hdr *seg_hdr; | ||||
ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); | ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); | ||||
if (!pkg_hdr) | if (!pkg_hdr) | ||||
return ICE_ERR_PARAM; | return ICE_ERR_PARAM; | ||||
hw->pkg_seg_id = SEGMENT_TYPE_ICE_E810; | |||||
ice_debug(hw, ICE_DBG_INIT, "Pkg using segment id: 0x%08X\n", | |||||
hw->pkg_seg_id); | |||||
seg_hdr = (struct ice_generic_seg_hdr *) | seg_hdr = (struct ice_generic_seg_hdr *) | ||||
ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr); | ice_find_seg_in_pkg(hw, hw->pkg_seg_id, pkg_hdr); | ||||
if (seg_hdr) { | if (seg_hdr) { | ||||
struct ice_meta_sect *meta; | struct ice_meta_sect *meta; | ||||
struct ice_pkg_enum state; | struct ice_pkg_enum state; | ||||
ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM); | ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM); | ||||
/* Get package information from the Metadata Section */ | /* Get package information from the Metadata Section */ | ||||
meta = (struct ice_meta_sect *) | meta = (struct ice_meta_sect *) | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | ice_chk_pkg_compat(struct ice_hw *hw, struct ice_pkg_hdr *ospkg, | ||||
/* Check package version compatibility */ | /* Check package version compatibility */ | ||||
status = ice_chk_pkg_version(&hw->pkg_ver); | status = ice_chk_pkg_version(&hw->pkg_ver); | ||||
if (status) { | if (status) { | ||||
ice_debug(hw, ICE_DBG_INIT, "Package version check failed.\n"); | ice_debug(hw, ICE_DBG_INIT, "Package version check failed.\n"); | ||||
return status; | return status; | ||||
} | } | ||||
/* find ICE segment in given package */ | /* find ICE segment in given package */ | ||||
*seg = (struct ice_seg *)ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, | *seg = (struct ice_seg *)ice_find_seg_in_pkg(hw, hw->pkg_seg_id, | ||||
ospkg); | ospkg); | ||||
if (!*seg) { | if (!*seg) { | ||||
ice_debug(hw, ICE_DBG_INIT, "no ice segment in package.\n"); | ice_debug(hw, ICE_DBG_INIT, "no ice segment in package.\n"); | ||||
return ICE_ERR_CFG; | return ICE_ERR_CFG; | ||||
} | } | ||||
/* Check if FW is compatible with the OS package */ | /* Check if FW is compatible with the OS package */ | ||||
size = ice_struct_size(pkg, pkg_info, ICE_PKG_CNT); | size = ice_struct_size(pkg, pkg_info, ICE_PKG_CNT); | ||||
▲ Show 20 Lines • Show All 1,345 Lines • ▼ Show 20 Lines | ice_match_prop_lst(struct LIST_HEAD_TYPE *list1, struct LIST_HEAD_TYPE *list2) | ||||
u16 chk_count = 0; | u16 chk_count = 0; | ||||
u16 count = 0; | u16 count = 0; | ||||
/* compare counts */ | /* compare counts */ | ||||
LIST_FOR_EACH_ENTRY(tmp1, list1, ice_vsig_prof, list) | LIST_FOR_EACH_ENTRY(tmp1, list1, ice_vsig_prof, list) | ||||
count++; | count++; | ||||
LIST_FOR_EACH_ENTRY(tmp2, list2, ice_vsig_prof, list) | LIST_FOR_EACH_ENTRY(tmp2, list2, ice_vsig_prof, list) | ||||
chk_count++; | chk_count++; | ||||
/* cppcheck-suppress knownConditionTrueFalse */ | |||||
if (!count || count != chk_count) | if (!count || count != chk_count) | ||||
return false; | return false; | ||||
tmp1 = LIST_FIRST_ENTRY(list1, struct ice_vsig_prof, list); | tmp1 = LIST_FIRST_ENTRY(list1, struct ice_vsig_prof, list); | ||||
tmp2 = LIST_FIRST_ENTRY(list2, struct ice_vsig_prof, list); | tmp2 = LIST_FIRST_ENTRY(list2, struct ice_vsig_prof, list); | ||||
/* profile cookies must compare, and in the exact same order to take | /* profile cookies must compare, and in the exact same order to take | ||||
* into account priority | * into account priority | ||||
▲ Show 20 Lines • Show All 2,878 Lines • Show Last 20 Lines |