stat.c (10698B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 */ 7 8 #include <bcm/stat.h> 9 #include <sal/types.h> 10 #include <soc/mem.h> 11 12 /* 13 * Function: 14 * bcm_stat_group_mode_attr_selector_t_init 15 * Description: 16 * Initialize an attribute selector of Stat Flex Group Mode 17 * Parameters: 18 * attr_selector : (INOUT) Attribute Selector for Stat Flex Group Mode 19 * Returns: 20 * NONE 21 */ 22 void bcm_stat_group_mode_attr_selector_t_init( 23 bcm_stat_group_mode_attr_selector_t *attr_selector) 24 { 25 if (attr_selector != NULL) { 26 sal_memset(attr_selector, 0, 27 sizeof(bcm_stat_group_mode_attr_selector_t)); 28 } 29 return; 30 } 31 32 /* 33 * Function: 34 * bcm_stat_value_t_init 35 * Description: 36 * Initialize a data structure bcm_stat_value_t 37 * void bcm_stat_value_t_init(bcm_stat_value_t *stat_value) 38 * Parameters: 39 * stat_value : (INOUT) Pointer to bcm_stat_value_t structure to be initialized 40 * Returns: 41 * NONE 42 */ 43 void bcm_stat_value_t_init( 44 bcm_stat_value_t *stat_value) 45 { 46 if (stat_value != NULL) { 47 sal_memset(stat_value, 0, 48 sizeof(bcm_stat_value_t)); 49 } 50 return; 51 } 52 53 void bcm_stat_group_mode_id_config_t_init( 54 bcm_stat_group_mode_id_config_t *stat_config) 55 { 56 if (stat_config != NULL) { 57 sal_memset(stat_config, 0, 58 sizeof(bcm_stat_group_mode_id_config_t)); 59 } 60 return; 61 } 62 63 void bcm_stat_group_mode_hint_t_init( 64 bcm_stat_group_mode_hint_t *stat_hint) 65 { 66 if (stat_hint != NULL) { 67 sal_memset(stat_hint, 0, 68 sizeof(bcm_stat_group_mode_hint_t)); 69 } 70 return; 71 } 72 73 /* 74 * Function: 75 * bcm_stat_counter_input_data_t_init 76 * Purpose: 77 * Initialize a stat_counter_input_data object struct. 78 * Parameters: 79 * stat_input_data - pointer to stat_counter_input_data object struct. 80 * Returns: 81 * NONE 82 */ 83 void bcm_stat_counter_input_data_t_init( 84 bcm_stat_counter_input_data_t *stat_input_data) 85 { 86 if (stat_input_data != NULL) { 87 sal_memset(stat_input_data, 0, 88 sizeof (bcm_stat_counter_input_data_t)); 89 stat_input_data->counter_source_gport = -1; 90 stat_input_data->counter_source_id = -1; 91 } 92 return; 93 } 94 95 /* 96 * Function: 97 * bcm_stat_flex_pool_stat_info_t_init 98 * Purpose: 99 * Initialize a stat_flex_pool_stat_info object struct. 100 * Parameters: 101 * stat_flex_pool_stat_info - pointer to stat_flex_pool_stat_info object struct. 102 * Returns: 103 * NONE 104 */ 105 void bcm_stat_flex_pool_stat_info_t_init( 106 bcm_stat_flex_pool_stat_info_t *stat_flex_pool_stat_info) 107 { 108 if (stat_flex_pool_stat_info != NULL) { 109 sal_memset(stat_flex_pool_stat_info, 0, 110 sizeof (bcm_stat_flex_pool_stat_info_t)); 111 } 112 return; 113 } 114 115 /* 116 * Function: 117 * bcm_stat_engine_t_init 118 * Purpose: 119 * Initialize a stat_engine object struct. 120 * Parameters: 121 * stat_engine - pointer to stat_engine object struct. 122 * Returns: 123 * NONE 124 */ 125 void bcm_stat_engine_t_init( 126 bcm_stat_engine_t *stat_engine) 127 { 128 if (stat_engine != NULL) { 129 sal_memset(stat_engine, 0, 130 sizeof(bcm_stat_engine_t)); 131 } 132 return; 133 } 134 135 /* 136 * Function: 137 * bcm_stat_counter_database_t_init 138 * Purpose: 139 * Initialize a stat_counter_database object struct. 140 * Parameters: 141 * stat_engine - pointer to stat_counter_database object struct. 142 * Returns: 143 * NONE 144 */ 145 void bcm_stat_counter_database_t_init( 146 bcm_stat_counter_database_t *stat_counter_database) 147 { 148 if (stat_counter_database != NULL) { 149 sal_memset(stat_counter_database, 0, 150 sizeof(bcm_stat_counter_database_t)); 151 } 152 return; 153 } 154 155 /* 156 * Function: 157 * bcm_stat_counter_explicit_input_data_t_init 158 * Purpose: 159 * Initialize the bcm_stat_counter_explicit_input_data_t structure 160 * Parameters: 161 * stat_counter_explicit_input_data - Pointer to structure which should be initialized 162 * Returns: 163 * NONE 164 */ 165 void bcm_stat_counter_explicit_input_data_t_init( 166 bcm_stat_counter_explicit_input_data_t *stat_counter_explicit_input_data) 167 { 168 if (stat_counter_explicit_input_data != NULL) { 169 sal_memset(stat_counter_explicit_input_data, 0, 170 sizeof(bcm_stat_counter_explicit_input_data_t)); 171 } 172 return; 173 } 174 175 /* 176 * Function: 177 * bcm_stat_eviction_t_init 178 * Purpose: 179 * Initialize the bcm_stat_eviction_t structure 180 * Parameters: 181 * stat_eviction - Pointer to structure which should be initialized 182 * Returns: 183 * NONE 184 */ 185 void bcm_stat_eviction_t_init( 186 bcm_stat_eviction_t *stat_eviction) 187 { 188 if (stat_eviction != NULL) { 189 sal_memset(stat_eviction, 0, 190 sizeof(bcm_stat_eviction_t)); 191 } 192 return; 193 } 194 195 /* 196 * Function: 197 * bcm_stat_counter_set_map_t_init 198 * Purpose: 199 * Initialize the bcm_stat_counter_set_map_t structure 200 * Parameters: 201 * stat_counter_set_map - Pointer to structure which should be initialized 202 * Returns: 203 * NONE 204 */ 205 void bcm_stat_counter_set_map_t_init( 206 bcm_stat_counter_set_map_t *stat_counter_set_map) 207 { 208 if (stat_counter_set_map != NULL) { 209 sal_memset(stat_counter_set_map, 0, 210 sizeof(bcm_stat_counter_set_map_t)); 211 } 212 return; 213 } 214 215 /* 216 * Function: 217 * bcm_stat_expansion_data_mapping_t_init 218 * Purpose: 219 * Initialize the bcm_stat_expansion_data_mapping_t structure 220 * Parameters: 221 * stat_expansion_data_mapping - Pointer to structure which should be initialized 222 * Returns: 223 * NONE 224 */ 225 void bcm_stat_expansion_data_mapping_t_init( 226 bcm_stat_expansion_data_mapping_t *stat_expansion_data_mapping) 227 { 228 if (stat_expansion_data_mapping != NULL) { 229 sal_memset(stat_expansion_data_mapping, 0, 230 sizeof(bcm_stat_expansion_data_mapping_t)); 231 } 232 return; 233 } 234 235 /* 236 * Function: 237 * bcm_stat_counter_interface_key_t_init 238 * Purpose: 239 * Initialize the bcm_stat_counter_interface_key_t structure 240 * Parameters: 241 * stat_counter_interface_key - Pointer to structure which should be initialized 242 * Returns: 243 * NONE 244 */ 245 void bcm_stat_counter_interface_key_t_init( 246 bcm_stat_counter_interface_key_t *stat_counter_interface_key) 247 { 248 if (stat_counter_interface_key != NULL) { 249 sal_memset(stat_counter_interface_key, 0, 250 sizeof(bcm_stat_counter_interface_key_t)); 251 } 252 return; 253 } 254 255 /* 256 * Function: 257 * bcm_stat_expansion_select_t_init 258 * Purpose: 259 * Initialize the bcm_stat_expansion_select_t structure 260 * Parameters: 261 * stat_expansion_select - Pointer to structure which should be initialized 262 * Returns: 263 * NONE 264 */ 265 void bcm_stat_expansion_select_t_init( 266 bcm_stat_expansion_select_t *stat_expansion_select) 267 { 268 if (stat_expansion_select != NULL) { 269 sal_memset(stat_expansion_select, 0, 270 sizeof(bcm_stat_expansion_select_t)); 271 } 272 return; 273 } 274 275 /* 276 * Function: 277 * bcm_stat_counter_interface_t_init 278 * Purpose: 279 * Initialize the bcm_stat_counter_interface_t structure 280 * Parameters: 281 * stat_counter_interface - Pointer to structure which should be initialized 282 * Returns: 283 * NONE 284 */ 285 void bcm_stat_counter_interface_t_init( 286 bcm_stat_counter_interface_t *stat_counter_interface) 287 { 288 if (stat_counter_interface != NULL) { 289 sal_memset(stat_counter_interface, 0, 290 sizeof(bcm_stat_counter_interface_t)); 291 } 292 return; 293 } 294 295 /* 296 * Function: 297 * bcm_stat_counter_enable_t_init 298 * Purpose: 299 * Initialize the bcm_stat_counter_enable_t structure 300 * Parameters: 301 * stat_counter_enable - Pointer to structure which should be initialized 302 * Returns: 303 * NONE 304 */ 305 void bcm_stat_counter_enable_t_init( 306 bcm_stat_counter_enable_t *stat_counter_enable) 307 { 308 if (stat_counter_enable != NULL) { 309 sal_memset(stat_counter_enable, 0, 310 sizeof(bcm_stat_counter_enable_t)); 311 } 312 return; 313 } 314 315 /* 316 * Function: 317 * bcm_stat_engine_enable_t_init 318 * Purpose: 319 * Initialize the bcm_stat_engine_enable_t structure 320 * Parameters: 321 * stat_engine_enable - Pointer to structure which should be initialized 322 * Returns: 323 * NONE 324 */ 325 void bcm_stat_counter_output_data_t_init( 326 bcm_stat_counter_output_data_t *stat_counter_output_data) 327 { 328 if (stat_counter_output_data != NULL) { 329 sal_memset(stat_counter_output_data, 0, 330 sizeof(bcm_stat_counter_output_data_t)); 331 } 332 return; 333 } 334 335 /* 336 * Function: 337 * bcm_stat_counter_command_id_key_t_init 338 * Purpose: 339 * Initialize the bcm_stat_counter_command_id_key_t structure 340 * Parameters: 341 * stat_counter_command_id_key - Pointer to structure which should be initialized 342 * Returns: 343 * NONE 344 */ 345 void bcm_stat_counter_command_id_key_t_init( 346 bcm_stat_counter_command_id_key_t *stat_counter_command_id_key) 347 { 348 return; 349 } 350 351 /* 352 * Function: 353 * bcm_stat_eviction_boundaries_t_init 354 * Purpose: 355 * Initialize the bcm_stat_eviction_boundaries_t structure 356 * Parameters: 357 * stat_eviction_boundaries - Pointer to structure which should be initialized 358 * Returns: 359 * NONE 360 */ 361 void bcm_stat_eviction_boundaries_t_init( 362 bcm_stat_eviction_boundaries_t *stat_eviction_boundaries) 363 { 364 return; 365 } 366 367 /* 368 * Function: 369 * bcm_stat_custom_counter_info_t_init 370 * Purpose: 371 * Initialize the bcm_bcm_stat_custom_counter_info_t structure 372 * Parameters: 373 * counter_info - Pointer to structure which should be initialized 374 * Returns: 375 * NONE 376 */ 377 void bcm_stat_custom_counter_info_t_init( 378 bcm_stat_custom_counter_info_t *counter_info) 379 { 380 if (counter_info != NULL) { 381 sal_memset(counter_info, 0, 382 sizeof(bcm_stat_custom_counter_info_t)); 383 } 384 return; 385 } 386 387 /* 388 * Function: 389 * bcm_stat_pp_profile_info_t_init 390 * Purpose: 391 * Initialize the bcm_stat_pp_profile_info_t structure 392 * Parameters: 393 * pp_profile - Pointer to structure which should be initialized 394 * Returns: 395 * NONE 396 */ 397 void bcm_stat_pp_profile_info_t_init( 398 bcm_stat_pp_profile_info_t *pp_profile) 399 { 400 sal_memset(pp_profile, 0, sizeof(bcm_stat_pp_profile_info_t)); 401 pp_profile->meter_command_id = 0; 402 return; 403 } 404 405 /* 406 * Function: 407 * bcm_stat_pp_info_t_init 408 * Purpose: 409 * Initialize the bcm_stat_info_t structure 410 * Parameters: 411 * stat_info - Pointer to structure which should be initialized 412 * Returns: 413 * NONE 414 */ 415 void bcm_stat_pp_info_t_init( 416 bcm_stat_pp_info_t *stat_info) 417 { 418 sal_memset(stat_info, 0, sizeof(bcm_stat_pp_info_t)); 419 return; 420 }