Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(c) 2001-2023 Intel Corporation 3 : : */ 4 : : 5 : : #include "ice_common.h" 6 : : #include "ice_parser_util.h" 7 : : 8 : : #define ICE_MK_GRP_TABLE_SIZE 128 9 : : #define ICE_MK_COUNT_PER_GRP 8 10 : : 11 : : /** 12 : : * ice_mk_grp_dump - dump an marker group item info 13 : : * @hw: pointer to the hardware structure 14 : : * @item: marker group item to dump 15 : : */ 16 : 0 : void ice_mk_grp_dump(struct ice_hw *hw, struct ice_mk_grp_item *item) 17 : : { 18 : : int i; 19 : : 20 [ # # ]: 0 : ice_info(hw, "index = %d\n", item->idx); 21 [ # # ]: 0 : ice_info(hw, "markers: "); 22 [ # # ]: 0 : for (i = 0; i < ICE_MK_COUNT_PER_GRP; i++) 23 [ # # ]: 0 : ice_info(hw, "%d ", item->markers[i]); 24 [ # # ]: 0 : ice_info(hw, "\n"); 25 : 0 : } 26 : : 27 : 0 : static void _mk_grp_parse_item(struct ice_hw *hw, u16 idx, void *item, 28 : : void *data, int size) 29 : : { 30 : : struct ice_mk_grp_item *grp = (struct ice_mk_grp_item *)item; 31 : : u8 *buf = (u8 *)data; 32 : : int i; 33 : : 34 : 0 : grp->idx = idx; 35 : : 36 [ # # ]: 0 : for (i = 0; i < ICE_MK_COUNT_PER_GRP; i++) 37 : 0 : grp->markers[i] = buf[i]; 38 : : 39 [ # # ]: 0 : if (hw->debug_mask & ICE_DBG_PARSER) 40 : 0 : ice_mk_grp_dump(hw, grp); 41 : 0 : } 42 : : 43 : : /** 44 : : * ice_mk_grp_table_get - create a marker group table 45 : : * @hw: pointer to the hardware structure 46 : : */ 47 : 0 : struct ice_mk_grp_item *ice_mk_grp_table_get(struct ice_hw *hw) 48 : : { 49 : 0 : return (struct ice_mk_grp_item *) 50 : 0 : ice_parser_create_table(hw, ICE_SID_RXPARSER_MARKER_GRP, 51 : : sizeof(struct ice_mk_grp_item), 52 : : ICE_MK_GRP_TABLE_SIZE, 53 : : ice_parser_sect_item_get, 54 : : _mk_grp_parse_item, false); 55 : : }