mcast.c (2369B)
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: mcast.c 8 * Purpose: Tracks and manages L2 Multicast tables. 9 */ 10 11 #include <soc/defs.h> 12 #if defined(BCM_BRADLEY_SUPPORT) 13 #include <soc/drv.h> 14 #include <soc/mem.h> 15 16 #include <bcm/error.h> 17 #include <bcm/l2.h> 18 19 /* 20 * Function: 21 * bcm_humv_mcast_init 22 * Purpose: 23 * Initialize multicast api components 24 * Returns: 25 * BCM_E_XXX on error 26 * number of mcast entries supported on success 27 */ 28 29 int 30 bcm_humv_mcast_init(int unit) 31 { 32 #ifdef BCM_WARM_BOOT_SUPPORT 33 if (SOC_WARM_BOOT(unit)) { 34 uint32 mc_ctrl; 35 soc_control_t *soc = SOC_CONTROL(unit); 36 37 /* Recover the mcast size settings */ 38 SOC_IF_ERROR_RETURN 39 (READ_MC_CONTROL_1r(unit, &mc_ctrl)); 40 soc->higig2_bcast_size = 41 soc_reg_field_get(unit, MC_CONTROL_1r, mc_ctrl, 42 HIGIG2_BC_SIZEf); 43 44 SOC_IF_ERROR_RETURN 45 (READ_MC_CONTROL_2r(unit, &mc_ctrl)); 46 soc->higig2_mcast_size = 47 soc_reg_field_get(unit, MC_CONTROL_2r, mc_ctrl, 48 HIGIG2_L2MC_SIZEf); 49 50 SOC_IF_ERROR_RETURN 51 (READ_MC_CONTROL_3r(unit, &mc_ctrl)); 52 soc->higig2_ipmc_size = 53 soc_reg_field_get(unit, MC_CONTROL_3r, mc_ctrl, 54 HIGIG2_IPMC_SIZEf); 55 56 SOC_IF_ERROR_RETURN 57 (READ_MC_CONTROL_5r(unit, &mc_ctrl)); 58 soc->mcast_size = 59 soc_reg_field_get(unit, MC_CONTROL_5r, mc_ctrl, 60 SHARED_TABLE_L2MC_SIZEf); 61 soc->ipmc_size = 62 soc_reg_field_get(unit, MC_CONTROL_5r, mc_ctrl, 63 SHARED_TABLE_IPMC_SIZEf); 64 65 66 } 67 #endif /* BCM_WARM_BOOT_SUPPORT */ 68 69 /* Other initialization relocated to soc_misc_init */ 70 return BCM_E_NONE; 71 } 72 73 /* 74 * Function: 75 * _bcm_humv_mcast_detach 76 * Purpose: 77 * De-initialize multicast api components 78 * Returns: 79 * BCM_E_XXX on error 80 * number of mcast entries supported on success 81 */ 82 83 int 84 _bcm_humv_mcast_detach(int unit) 85 { 86 return BCM_E_NONE; 87 } 88 #else /* BCM_BRADLEY_SUPPORT */ 89 int _humv_mcast_not_empty; 90 #endif /* BCM_BRADLEY_SUPPORT */