tsn.c (4858B)
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/mem.h> 9 #include <bcm/tsn.h> 10 11 void bcm_tsn_sr_port_config_t_init(bcm_tsn_sr_port_config_t *port_config) 12 { 13 if (NULL != port_config) { 14 sal_memset(port_config, 0, sizeof(*port_config)); 15 } 16 } 17 18 void bcm_tsn_pri_map_entry_t_init(bcm_tsn_pri_map_entry_t *entry) 19 { 20 if (NULL != entry) { 21 sal_memset(entry, 0, sizeof(*entry)); 22 } 23 } 24 25 void bcm_tsn_pri_map_config_t_init(bcm_tsn_pri_map_config_t *config) 26 { 27 int ent_idx; 28 if (NULL != config) { 29 sal_memset(config, 0, sizeof(*config)); 30 31 config->map_type = bcmTsnPriMapTypeCount; 32 config->num_map_entries = 0; 33 for (ent_idx = 0; 34 ent_idx < 35 sizeof(config->map_entries) / sizeof(bcm_tsn_pri_map_entry_t); 36 ent_idx++) { 37 bcm_tsn_pri_map_entry_t_init(&config->map_entries[ent_idx]); 38 config->map_entries[ent_idx].new_int_pri = ent_idx; 39 config->map_entries[ent_idx].flow_offset = 0; 40 config->map_entries[ent_idx].profile_id = -1; 41 config->map_entries[ent_idx].taf_gate_express = -1; 42 config->map_entries[ent_idx].taf_gate_preempt = -1; 43 } 44 } 45 } 46 47 void bcm_tsn_sr_tx_flow_config_t_init(bcm_tsn_sr_tx_flow_config_t *flow_config) 48 { 49 if (NULL != flow_config) { 50 sal_memset(flow_config, 0, sizeof(*flow_config)); 51 } 52 } 53 54 void bcm_tsn_sr_rx_flow_config_t_init(bcm_tsn_sr_rx_flow_config_t *config) 55 { 56 if (NULL != config) { 57 sal_memset(config, 0, sizeof(*config)); 58 } 59 } 60 61 void bcm_tsn_sr_flowset_status_t_init(bcm_tsn_sr_flowset_status_t *status) 62 { 63 if (NULL != status) { 64 sal_memset(status, 0, sizeof(*status)); 65 } 66 } 67 68 void bcm_tsn_sr_tx_flow_status_t_init(bcm_tsn_sr_tx_flow_status_t *status) 69 { 70 if (NULL != status) { 71 sal_memset(status, 0, sizeof(*status)); 72 } 73 } 74 75 void bcm_tsn_sr_rx_flow_status_t_init(bcm_tsn_sr_rx_flow_status_t *status) 76 { 77 if (NULL != status) { 78 sal_memset(status, 0, sizeof(*status)); 79 } 80 } 81 82 void bcm_tsn_flow_config_t_init(bcm_tsn_flow_config_t *flow_config) 83 { 84 if (NULL != flow_config) { 85 sal_memset(flow_config, 0, sizeof(*flow_config)); 86 } 87 } 88 89 void bcm_tsn_flowset_status_t_init(bcm_tsn_flowset_status_t *status) 90 { 91 if (NULL != status) { 92 sal_memset(status, 0, sizeof(*status)); 93 } 94 } 95 96 void bcm_tsn_sr_auto_learn_group_config_t_init(bcm_tsn_sr_auto_learn_group_config_t *config) 97 { 98 if (NULL != config) { 99 sal_memset(config, 0, sizeof(*config)); 100 } 101 } 102 103 void bcm_tsn_sr_auto_learn_config_t_init(bcm_tsn_sr_auto_learn_config_t *config) 104 { 105 if (NULL != config) { 106 sal_memset(config, 0, sizeof(*config)); 107 } 108 } 109 110 /* 111 * Function: 112 * bcm_tsn_stat_threshold_config_t_init 113 * Purpose: 114 * Intitialize an TSN stat threshold configuration structure 115 * Parameters: 116 * config - (OUT) Pointer to TSN stat threshold configuration structure. 117 * Returns: 118 * nothing 119 */ 120 void 121 bcm_tsn_stat_threshold_config_t_init(bcm_tsn_stat_threshold_config_t *config) 122 { 123 if (NULL != config) { 124 sal_memset(config, 0, sizeof(*config)); 125 } 126 } 127 128 void bcm_tsn_event_source_t_init(bcm_tsn_event_source_t *source) 129 { 130 if (NULL != source) { 131 sal_memset(source, 0, sizeof(*source)); 132 } 133 } 134 135 /* 136 * Function: 137 * bcm_tsn_mtu_config_t_init 138 * Purpose: 139 * Initialize a tsn_mtu_config structure 140 * Parameters: 141 * config - pointer to the bcm_tsn_mtu_config_t structure. 142 * Returns: 143 * NONE 144 */ 145 void bcm_tsn_mtu_config_t_init(bcm_tsn_mtu_config_t *config) 146 { 147 if (NULL != config) { 148 sal_memset(config, 0, sizeof(*config)); 149 } 150 } 151 152 /* 153 * Function: 154 * bcm_tsn_stu_config_t_init 155 * Purpose: 156 * Initialize a tsn_stu_config structure 157 * Parameters: 158 * config - pointer to the bcm_tsn_stu_config_t structure. 159 * Returns: 160 * NONE 161 */ 162 void bcm_tsn_stu_config_t_init(bcm_tsn_stu_config_t *config) 163 { 164 if (NULL != config) { 165 sal_memset(config, 0, sizeof(*config)); 166 } 167 } 168 169 void bcm_tsn_ingress_mtu_config_t_init(bcm_tsn_ingress_mtu_config_t *config) 170 { 171 if (NULL != config) { 172 sal_memset(config, 0, sizeof(*config)); 173 } 174 } 175 176 void bcm_tsn_ingress_stu_config_t_init(bcm_tsn_ingress_stu_config_t *config) 177 { 178 if (NULL != config) { 179 sal_memset(config, 0, sizeof(*config)); 180 } 181 } 182 183 void bcm_tsn_taf_profile_status_t_init( 184 bcm_tsn_taf_profile_status_t *profile_status) 185 { 186 if (profile_status) { 187 sal_memset(profile_status, 0, sizeof(bcm_tsn_taf_profile_status_t)); 188 } 189 } 190 191 void bcm_tsn_taf_profile_t_init( 192 bcm_tsn_taf_profile_t *profile) 193 { 194 if (profile) { 195 sal_memset(profile, 0, sizeof(bcm_tsn_taf_profile_t)); 196 } 197 }