mbcm_sat.c (2430B)
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: mbcm.c 8 * Purpose: Implementation of bcm multiplexing 9 */ 10 11 #include <shared/bsl.h> 12 #include <soc/defs.h> 13 #include <soc/drv.h> 14 #include <soc/shared/mbcm_sat.h> 15 #ifdef BCM_SAT_SUPPORT 16 17 CONST mbcm_sat_functions_t *mbcm_sat_driver[BCM_MAX_NUM_UNITS]={0}; 18 soc_sat_chip_family_t mbcm_sat_family[BCM_MAX_NUM_UNITS]; 19 20 CONST mbcm_sat_functions_t mbcm_sat_fun_driver = { 21 soc_sat_config_set, 22 soc_sat_config_get, 23 /* GTF functions */ 24 soc_sat_general_cfg_init, 25 soc_sat_gtf_packet_gen_set, 26 soc_sat_gtf_packet_gen_get, 27 soc_sat_gtf_packet_config, 28 soc_sat_gtf_bandwidth_set, 29 soc_sat_gtf_bandwidth_get, 30 soc_sat_gtf_rate_pattern_set, 31 soc_sat_gtf_rate_pattern_get, 32 soc_sat_gtf_stat_get, 33 /* CTF functions */ 34 soc_sat_ctf_packet_config, 35 soc_sat_ctf_identifier_map, 36 soc_sat_ctf_identifier_unmap, 37 soc_sat_ctf_trap_set, 38 soc_sat_ctf_bin_limit_set, 39 soc_sat_ctf_bin_limit_get, 40 soc_sat_ctf_stat_config_set, 41 soc_sat_ctf_stat_get, 42 soc_sat_ctf_availability_config_set, 43 soc_sat_ctf_trap_data_to_session_map, 44 soc_sat_ctf_trap_data_to_session_unmap, 45 soc_sat_ctf_reports_config_set, 46 /* OAMP interrupt */ 47 soc_sat_oamp_stat_event_control, 48 soc_sat_oamp_stat_event_clear, 49 soc_sat_session_inuse, 50 }; 51 52 53 /**************************************************************** 54 * 55 * Function: mbcm_sat_init 56 * Parameters: unit -- unit to setup 57 * 58 * Initialize the mbcm sat driver for the indicated unit. 59 */ 60 int 61 mbcm_sat_init(int unit) 62 { 63 #if defined(BCM_PETRA_SUPPORT) 64 if (SOC_IS_JERICHO(unit)) { 65 mbcm_sat_driver[unit] = &mbcm_sat_fun_driver; 66 mbcm_sat_family[unit] = SOC_SAT_FAMILY_JERICHO; 67 return SOC_E_NONE; 68 } 69 #endif 70 71 #ifdef BCM_SABER2_SUPPORT 72 if (SOC_IS_SABER2(unit)) { 73 mbcm_sat_driver[unit] = &mbcm_sat_fun_driver; 74 mbcm_sat_family[unit] = SOC_SAT_FAMILY_SABER2; 75 return SOC_E_NONE; 76 } 77 #endif /* BCM_SABER2_SUPPORT */ 78 79 80 LOG_INFO(BSL_LS_BCM_INIT, 81 (BSL_META_U(unit, 82 "ERROR: mbcm_sat_init unit %d: unsupported chip type\n"), unit)); 83 return SOC_E_UNAVAIL; 84 } 85 #endif /* BCM_SAT_SUPPORT */