flexstate.h (4113B)
1 /* 2 * DO NOT EDIT THIS FILE! 3 * This file is auto-generated. 4 * Edits to this file will be lost when it is regenerated. 5 * 6 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 7 * 8 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 9 */ 10 11 #ifndef BCMI_LTSW_FLEXSTATE_H 12 #define BCMI_LTSW_FLEXSTATE_H 13 14 #include <sal/sal_types.h> 15 16 /*! Invalid flex state action. */ 17 #define BCMI_LTSW_FLEXSTATE_ACTION_INVALID (0) 18 19 /*! Options internal. */ 20 #define BCMI_LTSW_FLEXSTATE_OPTIONS_INTERNAL (1 << 31) 21 22 /*! Options pipe bitmap. */ 23 #define BCMI_LTSW_FLEXSTATE_OPTIONS_PIPE_BMP (1 << 30) 24 25 /*! Ingress flex state lookup stage. */ 26 #define BCMI_LTSW_FLEXSTATE_STAGE_ING_LKUP (0x0) 27 28 /*! Ingress flex state forward stage. */ 29 #define BCMI_LTSW_FLEXSTATE_STAGE_ING_FWD (0x1) 30 31 /*! Egress flex state stage. */ 32 #define BCMI_LTSW_FLEXSTATE_STAGE_EGR (0x2) 33 34 /*! Flex counter stage count. */ 35 #define BCMI_LTSW_FLEXSTATE_STAGE_COUNT (0x3) 36 37 /*! Ingress flex state. */ 38 #define BCMI_LTSW_FLEXSTATE_DIR_INGRESS (0x0) 39 40 /*! Egress flex state. */ 41 #define BCMI_LTSW_FLEXSTATE_DIR_EGRESS (0x1) 42 43 /*! Flex state direction count. */ 44 #define BCMI_LTSW_FLEXSTATE_DIR_COUNT (0x2) 45 46 /*! 47 * \brief Internal flex state source. 48 */ 49 typedef enum bcmi_ltsw_flexstate_state_source_s { 50 51 /*! First internal source. */ 52 bcmiFlexstateSourceStart = 512, 53 54 /*! Ecn state source. */ 55 bcmiFlexstateSourceEcnState = 512, 56 57 /*! Tx byte state source. */ 58 bcmiFlexstateSourceTxByteState = 513, 59 60 /*! Last internal source. */ 61 bcmiFlexstateSourceEnd = 514 62 63 } bcmi_ltsw_flexstate_state_source_t; 64 65 #define BCMI_LTSW_FLEXSTATE_STATE_SOURCE_STR \ 66 { \ 67 "Start", \ 68 "EcnState", \ 69 "TxByteState", \ 70 "End" \ 71 } 72 73 /*! 74 * \brief Counter informaiton. 75 */ 76 typedef struct bcmi_ltsw_flexstate_counter_info_s { 77 78 /*! Stage id. */ 79 int stage; 80 81 /*! Pipeline id. */ 82 int pipe; 83 84 /*! h/w action index. */ 85 uint32_t action_index; 86 87 /*! action profile id. */ 88 uint64_t action_profile_id; 89 90 /*! Source enumeration in HSDK API. */ 91 int source; 92 93 /*! h/w source table name. */ 94 const char *table_name; 95 96 /*! Total counter index number. */ 97 uint32_t index_num; 98 99 /*! First allocated counter pool. */ 100 uint32_t start_pool; 101 102 /*! Last allocated counter pool. */ 103 uint32_t end_pool; 104 105 } bcmi_ltsw_flexstate_counter_info_t; 106 107 /*! 108 * \brief Get a counter id information. 109 * 110 * \param [in] unit Unit Number. 111 * \param [in] stat_counter_id Flex state action identifier. 112 * \param [out] info Counter information. 113 * 114 * \retval SHR_E_NONE No errors. 115 * \retval !SHR_E_NONE Failure. 116 */ 117 extern int 118 bcmi_ltsw_flexstate_counter_id_info_get( 119 int unit, 120 uint32_t stat_counter_id, 121 bcmi_ltsw_flexstate_counter_info_t *info); 122 123 /*! 124 * \brief Update an attached counter id status. 125 * 126 * \param [in] unit Unit Number. 127 * \param [in] stat_counter_id Flex state action identifier. 128 * 129 * \retval SHR_E_NONE No errors. 130 * \retval !SHR_E_NONE Failure. 131 */ 132 extern int 133 bcmi_ltsw_flexstate_attach_counter_id_status_update( 134 int unit, 135 uint32_t stat_counter_id); 136 137 /*! 138 * \brief Update a detached counter id status. 139 * 140 * \param [in] unit Unit Number. 141 * \param [in] stat_counter_id Flex state action identifier. 142 * 143 * \retval SHR_E_NONE No errors. 144 * \retval !SHR_E_NONE Failure. 145 */ 146 extern int 147 bcmi_ltsw_flexstate_detach_counter_id_status_update( 148 int unit, 149 uint32_t stat_counter_id); 150 151 /*! 152 * \brief Get a flex counter stat counter id. 153 * 154 * \param [in] unit Unit Number. 155 * \param [in] info Counter information. 156 * \param [out] stat_counter_id Flex state action identifier. 157 * 158 * \retval SHR_E_NONE No errors. 159 * \retval !SHR_E_NONE Failure. 160 */ 161 extern int 162 bcmi_ltsw_flexstate_counter_id_get( 163 int unit, 164 bcmi_ltsw_flexstate_counter_info_t *info, 165 uint32_t *stat_counter_id); 166 167 /*! 168 * \brief Dump flexctr module sw information. 169 * 170 * \param [in] unit Unit Number. 171 * 172 * \retval SHR_E_NONE No errors. 173 * \retval !SHR_E_NONE Failure. 174 */ 175 extern int 176 bcmi_ltsw_flexstate_sw_dump(int unit); 177 178 #endif /* BCMI_LTSW_FLEXSTATE_H */