unimac.h (3932B)
1 /* 2 * 3 * 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 8 */ 9 10 #ifndef _PORTMOD_UNIMAC_H_ 11 #define _PORTMOD_UNIMAC_H_ 12 13 #include <soc/portmod/portmod.h> 14 15 #define UNIMAC_INIT_F_AUTO_CFG 0x1 16 #define UNIMAC_INIT_F_RX_STRIP_CRC 0x2 17 18 #define UNIMAC_ENABLE_SET_FLAGS_TX_EN 0x1 19 #define UNIMAC_ENABLE_SET_FLAGS_RX_EN 0x2 20 21 22 int unimac_init (int unit, soc_port_t port, int init_flags); 23 int unimac_deinit (int unit, soc_port_t port); 24 int unimac_speed_set (int unit, soc_port_t port, int speed); 25 int unimac_speed_get (int unit, soc_port_t port, int *speed); 26 int unimac_encap_set (int unit, soc_port_t port, portmod_encap_t encap); 27 int unimac_encap_get (int unit, soc_port_t port, portmod_encap_t *encap); 28 int unimac_enable_set (int unit, soc_port_t port, int flags, int enable); 29 int unimac_enable_get (int unit, soc_port_t port, int flags, int *enable); 30 int unimac_duplex_set (int unit, soc_port_t port, int duplex); 31 int unimac_duplex_get (int unit, soc_port_t port, int *duplex); 32 int unimac_loopback_set (int unit, soc_port_t port, int enable); 33 int unimac_loopback_get (int unit, soc_port_t port, int *enable); 34 int unimac_rx_enable_set (int unit, soc_port_t port, int enable); 35 int unimac_rx_enable_get (int unit, soc_port_t port, int *enable); 36 37 int unimac_mac_sa_set (int unit, soc_port_t port, sal_mac_addr_t mac); 38 int unimac_mac_sa_get (int unit, soc_port_t port, sal_mac_addr_t mac); 39 40 int unimac_soft_reset_set (int unit, soc_port_t port, int enable); 41 int unimac_soft_reset_get (int unit, soc_port_t port, int *enable); 42 int unimac_rx_max_size_set (int unit, soc_port_t port, int value); 43 int unimac_rx_max_size_get (int unit, soc_port_t port, int *value); 44 int unimac_tx_average_ipg_set (int unit, soc_port_t port, int ipg_val); 45 int unimac_tx_average_ipg_get (int unit, soc_port_t port, int *ipg_val); 46 int unimac_rx_vlan_tag_set (int unit, soc_port_t port, int outer_vlan_tag, int inner_vlan_tag); 47 int unimac_rx_vlan_tag_get (int unit, soc_port_t port, int *outer_vlan_tag, int *inner_vlan_tag); 48 49 int unimac_tx_preamble_length_set (int unit, soc_port_t port, int length); 50 51 /***************************************************************************** 52 SDK Support Functions 53 */ 54 int unimac_eee_set (int unit, int port, const portmod_eee_t* eee); 55 int unimac_eee_get (int unit, int port, const portmod_eee_t* eee); 56 57 int unimac_pfc_config_set (int unit, int port, const portmod_pfc_config_t* pfc_cfg); 58 int unimac_pfc_config_get (int unit, int port, const portmod_pfc_config_t* pfc_cfg); 59 60 int unimac_pause_control_set(int unit, soc_port_t port, const portmod_pause_control_t *control); 61 int unimac_pause_control_get(int unit, soc_port_t port, portmod_pause_control_t *control); 62 63 int unimac_pfc_control_set(int unit, soc_port_t port, const portmod_pfc_control_t *control); 64 int unimac_pfc_control_get(int unit, soc_port_t port, portmod_pfc_control_t *control); 65 66 int unimac_diag_fifo_status_get (int unit, int port, const portmod_fifo_status_t* inf); 67 68 int unimac_pass_control_frame_set(int unit, int port, int value); 69 int unimac_pass_control_frame_get(int unit, int port, int* value); 70 71 int unimac_pass_pause_frame_set(int unit, int port, uint32 value); 72 int unimac_pass_pause_frame_get(int unit, int port, uint32* value); 73 74 int unimac_mac_ctrl_set (int unit, int port, uint32 ctrl); 75 int unimac_mac_ctrl_get(int unit, int port, uint32 *mac_ctrl, int *rx_en); 76 int unimac_drain_cell_get (int unit, int port, portmod_drain_cells_t *drain_cells); 77 78 int unimac_tx_enable_set(int unit, soc_port_t port, int enable); 79 int unimac_tx_enable_get(int unit, soc_port_t port, int *enable); 80 81 int unimac_reset_check(int u, int p, int enable, int *reset); 82 #endif /*_PORTMOD_UNIMAC_H_*/