net/ice/base: add parser create and destroy skeleton
[dpdk.git] / drivers / net / ice / base / ice_flex_pipe.c
index 8a6fc8a..703c3e0 100644 (file)
@@ -284,7 +284,7 @@ ice_pkg_enum_section(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
  * indicates a base offset of 10, and the index for the entry is 2, then
  * section handler function should set the offset to 10 + 2 = 12.
  */
-static void *
+void *
 ice_pkg_enum_entry(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
                   u32 sect_type, u32 *offset,
                   void *(*handler)(u32 sect_type, void *section,
@@ -1263,8 +1263,13 @@ ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr)
        if (!pkg_hdr)
                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 *)
-               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) {
                struct ice_meta_sect *meta;
                struct ice_pkg_enum state;
@@ -1496,7 +1501,7 @@ ice_chk_pkg_compat(struct ice_hw *hw, struct ice_pkg_hdr *ospkg,
        }
 
        /* 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);
        if (!*seg) {
                ice_debug(hw, ICE_DBG_INIT, "no ice segment in package.\n");