fabric.h (2318B)
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-2020 Broadcom Inc. All rights reserved. 6 * 7 * File: fabric.h 8 * Purpose: FABRIC internal definitions to the BCM library. 9 */ 10 11 #ifndef _BCM_INT_DPP_FABRIC_H_ 12 #define _BCM_INT_DPP_FABRIC_H_ 13 14 #include <bcm/debug.h> 15 16 #include <soc/dpp/dpp_config_defs.h> 17 18 /* 19 * Defines 20 */ 21 #define BCM_FABRIC_MODID_IS_VALID(unit, modid) \ 22 ((modid >= 0) && (modid < SOC_DPP_DEFS_GET(unit, modid_max_valid))) /* True if modid is between 0 and the max 23 limit of FAP's in the device */ 24 #define BCM_FABRIC_NUM_OF_LINKS_IS_VALID(unit, num_of_links) \ 25 ((num_of_links >= 0) && (num_of_links <= SOC_DPP_DEFS_GET(unit, nof_fabric_links))) /* True if num_of_links is between 0 and the max 26 fabric links in the device */ 27 #define BCM_FABRIC_PCP_MODE_IS_VALID(pcp_mode) \ 28 ((pcp_mode >= 0) && (pcp_mode <= 2)) /* True if pcp_mode is one of the 29 three supported pcp_modes (0-2) */ 30 #define BCM_FABRIC_MC_ID_IS_VALID(unit, mc_id) \ 31 ((mc_id >= 0) && (mc_id <= (SOC_DPP_DEFS_GET(unit, fabric_mesh_mc_id_max_valid)))) /* True if mc_id is between 0 and the max 32 limit of mc id's in mesh mode */ 33 #define BCM_FABRIC_RCI_HIGH_SCORE_IS_VALID(high_score) \ 34 (((int)high_score >= 0) && (high_score <= 0x1FFF)) 35 36 #define BCM_FABRIC_RCI_SEVERITY_FACTOR_IS_VALID(factor) \ 37 (((int)factor >= 0) && (factor <= 0x8)) 38 39 #define BCM_FABRIC_RCI_THRESHOLD_IS_VALID(threshold) \ 40 (((int)threshold >= 0) && (threshold <= 0x1FFF)) 41 42 #define BCM_FABRIC_RCI_CONGESTED_LINKS_THRESHOLD_IS_VALID(congested_th) \ 43 (((int)congested_th >= 0) && (congested_th <= 0X3F)) 44 45 46 /* 47 * External functions 48 */ 49 int 50 bcm_petra_fabric_enhance_ports_get(int unit, bcm_core_t core, int *nbr_ports, int *ports); 51 int 52 bcm_petra_fabric_multicast_scheduler_mode_get(int unit, int core_id, int *mode); 53 #endif /* _BCM_INT_DPP_FABRIC_H_ */