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

fabric.c (2542B)


      1 /*
      2  * 
      3  *
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      7  *
      8  *  Fabric functions common to all platforms.
      9  */
     10 
     11 #include <sal/core/libc.h>
     12 #include <bcm/fabric.h>
     13 
     14 /* Initialize a fabric predicate info structure. */
     15 void bcm_fabric_predicate_info_t_init(int unit, 
     16                                       bcm_fabric_predicate_info_t *pred_info)
     17 {
     18     sal_memset(pred_info, 0x00, sizeof(*pred_info));
     19 }
     20 
     21 /* Initialize a fabric action info structure. */
     22 void bcm_fabric_action_info_t_init(int unit, 
     23                                    bcm_fabric_action_info_t *action_info)
     24 {
     25     sal_memset(action_info, 0x00, sizeof(*action_info));
     26     action_info->override_dp = -1;
     27     action_info->override_ecn = -1;
     28     action_info->clear_ehv_bit = -1;
     29     action_info->clear_mp_bit = -1;
     30     action_info->four_byte_remove_offset = -1;
     31 }
     32 
     33 /* Initialize a fabric predicate action info structure */
     34 void bcm_fabric_predicate_action_info_t_init(int unit, 
     35                      bcm_fabric_predicate_action_info_t *predicate_action_info)
     36 {
     37     sal_memset(predicate_action_info, 0x00, sizeof(*predicate_action_info));
     38 }
     39 
     40 /* Initialize a fabric tdm editing structure. */
     41 void bcm_fabric_tdm_editing_t_init(bcm_fabric_tdm_editing_t *editing)
     42 {
     43     sal_memset(editing, 0x00, sizeof(bcm_fabric_tdm_editing_t));
     44 }
     45 
     46 /* Initialize a fabric route structure. */
     47 void bcm_fabric_route_t_init(bcm_fabric_route_t *fabric_route)
     48 {
     49     sal_memset(fabric_route, 0x00, sizeof(bcm_fabric_route_t));
     50     fabric_route->pipe_id = -1;
     51 }
     52 
     53 /* Initialize a fabric remote pipe mapping structure. */
     54 void bcm_fabric_link_remote_pipe_mapping_t_init(bcm_fabric_link_remote_pipe_mapping_t *pipe_mapping)
     55 {
     56     sal_memset(pipe_mapping, 0x00, sizeof(bcm_fabric_link_remote_pipe_mapping_t));
     57 }
     58 
     59 /* Initialize a fabric rci config structure. */
     60 void bcm_fabric_rci_config_t_init(bcm_fabric_rci_config_t *rci_config)
     61 {
     62     int i;
     63     for (i = 0; i < BCM_FABRIC_NUM_OF_RCI_LEVELS; ++i) {
     64         rci_config->rci_core_level_thresholds[i] = -1; 
     65         rci_config->rci_device_level_thresholds[i] = -1;
     66     }
     67     for (i = 0; i < BCM_FABRIC_NUM_OF_RCI_SEVERITIES; ++i) {
     68         rci_config->rci_severity_factors[i] = -1;
     69     }
     70     rci_config->rci_high_score_fabric_rx_queue = -1;
     71     rci_config->rci_high_score_fabric_rx_local_queue = -1;
     72     rci_config->rci_threshold_num_of_congested_links = -1;
     73     rci_config->rci_high_score_congested_links = -1;
     74 }
     75