openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

rate.c (1144B)


      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 <soc/drv.h>
      9 
     10 #include <soc/mem.h>
     11 #include <soc/register.h>
     12 #include <soc/memory.h>
     13 #include <bcm/rate.h>
     14 #include <bcm/error.h>
     15 /*
     16 * Function:
     17 *      bcm_rate_limit_t_init
     18 * Purpose:
     19 *      Initialize the bcm_rate_limit_t structure
     20 * Parameters:
     21 *      rate_limit - Pointer to structure which should be initialized
     22 * Returns:
     23 *      NONE
     24 */
     25 void 
     26 bcm_rate_limit_t_init(bcm_rate_limit_t *rate_limit)
     27 { 
     28     if (NULL != rate_limit) {
     29         sal_memset(rate_limit, 0, sizeof (*rate_limit));
     30     }
     31     return;
     32 }
     33 
     34 /*
     35 * Function:
     36 *      bcm_rate_packet_t_init
     37 * Purpose:
     38 *      Initialize the bcm_rate_packet_t structure
     39 * Parameters:
     40 *      rate_limit - Pointer to structure which should be initialized
     41 * Returns:
     42 *      NONE
     43 */
     44 void 
     45 bcm_rate_packet_t_init(bcm_rate_packet_t *pkt_rate)
     46 { 
     47     if (NULL != pkt_rate) {
     48         sal_memset(pkt_rate, 0, sizeof (*pkt_rate));
     49         pkt_rate->kbits_burst = -1;
     50     }
     51     return;
     52 }
     53 
     54