portctrl.h (17041B)
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: portctrl.h 8 * Purpose: SDK Port Control Glue Layer 9 */ 10 11 #ifndef _BCM_INT_PORTCTRL_H_ 12 #define _BCM_INT_PORTCTRL_H_ 13 14 #include <sal/types.h> 15 #include <soc/types.h> 16 #include <soc/esw/portctrl.h> 17 #include <bcm/types.h> 18 #include <soc/higig.h> 19 20 21 22 23 /* Functions */ 24 extern int bcmi_esw_portctrl_probe(int unit, bcm_gport_t port, int init_flag, 25 void *add_info, int *okay); 26 extern int bcmi_esw_portctrl_probe_pbmp(int unit, 27 pbmp_t pbmp, pbmp_t *okay_pbmp); 28 29 extern int bcmi_esw_portctrl_ability_get(int unit, bcm_gport_t port, 30 bcm_port_ability_t *port_ability, 31 bcm_port_abil_t *ability_mask); 32 extern int bcmi_esw_portctrl_speed_ability_local_get(int unit, 33 bcm_gport_t port, 34 int max_num_ability, 35 bcm_port_speed_ability_t *abilities, 36 int *actual_num_ability); 37 38 extern int bcmi_esw_portctrl_ability_remote_get(int unit, bcm_gport_t port, 39 bcm_port_ability_t *ability, 40 bcm_port_abil_t *ability_mask); 41 42 extern int bcmi_esw_portctrl_autoneg_ability_remote_get(int unit, bcm_gport_t port, 43 int max_num_ability, 44 bcm_port_speed_ability_t *abilities, 45 int *actual_num_ability); 46 extern int bcmi_esw_portctrl_enable_get(int unit, 47 bcm_gport_t port, int *enable); 48 extern int bcmi_esw_portctrl_enable_set(int unit, 49 bcm_gport_t port, int enable); 50 extern int bcmi_esw_portctrl_mac_enable_set(int unit, 51 bcm_gport_t port, int enable); 52 extern int bcmi_esw_portctrl_phy_enable_set(int unit, 53 bcm_gport_t port, int enable); 54 55 extern int bcmi_esw_portctrl_egress_queue_drain(int unit, bcm_gport_t port); 56 extern int bcmi_esw_portctrl_update(int unit, bcm_gport_t port, int link); 57 58 extern int bcmi_esw_portctrl_fault_get(int unit, 59 bcm_gport_t port, uint32 *flags); 60 61 extern int bcmi_esw_portctrl_link_fault_get(int unit, bcm_gport_t port, 62 int *local_fault, 63 int *remote_fault); 64 65 extern int bcmi_esw_portctrl_loopback_get(int unit, 66 bcm_gport_t port, int *loopback); 67 extern int bcmi_esw_portctrl_loopback_set(int unit, 68 bcm_gport_t port, int loopback); 69 70 extern int bcmi_esw_portctrl_speed_get(int unit, bcm_gport_t port, int *speed); 71 extern int bcmi_esw_portctrl_speed_max(int unit, bcm_gport_t port, int *speed); 72 extern int bcmi_esw_portctrl_speed_set(int unit, bcm_gport_t port, int speed); 73 74 extern int bcmi_esw_portctrl_resource_speed_config_validate(int unit, 75 bcm_port_resource_t *resource, bcm_pbmp_t *pbmp); 76 77 extern int bcmi_esw_portctrl_speed_multi_set(int unit, int nport, 78 bcm_port_resource_t *resource); 79 80 extern int bcmi_esw_portctrl_stk_my_modid_set(int unit, bcm_gport_t port, 81 int my_modid); 82 83 extern int bcmi_esw_portctrl_pause_get(int unit, bcm_gport_t port, 84 int *pause_tx, int *pause_rx); 85 extern int bcmi_esw_portctrl_pause_set(int unit, bcm_gport_t port, 86 int pause_tx, int pause_rx); 87 88 extern int bcmi_esw_portctrl_pause_addr_get(int unit, bcm_gport_t port, 89 bcm_mac_t mac); 90 extern int bcmi_esw_portctrl_pause_addr_set(int unit, bcm_gport_t port, 91 bcm_mac_t mac); 92 93 extern int bcmi_esw_portctrl_eee_enable_get(int unit, 94 bcm_gport_t port, int *enable); 95 extern int bcmi_esw_portctrl_eee_enable_set(int unit, 96 bcm_gport_t port, int enable); 97 98 extern int bcmi_esw_portctrl_medium_config_set(int unit, bcm_gport_t port, 99 bcm_port_medium_t medium, 100 bcm_phy_config_t *config); 101 extern int bcmi_esw_portctrl_medium_config_get(int unit, bcm_gport_t port, 102 bcm_port_medium_t medium, 103 bcm_phy_config_t *config); 104 extern int bcmi_esw_portctrl_medium_get(int unit, bcm_gport_t port, 105 bcm_port_medium_t *medium); 106 107 extern int bcmi_esw_portctrl_master_get(int unit, bcm_gport_t port, int *ms); 108 extern int bcmi_esw_portctrl_master_set(int unit, bcm_gport_t port, int ms); 109 110 extern int bcmi_esw_portctrl_interface_get(int unit, bcm_gport_t port, 111 bcm_port_if_t *intf); 112 extern int bcmi_esw_portctrl_interface_set(int unit, bcm_gport_t port, 113 bcm_port_if_t intf); 114 115 extern int bcmi_esw_portctrl_mdix_get(int unit, bcm_gport_t port, 116 bcm_port_mdix_t *mode); 117 extern int bcmi_esw_portctrl_mdix_set(int unit, bcm_gport_t port, 118 bcm_port_mdix_t mode); 119 120 extern int bcmi_esw_portctrl_mdix_status_get(int unit, bcm_gport_t port, 121 bcm_port_mdix_status_t *status); 122 extern int bcmi_esw_portctrl_phy_get(int unit, bcm_gport_t port, uint32 flags, 123 uint32 phy_reg_addr, uint32 *phy_data); 124 extern int bcmi_esw_portctrl_phy_multi_get(int unit, bcm_gport_t port, 125 uint32 flags, uint32 dev_addr, 126 uint32 offset, int max_size, 127 uint8 *data, int *actual_size); 128 extern int bcmi_esw_portctrl_phy_modify(int unit, bcm_gport_t port, 129 uint32 flags, uint32 phy_reg_addr, 130 uint32 phy_data, uint32 phy_mask); 131 extern int bcmi_esw_portctrl_phy_set(int unit, bcm_gport_t port, uint32 flags, 132 uint32 phy_reg_addr, uint32 phy_data); 133 134 extern int bcmi_esw_portctrl_phy_drv_name_get(int unit, bcm_gport_t port, 135 char *name, int len); 136 extern int bcmi_esw_portctrl_phy_reset(int unit, bcm_gport_t port); 137 138 extern int bcmi_esw_portctrl_ability_advert_get(int unit, bcm_gport_t port, 139 bcm_port_ability_t *port_ability, 140 bcm_port_abil_t *ability_mask); 141 extern int bcmi_esw_portctrl_ability_advert_set(int unit, bcm_gport_t port, 142 bcm_port_ability_t *port_ability, 143 bcm_port_abil_t ability_mask); 144 145 extern int bcmi_esw_portctrl_autoneg_get(int unit, bcm_gport_t port, 146 int *autoneg); 147 extern int bcmi_esw_portctrl_autoneg_set(int unit, bcm_gport_t port, 148 int autoneg); 149 150 extern int bcmi_esw_portctrl_autoneg_ability_advert_get(int unit, bcm_gport_t port, 151 int max_num_ability, 152 bcm_port_speed_ability_t *abilities, 153 int *actual_num_ability); 154 extern int bcmi_esw_portctrl_autoneg_ability_advert_set(int unit, bcm_gport_t port, 155 int num_ability, 156 bcm_port_speed_ability_t *abilities); 157 158 extern int bcmi_esw_portctrl_duplex_get(int unit, bcm_gport_t port, 159 int *duplex); 160 extern int bcmi_esw_portctrl_duplex_set(int unit, bcm_gport_t port, 161 int duplex); 162 extern int bcmi_esw_portctrl_clear_rx_lss_status_set(int unit, bcm_gport_t port, 163 int local_fault, 164 int remote_fault); 165 extern int bcmi_esw_portctrl_clear_rx_lss_status_get(int unit, bcm_gport_t port, 166 int *local_fault, 167 int *remote_fault); 168 169 extern int bcmi_esw_portctrl_frame_max_get(int unit, 170 bcm_gport_t port, int *size); 171 extern int bcmi_esw_portctrl_frame_max_set(int unit, 172 bcm_gport_t port, int size); 173 174 extern int bcmi_esw_portctrl_encap_get(int unit, bcm_gport_t port, int *mode); 175 extern int bcmi_esw_portctrl_encap_set(int unit, bcm_gport_t port, 176 int mode, int force); 177 extern int bcmi_esw_portctrl_encap_set_execute(int unit, bcm_gport_t port, 178 int mode, int force); 179 180 extern int bcmi_esw_portctrl_encap_xport_set(int unit, bcm_gport_t port, 181 int mode); 182 extern int bcmi_esw_portctrl_encap_higig_lite_set(int unit, bcm_gport_t port); 183 extern int bcmi_esw_portctrl_higig_mode_set(int unit, bcm_gport_t port, 184 int higig_mode); 185 extern int bcmi_esw_portctrl_higig2_mode_set(int unit, bcm_gport_t port, 186 int higig2_mode); 187 188 extern int bcmi_esw_portctrl_link_get(int unit, bcm_gport_t port, 189 int hw, int *up); 190 191 extern int bcmi_esw_portctrl_mode_setup(int unit, bcm_gport_t port, int enable); 192 extern int bcmi_esw_portctrl_detach(int unit, pbmp_t pbmp, pbmp_t *detached); 193 extern int bcmi_esw_portctrl_ifg_set(int unit, bcm_gport_t port, int speed, 194 bcm_port_duplex_t duplex, int ifg); 195 extern int bcmi_esw_portctrl_ifg_get(int unit, bcm_gport_t port, int speed, 196 bcm_port_duplex_t duplex, int *ifg); 197 extern int bcmi_esw_portctrl_mac_rx_control(int unit, bcm_port_t port, uint8 optype, int *enable); 198 extern int bcmi_esw_portctrl_mac_up(int unit, int nport, bcm_port_t *port); 199 extern int bcmi_esw_portctrl_mac_rx_down(int unit, int nport, bcm_port_t *port); 200 extern int bcmi_esw_portctrl_mac_tx_down(int unit, int nport, bcm_port_t *port); 201 202 extern int bcmi_esw_portctrl_llfc_get(int unit, bcm_gport_t port, bcm_port_control_t type, int *value); 203 extern int bcmi_esw_portctrl_llfc_set(int unit, bcm_port_t port, bcm_port_control_t type, int value); 204 extern int bcmi_esw_portctrl_lag_failover_disable(int unit, bcm_gport_t port); 205 extern int bcmi_esw_portctrl_lag_failover_loopback_get(int unit, bcm_gport_t port, int* value); 206 extern int bcmi_esw_portctrl_lag_failover_status_toggle(int unit, bcm_gport_t port); 207 extern int bcmi_esw_portctrl_lag_remove_failover_lpbk_set(int unit, bcm_gport_t port, int value); 208 extern int bcmi_esw_portctrl_trunk_hwfailover_set(int unit, bcm_gport_t port, int hw_count); 209 210 extern int bcmi_esw_td2_portctrl_lanes_set(int unit, bcm_port_t port_base, int lanes); 211 212 extern int bcmi_esw_portctrl_hwfailover_enable_set(int unit, bcm_gport_t port, 213 int enable); 214 extern int bcmi_esw_portctrl_hwfailover_enable_get(int unit, bcm_gport_t port, 215 int *enable); 216 extern int bcmi_esw_portctrl_hwfailover_status_get(int unit, bcm_gport_t port, 217 int *status); 218 219 extern int bcmi_esw_portctrl_phy_control_set(int unit, bcm_gport_t port, 220 bcm_port_phy_control_t type, uint32 value); 221 extern int bcmi_esw_portctrl_phy_control_get(int unit, bcm_gport_t port, 222 bcm_port_phy_control_t type, uint32 *value); 223 224 extern int bcmi_esw_portctrl_control_validate(int unit, bcm_port_control_t type, 225 int *valid); 226 extern int bcmi_esw_portctrl_control_set(int unit, bcm_gport_t port, 227 bcm_port_control_t type, int value); 228 extern int bcmi_esw_portctrl_control_get(int unit, bcm_gport_t port, 229 bcm_port_control_t type, int *value); 230 231 extern int bcmi_esw_portctrl_mode_get(int unit, bcm_gport_t port, int *mode); 232 233 extern int bcmi_esw_portctrl_priority_group_config_set(int unit, bcm_gport_t port, 234 int priority_group, 235 bcm_port_priority_group_config_t *prigrp_config); 236 237 extern int bcmi_esw_portctrl_e2e_tx_enable_get(int unit, bcm_gport_t port, 238 int *enable); 239 extern int bcmi_esw_portctrl_e2e_tx_enable_set(int unit, bcm_gport_t port, 240 int enable); 241 extern int bcmi_esw_portctrl_e2ecc_hdr_get(int unit, bcm_gport_t port, 242 soc_higig_e2ecc_hdr_t *e2ecc_hdr); 243 extern int bcmi_esw_portctrl_e2ecc_hdr_set(int unit, bcm_gport_t port, 244 soc_higig_e2ecc_hdr_t *e2ecc_hdr); 245 extern int bcmi_esw_portctrl_vlan_tpid_set(int unit, bcm_gport_t port, int tpid); 246 247 extern int bcmi_esw_portctrl_vlan_inner_tpid_set(int unit, bcm_gport_t port, int tpid); 248 249 250 extern int bcmi_esw_portctrl_cntmaxsize_get(int unit, bcm_gport_t port, 251 int *val); 252 extern int bcmi_esw_portctrl_cntmaxsize_set(int unit, bcm_gport_t port, 253 int val); 254 extern int _bcm_esw_port_vrf_set(int unit, bcm_port_t port, int val); 255 extern int _bcm_esw_port_vrf_get(int unit, bcm_port_t port, int *val); 256 extern int bcmi_esw_portctrl_cable_diag(int unit, bcm_port_t port, 257 bcm_port_cable_diag_t *status); 258 extern int 259 bcmi_esw_portctrl_preemption_status_tx_get(int unit, bcm_port_t port, 260 uint32* value); 261 262 extern int 263 bcmi_esw_portctrl_preemption_status_verify_get(int unit, bcm_port_t port, 264 uint32* value); 265 extern int 266 bcmi_esw_portctrl_preemption_mac_config_set(int unit, bcm_port_t port, 267 bcm_port_preempt_control_t type, 268 uint32 arg); 269 extern int 270 bcmi_esw_portctrl_preemption_mac_config_get(int unit, bcm_port_t port, 271 bcm_port_preempt_control_t type, 272 uint32* arg); 273 extern int 274 bcmi_esw_portctrl_timestamp_adjust_set(int unit, bcm_gport_t port, 275 bcm_port_timestamp_adjust_t *ts_adjust); 276 extern int 277 bcmi_esw_portctrl_timestamp_adjust_get(int unit, bcm_gport_t port, 278 bcm_port_timestamp_adjust_t *ts_adjust); 279 extern int 280 bcmi_esw_portctrl_phy_tx_set(int unit, 281 bcm_port_t port, 282 bcm_port_phy_tx_t *tx); 283 extern int 284 bcmi_esw_portctrl_phy_tx_get(int unit, 285 bcm_port_t port, 286 bcm_port_phy_tx_t *tx); 287 extern int 288 bcmi_esw_portctrl_speed_config_get(int unit, 289 bcm_gport_t gport, 290 void *speed_config); 291 extern int 292 bcmi_esw_portctrl_rlm_config_set(int unit, 293 bcm_port_t port, 294 bcm_port_rlm_config_t *rlm_config, 295 int enable); 296 extern int 297 bcmi_esw_portctrl_rlm_config_get(int unit, 298 bcm_port_t port, 299 bcm_port_rlm_config_t *rlm_config, 300 int *enable); 301 extern int 302 bcmi_esw_portctrl_rlm_status_get(int unit, 303 bcm_port_t port, 304 bcm_port_rlm_status_t *rlm_status); 305 extern int 306 bcmi_esw_portctrl_autoneg_status_get(int unit, 307 bcm_gport_t port, 308 int *enabled, 309 int *locked); 310 311 #if defined(INCLUDE_PHY_542XX) 312 extern int bcmi_esw_portctrl_serdes_link_update(int unit, 313 bcm_port_t port, 314 int link); 315 #endif /* defined(INCLUDE_PHY_542XX) */ 316 #endif /* _BCM_INT_PORTCTRL_H_ */