pstats.c (1618B)
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 * PSTATS - Broadcom StrataSwitch PSTATS API 8 */ 9 10 #include <soc/drv.h> 11 #include <bcm/pstats.h> 12 13 #if defined(INCLUDE_PSTATS) 14 /* 15 * Function: 16 * bcm_pstats_timestamp_t_init 17 * Purpose: 18 * Initialize an PSTATS timestamp structure 19 * Parameters: 20 * timestamp - (OUT) pointer to bcm_pstats_timestamp_t structure 21 */ 22 void 23 bcm_pstats_timestamp_t_init(bcm_pstats_timestamp_t *timestamp) 24 { 25 if (NULL != timestamp) { 26 sal_memset(timestamp, 0, sizeof (*timestamp)); 27 } 28 return; 29 } 30 31 /* 32 * Function: 33 * bcm_pstats_session_element_t_init 34 * Purpose: 35 * Initialize an PSTATS session element structure 36 * Parameters: 37 * timestamp - (OUT) pointer to bcm_pstats_session_element_t structure 38 */ 39 void 40 bcm_pstats_session_element_t_init(bcm_pstats_session_element_t *element) 41 { 42 if (NULL != element) { 43 sal_memset(element, 0, sizeof (*element)); 44 element->type = bcmPStatsSessionTypeCount; 45 element->gport = BCM_GPORT_INVALID; 46 element->cosq = -1; 47 element->pool = -1; 48 } 49 50 return; 51 } 52 53 /* 54 * Function: 55 * bcm_pstats_data_t_init 56 * Purpose: 57 * Initialize an PSTATS data structure 58 * Parameters: 59 * timestamp - (OUT) pointer to bcm_pstats_data_t structure 60 */ 61 void 62 bcm_pstats_data_t_init(bcm_pstats_data_t *data) 63 { 64 if (NULL != data) { 65 sal_memset(data, 0, sizeof (*data)); 66 } 67 return; 68 } 69 #endif /* INCLUDE_PSTATS */