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

l2.c (1444B)


      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:        l2.c
      8  * Purpose:     Trident2 L2 function implementations
      9  */
     10 
     11 #include <shared/bsl.h>
     12 #include <soc/defs.h>
     13 
     14 #if defined(BCM_TRIDENT2_SUPPORT)
     15 #include <soc/drv.h>
     16 #include <soc/l2x.h>
     17 
     18 #include <bcm/l2.h>
     19 #include <bcm/error.h>
     20 
     21 #include <bcm_int/esw/mbcm.h>
     22 #include <bcm_int/esw/l2.h>
     23 #include <bcm_int/esw/triumph.h>
     24 #include <bcm_int/esw/trident2.h>
     25 
     26 /*
     27  * Function:
     28  *      bcm_td2_l2_init
     29  * Description:
     30  *      Initialize chip-dependent parts of L2 module
     31  * Parameters:
     32  *      unit - StrataSwitch unit number.
     33  */
     34 
     35 int
     36 bcm_td2_l2_init(int unit)
     37 {
     38     int sw_learning_support = 0;
     39 
     40     BCM_IF_ERROR_RETURN(bcm_tr_l2_init(unit));
     41 
     42     if (SOC_CONTROL(unit)->l2x_age_interval != 0) {
     43         SOC_IF_ERROR_RETURN(soc_td2_l2_bulk_age_stop(unit));
     44     }
     45 
     46     sw_learning_support = soc_feature(unit, soc_feature_l2_hw_aging_bug) ||
     47                           soc_feature(unit, soc_feature_no_l2_remote_trunk);
     48     
     49     if (soc_property_get(unit, spn_RUN_L2_SW_AGING, sw_learning_support)) {
     50         if (!SOC_WARM_BOOT(unit)) {
     51             SOC_IF_ERROR_RETURN(soc_td2_l2_bulk_age_start(unit, 0));
     52         }
     53         SOC_CONTROL(unit)->l2x_sw_aging = 1;
     54     }
     55 
     56     return BCM_E_NONE;
     57 }
     58 
     59 #endif /* BCM_TRIDENT2_SUPORT */