tdm_mv2_shim.c (1740B)
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 * $All Rights Reserved.$ 7 * 8 * TDM chip to core API shim layer 9 */ 10 #ifdef _TDM_STANDALONE 11 #include <tdm_top.h> 12 #else 13 #include <soc/tdm/core/tdm_top.h> 14 #endif 15 16 17 /** 18 @name: tdm_mv2_shim_get_port_pm 19 @param: 20 21 Return PM number to which the input port belongs 22 */ 23 int 24 tdm_mv2_shim_get_port_pm(tdm_mod_t *_tdm) 25 { 26 return (tdm_mv2_cmn_get_port_pm(_tdm->_core_data.vars_pkg.port, _tdm)); 27 } 28 29 30 /** 31 @name: tdm_mv2_shim_get_pipe_ethernet 32 @param: 33 34 Returns BOOL_TRUE if pipe of the given port has traffic entirely Ethernet, 35 otherwise returns BOOL_FALSE. 36 */ 37 int 38 tdm_mv2_shim_get_pipe_ethernet(tdm_mod_t *_tdm) 39 { 40 int port, pipe_id = 0, result = BOOL_TRUE; 41 42 port = _tdm->_core_data.vars_pkg.port; 43 if (port >= _tdm->_chip_data.soc_pkg.soc_vars.fp_port_lo && 44 port <= _tdm->_chip_data.soc_pkg.soc_vars.fp_port_hi) { 45 pipe_id = (port - 1) / MV2_NUM_PHY_PORTS_PER_PIPE; 46 result = tdm_mv2_cmn_get_pipe_ethernet(pipe_id, _tdm); 47 } 48 49 return (result); 50 } 51 52 53 /** 54 @name: tdm_chip_th2_shim__core_vbs_scheduler_ovs 55 @param: 56 57 Passthru function for oversub scheduling request from TD2/TD2+ 58 */ 59 int 60 tdm_mv2_shim_core_vbs_scheduler_ovs(tdm_mod_t *_tdm) 61 { 62 if (_tdm->_chip_data.soc_pkg.flex_port_en) { 63 /* Used for FlexPort */ 64 /* return tdm_mv2_vbs_scheduler_ovs_flex_port(_tdm); */ 65 /* return tdm_mv2_vbs_scheduler_ovs_flex_port_delta(_tdm) */; 66 return tdm_core_vbs_scheduler_ovs(_tdm); 67 } else { 68 /* Used for initial config */ 69 return tdm_core_vbs_scheduler_ovs(_tdm); 70 } 71 }