lb.c (2126B)
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 * File: lb.c 8 * Purpose: Manages common LB functions 9 */ 10 11 #include <sal/core/libc.h> 12 13 #include <soc/drv.h> 14 #include <soc/debug.h> 15 16 #include <bcm/lb.h> 17 18 19 /* Initialize structure bcm_lb_rx_modem_map_index_t */ 20 void bcm_lb_rx_modem_map_index_t_init( 21 bcm_lb_rx_modem_map_index_t *map_index) 22 { 23 if (map_index != NULL) { 24 sal_memset(map_index, 0, sizeof(*map_index)); 25 } 26 } 27 28 /* Initialize structure bcm_lb_rx_modem_map_config_t */ 29 void bcm_lb_rx_modem_map_config_t_init( 30 bcm_lb_rx_modem_map_config_t *map_config) 31 { 32 if (map_config != NULL) { 33 sal_memset(map_config, 0, sizeof(*map_config)); 34 } 35 } 36 37 /* Initialize structure bcm_lb_packet_config_t */ 38 void bcm_lb_packet_config_t_init( 39 bcm_lb_packet_config_t *packet_config) 40 { 41 if (packet_config != NULL) { 42 sal_memset(packet_config, 0, sizeof(*packet_config)); 43 } 44 } 45 46 /* Initialize structure bcm_lb_modem_packet_config_t */ 47 void bcm_lb_modem_packet_config_t_init( 48 bcm_lb_modem_packet_config_t *packet_config) 49 { 50 if (packet_config != NULL) { 51 sal_memset(packet_config, 0, sizeof(*packet_config)); 52 } 53 } 54 55 /* Initialize structure bcm_lb_tc_dp_t */ 56 void bcm_lb_tc_dp_t_init( 57 bcm_lb_tc_dp_t *tc_dp) 58 { 59 if (tc_dp != NULL) { 60 sal_memset(tc_dp, 0, sizeof(*tc_dp)); 61 } 62 } 63 64 /* Initialize structure bcm_lb_pkt_pri_t */ 65 void bcm_lb_pkt_pri_t_init( 66 bcm_lb_pkt_pri_t *pkt_pri) 67 { 68 if (pkt_pri != NULL) { 69 sal_memset(pkt_pri, 0, sizeof(*pkt_pri)); 70 } 71 } 72 73 /* Initialize structure bcm_lb_lbg_weight_t */ 74 void bcm_lb_lbg_weight_t_init( 75 bcm_lb_lbg_weight_t *lbg_weights) 76 { 77 if (lbg_weights != NULL) { 78 sal_memset(lbg_weights, 0, sizeof(*lbg_weights)); 79 } 80 } 81 82 /* Initialize structure bcm_lb_modem_shaper_config_t */ 83 void bcm_lb_modem_shaper_config_t_init( 84 bcm_lb_modem_shaper_config_t *shaper) 85 { 86 if (shaper != NULL) { 87 sal_memset(shaper, 0, sizeof(*shaper)); 88 } 89 } 90