OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Port Management

Data Structures

struct  opennsl_port_config_s
 Port Configuration structure. More...
 
struct  opennsl_port_info_s
 opennsl_port_info_s More...
 
struct  opennsl_port_priority_group_config_s
 Priority Group attributes. More...
 

Files

file  portX.h
 

Macros

#define OPENNSL_PIPES_MAX   _SHR_SWITCH_MAX_PIPES
 
#define OPENNSL_PORT_ABIL_1000MB   _SHR_PM_1000MB
 
#define OPENNSL_PORT_ABIL_1000MB_FD   _SHR_PM_1000MB_FD
 
#define OPENNSL_PORT_ABIL_1000MB_HD   _SHR_PM_1000MB_HD
 
#define OPENNSL_PORT_ABIL_100MB   _SHR_PM_100MB
 
#define OPENNSL_PORT_ABIL_100MB_FD   _SHR_PM_100MB_FD
 
#define OPENNSL_PORT_ABIL_100MB_HD   _SHR_PM_100MB_HD
 
#define OPENNSL_PORT_ABIL_10B   OPENNSL_PORT_ABIL_TBI
 Deprecated.
 
#define OPENNSL_PORT_ABIL_10GB   _SHR_PM_10GB
 
#define OPENNSL_PORT_ABIL_10GB_FD   _SHR_PM_10GB_FD
 
#define OPENNSL_PORT_ABIL_10GB_HD   _SHR_PM_10GB_HD
 
#define OPENNSL_PORT_ABIL_10MB   _SHR_PM_10MB
 
#define OPENNSL_PORT_ABIL_10MB_FD   _SHR_PM_10MB_FD
 
#define OPENNSL_PORT_ABIL_10MB_HD   _SHR_PM_10MB_HD
 
#define OPENNSL_PORT_ABIL_12GB   _SHR_PM_12GB
 
#define OPENNSL_PORT_ABIL_12GB_FD   _SHR_PM_12GB_FD
 
#define OPENNSL_PORT_ABIL_12GB_HD   _SHR_PM_12GB_HD
 
#define OPENNSL_PORT_ABIL_13GB   _SHR_PM_13GB
 
#define OPENNSL_PORT_ABIL_13GB_FD   _SHR_PM_13GB_FD
 
#define OPENNSL_PORT_ABIL_13GB_HD   _SHR_PM_13GB_HD
 
#define OPENNSL_PORT_ABIL_16GB   _SHR_PM_16GB
 
#define OPENNSL_PORT_ABIL_16GB_FD   _SHR_PM_16GB_FD
 
#define OPENNSL_PORT_ABIL_16GB_HD   _SHR_PM_16GB_HD
 
#define OPENNSL_PORT_ABIL_2500MB   _SHR_PM_2500MB
 
#define OPENNSL_PORT_ABIL_2500MB_FD   _SHR_PM_2500MB_FD
 
#define OPENNSL_PORT_ABIL_2500MB_HD   _SHR_PM_2500MB_HD
 
#define OPENNSL_PORT_ABIL_3000MB   _SHR_PM_3000MB
 
#define OPENNSL_PORT_ABIL_3000MB_FD   _SHR_PM_3000MB_FD
 
#define OPENNSL_PORT_ABIL_3000MB_HD   _SHR_PM_3000MB_HD
 
#define OPENNSL_PORT_ABIL_AN   _SHR_PM_AN
 
#define OPENNSL_PORT_ABIL_COMBO   _SHR_PM_COMBO
 
#define OPENNSL_PORT_ABIL_FD   _SHR_PM_FD
 
#define OPENNSL_PORT_ABIL_GMII   _SHR_PM_GMII
 
#define OPENNSL_PORT_ABIL_HD   _SHR_PM_HD
 
#define OPENNSL_PORT_ABIL_LB_MAC   _SHR_PM_LB_MAC
 
#define OPENNSL_PORT_ABIL_LB_NONE   _SHR_PM_LB_NONE
 
#define OPENNSL_PORT_ABIL_LB_PHY   _SHR_PM_LB_PHY
 
#define OPENNSL_PORT_ABIL_MII   _SHR_PM_MII
 
#define OPENNSL_PORT_ABIL_PAUSE   _SHR_PM_PAUSE
 Both TX and RX.
 
#define OPENNSL_PORT_ABIL_PAUSE_ASYMM   _SHR_PM_PAUSE_ASYMM
 The following is used only by opennsl_port_ability_get, and indicates that a port can support having PAUSE_TX be different than PAUSE_RX.
 
#define OPENNSL_PORT_ABIL_PAUSE_RX   _SHR_PM_PAUSE_RX
 
#define OPENNSL_PORT_ABIL_PAUSE_TX   _SHR_PM_PAUSE_TX
 
#define OPENNSL_PORT_ABIL_SGMII   _SHR_PM_SGMII
 
#define OPENNSL_PORT_ABIL_SPD_ANY   _SHR_PM_SPEED_ALL
 
#define OPENNSL_PORT_ABIL_SPD_MAX(abil)   _SHR_PM_SPEED_MAX(abil)
 
#define OPENNSL_PORT_ABIL_TBI   _SHR_PM_TBI
 
#define OPENNSL_PORT_ABIL_XGMII   _SHR_PM_XGMII
 
#define OPENNSL_PORT_ABILITY_1000MB   _SHR_PA_SPEED_1000MB
 
#define OPENNSL_PORT_ABILITY_100GB   _SHR_PA_SPEED_100GB
 
#define OPENNSL_PORT_ABILITY_100MB   _SHR_PA_SPEED_100MB
 
#define OPENNSL_PORT_ABILITY_106GB   _SHR_PA_SPEED_106GB
 
#define OPENNSL_PORT_ABILITY_10GB   _SHR_PA_SPEED_10GB
 
#define OPENNSL_PORT_ABILITY_10MB   _SHR_PA_SPEED_10MB
 
#define OPENNSL_PORT_ABILITY_11GB   _SHR_PA_SPEED_11GB
 
#define OPENNSL_PORT_ABILITY_120GB   _SHR_PA_SPEED_120GB
 
#define OPENNSL_PORT_ABILITY_127GB   _SHR_PA_SPEED_127GB
 
#define OPENNSL_PORT_ABILITY_12GB   _SHR_PA_SPEED_12GB
 
#define OPENNSL_PORT_ABILITY_12P5GB   _SHR_PA_SPEED_12P5GB
 
#define OPENNSL_PORT_ABILITY_13GB   _SHR_PA_SPEED_13GB
 
#define OPENNSL_PORT_ABILITY_15GB   _SHR_PA_SPEED_15GB
 
#define OPENNSL_PORT_ABILITY_16GB   _SHR_PA_SPEED_16GB
 
#define OPENNSL_PORT_ABILITY_20GB   _SHR_PA_SPEED_20GB
 
#define OPENNSL_PORT_ABILITY_21GB   _SHR_PA_SPEED_21GB
 
#define OPENNSL_PORT_ABILITY_23GB   _SHR_PA_SPEED_23GB
 
#define OPENNSL_PORT_ABILITY_24GB   _SHR_PA_SPEED_24GB
 
#define OPENNSL_PORT_ABILITY_2500MB   _SHR_PA_SPEED_2500MB
 
#define OPENNSL_PORT_ABILITY_25GB   _SHR_PA_SPEED_25GB
 
#define OPENNSL_PORT_ABILITY_27GB   _SHR_PA_SPEED_27GB
 
#define OPENNSL_PORT_ABILITY_3000MB   _SHR_PA_SPEED_3000MB
 
#define OPENNSL_PORT_ABILITY_30GB   _SHR_PA_SPEED_30GB
 
#define OPENNSL_PORT_ABILITY_32GB   _SHR_PA_SPEED_32GB
 
#define OPENNSL_PORT_ABILITY_40GB   _SHR_PA_SPEED_40GB
 
#define OPENNSL_PORT_ABILITY_42GB   _SHR_PA_SPEED_42GB
 
#define OPENNSL_PORT_ABILITY_48GB   _SHR_PA_SPEED_48GB
 
#define OPENNSL_PORT_ABILITY_5000MB   _SHR_PA_SPEED_5000MB
 
#define OPENNSL_PORT_ABILITY_50GB   _SHR_PA_SPEED_50GB
 
#define OPENNSL_PORT_ABILITY_53GB   _SHR_PA_SPEED_53GB
 
#define OPENNSL_PORT_ABILITY_6000MB   _SHR_PA_SPEED_6000MB
 
#define OPENNSL_PORT_ABILITY_AUTONEG   _SHR_PA_AUTONEG
 
#define OPENNSL_PORT_ABILITY_CHANNEL_LONG   _SHR_PA_CHANNEL_LONG
 port is long channel.
 
#define OPENNSL_PORT_ABILITY_CHANNEL_SHORT   _SHR_PA_CHANNEL_SHORT
 port is short channel.
 
#define OPENNSL_PORT_ABILITY_COMBO   _SHR_PA_COMBO
 
#define OPENNSL_PORT_ABILITY_EEE_100MB_BASETX   _SHR_PA_EEE_100MB_BASETX
 EEE ability at 100M-BaseTX.
 
#define OPENNSL_PORT_ABILITY_EEE_10GB_BASET   _SHR_PA_EEE_10GB_BASET
 EEE ability at 10G-BaseT.
 
#define OPENNSL_PORT_ABILITY_EEE_10GB_KR   _SHR_PA_EEE_10GB_KR
 EEE ability at 10GB-KR.
 
#define OPENNSL_PORT_ABILITY_EEE_10GB_KX   _SHR_PA_EEE_10GB_KX
 EEE ability at 10GB-KX.
 
#define OPENNSL_PORT_ABILITY_EEE_10GB_KX4   _SHR_PA_EEE_10GB_KX4
 EEE ability at 10GB-KX4.
 
#define OPENNSL_PORT_ABILITY_EEE_1GB_BASET   _SHR_PA_EEE_1GB_BASET
 EEE ability at 1G-BaseT.
 
#define OPENNSL_PORT_ABILITY_FEC_CL74   _SHR_PA_FEC_CL74
 FEC CL74 request.
 
#define OPENNSL_PORT_ABILITY_FEC_CL91   _SHR_PA_FEC_CL91
 FEC CL91 request.
 
#define OPENNSL_PORT_ABILITY_FEC_NONE   _SHR_PA_FEC_NONE
 No FEC request.
 
#define OPENNSL_PORT_ABILITY_INTERFACE_CGMII   _SHR_PA_INTF_CGMII
 
#define OPENNSL_PORT_ABILITY_INTERFACE_GMII   _SHR_PA_INTF_GMII
 
#define OPENNSL_PORT_ABILITY_INTERFACE_MII   _SHR_PA_INTF_MII
 
#define OPENNSL_PORT_ABILITY_INTERFACE_QSGMII   _SHR_PA_INTF_QSGMII
 
#define OPENNSL_PORT_ABILITY_INTERFACE_SGMII   _SHR_PA_INTF_SGMII
 
#define OPENNSL_PORT_ABILITY_INTERFACE_TBI   _SHR_PA_INTF_TBI
 
#define OPENNSL_PORT_ABILITY_INTERFACE_XGMII   _SHR_PA_INTF_XGMII
 
#define OPENNSL_PORT_ABILITY_LB_LINE   _SHR_PA_LB_LINE
 
#define OPENNSL_PORT_ABILITY_LB_MAC   _SHR_PA_LB_MAC
 
#define OPENNSL_PORT_ABILITY_LB_NONE   _SHR_PA_LB_NONE
 
#define OPENNSL_PORT_ABILITY_LB_PHY   _SHR_PA_LB_PHY
 
#define OPENNSL_PORT_ABILITY_MEDIUM_BACKPLANE   _SHR_PA_MEDIUM_BACKPLANE
 
#define OPENNSL_PORT_ABILITY_MEDIUM_COPPER   _SHR_PA_MEDIUM_COPPER
 
#define OPENNSL_PORT_ABILITY_MEDIUM_FIBER   _SHR_PA_MEDIUM_FIBER
 
#define OPENNSL_PORT_ABILITY_PAUSE   _SHR_PA_PAUSE
 Both TX and RX.
 
#define OPENNSL_PORT_ABILITY_PAUSE_ASYMM   _SHR_PA_PAUSE_ASYMM
 The following is used only by opennsl_port_ability_get, and indicates that a port can support having PAUSE_TX be different than PAUSE_RX.
 
#define OPENNSL_PORT_ABILITY_PAUSE_RX   _SHR_PA_PAUSE_RX
 
#define OPENNSL_PORT_ABILITY_PAUSE_TX   _SHR_PA_PAUSE_TX
 
#define OPENNSL_PORT_ABILITY_SPEED_MAX(abil)   _SHR_PA_SPEED_MAX(abil)
 
#define OPENNSL_PORT_ATTR2_PORT_ABILITY   0x00000001
 
#define OPENNSL_PORT_ATTR_ABILITY_MASK   0x04000000
 Get only.
 
#define OPENNSL_PORT_ATTR_ALL_MASK   0xffffffff
 
#define OPENNSL_PORT_ATTR_AUTONEG_MASK   0x00000004
 
#define OPENNSL_PORT_ATTR_DISCARD_MASK   0x00000080
 
#define OPENNSL_PORT_ATTR_DUPLEX_MASK   0x00000010
 
#define OPENNSL_PORT_ATTR_ENABLE_MASK   0x00000001
 
#define OPENNSL_PORT_ATTR_ENCAP_MASK   0x00200000
 
#define OPENNSL_PORT_ATTR_FAULT_MASK   0x80000000
 Get only.
 
#define OPENNSL_PORT_ATTR_FRAME_MAX_MASK   0x08000000
 
#define OPENNSL_PORT_ATTR_INTERFACE_MASK   0x00008000
 
#define OPENNSL_PORT_ATTR_LEARN_MASK   0x00000040
 
#define OPENNSL_PORT_ATTR_LINKSCAN_MASK   0x00000020
 
#define OPENNSL_PORT_ATTR_LINKSTAT_MASK   0x00000002
 Get only.
 
#define OPENNSL_PORT_ATTR_LOCAL_ADVERT_MASK   0x00080000
 
#define OPENNSL_PORT_ATTR_LOOPBACK_MASK   0x00002000
 
#define OPENNSL_PORT_ATTR_MDIX_MASK   0x10000000
 
#define OPENNSL_PORT_ATTR_MDIX_STATUS_MASK   0x20000000
 
#define OPENNSL_PORT_ATTR_MEDIUM_MASK   0x40000000
 
#define OPENNSL_PORT_ATTR_PAUSE_MAC_MASK   0x00040000
 
#define OPENNSL_PORT_ATTR_PAUSE_RX_MASK   0x00020000
 
#define OPENNSL_PORT_ATTR_PAUSE_TX_MASK   0x00010000
 
#define OPENNSL_PORT_ATTR_PFM_MASK   0x00001000
 
#define OPENNSL_PORT_ATTR_PHY_MASTER_MASK   0x00004000
 
#define OPENNSL_PORT_ATTR_RATE_BCAST_MASK   0x00800000
 
#define OPENNSL_PORT_ATTR_RATE_DLFBC_MASK   0x01000000
 
#define OPENNSL_PORT_ATTR_RATE_MCAST_MASK   0x00400000
 
#define OPENNSL_PORT_ATTR_REMOTE_ADVERT_MASK   0x00100000
 Get only.
 
#define OPENNSL_PORT_ATTR_SPEED_MASK   0x00000008
 
#define OPENNSL_PORT_ATTR_SPEED_MAX_MASK   0x02000000
 Get only.
 
#define OPENNSL_PORT_ATTR_STP_STATE_MASK   0x00000800
 
#define OPENNSL_PORT_ATTR_UNTAG_PRI_MASK   0x00000200
 
#define OPENNSL_PORT_ATTR_UNTAG_VLAN_MASK   0x00000400
 
#define OPENNSL_PORT_ATTR_VLANFILTER_MASK   0x00000100
 
#define OPENNSL_PORT_CONTROL_SAMPLE_DEST_CPU   0x1
 Copy packet samples to CPU.
 
#define OPENNSL_PORT_CONTROL_SAMPLE_DEST_MIRROR   0x2
 Copy packet samples to all mirror destinations created with OPENNSL_MIRROR_PORT_SFLOW flag.
 
#define OPENNSL_PORT_DSCP_MAP_ALL   2
 Map all.
 
#define OPENNSL_PORT_DSCP_MAP_DEFAULT   4
 Map according to default mapping,Not looking at PCP or TOS.
 
#define OPENNSL_PORT_DSCP_MAP_NONE   0
 Disable DSCP mapping.
 
#define OPENNSL_PORT_DSCP_MAP_UNTAGGED_ONLY   3
 Map only when packet is untagged.
 
#define OPENNSL_PORT_DSCP_MAP_ZERO   1
 Map only if incoming DSCP = 0.
 
#define OPENNSL_PORT_DTAG_MODE_EXTERNAL   2
 Customer port.
 
#define OPENNSL_PORT_DTAG_MODE_INTERNAL   1
 Service Provider port.
 
#define OPENNSL_PORT_DTAG_MODE_NONE   0
 No double tagging.
 
#define OPENNSL_PORT_DUPLEX_COUNT   _SHR_PORT_DUPLEX_COUNT
 
#define OPENNSL_PORT_DUPLEX_FULL   _SHR_PORT_DUPLEX_FULL
 
#define OPENNSL_PORT_DUPLEX_HALF   _SHR_PORT_DUPLEX_HALF
 
#define OPENNSL_PORT_FLOOD_BLOCK_ALL   0x8
 
#define OPENNSL_PORT_FLOOD_BLOCK_BCAST   0x1
 
#define OPENNSL_PORT_FLOOD_BLOCK_KNOWN_MCAST   0x40
 
#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_IP_MCAST   0x10
 
#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_MCAST   0x4
 
#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_NONIP_MCAST   0x20
 
#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_UCAST   0x2
 
#define OPENNSL_PORT_IF_10B   OPENNSL_PORT_IF_TBI
 Deprecated.
 
#define OPENNSL_PORT_IF_CAUI   _SHR_PORT_IF_CAUI
 
#define OPENNSL_PORT_IF_CAUI4   _SHR_PORT_IF_CAUI4
 CAUI4 100G interface.
 
#define OPENNSL_PORT_IF_CAUI_C2C   _SHR_PORT_IF_CAUI_C2C
 CAUI 100G C2C interface.
 
#define OPENNSL_PORT_IF_CAUI_C2M   _SHR_PORT_IF_CAUI_C2M
 CAUI 100G C2M interface.
 
#define OPENNSL_PORT_IF_COUNT   _SHR_PORT_IF_COUNT
 
#define OPENNSL_PORT_IF_CPU   _SHR_PORT_IF_CPU
 
#define OPENNSL_PORT_IF_CR   _SHR_PORT_IF_CR
 Copper 10 GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_CR10   _SHR_PORT_IF_CR10
 Copper CR10 64B/66B interface.
 
#define OPENNSL_PORT_IF_CR2   _SHR_PORT_IF_CR2
 Copper 2x10GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_CR4   _SHR_PORT_IF_CR4
 Copper 4x10 GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_CX   _SHR_PORT_IF_CX
 Copper 10G 10B/8B interface.
 
#define OPENNSL_PORT_IF_CX2   _SHR_PORT_IF_CX2
 Copper 2x10G 10B/8B interface.
 
#define OPENNSL_PORT_IF_CX4   _SHR_PORT_IF_CX4
 Copper 4x10G 10B/8B interface.
 
#define OPENNSL_PORT_IF_ER   _SHR_PORT_IF_ER
 Fiber ER 64B/66B interface.
 
#define OPENNSL_PORT_IF_ER2   _SHR_PORT_IF_ER2
 Fiber ER2 2x10G 64B/66B interface.
 
#define OPENNSL_PORT_IF_ER4   _SHR_PORT_IF_ER4
 Fiber ER4 4x10G 64B/66B interface.
 
#define OPENNSL_PORT_IF_ERP   _SHR_PORT_IF_ERP
 
#define OPENNSL_PORT_IF_EVENTOR   _SHR_PORT_IF_EVENTOR
 
#define OPENNSL_PORT_IF_FAT_PIPE   _SHR_PORT_IF_FAT_PIPE
 
#define OPENNSL_PORT_IF_GMII   _SHR_PORT_IF_GMII
 GMII Operating mode, not supported on all ports.
 
#define OPENNSL_PORT_IF_ILKN   _SHR_PORT_IF_ILKN
 
#define OPENNSL_PORT_IF_KR   _SHR_PORT_IF_KR
 Backplane 10 GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_KR10   _SHR_PORT_IF_KR10
 Backplane KR10 64B/66B interface.
 
#define OPENNSL_PORT_IF_KR2   _SHR_PORT_IF_KR2
 Backplane 2x10GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_KR4   _SHR_PORT_IF_KR4
 Backplane 4x10 GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_KX   _SHR_PORT_IF_KX
 
#define OPENNSL_PORT_IF_LBG   _SHR_PORT_IF_LBG
 Link bonding interface.
 
#define OPENNSL_PORT_IF_LR   _SHR_PORT_IF_LR
 Fiber LR 64B/66B interface.
 
#define OPENNSL_PORT_IF_LR10   _SHR_PORT_IF_LR10
 Fiber LR10 64B/66B interface.
 
#define OPENNSL_PORT_IF_LR2   _SHR_PORT_IF_LR2
 Fiber 2x10Gbe LR 64B/66B interface.
 
#define OPENNSL_PORT_IF_LR4   _SHR_PORT_IF_LR4
 Fiber LR4 64B/66B interface.
 
#define OPENNSL_PORT_IF_LRM   _SHR_PORT_IF_LRM
 Fiber LRM multipoint 64B/66B interface.
 
#define OPENNSL_PORT_IF_MII   _SHR_PORT_IF_MII
 MII Operating mode, not supported on all ports.
 
#define OPENNSL_PORT_IF_NOCXN   _SHR_PORT_IF_NOCXN
 
#define OPENNSL_PORT_IF_NULL   _SHR_PORT_IF_NULL
 
#define OPENNSL_PORT_IF_OAMP   _SHR_PORT_IF_OAMP
 
#define OPENNSL_PORT_IF_OLP   _SHR_PORT_IF_OLP
 
#define OPENNSL_PORT_IF_OTL   _SHR_PORT_IF_OTL
 Fiber 4x25 GbE OTL interface.
 
#define OPENNSL_PORT_IF_QSGMII   _SHR_PORT_IF_QSGMII
 
#define OPENNSL_PORT_IF_RCY   _SHR_PORT_IF_RCY
 
#define OPENNSL_PORT_IF_RCY_MIRROR   _SHR_PORT_IF_RCY_MIRROR
 
#define OPENNSL_PORT_IF_RGMII   _SHR_PORT_IF_RGMII
 Reduced Gigabit Media Independent Interface.
 
#define OPENNSL_PORT_IF_RXAUI   _SHR_PORT_IF_RXAUI
 
#define OPENNSL_PORT_IF_SAT   _SHR_PORT_IF_SAT
 
#define OPENNSL_PORT_IF_SFI   _SHR_PORT_IF_SFI
 SFI 10-Gigabit serial electrical interface.
 
#define OPENNSL_PORT_IF_SGMII   _SHR_PORT_IF_SGMII
 
#define OPENNSL_PORT_IF_SPAUI   _SHR_PORT_IF_SPAUI
 
#define OPENNSL_PORT_IF_SR   _SHR_PORT_IF_SR
 Fiber SR/LR 64B/66B interface.
 
#define OPENNSL_PORT_IF_SR10   _SHR_PORT_IF_SR10
 Fiber SR10 64B/66B interface.
 
#define OPENNSL_PORT_IF_SR2   _SHR_PORT_IF_SR2
 Fiber 2x10GbE 64B/66B interface.
 
#define OPENNSL_PORT_IF_SR4   _SHR_PORT_IF_SR4
 Fiber SR4 64B/66B interface.
 
#define OPENNSL_PORT_IF_TBI   _SHR_PORT_IF_TBI
 TBI interface supported on Gigabit Ethernet ports operating at gigabit speeds.
 
#define OPENNSL_PORT_IF_VSR   _SHR_PORT_IF_VSR
 Fiber VSR 10G 64B/66B interface.
 
#define OPENNSL_PORT_IF_XAUI   _SHR_PORT_IF_XAUI
 
#define OPENNSL_PORT_IF_XFI   _SHR_PORT_IF_XFI
 XFI 10-Gigabit serial electrical interface.
 
#define OPENNSL_PORT_IF_XGMII   _SHR_PORT_IF_XGMII
 10-Gigabit interface
 
#define OPENNSL_PORT_IF_XLAUI   _SHR_PORT_IF_XLAUI
 40 Gigabit Attachment Unit Interface
 
#define OPENNSL_PORT_IF_XLAUI2   _SHR_PORT_IF_XLAUI2
 40 Gigabit Attachment Unit Interface over 2 lanes
 
#define OPENNSL_PORT_IF_XLPPI   _SHR_PORT_IF_XLPPI
 40G parallel physical interface
 
#define OPENNSL_PORT_IF_ZR   _SHR_PORT_IF_ZR
 Fiber ZR 64B/66B interface.
 
#define OPENNSL_PORT_IFILTER_OFF   0
 
#define OPENNSL_PORT_IFILTER_ON   1
 
#define OPENNSL_PORT_LEARN_ARL   0x01
 Learn SLF address.
 
#define OPENNSL_PORT_LEARN_CPU   0x02
 Copy SLF packet to CPU.
 
#define OPENNSL_PORT_LEARN_FWD   0x04
 Forward SLF packet.
 
#define OPENNSL_PORT_LEARN_PENDING   0x08
 Mark learned SLF as pending.
 
#define OPENNSL_PORT_LINK_STATUS_UP   1
 
#define OPENNSL_PORT_MDIX_AUTO   _SHR_PORT_MDIX_AUTO
 
#define OPENNSL_PORT_MDIX_COUNT   _SHR_PORT_MDIX_COUNT
 
#define OPENNSL_PORT_MDIX_FORCE_AUTO   _SHR_PORT_MDIX_FORCE_AUTO
 
#define OPENNSL_PORT_MDIX_NORMAL   _SHR_PORT_MDIX_NORMAL
 
#define OPENNSL_PORT_MDIX_STATUS_COUNT   _SHR_PORT_MDIX_STATUS_COUNT
 
#define OPENNSL_PORT_MDIX_STATUS_NORMAL   _SHR_PORT_MDIX_STATUS_NORMAL
 
#define OPENNSL_PORT_MDIX_STATUS_XOVER   _SHR_PORT_MDIX_STATUS_XOVER
 
#define OPENNSL_PORT_MDIX_XOVER   _SHR_PORT_MDIX_XOVER
 
#define OPENNSL_PORT_MEDIUM_COPPER   _SHR_PORT_MEDIUM_COPPER
 
#define OPENNSL_PORT_MEDIUM_COUNT   _SHR_PORT_MEDIUM_COUNT
 
#define OPENNSL_PORT_MEDIUM_FIBER   _SHR_PORT_MEDIUM_FIBER
 
#define OPENNSL_PORT_MEDIUM_NONE   _SHR_PORT_MEDIUM_NONE
 
#define OPENNSL_PORT_PHY_CLAUSE45   _SHR_PORT_PHY_CLAUSE45
 
#define OPENNSL_PORT_PHY_CLAUSE45_ADDR(_devad, _regad)   _SHR_PORT_PHY_CLAUSE45_ADDR(_devad, _regad)
 
#define OPENNSL_PORT_PHY_CONTROL_FEC_OFF   _SHR_PORT_PHY_CONTROL_FEC_OFF
 
#define OPENNSL_PORT_PHY_CONTROL_FEC_ON   _SHR_PORT_PHY_CONTROL_FEC_ON
 
#define OPENNSL_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION   _SHR_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION
 
#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_FIRMWARE   _SHR_PORT_PHY_CONTROL_RX_LOS_FIRMWARE
 
#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_NONE   _SHR_PORT_PHY_CONTROL_RX_LOS_NONE
 
#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_SOFTWARE   _SHR_PORT_PHY_CONTROL_RX_LOS_SOFTWARE
 
#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS
 
#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US
 
#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X11_X9_1   _SHR_PORT_PRBS_POLYNOMIAL_X11_X9_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X15_X14_1   _SHR_PORT_PRBS_POLYNOMIAL_X15_X14_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X23_X18_1   _SHR_PORT_PRBS_POLYNOMIAL_X23_X18_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X31_X28_1   _SHR_PORT_PRBS_POLYNOMIAL_X31_X28_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X58_X31_1   _SHR_PORT_PRBS_POLYNOMIAL_X58_X31_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X7_X6_1   _SHR_PORT_PRBS_POLYNOMIAL_X7_X6_1
 
#define OPENNSL_PORT_PRBS_POLYNOMIAL_X9_X5_1   _SHR_PORT_PRBS_POLYNOMIAL_X9_X5_1
 
#define OPENNSL_PORT_VLAN_MEMBER_EGRESS   0x00000002
 
#define OPENNSL_PORT_VLAN_MEMBER_INGRESS   0x00000001
 

Typedefs

typedef _shr_port_mode_t opennsl_port_abil_t
 Port ability mask.
 
typedef _shr_port_ability_t opennsl_port_ability_t
 Port ability.
 
typedef enum opennsl_port_class_e opennsl_port_class_t
 opennsl_port_class_e
 
typedef struct
opennsl_port_config_s 
opennsl_port_config_t
 Port Configuration structure.
 
typedef enum opennsl_port_control_e opennsl_port_control_t
 Features that can be controlled on a per-port basis.
 
typedef _shr_port_duplex_t opennsl_port_duplex_t
 opennsl_port_duplex_t
 
typedef enum
opennsl_port_field_egress_class_select_e 
opennsl_port_field_egress_class_select_t
 Parameter for opennslPortControlFieldEgressClassSelect.
 
typedef _shr_port_if_t opennsl_port_if_t
 opennsl_port_if_t
 
typedef struct opennsl_port_info_s opennsl_port_info_t
 opennsl_port_info_s
 
typedef enum
opennsl_port_loopback_e 
opennsl_port_loopback_t
 Port loopback modes.
 
typedef _shr_port_mdix_status_t opennsl_port_mdix_status_t
 MDI crossover status.
 
typedef _shr_port_mdix_t opennsl_port_mdix_t
 MDI crossover control.
 
typedef _shr_port_medium_t opennsl_port_medium_t
 Combo port control/status.
 
typedef enum opennsl_port_pause_e opennsl_port_pause_t
 Port pause modes (mainly used by the OPENNSLX layer).
 
typedef _shr_port_phy_control_t opennsl_port_phy_control_t
 opennsl_port_phy_control_t
 
typedef struct
opennsl_port_priority_group_config_s 
opennsl_port_priority_group_config_t
 Priority Group attributes.
 

Enumerations

enum  opennsl_port_class_e {
  opennslPortClassFieldLookup = 0,
  opennslPortClassFieldIngress = 1,
  opennslPortClassFieldEgress = 2,
  opennslPortClassId = 5,
  opennslPortClassFieldIngressPacketProcessing = 6,
  opennslPortClassFieldEgressPacketProcessing = 7,
  opennslPortClassEgress = 14
}
 opennsl_port_class_e More...
 
enum  opennsl_port_control_e {
  opennslPortControlIP4 = 8,
  opennslPortControlIP6 = 9,
  opennslPortControlTrustIncomingVlan = 22,
  opennslPortControlDoNotCheckVlan = 23,
  opennslPortControlPrbsMode = 27,
  opennslPortControlPrbsPolynomial = 28,
  opennslPortControlPrbsTxInvertData = 29,
  opennslPortControlPrbsForceTxError = 30,
  opennslPortControlPrbsTxEnable = 31,
  opennslPortControlPrbsRxEnable = 32,
  opennslPortControlPrbsRxStatus = 33,
  opennslPortControlEgressVlanPriUsesPktPri = 43,
  opennslPortControlLanes = 55,
  opennslPortControlPFCReceive = 59,
  opennslPortControlPFCTransmit = 60,
  opennslPortControlPFCClasses = 61,
  opennslPortControlPFCPassFrames = 62,
  opennslPortControlL2Move = 70,
  opennslPortControlEEETransmitWakeTime = 82,
  opennslPortControlStatOversize = 92,
  opennslPortControlEEEEnable = 94,
  opennslPortControlEEETransmitIdleTime = 96,
  opennslPortControlVxlanEnable = 187,
  opennslPortControlVxlanTunnelbasedVnId = 188,
  opennslPortControlVxlanDefaultTunnelEnable = 189,
  opennslPortControlMmuDrain = 285,
  opennslPortControlMmuTrafficEnable = 286,
  opennslPortControlSampleIngressDest = 304,
  opennslPortControlSampleFlexDest = 305,
  opennslPortControlSampleFlexRate = 306
}
 Features that can be controlled on a per-port basis. More...
 
enum  opennsl_port_field_egress_class_select_e { opennslPortEgressClassSelectPort = 1 }
 Parameter for opennslPortControlFieldEgressClassSelect. More...
 
enum  opennsl_port_loopback_e {
  OPENNSL_PORT_LOOPBACK_NONE = 0,
  OPENNSL_PORT_LOOPBACK_MAC = 1,
  OPENNSL_PORT_LOOPBACK_PHY = 2,
  OPENNSL_PORT_LOOPBACK_PHY_REMOTE = 3,
  OPENNSL_PORT_LOOPBACK_MAC_REMOTE = 4,
  OPENNSL_PORT_LOOPBACK_COUNT = 5
}
 Port loopback modes. More...
 
enum  opennsl_port_pause_e {
  OPENNSL_PORT_PAUSE_NONE = 0,
  OPENNSL_PORT_PAUSE_ASYM_RX = 1,
  OPENNSL_PORT_PAUSE_ASYM_TX = 2,
  OPENNSL_PORT_PAUSE_SYM = 3
}
 Port pause modes (mainly used by the OPENNSLX layer). More...
 

Functions

int opennsl_port_ability_advert_get (int unit, opennsl_port_t port, opennsl_port_ability_t *ability_mask) LIB_DLL_EXPORTED
 Set or retrieve auto-negotiation abilities for a port.
 
int opennsl_port_ability_advert_set (int unit, opennsl_port_t port, opennsl_port_ability_t *ability_mask) LIB_DLL_EXPORTED
 Set or retrieve auto-negotiation abilities for a port.
 
int opennsl_port_ability_get (int unit, opennsl_port_t port, opennsl_port_abil_t *local_ability_mask) LIB_DLL_EXPORTED
 
int opennsl_port_ability_local_get (int unit, opennsl_port_t port, opennsl_port_ability_t *local_ability_mask) LIB_DLL_EXPORTED
 Retrieve the valid abilities of a local port.
 
int opennsl_port_ability_remote_get (int unit, opennsl_port_t port, opennsl_port_ability_t *ability_mask) LIB_DLL_EXPORTED
 Retrieve the valid abilities of a remote port.
 
void opennsl_port_ability_t_init (opennsl_port_ability_t *ability) LIB_DLL_EXPORTED
 Initialize a Port Ability structure.
 
int opennsl_port_advert_get (int unit, opennsl_port_t port, opennsl_port_abil_t *ability_mask) LIB_DLL_EXPORTED
 
int opennsl_port_advert_remote_get (int unit, opennsl_port_t port, opennsl_port_abil_t *ability_mask) LIB_DLL_EXPORTED
 
int opennsl_port_advert_set (int unit, opennsl_port_t port, opennsl_port_abil_t ability_mask) LIB_DLL_EXPORTED
 
int opennsl_port_autoneg_get (int unit, opennsl_port_t port, int *autoneg) LIB_DLL_EXPORTED
 Configure or retrieve the current auto-negotiation settings for a port, or restart auto-negotiation if already enabled.
 
int opennsl_port_autoneg_set (int unit, opennsl_port_t port, int autoneg) LIB_DLL_EXPORTED
 Configure or retrieve the current auto-negotiation settings for a port, or restart auto-negotiation if already enabled.
 
int opennsl_port_cfi_color_get (int unit, opennsl_port_t port, int cfi, opennsl_color_t *color) LIB_DLL_EXPORTED
 Set or retrieve color assignment for a given port and Canonical Format Indicator (CFI).
 
int opennsl_port_cfi_color_set (int unit, opennsl_port_t port, int cfi, opennsl_color_t color) LIB_DLL_EXPORTED
 Set or retrieve color assignment for a given port and Canonical Format Indicator (CFI).
 
int opennsl_port_class_get (int unit, opennsl_port_t port, opennsl_port_class_t pclass, uint32 *class_id) LIB_DLL_EXPORTED
 Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing.
 
int opennsl_port_class_set (int unit, opennsl_port_t port, opennsl_port_class_t pclass, uint32 class_id) LIB_DLL_EXPORTED
 Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing.
 
int opennsl_port_clear (int unit) LIB_DLL_EXPORTED
 Initialize the port subsystem without affecting the current state of stack ports.
 
int opennsl_port_config_get (int unit, opennsl_port_config_t *config) LIB_DLL_EXPORTED
 Retrieved the port configuration for the specified device.
 
void opennsl_port_config_t_init (opennsl_port_config_t *pconfig) LIB_DLL_EXPORTED
 Initialize a Port Configuration structure.
 
int opennsl_port_control_get (int unit, opennsl_port_t port, opennsl_port_control_t type, int *value) LIB_DLL_EXPORTED
 Get or set various features at the port level.
 
int opennsl_port_control_set (int unit, opennsl_port_t port, opennsl_port_control_t type, int value) LIB_DLL_EXPORTED
 Get or set various features at the port level.
 
int opennsl_port_detach (int unit, opennsl_pbmp_t pbmp, opennsl_pbmp_t *detached) LIB_DLL_EXPORTED
 Detach ports from the OPENNSL API.
 
int opennsl_port_dscp_map_get (int unit, opennsl_port_t port, int srccp, int *mapcp, int *prio) LIB_DLL_EXPORTED
 Control mapping of Differentiated Services Code Points (DSCP).
 
int opennsl_port_dscp_map_mode_get (int unit, opennsl_port_t port, int *mode) LIB_DLL_EXPORTED
 Control mapping of Differentiated Services Code Points (DSCP).
 
int opennsl_port_dscp_map_mode_set (int unit, opennsl_port_t port, int mode) LIB_DLL_EXPORTED
 Control mapping of Differentiated Services Code Points (DSCP).
 
int opennsl_port_dscp_map_set (int unit, opennsl_port_t port, int srccp, int mapcp, int prio) LIB_DLL_EXPORTED
 Control mapping of Differentiated Services Code Points (DSCP).
 
int opennsl_port_dtag_mode_get (int unit, opennsl_port_t port, int *mode) LIB_DLL_EXPORTED
 Set or retrieve the current double tagging mode for a port.
 
int opennsl_port_dtag_mode_set (int unit, opennsl_port_t port, int mode) LIB_DLL_EXPORTED
 Set or retrieve the current double tagging mode for a port.
 
int opennsl_port_duplex_get (int unit, opennsl_port_t port, int *duplex) LIB_DLL_EXPORTED
 Get or set the current duplex mode of a port.
 
int opennsl_port_duplex_set (int unit, opennsl_port_t port, int duplex) LIB_DLL_EXPORTED
 Get or set the current duplex mode of a port.
 
int opennsl_port_egress_get (int unit, opennsl_port_t port, int modid, opennsl_pbmp_t *pbmp) LIB_DLL_EXPORTED
 Configure ports to block or allow packets from a given ingress port.
 
int opennsl_port_egress_set (int unit, opennsl_port_t port, int modid, opennsl_pbmp_t pbmp) LIB_DLL_EXPORTED
 Configure ports to block or allow packets from a given ingress port.
 
int opennsl_port_enable_get (int unit, opennsl_port_t port, int *enable) LIB_DLL_EXPORTED
 Enable or disable a port.
 
int opennsl_port_enable_set (int unit, opennsl_port_t port, int enable) LIB_DLL_EXPORTED
 Enable or disable a port.
 
int opennsl_port_flood_block_get (int unit, opennsl_port_t ingress_port, opennsl_port_t egress_port, uint32 *flags) LIB_DLL_EXPORTED
 Selectively block flooding traffic.
 
int opennsl_port_flood_block_set (int unit, opennsl_port_t ingress_port, opennsl_port_t egress_port, uint32 flags) LIB_DLL_EXPORTED
 Selectively block flooding traffic.
 
int opennsl_port_frame_max_get (int unit, opennsl_port_t port, int *size) LIB_DLL_EXPORTED
 Set or retrieve the current maximum packet size permitted on a port.
 
int opennsl_port_frame_max_set (int unit, opennsl_port_t port, int size) LIB_DLL_EXPORTED
 Set or retrieve the current maximum packet size permitted on a port.
 
int opennsl_port_gport_get (int unit, opennsl_port_t port, opennsl_gport_t *gport) LIB_DLL_EXPORTED
 Get the GPORT ID for the specified local port number.
 
int opennsl_port_ifilter_set (int unit, opennsl_port_t port, int mode) LIB_DLL_EXPORTED
 Set or retrieve current behavior of tagged packets arriving on a port not a member of the specified VLAN.
 
void opennsl_port_info_t_init (opennsl_port_info_t *info) LIB_DLL_EXPORTED
 Initializes the opennsl_port_info_t structure.
 
int opennsl_port_init (int unit) LIB_DLL_EXPORTED
 Initialize the port subsystem.
 
int opennsl_port_interface_get (int unit, opennsl_port_t port, opennsl_port_if_t *intf) LIB_DLL_EXPORTED
 Configure the physical interface between the MAC and the PHY for the specified port.
 
int opennsl_port_interface_set (int unit, opennsl_port_t port, opennsl_port_if_t intf) LIB_DLL_EXPORTED
 Configure the physical interface between the MAC and the PHY for the specified port.
 
int opennsl_port_l3_mtu_get (int unit, opennsl_port_t port, int *size) LIB_DLL_EXPORTED
 Set or retrieve the current maximum L3 packet size permitted on a port.
 
int opennsl_port_l3_mtu_set (int unit, opennsl_port_t port, int size) LIB_DLL_EXPORTED
 Set or retrieve the current maximum L3 packet size permitted on a port.
 
int opennsl_port_learn_get (int unit, opennsl_port_t port, uint32 *flags) LIB_DLL_EXPORTED
 Control the hardware and software learning support on a port.
 
int opennsl_port_learn_set (int unit, opennsl_port_t port, uint32 flags) LIB_DLL_EXPORTED
 Control the hardware and software learning support on a port.
 
int opennsl_port_link_failed_clear (int unit, opennsl_port_t port) LIB_DLL_EXPORTED
 Clear failed link status from a port which has undergone LAG failover.
 
int opennsl_port_link_status_get (int unit, opennsl_port_t port, int *status) LIB_DLL_EXPORTED
 Retrieve the current link status of a port.
 
int opennsl_port_linkscan_get (int unit, opennsl_port_t port, int *linkscan) LIB_DLL_EXPORTED
 Get or set the current linkscan mode for the specified port.
 
int opennsl_port_linkscan_set (int unit, opennsl_port_t port, int linkscan) LIB_DLL_EXPORTED
 Get or set the current linkscan mode for the specified port.
 
int opennsl_port_local_get (int unit, opennsl_gport_t gport, opennsl_port_t *local_port) LIB_DLL_EXPORTED
 Get local port number encoded within a GPORT ID.
 
int opennsl_port_loopback_get (int unit, opennsl_port_t port, int *loopback) LIB_DLL_EXPORTED
 Set or retrieve the current loopback mode of a port.
 
int opennsl_port_loopback_set (int unit, opennsl_port_t port, int loopback) LIB_DLL_EXPORTED
 Set or retrieve the current loopback mode of a port.
 
char * opennsl_port_name (int unit, int port) LIB_DLL_EXPORTED
 
int opennsl_port_pause_addr_get (int unit, opennsl_port_t port, opennsl_mac_t mac) LIB_DLL_EXPORTED
 Get or set the source MAC address transmitted in MAC control pause frames.
 
int opennsl_port_pause_addr_set (int unit, opennsl_port_t port, opennsl_mac_t mac) LIB_DLL_EXPORTED
 Get or set the source MAC address transmitted in MAC control pause frames.
 
int opennsl_port_pause_get (int unit, opennsl_port_t port, int *pause_tx, int *pause_rx) LIB_DLL_EXPORTED
 Enable or disable transmission of pause frames and honoring received pause frames on a port.
 
int opennsl_port_pause_set (int unit, opennsl_port_t port, int pause_tx, int pause_rx) LIB_DLL_EXPORTED
 Enable or disable transmission of pause frames and honoring received pause frames on a port.
 
int opennsl_port_pause_sym_get (int unit, opennsl_port_t port, int *pause) LIB_DLL_EXPORTED
 Configure or retrieve asymmetric pause setting for a port.
 
int opennsl_port_pause_sym_set (int unit, opennsl_port_t port, int pause) LIB_DLL_EXPORTED
 Configure or retrieve asymmetric pause setting for a port.
 
int opennsl_port_phy_control_get (int unit, opennsl_port_t port, opennsl_port_phy_control_t type, uint32 *value) LIB_DLL_EXPORTED
 Set/Get PHY specific configurations.
 
int opennsl_port_phy_control_set (int unit, opennsl_port_t port, opennsl_port_phy_control_t type, uint32 value) LIB_DLL_EXPORTED
 Set/Get PHY specific configurations.
 
int opennsl_port_phy_modify (int unit, opennsl_port_t port, uint32 flags, uint32 phy_reg_addr, uint32 phy_data, uint32 phy_mask) LIB_DLL_EXPORTED
 Read or write PHY registers associated with a port.
 
int opennsl_port_priority_color_get (int unit, opennsl_port_t port, int prio, opennsl_color_t *color) LIB_DLL_EXPORTED
 Set or retrieve color assignment for a given port and priority.
 
int opennsl_port_priority_color_set (int unit, opennsl_port_t port, int prio, opennsl_color_t color) LIB_DLL_EXPORTED
 Set or retrieve color assignment for a given port and priority.
 
int opennsl_port_priority_group_config_get (int unit, opennsl_gport_t gport, int priority_group, opennsl_port_priority_group_config_t *prigrp_config) LIB_DLL_EXPORTED
 Set/get the port priority group configuration.
 
int opennsl_port_priority_group_config_set (int unit, opennsl_gport_t gport, int priority_group, opennsl_port_priority_group_config_t *prigrp_config) LIB_DLL_EXPORTED
 Set/get the port priority group configuration.
 
void opennsl_port_priority_group_config_t_init (opennsl_port_priority_group_config_t *prigrp_config) LIB_DLL_EXPORTED
 Initialize a port priority group configuration struct.
 
int opennsl_port_priority_group_mapping_get (int unit, opennsl_gport_t gport, int prio, int *priority_group) LIB_DLL_EXPORTED
 Assign/retrieve the Priority Group mapped to the input priority.
 
int opennsl_port_priority_group_mapping_set (int unit, opennsl_gport_t gport, int prio, int priority_group) LIB_DLL_EXPORTED
 Assign/retrieve the Priority Group mapped to the input priority.
 
int opennsl_port_probe (int unit, opennsl_pbmp_t pbmp, opennsl_pbmp_t *okay_pbmp) LIB_DLL_EXPORTED
 Probe the port to determine the proper MAC and PHY drivers.
 
int opennsl_port_queued_count_get (int unit, opennsl_port_t port, uint32 *count) LIB_DLL_EXPORTED
 Get the current count of cells or packets queued on a port for transmission.
 
int opennsl_port_sample_rate_get (int unit, opennsl_port_t port, int *ingress_rate, int *egress_rate) LIB_DLL_EXPORTED
 Control the sampling of packets ingressing or egressing a port.
 
int opennsl_port_sample_rate_set (int unit, opennsl_port_t port, int ingress_rate, int egress_rate) LIB_DLL_EXPORTED
 Control the sampling of packets ingressing or egressing a port.
 
int opennsl_port_selective_get (int unit, opennsl_port_t port, opennsl_port_info_t *info) LIB_DLL_EXPORTED
 Get or set multiple port characteristics.
 
int opennsl_port_selective_set (int unit, opennsl_port_t port, opennsl_port_info_t *info) LIB_DLL_EXPORTED
 Get or set multiple port characteristics.
 
int opennsl_port_speed_get (int unit, opennsl_port_t port, int *speed) LIB_DLL_EXPORTED
 Get or set the current operating speed of a port.
 
int opennsl_port_speed_max (int unit, opennsl_port_t port, int *speed) LIB_DLL_EXPORTED
 Get or set the current operating speed of a port.
 
int opennsl_port_speed_set (int unit, opennsl_port_t port, int speed) LIB_DLL_EXPORTED
 Get or set the current operating speed of a port.
 
int opennsl_port_stat_enable_set (int unit, opennsl_gport_t port, int enable) LIB_DLL_EXPORTED
 Enable/disable packet and byte counters for the selected gport.
 
int opennsl_port_stp_get (int unit, opennsl_port_t port, int *state) LIB_DLL_EXPORTED
 Set the spanning tree state for a port (single instance spanning tree only).
 
int opennsl_port_stp_set (int unit, opennsl_port_t port, int state) LIB_DLL_EXPORTED
 Set the spanning tree state for a port (single instance spanning tree only).
 
int opennsl_port_subsidiary_ports_get (int unit, opennsl_port_t port, opennsl_pbmp_t *pbmp) LIB_DLL_EXPORTED
 Get the list of ancillary/flex ports belonging to the same port block as the controlling port.
 
int opennsl_port_untagged_priority_get (int unit, opennsl_port_t port, int *priority) LIB_DLL_EXPORTED
 Get or set the default priority for packets that ingress untagged.
 
int opennsl_port_untagged_priority_set (int unit, opennsl_port_t port, int priority) LIB_DLL_EXPORTED
 Get or set the default priority for packets that ingress untagged.
 
int opennsl_port_untagged_vlan_get (int unit, opennsl_port_t port, opennsl_vlan_t *vid_ptr) LIB_DLL_EXPORTED
 Get or set the default VLAN for packets that ingress untagged.
 
int opennsl_port_untagged_vlan_set (int unit, opennsl_port_t port, opennsl_vlan_t vid) LIB_DLL_EXPORTED
 Get or set the default VLAN for packets that ingress untagged.
 
int opennsl_port_vlan_member_get (int unit, opennsl_port_t port, uint32 *flags) LIB_DLL_EXPORTED
 Set or retrieve current behavior of tagged packets arriving/leaving on a port not a member of the specified VLAN.
 
int opennsl_port_vlan_member_set (int unit, opennsl_port_t port, uint32 flags) LIB_DLL_EXPORTED
 Set or retrieve current behavior of tagged packets arriving/leaving on a port not a member of the specified VLAN.
 
int opennsl_port_vlan_priority_map_get (int unit, opennsl_port_t port, int pkt_pri, int cfi, int *internal_pri, opennsl_color_t *color) LIB_DLL_EXPORTED
 
int opennsl_port_vlan_priority_map_set (int unit, opennsl_port_t port, int pkt_pri, int cfi, int internal_pri, opennsl_color_t color) LIB_DLL_EXPORTED
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_PIPES_MAX   _SHR_SWITCH_MAX_PIPES

Definition at line 36 of file port.h.

#define OPENNSL_PORT_ABIL_1000MB   _SHR_PM_1000MB

Definition at line 197 of file port.h.

#define OPENNSL_PORT_ABIL_1000MB_FD   _SHR_PM_1000MB_FD

Definition at line 161 of file port.h.

#define OPENNSL_PORT_ABIL_1000MB_HD   _SHR_PM_1000MB_HD

Definition at line 160 of file port.h.

#define OPENNSL_PORT_ABIL_100MB   _SHR_PM_100MB

Definition at line 196 of file port.h.

#define OPENNSL_PORT_ABIL_100MB_FD   _SHR_PM_100MB_FD

Definition at line 159 of file port.h.

#define OPENNSL_PORT_ABIL_100MB_HD   _SHR_PM_100MB_HD

Definition at line 158 of file port.h.

#define OPENNSL_PORT_ABIL_10B   OPENNSL_PORT_ABIL_TBI

Deprecated.

Definition at line 187 of file port.h.

#define OPENNSL_PORT_ABIL_10GB   _SHR_PM_10GB

Definition at line 200 of file port.h.

#define OPENNSL_PORT_ABIL_10GB_FD   _SHR_PM_10GB_FD

Definition at line 167 of file port.h.

#define OPENNSL_PORT_ABIL_10GB_HD   _SHR_PM_10GB_HD

Definition at line 166 of file port.h.

#define OPENNSL_PORT_ABIL_10MB   _SHR_PM_10MB

Definition at line 195 of file port.h.

#define OPENNSL_PORT_ABIL_10MB_FD   _SHR_PM_10MB_FD

Definition at line 157 of file port.h.

#define OPENNSL_PORT_ABIL_10MB_HD   _SHR_PM_10MB_HD

Definition at line 156 of file port.h.

#define OPENNSL_PORT_ABIL_12GB   _SHR_PM_12GB

Definition at line 201 of file port.h.

#define OPENNSL_PORT_ABIL_12GB_FD   _SHR_PM_12GB_FD

Definition at line 169 of file port.h.

#define OPENNSL_PORT_ABIL_12GB_HD   _SHR_PM_12GB_HD

Definition at line 168 of file port.h.

#define OPENNSL_PORT_ABIL_13GB   _SHR_PM_13GB

Definition at line 202 of file port.h.

#define OPENNSL_PORT_ABIL_13GB_FD   _SHR_PM_13GB_FD

Definition at line 171 of file port.h.

#define OPENNSL_PORT_ABIL_13GB_HD   _SHR_PM_13GB_HD

Definition at line 170 of file port.h.

#define OPENNSL_PORT_ABIL_16GB   _SHR_PM_16GB

Definition at line 203 of file port.h.

#define OPENNSL_PORT_ABIL_16GB_FD   _SHR_PM_16GB_FD

Definition at line 173 of file port.h.

#define OPENNSL_PORT_ABIL_16GB_HD   _SHR_PM_16GB_HD

Definition at line 172 of file port.h.

#define OPENNSL_PORT_ABIL_2500MB   _SHR_PM_2500MB

Definition at line 198 of file port.h.

#define OPENNSL_PORT_ABIL_2500MB_FD   _SHR_PM_2500MB_FD

Definition at line 163 of file port.h.

#define OPENNSL_PORT_ABIL_2500MB_HD   _SHR_PM_2500MB_HD

Definition at line 162 of file port.h.

#define OPENNSL_PORT_ABIL_3000MB   _SHR_PM_3000MB

Definition at line 199 of file port.h.

#define OPENNSL_PORT_ABIL_3000MB_FD   _SHR_PM_3000MB_FD

Definition at line 165 of file port.h.

#define OPENNSL_PORT_ABIL_3000MB_HD   _SHR_PM_3000MB_HD

Definition at line 164 of file port.h.

#define OPENNSL_PORT_ABIL_AN   _SHR_PM_AN

Definition at line 182 of file port.h.

#define OPENNSL_PORT_ABIL_COMBO   _SHR_PM_COMBO

Definition at line 183 of file port.h.

#define OPENNSL_PORT_ABIL_FD   _SHR_PM_FD

Definition at line 205 of file port.h.

#define OPENNSL_PORT_ABIL_GMII   _SHR_PM_GMII

Definition at line 176 of file port.h.

#define OPENNSL_PORT_ABIL_HD   _SHR_PM_HD

Definition at line 204 of file port.h.

#define OPENNSL_PORT_ABIL_LB_MAC   _SHR_PM_LB_MAC

Definition at line 179 of file port.h.

#define OPENNSL_PORT_ABIL_LB_NONE   _SHR_PM_LB_NONE

Definition at line 181 of file port.h.

#define OPENNSL_PORT_ABIL_LB_PHY   _SHR_PM_LB_PHY

Definition at line 180 of file port.h.

#define OPENNSL_PORT_ABIL_MII   _SHR_PM_MII

Definition at line 175 of file port.h.

#define OPENNSL_PORT_ABIL_PAUSE   _SHR_PM_PAUSE

Both TX and RX.

Definition at line 186 of file port.h.

#define OPENNSL_PORT_ABIL_PAUSE_ASYMM   _SHR_PM_PAUSE_ASYMM

The following is used only by opennsl_port_ability_get, and indicates that a port can support having PAUSE_TX be different than PAUSE_RX.

Definition at line 188 of file port.h.

#define OPENNSL_PORT_ABIL_PAUSE_RX   _SHR_PM_PAUSE_RX

Definition at line 185 of file port.h.

#define OPENNSL_PORT_ABIL_PAUSE_TX   _SHR_PM_PAUSE_TX

Definition at line 184 of file port.h.

#define OPENNSL_PORT_ABIL_SGMII   _SHR_PM_SGMII

Definition at line 177 of file port.h.

#define OPENNSL_PORT_ABIL_SPD_ANY   _SHR_PM_SPEED_ALL

Definition at line 206 of file port.h.

#define OPENNSL_PORT_ABIL_SPD_MAX (   abil)    _SHR_PM_SPEED_MAX(abil)

Definition at line 207 of file port.h.

#define OPENNSL_PORT_ABIL_TBI   _SHR_PM_TBI

Definition at line 174 of file port.h.

#define OPENNSL_PORT_ABIL_XGMII   _SHR_PM_XGMII

Definition at line 178 of file port.h.

#define OPENNSL_PORT_ABILITY_1000MB   _SHR_PA_SPEED_1000MB

Definition at line 73 of file port.h.

#define OPENNSL_PORT_ABILITY_100GB   _SHR_PA_SPEED_100GB

Definition at line 98 of file port.h.

#define OPENNSL_PORT_ABILITY_100MB   _SHR_PA_SPEED_100MB

Definition at line 72 of file port.h.

#define OPENNSL_PORT_ABILITY_106GB   _SHR_PA_SPEED_106GB

Definition at line 99 of file port.h.

#define OPENNSL_PORT_ABILITY_10GB   _SHR_PA_SPEED_10GB

Definition at line 78 of file port.h.

#define OPENNSL_PORT_ABILITY_10MB   _SHR_PA_SPEED_10MB

Definition at line 71 of file port.h.

#define OPENNSL_PORT_ABILITY_11GB   _SHR_PA_SPEED_11GB

Definition at line 79 of file port.h.

#define OPENNSL_PORT_ABILITY_120GB   _SHR_PA_SPEED_120GB

Definition at line 100 of file port.h.

#define OPENNSL_PORT_ABILITY_127GB   _SHR_PA_SPEED_127GB

Definition at line 101 of file port.h.

#define OPENNSL_PORT_ABILITY_12GB   _SHR_PA_SPEED_12GB

Definition at line 80 of file port.h.

#define OPENNSL_PORT_ABILITY_12P5GB   _SHR_PA_SPEED_12P5GB

Definition at line 81 of file port.h.

#define OPENNSL_PORT_ABILITY_13GB   _SHR_PA_SPEED_13GB

Definition at line 82 of file port.h.

#define OPENNSL_PORT_ABILITY_15GB   _SHR_PA_SPEED_15GB

Definition at line 83 of file port.h.

#define OPENNSL_PORT_ABILITY_16GB   _SHR_PA_SPEED_16GB

Definition at line 84 of file port.h.

#define OPENNSL_PORT_ABILITY_20GB   _SHR_PA_SPEED_20GB

Definition at line 85 of file port.h.

#define OPENNSL_PORT_ABILITY_21GB   _SHR_PA_SPEED_21GB

Definition at line 86 of file port.h.

#define OPENNSL_PORT_ABILITY_23GB   _SHR_PA_SPEED_23GB

Definition at line 87 of file port.h.

#define OPENNSL_PORT_ABILITY_24GB   _SHR_PA_SPEED_24GB

Definition at line 88 of file port.h.

#define OPENNSL_PORT_ABILITY_2500MB   _SHR_PA_SPEED_2500MB

Definition at line 74 of file port.h.

#define OPENNSL_PORT_ABILITY_25GB   _SHR_PA_SPEED_25GB

Definition at line 89 of file port.h.

#define OPENNSL_PORT_ABILITY_27GB   _SHR_PA_SPEED_27GB

Definition at line 90 of file port.h.

#define OPENNSL_PORT_ABILITY_3000MB   _SHR_PA_SPEED_3000MB

Definition at line 75 of file port.h.

#define OPENNSL_PORT_ABILITY_30GB   _SHR_PA_SPEED_30GB

Definition at line 91 of file port.h.

#define OPENNSL_PORT_ABILITY_32GB   _SHR_PA_SPEED_32GB

Definition at line 92 of file port.h.

#define OPENNSL_PORT_ABILITY_40GB   _SHR_PA_SPEED_40GB

Definition at line 93 of file port.h.

#define OPENNSL_PORT_ABILITY_42GB   _SHR_PA_SPEED_42GB

Definition at line 94 of file port.h.

#define OPENNSL_PORT_ABILITY_48GB   _SHR_PA_SPEED_48GB

Definition at line 95 of file port.h.

#define OPENNSL_PORT_ABILITY_5000MB   _SHR_PA_SPEED_5000MB

Definition at line 76 of file port.h.

#define OPENNSL_PORT_ABILITY_50GB   _SHR_PA_SPEED_50GB

Definition at line 96 of file port.h.

#define OPENNSL_PORT_ABILITY_53GB   _SHR_PA_SPEED_53GB

Definition at line 97 of file port.h.

#define OPENNSL_PORT_ABILITY_6000MB   _SHR_PA_SPEED_6000MB

Definition at line 77 of file port.h.

#define OPENNSL_PORT_ABILITY_AUTONEG   _SHR_PA_AUTONEG

Definition at line 116 of file port.h.

#define OPENNSL_PORT_ABILITY_CHANNEL_LONG   _SHR_PA_CHANNEL_LONG

port is long channel.

Definition at line 144 of file port.h.

#define OPENNSL_PORT_ABILITY_CHANNEL_SHORT   _SHR_PA_CHANNEL_SHORT

port is short channel.

Definition at line 145 of file port.h.

#define OPENNSL_PORT_ABILITY_COMBO   _SHR_PA_COMBO

Definition at line 117 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_100MB_BASETX   _SHR_PA_EEE_100MB_BASETX

EEE ability at 100M-BaseTX.

Definition at line 132 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_10GB_BASET   _SHR_PA_EEE_10GB_BASET

EEE ability at 10G-BaseT.

Definition at line 136 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_10GB_KR   _SHR_PA_EEE_10GB_KR

EEE ability at 10GB-KR.

Definition at line 142 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_10GB_KX   _SHR_PA_EEE_10GB_KX

EEE ability at 10GB-KX.

Definition at line 138 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_10GB_KX4   _SHR_PA_EEE_10GB_KX4

EEE ability at 10GB-KX4.

Definition at line 140 of file port.h.

#define OPENNSL_PORT_ABILITY_EEE_1GB_BASET   _SHR_PA_EEE_1GB_BASET

EEE ability at 1G-BaseT.

Definition at line 134 of file port.h.

#define OPENNSL_PORT_ABILITY_FEC_CL74   _SHR_PA_FEC_CL74

FEC CL74 request.

Definition at line 130 of file port.h.

#define OPENNSL_PORT_ABILITY_FEC_CL91   _SHR_PA_FEC_CL91

FEC CL91 request.

Definition at line 131 of file port.h.

#define OPENNSL_PORT_ABILITY_FEC_NONE   _SHR_PA_FEC_NONE

No FEC request.

Definition at line 129 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_CGMII   _SHR_PA_INTF_CGMII

Definition at line 108 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_GMII   _SHR_PA_INTF_GMII

Definition at line 104 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_MII   _SHR_PA_INTF_MII

Definition at line 103 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_QSGMII   _SHR_PA_INTF_QSGMII

Definition at line 107 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_SGMII   _SHR_PA_INTF_SGMII

Definition at line 105 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_TBI   _SHR_PA_INTF_TBI

Definition at line 102 of file port.h.

#define OPENNSL_PORT_ABILITY_INTERFACE_XGMII   _SHR_PA_INTF_XGMII

Definition at line 106 of file port.h.

#define OPENNSL_PORT_ABILITY_LB_LINE   _SHR_PA_LB_LINE

Definition at line 115 of file port.h.

#define OPENNSL_PORT_ABILITY_LB_MAC   _SHR_PA_LB_MAC

Definition at line 113 of file port.h.

#define OPENNSL_PORT_ABILITY_LB_NONE   _SHR_PA_LB_NONE

Definition at line 112 of file port.h.

#define OPENNSL_PORT_ABILITY_LB_PHY   _SHR_PA_LB_PHY

Definition at line 114 of file port.h.

#define OPENNSL_PORT_ABILITY_MEDIUM_BACKPLANE   _SHR_PA_MEDIUM_BACKPLANE

Definition at line 111 of file port.h.

#define OPENNSL_PORT_ABILITY_MEDIUM_COPPER   _SHR_PA_MEDIUM_COPPER

Definition at line 109 of file port.h.

#define OPENNSL_PORT_ABILITY_MEDIUM_FIBER   _SHR_PA_MEDIUM_FIBER

Definition at line 110 of file port.h.

#define OPENNSL_PORT_ABILITY_PAUSE   _SHR_PA_PAUSE

Both TX and RX.

Definition at line 120 of file port.h.

#define OPENNSL_PORT_ABILITY_PAUSE_ASYMM   _SHR_PA_PAUSE_ASYMM

The following is used only by opennsl_port_ability_get, and indicates that a port can support having PAUSE_TX be different than PAUSE_RX.

Definition at line 121 of file port.h.

#define OPENNSL_PORT_ABILITY_PAUSE_RX   _SHR_PA_PAUSE_RX

Definition at line 119 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ABILITY_PAUSE_TX   _SHR_PA_PAUSE_TX

Definition at line 118 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ABILITY_SPEED_MAX (   abil)    _SHR_PA_SPEED_MAX(abil)

Definition at line 209 of file port.h.

#define OPENNSL_PORT_ATTR2_PORT_ABILITY   0x00000001

Definition at line 2370 of file port.h.

#define OPENNSL_PORT_ATTR_ABILITY_MASK   0x04000000

Get only.

Definition at line 2364 of file port.h.

#define OPENNSL_PORT_ATTR_ALL_MASK   0xffffffff

Definition at line 2371 of file port.h.

#define OPENNSL_PORT_ATTR_AUTONEG_MASK   0x00000004

Definition at line 2340 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_DISCARD_MASK   0x00000080

Definition at line 2345 of file port.h.

#define OPENNSL_PORT_ATTR_DUPLEX_MASK   0x00000010

Definition at line 2342 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_ENABLE_MASK   0x00000001

Definition at line 2338 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_ENCAP_MASK   0x00200000

Definition at line 2359 of file port.h.

#define OPENNSL_PORT_ATTR_FAULT_MASK   0x80000000

Get only.

Definition at line 2369 of file port.h.

#define OPENNSL_PORT_ATTR_FRAME_MAX_MASK   0x08000000

Definition at line 2365 of file port.h.

#define OPENNSL_PORT_ATTR_INTERFACE_MASK   0x00008000

Definition at line 2353 of file port.h.

#define OPENNSL_PORT_ATTR_LEARN_MASK   0x00000040

Definition at line 2344 of file port.h.

#define OPENNSL_PORT_ATTR_LINKSCAN_MASK   0x00000020

Definition at line 2343 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_LINKSTAT_MASK   0x00000002

Get only.

Definition at line 2339 of file port.h.

#define OPENNSL_PORT_ATTR_LOCAL_ADVERT_MASK   0x00080000

Definition at line 2357 of file port.h.

#define OPENNSL_PORT_ATTR_LOOPBACK_MASK   0x00002000

Definition at line 2351 of file port.h.

#define OPENNSL_PORT_ATTR_MDIX_MASK   0x10000000

Definition at line 2366 of file port.h.

#define OPENNSL_PORT_ATTR_MDIX_STATUS_MASK   0x20000000

Definition at line 2367 of file port.h.

#define OPENNSL_PORT_ATTR_MEDIUM_MASK   0x40000000

Definition at line 2368 of file port.h.

#define OPENNSL_PORT_ATTR_PAUSE_MAC_MASK   0x00040000

Definition at line 2356 of file port.h.

#define OPENNSL_PORT_ATTR_PAUSE_RX_MASK   0x00020000

Definition at line 2355 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_PAUSE_TX_MASK   0x00010000

Definition at line 2354 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_PFM_MASK   0x00001000

Definition at line 2350 of file port.h.

#define OPENNSL_PORT_ATTR_PHY_MASTER_MASK   0x00004000

Definition at line 2352 of file port.h.

#define OPENNSL_PORT_ATTR_RATE_BCAST_MASK   0x00800000

Definition at line 2361 of file port.h.

#define OPENNSL_PORT_ATTR_RATE_DLFBC_MASK   0x01000000

Definition at line 2362 of file port.h.

#define OPENNSL_PORT_ATTR_RATE_MCAST_MASK   0x00400000

Definition at line 2360 of file port.h.

#define OPENNSL_PORT_ATTR_REMOTE_ADVERT_MASK   0x00100000

Get only.

Definition at line 2358 of file port.h.

#define OPENNSL_PORT_ATTR_SPEED_MASK   0x00000008

Definition at line 2341 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_ATTR_SPEED_MAX_MASK   0x02000000

Get only.

Definition at line 2363 of file port.h.

#define OPENNSL_PORT_ATTR_STP_STATE_MASK   0x00000800

Definition at line 2349 of file port.h.

#define OPENNSL_PORT_ATTR_UNTAG_PRI_MASK   0x00000200

Definition at line 2347 of file port.h.

#define OPENNSL_PORT_ATTR_UNTAG_VLAN_MASK   0x00000400

Definition at line 2348 of file port.h.

#define OPENNSL_PORT_ATTR_VLANFILTER_MASK   0x00000100

Definition at line 2346 of file port.h.

#define OPENNSL_PORT_CONTROL_SAMPLE_DEST_CPU   0x1

Copy packet samples to CPU.

Definition at line 3005 of file port.h.

Referenced by main().

#define OPENNSL_PORT_CONTROL_SAMPLE_DEST_MIRROR   0x2

Copy packet samples to all mirror destinations created with OPENNSL_MIRROR_PORT_SFLOW flag.

Definition at line 3007 of file port.h.

#define OPENNSL_PORT_DSCP_MAP_ALL   2

Map all.

Definition at line 680 of file port.h.

#define OPENNSL_PORT_DSCP_MAP_DEFAULT   4

Map according to default mapping,Not looking at PCP or TOS.

Definition at line 683 of file port.h.

#define OPENNSL_PORT_DSCP_MAP_NONE   0

Disable DSCP mapping.

Definition at line 677 of file port.h.

Referenced by qos_pcp_map_create().

#define OPENNSL_PORT_DSCP_MAP_UNTAGGED_ONLY   3

Map only when packet is untagged.

Definition at line 681 of file port.h.

#define OPENNSL_PORT_DSCP_MAP_ZERO   1

Map only if incoming DSCP = 0.

Definition at line 678 of file port.h.

#define OPENNSL_PORT_DTAG_MODE_EXTERNAL   2

Customer port.

Definition at line 2279 of file port.h.

#define OPENNSL_PORT_DTAG_MODE_INTERNAL   1

Service Provider port.

Definition at line 2278 of file port.h.

#define OPENNSL_PORT_DTAG_MODE_NONE   0

No double tagging.

Definition at line 2277 of file port.h.

#define OPENNSL_PORT_DUPLEX_COUNT   _SHR_PORT_DUPLEX_COUNT

Definition at line 1212 of file port.h.

#define OPENNSL_PORT_DUPLEX_FULL   _SHR_PORT_DUPLEX_FULL

Definition at line 1211 of file port.h.

Referenced by example_port_default_config().

#define OPENNSL_PORT_DUPLEX_HALF   _SHR_PORT_DUPLEX_HALF

Definition at line 1210 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_ALL   0x8

Definition at line 2161 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_BCAST   0x1

Definition at line 2158 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_KNOWN_MCAST   0x40

Definition at line 2164 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_IP_MCAST   0x10

Definition at line 2162 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_MCAST   0x4

Definition at line 2160 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_NONIP_MCAST   0x20

Definition at line 2163 of file port.h.

#define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_UCAST   0x2

Definition at line 2159 of file port.h.

#define OPENNSL_PORT_IF_10B   OPENNSL_PORT_IF_TBI

Deprecated.

Definition at line 1150 of file port.h.

#define OPENNSL_PORT_IF_CAUI   _SHR_PORT_IF_CAUI

Definition at line 1110 of file port.h.

#define OPENNSL_PORT_IF_CAUI4   _SHR_PORT_IF_CAUI4

CAUI4 100G interface.

Definition at line 1142 of file port.h.

#define OPENNSL_PORT_IF_CAUI_C2C   _SHR_PORT_IF_CAUI_C2C

CAUI 100G C2C interface.

Definition at line 1131 of file port.h.

#define OPENNSL_PORT_IF_CAUI_C2M   _SHR_PORT_IF_CAUI_C2M

CAUI 100G C2M interface.

Definition at line 1132 of file port.h.

#define OPENNSL_PORT_IF_COUNT   _SHR_PORT_IF_COUNT

Definition at line 1149 of file port.h.

#define OPENNSL_PORT_IF_CPU   _SHR_PORT_IF_CPU

Definition at line 1122 of file port.h.

#define OPENNSL_PORT_IF_CR   _SHR_PORT_IF_CR

Copper 10 GbE 64B/66B interface.

Definition at line 1090 of file port.h.

#define OPENNSL_PORT_IF_CR10   _SHR_PORT_IF_CR10

Copper CR10 64B/66B interface.

Definition at line 1117 of file port.h.

#define OPENNSL_PORT_IF_CR2   _SHR_PORT_IF_CR2

Copper 2x10GbE 64B/66B interface.

Definition at line 1092 of file port.h.

#define OPENNSL_PORT_IF_CR4   _SHR_PORT_IF_CR4

Copper 4x10 GbE 64B/66B interface.

Definition at line 1094 of file port.h.

#define OPENNSL_PORT_IF_CX   _SHR_PORT_IF_CX

Copper 10G 10B/8B interface.

Definition at line 1128 of file port.h.

#define OPENNSL_PORT_IF_CX2   _SHR_PORT_IF_CX2

Copper 2x10G 10B/8B interface.

Definition at line 1129 of file port.h.

#define OPENNSL_PORT_IF_CX4   _SHR_PORT_IF_CX4

Copper 4x10G 10B/8B interface.

Definition at line 1130 of file port.h.

#define OPENNSL_PORT_IF_ER   _SHR_PORT_IF_ER

Fiber ER 64B/66B interface.

Definition at line 1123 of file port.h.

#define OPENNSL_PORT_IF_ER2   _SHR_PORT_IF_ER2

Fiber ER2 2x10G 64B/66B interface.

Definition at line 1124 of file port.h.

#define OPENNSL_PORT_IF_ER4   _SHR_PORT_IF_ER4

Fiber ER4 4x10G 64B/66B interface.

Definition at line 1126 of file port.h.

#define OPENNSL_PORT_IF_ERP   _SHR_PORT_IF_ERP

Definition at line 1145 of file port.h.

#define OPENNSL_PORT_IF_EVENTOR   _SHR_PORT_IF_EVENTOR

Definition at line 1148 of file port.h.

#define OPENNSL_PORT_IF_FAT_PIPE   _SHR_PORT_IF_FAT_PIPE

Definition at line 1106 of file port.h.

#define OPENNSL_PORT_IF_GMII   _SHR_PORT_IF_GMII

GMII Operating mode, not supported on all ports.

Definition at line 1071 of file port.h.

#define OPENNSL_PORT_IF_ILKN   _SHR_PORT_IF_ILKN

Definition at line 1104 of file port.h.

#define OPENNSL_PORT_IF_KR   _SHR_PORT_IF_KR

Backplane 10 GbE 64B/66B interface.

Definition at line 1084 of file port.h.

#define OPENNSL_PORT_IF_KR10   _SHR_PORT_IF_KR10

Backplane KR10 64B/66B interface.

Definition at line 1118 of file port.h.

#define OPENNSL_PORT_IF_KR2   _SHR_PORT_IF_KR2

Backplane 2x10GbE 64B/66B interface.

Definition at line 1086 of file port.h.

#define OPENNSL_PORT_IF_KR4   _SHR_PORT_IF_KR4

Backplane 4x10 GbE 64B/66B interface.

Definition at line 1088 of file port.h.

#define OPENNSL_PORT_IF_KX   _SHR_PORT_IF_KX

Definition at line 1114 of file port.h.

#define OPENNSL_PORT_IF_LBG   _SHR_PORT_IF_LBG

Link bonding interface.

Definition at line 1141 of file port.h.

#define OPENNSL_PORT_IF_LR   _SHR_PORT_IF_LR

Fiber LR 64B/66B interface.

Definition at line 1111 of file port.h.

#define OPENNSL_PORT_IF_LR10   _SHR_PORT_IF_LR10

Fiber LR10 64B/66B interface.

Definition at line 1120 of file port.h.

#define OPENNSL_PORT_IF_LR2   _SHR_PORT_IF_LR2

Fiber 2x10Gbe LR 64B/66B interface.

Definition at line 1135 of file port.h.

#define OPENNSL_PORT_IF_LR4   _SHR_PORT_IF_LR4

Fiber LR4 64B/66B interface.

Definition at line 1112 of file port.h.

#define OPENNSL_PORT_IF_LRM   _SHR_PORT_IF_LRM

Fiber LRM multipoint 64B/66B interface.

Definition at line 1137 of file port.h.

#define OPENNSL_PORT_IF_MII   _SHR_PORT_IF_MII

MII Operating mode, not supported on all ports.

Definition at line 1069 of file port.h.

#define OPENNSL_PORT_IF_NOCXN   _SHR_PORT_IF_NOCXN

Definition at line 1067 of file port.h.

#define OPENNSL_PORT_IF_NULL   _SHR_PORT_IF_NULL

Definition at line 1068 of file port.h.

#define OPENNSL_PORT_IF_OAMP   _SHR_PORT_IF_OAMP

Definition at line 1143 of file port.h.

#define OPENNSL_PORT_IF_OLP   _SHR_PORT_IF_OLP

Definition at line 1144 of file port.h.

#define OPENNSL_PORT_IF_OTL   _SHR_PORT_IF_OTL

Fiber 4x25 GbE OTL interface.

Definition at line 1121 of file port.h.

#define OPENNSL_PORT_IF_QSGMII   _SHR_PORT_IF_QSGMII

Definition at line 1103 of file port.h.

#define OPENNSL_PORT_IF_RCY   _SHR_PORT_IF_RCY

Definition at line 1105 of file port.h.

#define OPENNSL_PORT_IF_RCY_MIRROR   _SHR_PORT_IF_RCY_MIRROR

Definition at line 1147 of file port.h.

#define OPENNSL_PORT_IF_RGMII   _SHR_PORT_IF_RGMII

Reduced Gigabit Media Independent Interface.

Definition at line 1078 of file port.h.

#define OPENNSL_PORT_IF_RXAUI   _SHR_PORT_IF_RXAUI

Definition at line 1100 of file port.h.

#define OPENNSL_PORT_IF_SAT   _SHR_PORT_IF_SAT

Definition at line 1146 of file port.h.

#define OPENNSL_PORT_IF_SFI   _SHR_PORT_IF_SFI

SFI 10-Gigabit serial electrical interface.

Definition at line 1080 of file port.h.

#define OPENNSL_PORT_IF_SGMII   _SHR_PORT_IF_SGMII

Definition at line 1073 of file port.h.

#define OPENNSL_PORT_IF_SPAUI   _SHR_PORT_IF_SPAUI

Definition at line 1102 of file port.h.

#define OPENNSL_PORT_IF_SR   _SHR_PORT_IF_SR

Fiber SR/LR 64B/66B interface.

Definition at line 1107 of file port.h.

#define OPENNSL_PORT_IF_SR10   _SHR_PORT_IF_SR10

Fiber SR10 64B/66B interface.

Definition at line 1116 of file port.h.

#define OPENNSL_PORT_IF_SR2   _SHR_PORT_IF_SR2

Fiber 2x10GbE 64B/66B interface.

Definition at line 1108 of file port.h.

#define OPENNSL_PORT_IF_SR4   _SHR_PORT_IF_SR4

Fiber SR4 64B/66B interface.

Definition at line 1113 of file port.h.

#define OPENNSL_PORT_IF_TBI   _SHR_PORT_IF_TBI

TBI interface supported on Gigabit Ethernet ports operating at gigabit speeds.

Definition at line 1074 of file port.h.

#define OPENNSL_PORT_IF_VSR   _SHR_PORT_IF_VSR

Fiber VSR 10G 64B/66B interface.

Definition at line 1133 of file port.h.

#define OPENNSL_PORT_IF_XAUI   _SHR_PORT_IF_XAUI

Definition at line 1101 of file port.h.

#define OPENNSL_PORT_IF_XFI   _SHR_PORT_IF_XFI

XFI 10-Gigabit serial electrical interface.

Definition at line 1082 of file port.h.

#define OPENNSL_PORT_IF_XGMII   _SHR_PORT_IF_XGMII

10-Gigabit interface

Definition at line 1077 of file port.h.

#define OPENNSL_PORT_IF_XLAUI   _SHR_PORT_IF_XLAUI

40 Gigabit Attachment Unit Interface

Definition at line 1096 of file port.h.

#define OPENNSL_PORT_IF_XLAUI2   _SHR_PORT_IF_XLAUI2

40 Gigabit Attachment Unit Interface over 2 lanes

Definition at line 1098 of file port.h.

#define OPENNSL_PORT_IF_XLPPI   _SHR_PORT_IF_XLPPI

40G parallel physical interface

Definition at line 1139 of file port.h.

#define OPENNSL_PORT_IF_ZR   _SHR_PORT_IF_ZR

Fiber ZR 64B/66B interface.

Definition at line 1115 of file port.h.

#define OPENNSL_PORT_IFILTER_OFF   0

Definition at line 1937 of file port.h.

#define OPENNSL_PORT_IFILTER_ON   1

Definition at line 1938 of file port.h.

#define OPENNSL_PORT_LEARN_ARL   0x01

Learn SLF address.

Definition at line 1811 of file port.h.

#define OPENNSL_PORT_LEARN_CPU   0x02

Copy SLF packet to CPU.

Definition at line 1812 of file port.h.

#define OPENNSL_PORT_LEARN_FWD   0x04

Forward SLF packet.

Definition at line 1813 of file port.h.

#define OPENNSL_PORT_LEARN_PENDING   0x08

Mark learned SLF as pending.

Definition at line 1814 of file port.h.

#define OPENNSL_PORT_LINK_STATUS_UP   1

Definition at line 1881 of file port.h.

#define OPENNSL_PORT_MDIX_AUTO   _SHR_PORT_MDIX_AUTO

Definition at line 1662 of file port.h.

#define OPENNSL_PORT_MDIX_COUNT   _SHR_PORT_MDIX_COUNT

Definition at line 1666 of file port.h.

#define OPENNSL_PORT_MDIX_FORCE_AUTO   _SHR_PORT_MDIX_FORCE_AUTO

Definition at line 1663 of file port.h.

#define OPENNSL_PORT_MDIX_NORMAL   _SHR_PORT_MDIX_NORMAL

Definition at line 1664 of file port.h.

#define OPENNSL_PORT_MDIX_STATUS_COUNT   _SHR_PORT_MDIX_STATUS_COUNT

Definition at line 1672 of file port.h.

#define OPENNSL_PORT_MDIX_STATUS_NORMAL   _SHR_PORT_MDIX_STATUS_NORMAL

Definition at line 1670 of file port.h.

#define OPENNSL_PORT_MDIX_STATUS_XOVER   _SHR_PORT_MDIX_STATUS_XOVER

Definition at line 1671 of file port.h.

#define OPENNSL_PORT_MDIX_XOVER   _SHR_PORT_MDIX_XOVER

Definition at line 1665 of file port.h.

#define OPENNSL_PORT_MEDIUM_COPPER   _SHR_PORT_MEDIUM_COPPER

Definition at line 1677 of file port.h.

#define OPENNSL_PORT_MEDIUM_COUNT   _SHR_PORT_MEDIUM_COUNT

Definition at line 1679 of file port.h.

#define OPENNSL_PORT_MEDIUM_FIBER   _SHR_PORT_MEDIUM_FIBER

Definition at line 1678 of file port.h.

#define OPENNSL_PORT_MEDIUM_NONE   _SHR_PORT_MEDIUM_NONE

Definition at line 1676 of file port.h.

#define OPENNSL_PORT_PHY_CLAUSE45   _SHR_PORT_PHY_CLAUSE45

Definition at line 1617 of file port.h.

#define OPENNSL_PORT_PHY_CLAUSE45_ADDR (   _devad,
  _regad 
)    _SHR_PORT_PHY_CLAUSE45_ADDR(_devad, _regad)

Definition at line 1618 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_FEC_OFF   _SHR_PORT_PHY_CONTROL_FEC_OFF

Definition at line 2874 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_FEC_ON   _SHR_PORT_PHY_CONTROL_FEC_ON

Definition at line 2875 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION   _SHR_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION

Definition at line 2873 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_FIRMWARE   _SHR_PORT_PHY_CONTROL_RX_LOS_FIRMWARE

Definition at line 2881 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_NONE   _SHR_PORT_PHY_CONTROL_RX_LOS_NONE

Definition at line 2879 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_RX_LOS_SOFTWARE   _SHR_PORT_PHY_CONTROL_RX_LOS_SOFTWARE

Definition at line 2880 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS

Definition at line 2876 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US

Definition at line 2877 of file port.h.

#define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US   _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US

Definition at line 2878 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X11_X9_1   _SHR_PORT_PRBS_POLYNOMIAL_X11_X9_1

Definition at line 2096 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X15_X14_1   _SHR_PORT_PRBS_POLYNOMIAL_X15_X14_1

Definition at line 2092 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X23_X18_1   _SHR_PORT_PRBS_POLYNOMIAL_X23_X18_1

Definition at line 2093 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X31_X28_1   _SHR_PORT_PRBS_POLYNOMIAL_X31_X28_1

Definition at line 2094 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X58_X31_1   _SHR_PORT_PRBS_POLYNOMIAL_X58_X31_1

Definition at line 2097 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X7_X6_1   _SHR_PORT_PRBS_POLYNOMIAL_X7_X6_1

Definition at line 2091 of file port.h.

#define OPENNSL_PORT_PRBS_POLYNOMIAL_X9_X5_1   _SHR_PORT_PRBS_POLYNOMIAL_X9_X5_1

Definition at line 2095 of file port.h.

#define OPENNSL_PORT_VLAN_MEMBER_EGRESS   0x00000002

Definition at line 1972 of file port.h.

#define OPENNSL_PORT_VLAN_MEMBER_INGRESS   0x00000001

Definition at line 1971 of file port.h.

Typedef Documentation

Port ability mask.

The following flags are used to indicate which set of capabilities are provided by a PHY or MAC when retrieving the ability of a port, setting or getting the local advertisement, getting the remote advertisement, or setting the MAC encapsulation and/or CRC modes.

Definition at line 154 of file port.h.

Port ability.

Definition at line 69 of file port.h.

opennsl_port_class_e

Port Configuration structure.

Features that can be controlled on a per-port basis.

opennsl_port_duplex_t

Definition at line 1208 of file port.h.

Parameter for opennslPortControlFieldEgressClassSelect.

opennsl_port_if_t

Definition at line 1065 of file port.h.

Port loopback modes.

MDI crossover status.

Definition at line 1668 of file port.h.

MDI crossover control.

Definition at line 1660 of file port.h.

Combo port control/status.

Definition at line 1674 of file port.h.

Port pause modes (mainly used by the OPENNSLX layer).

opennsl_port_phy_control_t

Definition at line 2871 of file port.h.

Priority Group attributes.

Enumeration Type Documentation

opennsl_port_class_e

Enumerator:
opennslPortClassFieldLookup 

Class for field stage Lookup.

opennslPortClassFieldIngress 

Class for field stage Ingress.

opennslPortClassFieldEgress 

Class for field stage Egress.

opennslPortClassId 

Class for mapping local-port to vlan-domain.

vlan domain is used in mapping packet VID to Vlan

opennslPortClassFieldIngressPacketProcessing 

Packet processing port Class lower 32 bits for field stage Ingress.

opennslPortClassFieldEgressPacketProcessing 

Packet processing port Class for field stage Egress.

opennslPortClassEgress 

EGR_PORT class ID field for field stage Egress.

Definition at line 2605 of file port.h.

Features that can be controlled on a per-port basis.

Enumerator:
opennslPortControlIP4 

Enable IPv4 Routing on port.

opennslPortControlIP6 

Enable IPv6 Routing on port.

opennslPortControlTrustIncomingVlan 

Trust incoming packet's Vlan tag.

opennslPortControlDoNotCheckVlan 

Enable/disable spanning tree and Vlan membership checks on ingress ethernet and higig packets.

For cpu port configuration is applied only for higig packets. To configure these settings for ethernet packets opennslPortControlDoNotCheckVlanFromCpu port control can be used.

opennslPortControlPrbsMode 

PRBS location - 0=>Phy PRBS 1=>MAC/SI Port.

opennslPortControlPrbsPolynomial 

Assigns PRBS polynomial, OPENNSL_PORT_PRBS_POLYNOMIAL_.

opennslPortControlPrbsTxInvertData 

Configure inversion of Tx data.

opennslPortControlPrbsForceTxError 

Configure insertion of Tx errors.

opennslPortControlPrbsTxEnable 

Enable Tx PRBS.

opennslPortControlPrbsRxEnable 

Enable Rx PRBS.

opennslPortControlPrbsRxStatus 

PRBS Rx status.

opennslPortControlEgressVlanPriUsesPktPri 

If set, outgoing packets derive their priority from the incoming priority.

opennslPortControlLanes 

Sets the number of active lanes for a port that can be dynamically hot-swapped.

opennslPortControlPFCReceive 

Priority Flow Control packet receive enable.

opennslPortControlPFCTransmit 

Priority Flow Control packet transmit enable.

opennslPortControlPFCClasses 

Priority Flow Control number of classes.

opennslPortControlPFCPassFrames 

Allow Priority Flow Control packets into switch device.

opennslPortControlL2Move 

Configure L2 station movement behavior using OPENNSL_PORT_LEARN_xxx flags.

opennslPortControlEEETransmitWakeTime 

Time(in microsecs) to wait before transmitter can begin transmitting leaving Low Power Idle State.

opennslPortControlStatOversize 

Threshold above which packet will be counted as oversized.

opennslPortControlEEEEnable 

Enable/Disable Energy Efficient Ethernet.

opennslPortControlEEETransmitIdleTime 

Time (in microsecs) for which condition to move to LPI state is satisfied, at the end of which MAC transitions to LPI state.

opennslPortControlVxlanEnable 

Set per port enable for VXLAN (Value=TRUE/FALSE)

opennslPortControlVxlanTunnelbasedVnId 

Set per port VNID lookup key (Value=TRUE/FALSE)

opennslPortControlVxlanDefaultTunnelEnable 

Set per port dafult-SVP for Tunnel lookup failure(Value=TRUE/FALSE)

opennslPortControlMmuDrain 

Draining the cells of the port.

opennslPortControlMmuTrafficEnable 

Enable/disable enqueing the packets to the port.

opennslPortControlSampleIngressDest 

Set Ingress sFlow sample destination.

opennslPortControlSampleFlexDest 

Set Flex sFlow sample destination.

opennslPortControlSampleFlexRate 

Set Flex sFlow sampling rate.

Definition at line 2676 of file port.h.

Parameter for opennslPortControlFieldEgressClassSelect.

Enumerator:
opennslPortEgressClassSelectPort 

Class Id from Port Interface.

Definition at line 3014 of file port.h.

Port loopback modes.

Enumerator:
OPENNSL_PORT_LOOPBACK_NONE 
OPENNSL_PORT_LOOPBACK_MAC 
OPENNSL_PORT_LOOPBACK_PHY 
OPENNSL_PORT_LOOPBACK_PHY_REMOTE 
OPENNSL_PORT_LOOPBACK_MAC_REMOTE 
OPENNSL_PORT_LOOPBACK_COUNT 

Definition at line 1681 of file port.h.

Port pause modes (mainly used by the OPENNSLX layer).

Enumerator:
OPENNSL_PORT_PAUSE_NONE 
OPENNSL_PORT_PAUSE_ASYM_RX 
OPENNSL_PORT_PAUSE_ASYM_TX 
OPENNSL_PORT_PAUSE_SYM 

Definition at line 1214 of file port.h.

Function Documentation

int opennsl_port_ability_advert_get ( int  unit,
opennsl_port_t  port,
opennsl_port_ability_t ability_mask 
)

Set or retrieve auto-negotiation abilities for a port.

Description
Set or retrieve the current auto-negotiation abilities for the specified port. If the port is currently operating with auto-negotiation disabled, these settings will be programmed into the underlying devices but not have an affect until auto-negotiation is enabled. If auto-negotiation is enabled when the settings are changed, auto-negotiation must be restarted using =opennsl_port_autoneg_set . Setting or retrieving the currently set ability structure can be done at any time, including with auto-negotiation disabled. The setting will only take affect when auto-negotiation is enabled or restarted. See.
Parameters
unit[IN] Unit number.
port[IN] Physical or logical port to query or set information on.
ability_mask[OUT] Extended abilities structure, =EXTENDED_PORT_ABILITY_s .
Return values
OPENNSL_E_NONERequested action performed.
OPENNSL_E_XXXOperation failed
int opennsl_port_ability_advert_set ( int  unit,
opennsl_port_t  port,
opennsl_port_ability_t ability_mask 
)

Set or retrieve auto-negotiation abilities for a port.

Description
Set or retrieve the current auto-negotiation abilities for the specified port. If the port is currently operating with auto-negotiation disabled, these settings will be programmed into the underlying devices but not have an affect until auto-negotiation is enabled. If auto-negotiation is enabled when the settings are changed, auto-negotiation must be restarted using =opennsl_port_autoneg_set . Setting or retrieving the currently set ability structure can be done at any time, including with auto-negotiation disabled. The setting will only take affect when auto-negotiation is enabled or restarted. See.
Parameters
unit[IN] Unit number.
port[IN] Physical or logical port to query or set information on.
ability_mask[IN] Extended abilities structure, =EXTENDED_PORT_ABILITY_s .
Return values
OPENNSL_E_NONERequested action performed.
OPENNSL_E_XXXOperation failed
int opennsl_port_ability_get ( int  unit,
opennsl_port_t  port,
opennsl_port_abil_t local_ability_mask 
)
Parameters
unit[IN] Unit number.
port[IN]
local_ability_mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_port_ability_local_get ( int  unit,
opennsl_port_t  port,
opennsl_port_ability_t local_ability_mask 
)

Retrieve the valid abilities of a local port.

Description
Retrieve the abilities of the specified local port.
Parameters
unit[IN] Unit number.
port[IN] Physical or logical port to query or set information on.
local_ability_mask[OUT] Extended ability structure =EXTENDED_PORT_ABILITY_s
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_XXXOperation failed, the return value local_ability_mask is undefined.
int opennsl_port_ability_remote_get ( int  unit,
opennsl_port_t  port,
opennsl_port_ability_t ability_mask 
)

Retrieve the valid abilities of a remote port.

Description
Retrieve the abilities of the specified remote port.
Parameters
unit[IN] Unit number.
port[IN] Physical or logical port to query or set information on.
ability_mask[OUT]
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_XXXOperation failed, the return value local_ability_mask is undefined.
void opennsl_port_ability_t_init ( opennsl_port_ability_t ability)

Initialize a Port Ability structure.

Description
Initializes a port abilities structure to default values. This function should be used to initialize any Port Ability structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_port_ability_t structure, and opennsl_port_ability_t_init will initialize the new members to correct default values.
Parameters
ability[IN,OUT]
Return values
None.
int opennsl_port_advert_get ( int  unit,
opennsl_port_t  port,
opennsl_port_abil_t ability_mask 
)
Parameters
unit[IN] Unit number.
port[IN]
ability_mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_port_advert_remote_get ( int  unit,
opennsl_port_t  port,
opennsl_port_abil_t ability_mask 
)
Parameters
unit[IN] Unit number.
port[IN]
ability_mask[OUT]
Return values
OPENNSL_E_xxx
int opennsl_port_advert_set ( int  unit,
opennsl_port_t  port,
opennsl_port_abil_t  ability_mask 
)
Parameters
unit[IN] Unit number.
port[IN]
ability_mask[IN]
Return values
OPENNSL_E_xxx
int opennsl_port_autoneg_get ( int  unit,
opennsl_port_t  port,
int *  autoneg 
)

Configure or retrieve the current auto-negotiation settings for a port, or restart auto-negotiation if already enabled.

Description
Enable, disable, or recover the current auto-negotiation state for a port. If auto-negotiation is already enabled, re-enabling it will restart auto-negotiation. Before enabling auto-negotiation, the desired advertised modes must be configured using =opennsl_port_ability_advert_set .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
autoneg[OUT] 0 for disable, 1 for enabled
Return values
OPENNSL_E_NONEOperation performed. If retrieving current auto-negotiation mode, autoneg is set to the current state.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation fail, if retrieving current operating mode, autoneg is undefined.
int opennsl_port_autoneg_set ( int  unit,
opennsl_port_t  port,
int  autoneg 
)

Configure or retrieve the current auto-negotiation settings for a port, or restart auto-negotiation if already enabled.

Description
Enable, disable, or recover the current auto-negotiation state for a port. If auto-negotiation is already enabled, re-enabling it will restart auto-negotiation. Before enabling auto-negotiation, the desired advertised modes must be configured using =opennsl_port_ability_advert_set .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
autoneg[IN] 0 for disable, 1 for enabled
Return values
OPENNSL_E_NONEOperation performed. If retrieving current auto-negotiation mode, autoneg is set to the current state.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation fail, if retrieving current operating mode, autoneg is undefined.
int opennsl_port_cfi_color_get ( int  unit,
opennsl_port_t  port,
int  cfi,
opennsl_color_t color 
)

Set or retrieve color assignment for a given port and Canonical Format Indicator (CFI).

Description
Assign or examine the color with which packets are marked when they arrive on the given port with the specified Canonical Format Indicator (CFI) in the VLAN control index.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
cfi[IN] VLAN Canonical Format Indicator (CFI)
color[OUT] One of the OPENNSL color selections: opennslColorGreen, opennslColorYellow, opennslColorRed, opennslColorDropFirst, opennslColorPreserve
Return values
OPENNSL_E_UNAVAILNot supported.
OPENNSL_E_XXX
int opennsl_port_cfi_color_set ( int  unit,
opennsl_port_t  port,
int  cfi,
opennsl_color_t  color 
)

Set or retrieve color assignment for a given port and Canonical Format Indicator (CFI).

Description
Assign or examine the color with which packets are marked when they arrive on the given port with the specified Canonical Format Indicator (CFI) in the VLAN control index.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
cfi[IN] VLAN Canonical Format Indicator (CFI)
color[IN] One of the OPENNSL color selections: opennslColorGreen, opennslColorYellow, opennslColorRed, opennslColorDropFirst, opennslColorPreserve
Return values
OPENNSL_E_UNAVAILNot supported.
OPENNSL_E_XXX

Referenced by qos_pcp_map_create().

int opennsl_port_class_get ( int  unit,
opennsl_port_t  port,
opennsl_port_class_t  pclass,
uint32 class_id 
)

Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing.

Description
Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing. The class types are shown in opennsl_port_class_t:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
pclass[IN]
class_id[OUT] (for _set) Device Class ID.
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred
int opennsl_port_class_set ( int  unit,
opennsl_port_t  port,
opennsl_port_class_t  pclass,
uint32  class_id 
)

Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing.

Description
Set or get port classification ID to aggregate a group of ports for further processing such as VLAN translation and field processing. The class types are shown in opennsl_port_class_t:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
pclass[IN]
class_id[IN] (for _set) Device Class ID.
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred

Referenced by initial_qos_service_init().

int opennsl_port_clear ( int  unit)

Initialize the port subsystem without affecting the current state of stack ports.

Description
Clear the current port subsystem state for the specified device, without changing the state of stack link ports. This function used in conjunction with the corresponding opennsl_xxx_clear APIs in other modules can be used to re-initialize a unit without causing a link status change on known stack ports. This API can be used in conjunction with the Broadcom Stacking software to reset a unit into a known state after it has joined an existing stack.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_port_config_get ( int  unit,
opennsl_port_config_t config 
)

Retrieved the port configuration for the specified device.

Description
opennsl_port_config_get returns all known ports configured on the specified device. The logical information indicates port bit maps to represent the ports on the specified unit (see the Broadcom Network Switching Stacking Guide for a description of logical port lists). =OPENNSL_PORT_CONFIG_t describes the meaning of each field.
Parameters
unit[IN] Unit number.
config[OUT] Pointer to port configuration structure populated on successful return.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX

Referenced by example_max_port_count_get(), example_policer_test(), example_port_default_config(), example_switch_default_vlan_config(), and main().

void opennsl_port_config_t_init ( opennsl_port_config_t pconfig)

Initialize a Port Configuration structure.

Description
Initializes a port configuration structure to default values. This function should be used to initialize any Port Configuration structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_port_config_t structure, and opennsl_port_config_t_init will initialize the new members to correct default values.
Parameters
pconfig[IN,OUT] Pointer to Port Configuration structure to initialize.
Return values
None.

Referenced by example_port_default_config().

int opennsl_port_control_get ( int  unit,
opennsl_port_t  port,
opennsl_port_control_t  type,
int *  value 
)

Get or set various features at the port level.

Description
Control or examine various features at the port level. opennsl_port_control_set can be used to enable/disable various features at the port level. The <type> parameter to the API identifies the feature to be controlled. opennsl_port_control_get returns the current value of the port feature identified by <type> parameter. The feature types are show in =PORT_CONTROL_v :.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
type[IN] Port feature enumerator
value[OUT] Value of the bit field in port table
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred
int opennsl_port_control_set ( int  unit,
opennsl_port_t  port,
opennsl_port_control_t  type,
int  value 
)

Get or set various features at the port level.

Description
Control or examine various features at the port level. opennsl_port_control_set can be used to enable/disable various features at the port level. The <type> parameter to the API identifies the feature to be controlled. opennsl_port_control_get returns the current value of the port feature identified by <type> parameter. The feature types are show in =PORT_CONTROL_v :.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
type[IN] Port feature enumerator
value[IN] Value of the bit field in port table
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred

Referenced by main().

int opennsl_port_detach ( int  unit,
opennsl_pbmp_t  pbmp,
opennsl_pbmp_t detached 
)

Detach ports from the OPENNSL API.

Description
Detach a port from the port subsystem, configuring it such that the link state and other configuration routines behave as if the link is permanently down. This routine may be used to allow hot swapping of external PHY devices. If the external PHY is being swapped, the port must be detached to ensure OPENNSL API operations that query or change port state operate properly. When a new external PHY is installed, the port must be probed using =opennsl_port_probe to query the device and install the correct internal drivers for the device. It is the responsibility of the application to make the necessary changes to all other configuration settings such as VLANS, multicast groups, and trunk configuration. For portmod supported devices, such as Tomahawk2, Trident2+, Apache, Firebolt, Maverick, and and these variants, a port needs to be removed from linkscan if linkscan is enabled on the port before detaching it (opennsl_port_detach). .
Parameters
unit[IN] Unit number.
pbmp[IN] Port bit map of ports to be detached
detached[OUT] Port bit map of ports successfully detached.
Return values
OPENNSL_E_OKPort successfully detached.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXPort detach failed, considered a catastrophic error.
int opennsl_port_dscp_map_get ( int  unit,
opennsl_port_t  port,
int  srccp,
int *  mapcp,
int *  prio 
)

Control mapping of Differentiated Services Code Points (DSCP).

Description
Incoming IPv4 format packets have Differentiated Services Code Points in their type of service (ToS) header field. DSCP values are small integers from 0 to 63. Some switch devices have the capability of rewriting incoming code points into other mapped code points for use within the switching domain. Some switch devices also have the capability of setting the internal priority and drop precedence based on the source DSCP. The allowable values for the input parameters may be limited by the device's underlying hardware capabilities. switch family?and switch familySwitch switches allow a limited number of DSCP mapping possibilities: for these devices srccp can be -1 or 0 only. These devices do not perform DSCP-based priority mapping. The network switch family of switches use the OPENNSL_PRIO_RED(DP=3), OPENNSL_PRIO_YELLOW(DP=2), OPENNSL_PRIO_GREEN(DP=1), OPENNSL_PRIO_PRESERVE / OPENNSL_PRIO_DROP_LAST(DP=0) ored with prio to configure the drop precedence (DP) value. For network switch B0 family that supports ECN mapping, OPENNSL_DSCP_ECN can be ored with srccp to the designated {DSCP(7:2):ECN(1:0)}. A port value of -1 or gport type for system configuration will configure all ports. On devices network switch and network switch, before flexport operation, port dscp map set must be cleared on the port to be flexed.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number or -1 to setup global mapping table.
srccp[IN] Source code point. -1 indicates operation applies to all code points if being configured or a random code point if being retrieved.
mapcp[OUT] The new code point to map srccp to if setting the mapping; the currently configured mapping for the port if retrieving settings.
prio[OUT] Priority of packets mapped for the code point, if available. Priority is 0 to 7 and can have the value (OPENNSL_PRIO_RED/OPENNSL_PRIO_YELLOW/OPENNSL_PRIO_GREEN/OPENNSL_PRIO_PRESERVE) ored in. -1 on get means priority mapping is unavailable.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMSource or mapped code point values are invalid.
OPENNSL_E_UNAVAILOperation not supported on underlying device, or mapping resources depleted.
OPENNSL_E_XXXOperation failed.
int opennsl_port_dscp_map_mode_get ( int  unit,
opennsl_port_t  port,
int *  mode 
)

Control mapping of Differentiated Services Code Points (DSCP).

Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
mode[OUT] DSCP map mode.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMInvalid mapping mode
OPENNSL_E_UNAVAILOperation not supported on underlying device
OPENNSL_E_XXXOperation failed.
int opennsl_port_dscp_map_mode_set ( int  unit,
opennsl_port_t  port,
int  mode 
)

Control mapping of Differentiated Services Code Points (DSCP).

Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
mode[IN] DSCP map mode.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMInvalid mapping mode
OPENNSL_E_UNAVAILOperation not supported on underlying device
OPENNSL_E_XXXOperation failed.

Referenced by qos_pcp_map_create().

int opennsl_port_dscp_map_set ( int  unit,
opennsl_port_t  port,
int  srccp,
int  mapcp,
int  prio 
)

Control mapping of Differentiated Services Code Points (DSCP).

Description
Incoming IPv4 format packets have Differentiated Services Code Points in their type of service (ToS) header field. DSCP values are small integers from 0 to 63. Some switch devices have the capability of rewriting incoming code points into other mapped code points for use within the switching domain. Some switch devices also have the capability of setting the internal priority and drop precedence based on the source DSCP. The allowable values for the input parameters may be limited by the device's underlying hardware capabilities. switch family?and switch familySwitch switches allow a limited number of DSCP mapping possibilities: for these devices srccp can be -1 or 0 only. These devices do not perform DSCP-based priority mapping. The network switch family of switches use the OPENNSL_PRIO_RED(DP=3), OPENNSL_PRIO_YELLOW(DP=2), OPENNSL_PRIO_GREEN(DP=1), OPENNSL_PRIO_PRESERVE / OPENNSL_PRIO_DROP_LAST(DP=0) ored with prio to configure the drop precedence (DP) value. For network switch B0 family that supports ECN mapping, OPENNSL_DSCP_ECN can be ored with srccp to the designated {DSCP(7:2):ECN(1:0)}. A port value of -1 or gport type for system configuration will configure all ports. On devices network switch and network switch, before flexport operation, port dscp map set must be cleared on the port to be flexed.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number or -1 to setup global mapping table.
srccp[IN] Source code point. -1 indicates operation applies to all code points if being configured or a random code point if being retrieved.
mapcp[IN] The new code point to map srccp to if setting the mapping; the currently configured mapping for the port if retrieving settings.
prio[IN] Priority of packets mapped for the code point, if available. Priority is 0 to 7 and can have the value (OPENNSL_PRIO_RED/OPENNSL_PRIO_YELLOW/OPENNSL_PRIO_GREEN/OPENNSL_PRIO_PRESERVE) ored in. -1 on get means priority mapping is unavailable.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMSource or mapped code point values are invalid.
OPENNSL_E_UNAVAILOperation not supported on underlying device, or mapping resources depleted.
OPENNSL_E_XXXOperation failed.
int opennsl_port_dtag_mode_get ( int  unit,
opennsl_port_t  port,
int *  mode 
)

Set or retrieve the current double tagging mode for a port.

Description
Configuring double tagging requires the caller configure the TPID inserted using =opennsl_port_tpid_set . Depending on the underlying device, double tagging may be enabled on a per port basis or only on a system wide basis. If a specific port is requested and double tagging is only supported on a device basis, then this call will affect all ports. Valid values for double tagging mode are defined in table.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
mode[OUT] Double tag mode as defined in table =OPENNSL_PORT_DTAG_MODE_table
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILRequested double tagging mode is not support on the device.
OPENNSL_E_XXXOperation failed, if retrieving the current operating mode, the value of the parameter mode is undefined.
int opennsl_port_dtag_mode_set ( int  unit,
opennsl_port_t  port,
int  mode 
)

Set or retrieve the current double tagging mode for a port.

Description
Configuring double tagging requires the caller configure the TPID inserted using =opennsl_port_tpid_set . Depending on the underlying device, double tagging may be enabled on a per port basis or only on a system wide basis. If a specific port is requested and double tagging is only supported on a device basis, then this call will affect all ports. Valid values for double tagging mode are defined in table.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
mode[IN] Double tag mode as defined in table =OPENNSL_PORT_DTAG_MODE_table
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILRequested double tagging mode is not support on the device.
OPENNSL_E_XXXOperation failed, if retrieving the current operating mode, the value of the parameter mode is undefined.
int opennsl_port_duplex_get ( int  unit,
opennsl_port_t  port,
int *  duplex 
)

Get or set the current duplex mode of a port.

Description
Set or get the duplex of the specified port. opennsl_port_duplex_set disables auto-negotiation if it is enabled. When setting duplicity, if an error is returned the PHY and the MAC may not be properly set for operation. For correct operation following an error, a valid duplex and speed must be set. When retrieving the current duplicity of a port, if auto-negotiation is enabled the current negotiated duplicity is returned. If auto-negotiation is in progress or there is no link, duplex is returned as OPENNSL_PORT_DUPLEX_HALF. If auto-negotiation is disabled, the forced speed of the port is returned regardless of the link state.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
duplex[OUT] Returned or requested duplex setting, must be one of OPENNSL_PORT_DUPLEX_HALF or OPENNSL_PORT_DUPLEX_FULL.
Return values
OPENNSL_E_NONEPort duplex retrieved or configured as requested.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_UNAVAILThe specified port does not support the requested mode.
OPENNSL_E_XXXRequest failed, if configuring duplex mode the port state is undefined. If retrieving the current operating mode, the returned duplex value is undefined.
int opennsl_port_duplex_set ( int  unit,
opennsl_port_t  port,
int  duplex 
)

Get or set the current duplex mode of a port.

Description
Set or get the duplex of the specified port. opennsl_port_duplex_set disables auto-negotiation if it is enabled. When setting duplicity, if an error is returned the PHY and the MAC may not be properly set for operation. For correct operation following an error, a valid duplex and speed must be set. When retrieving the current duplicity of a port, if auto-negotiation is enabled the current negotiated duplicity is returned. If auto-negotiation is in progress or there is no link, duplex is returned as OPENNSL_PORT_DUPLEX_HALF. If auto-negotiation is disabled, the forced speed of the port is returned regardless of the link state.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
duplex[IN] Returned or requested duplex setting, must be one of OPENNSL_PORT_DUPLEX_HALF or OPENNSL_PORT_DUPLEX_FULL.
Return values
OPENNSL_E_NONEPort duplex retrieved or configured as requested.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_UNAVAILThe specified port does not support the requested mode.
OPENNSL_E_XXXRequest failed, if configuring duplex mode the port state is undefined. If retrieving the current operating mode, the returned duplex value is undefined.
int opennsl_port_egress_get ( int  unit,
opennsl_port_t  port,
int  modid,
opennsl_pbmp_t pbmp 
)

Configure ports to block or allow packets from a given ingress port.

Description
This API controls the ability of a specific ingress port on a specific module to send packets to a local egress port. The specified modid is derived from the modid of port. For opennsl_port_egress_set, if port is -1 or gport type for system configuration, the configuration is applied to all source ports on the specified module.
Parameters
unit[IN] Unit number.
port[IN] Device or logical source port number.
modid[IN] Module ID of the source port.
pbmp[OUT] Port bitmap indicating all local ports allowed to egress traffic from specified port/modid.
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_UNAVAILThe specified port does not support the requested block option.
OPENNSL_E_PARAMInvalid port, module ID or bitmap.
OPENNSL_E_XXXOperation failed.
int opennsl_port_egress_set ( int  unit,
opennsl_port_t  port,
int  modid,
opennsl_pbmp_t  pbmp 
)

Configure ports to block or allow packets from a given ingress port.

Description
This API controls the ability of a specific ingress port on a specific module to send packets to a local egress port. The specified modid is derived from the modid of port. For opennsl_port_egress_set, if port is -1 or gport type for system configuration, the configuration is applied to all source ports on the specified module.
Parameters
unit[IN] Unit number.
port[IN] Device or logical source port number.
modid[IN] Module ID of the source port.
pbmp[IN] Port bitmap indicating all local ports allowed to egress traffic from specified port/modid.
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_UNAVAILThe specified port does not support the requested block option.
OPENNSL_E_PARAMInvalid port, module ID or bitmap.
OPENNSL_E_XXXOperation failed.
int opennsl_port_enable_get ( int  unit,
opennsl_port_t  port,
int *  enable 
)

Enable or disable a port.

Description
Controls whether a port is enabled or disabled for transmission and reception of packets. The chip should not be configured so as to switch any packets to a disabled port because the packets may build up in the MMU.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
enable[OUT] Boolean value indicating enable (1) or disable (0).
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_XXXOperation failed, if retrieving the current enabled state, the value of the parameter enable is undefined.
int opennsl_port_enable_set ( int  unit,
opennsl_port_t  port,
int  enable 
)

Enable or disable a port.

Description
Controls whether a port is enabled or disabled for transmission and reception of packets. The chip should not be configured so as to switch any packets to a disabled port because the packets may build up in the MMU.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
enable[IN] Boolean value indicating enable (1) or disable (0).
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_XXXOperation failed, if retrieving the current enabled state, the value of the parameter enable is undefined.
int opennsl_port_flood_block_get ( int  unit,
opennsl_port_t  ingress_port,
opennsl_port_t  egress_port,
uint32 flags 
)

Selectively block flooding traffic.

Description
Selectively block VLAN flooding traffic ingressing on ingress_port from egressing on egress_port. The types of flooding traffic that can be selectively blocked are described in table.
Parameters
unit[IN] Unit number.
ingress_port[IN] Device or logical port number of the ingress port
egress_port[IN] Device or logical port number of the egress port
flags[OUT]
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on specified device
OPENNSL_E_PARAMingress_port and egress_port are not on the same device
OPENNSL_E_PORTOperation not supported on the specified ingress_port, or egress_port is invalid
OPENNSL_E_XXXOperation failed
int opennsl_port_flood_block_set ( int  unit,
opennsl_port_t  ingress_port,
opennsl_port_t  egress_port,
uint32  flags 
)

Selectively block flooding traffic.

Description
Selectively block VLAN flooding traffic ingressing on ingress_port from egressing on egress_port. The types of flooding traffic that can be selectively blocked are described in table.
Parameters
unit[IN] Unit number.
ingress_port[IN] Device or logical port number of the ingress port
egress_port[IN] Device or logical port number of the egress port
flags[IN]
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on specified device
OPENNSL_E_PARAMingress_port and egress_port are not on the same device
OPENNSL_E_PORTOperation not supported on the specified ingress_port, or egress_port is invalid
OPENNSL_E_XXXOperation failed
int opennsl_port_frame_max_get ( int  unit,
opennsl_port_t  port,
int *  size 
)

Set or retrieve the current maximum packet size permitted on a port.

Description
Set or retrieve the current maximum frame size for the specified port. The frame size may be different for ports supporting multiple speeds. For this reason, whenever the speed of a port changes the frame size should be set to the desired length. This API can be used to enable jumbo frames on a port by setting the frame size to a jumbo value. When setting the frame size on a port, it is the callers responsibility to take into account any additional tags or CRC that may be added by the switch device. For example, when configuring HiGig ports or stacking ports on some devices, a HiGig header or stack tag may be added to the packets. For front-panel ports (that is, non-stacking or HiGig ports), setting the maximum frame size to X indicates packets of length X
  • 4 are permitted.
Parameters
unit[IN] Unit number.
port[IN] Port to set or retrieve maximum frame size on
size[OUT] The frame size to set (or current frame size returned) in bytes.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, current frame size for port is undefined.
int opennsl_port_frame_max_set ( int  unit,
opennsl_port_t  port,
int  size 
)

Set or retrieve the current maximum packet size permitted on a port.

Description
Set or retrieve the current maximum frame size for the specified port. The frame size may be different for ports supporting multiple speeds. For this reason, whenever the speed of a port changes the frame size should be set to the desired length. This API can be used to enable jumbo frames on a port by setting the frame size to a jumbo value. When setting the frame size on a port, it is the callers responsibility to take into account any additional tags or CRC that may be added by the switch device. For example, when configuring HiGig ports or stacking ports on some devices, a HiGig header or stack tag may be added to the packets. For front-panel ports (that is, non-stacking or HiGig ports), setting the maximum frame size to X indicates packets of length X
  • 4 are permitted.
Parameters
unit[IN] Unit number.
port[IN] Port to set or retrieve maximum frame size on
size[IN] The frame size to set (or current frame size returned) in bytes.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, current frame size for port is undefined.
int opennsl_port_gport_get ( int  unit,
opennsl_port_t  port,
opennsl_gport_t gport 
)

Get the GPORT ID for the specified local port number.

Description
This API can be used to get the GPORT ID corresponding to a local port number. The supplied port number should return FALSE on a OPENNSL_GPORT_IS_SET(port) test. The GPORT ID returned in this API is a MODPORT type. Therefore this call will fail on devices without a module ID.
Parameters
unit[IN] Unit number.
port[IN] Port number
gport[OUT] GPORT ID
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number
OPENNSL_E_PARAMInvalid Parameter
OPENNSL_E_XXXError occurred

Referenced by main().

int opennsl_port_ifilter_set ( int  unit,
opennsl_port_t  port,
int  mode 
)

Set or retrieve current behavior of tagged packets arriving on a port not a member of the specified VLAN.

Description
If ingress filtering is enabled, this drops all packets arriving on a port with a VLAN tag identifying a VLAN of which the port is not a member. If disabled, packets will not be dropped if the port is not a member of the VLAN specified in the packet. It may however be dropped for other reasons such as spanning tree state, or head of line blocking. This function is superseded by =opennsl_port_vlan_member_get . Valid settings for mode are described in table =OPENNSL_PORT_IFILTER_MODE_table .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
mode[IN] Port filtering mode
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on underlying device
OPENNSL_E_XXXOperation failed, if retrieving current ingress filtering mode, the parameter mode is undefined.
void opennsl_port_info_t_init ( opennsl_port_info_t info)

Initializes the opennsl_port_info_t structure.

Description
Initializes the opennsl_port_info_t structure.
Parameters
info[IN,OUT] Pointer to port information structure (see =PORT_INFORMATION_CONTROL).
Returns
Nothing

Referenced by example_port_default_config().

int opennsl_port_init ( int  unit)

Initialize the port subsystem.

Description
In initializes the port API subsystem. Initialization includes probing the types of ports on the unit, as well as any external phys. Internally PHY drivers are attached for the known found devices. The initial configuration of the port and PHY state can be controlled through driver run-time configuration properties (see opennsl_port_settings_init). All port specific operating modes are placed in a known good state. Port initialization performs the following actions, but not all actions are supported on all chips:.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_xxx
int opennsl_port_interface_get ( int  unit,
opennsl_port_t  port,
opennsl_port_if_t intf 
)

Configure the physical interface between the MAC and the PHY for the specified port.

Description
Provides ability to change the physical interface used between the MAC in the switch device and the PHY. Under normal conditions this setting will be configured during port initialization and should not change. This function is provided for diagnostic purposes only. For information on initial physical interface settings, see.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
intf[OUT] Interface to configure or retrieved interface setting.
Return values
OPENNSL_E_NONEOperation performed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_UNAVAILRequested interface is not available on the specified port.
OPENNSL_E_XXXOperation failed, if retrieving current operating mode result value in intf is undefined.
int opennsl_port_interface_set ( int  unit,
opennsl_port_t  port,
opennsl_port_if_t  intf 
)

Configure the physical interface between the MAC and the PHY for the specified port.

Description
Provides ability to change the physical interface used between the MAC in the switch device and the PHY. Under normal conditions this setting will be configured during port initialization and should not change. This function is provided for diagnostic purposes only. For information on initial physical interface settings, see.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
intf[IN] Interface to configure or retrieved interface setting.
Return values
OPENNSL_E_NONEOperation performed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_UNAVAILRequested interface is not available on the specified port.
OPENNSL_E_XXXOperation failed, if retrieving current operating mode result value in intf is undefined.
int opennsl_port_l3_mtu_get ( int  unit,
opennsl_port_t  port,
int *  size 
)

Set or retrieve the current maximum L3 packet size permitted on a port.

Description
Set or retrieve the current maximum egress L3 frame size for the specified port. When setting the frame size on a port, it is the callers responsibility to take into account any additional tags or CRC that may be added by the switch device. For front-panel ports (that is, non-stacking or HiGig ports), setting the maximum egress L3 frame size to X indicates untagged packets of length X are permitted, while tagged packets of X + 4 bytes are permitted.
Parameters
unit[IN] Unit number.
port[IN] Port to set or retrieve maximum L3 frame size on
size[OUT] the frame size to set (or current frame size returned) in bytes.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, current egress L3 frame size for port is undefined.
int opennsl_port_l3_mtu_set ( int  unit,
opennsl_port_t  port,
int  size 
)

Set or retrieve the current maximum L3 packet size permitted on a port.

Description
Set or retrieve the current maximum egress L3 frame size for the specified port. When setting the frame size on a port, it is the callers responsibility to take into account any additional tags or CRC that may be added by the switch device. For front-panel ports (that is, non-stacking or HiGig ports), setting the maximum egress L3 frame size to X indicates untagged packets of length X are permitted, while tagged packets of X + 4 bytes are permitted.
Parameters
unit[IN] Unit number.
port[IN] Port to set or retrieve maximum L3 frame size on
size[IN] the frame size to set (or current frame size returned) in bytes.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, current egress L3 frame size for port is undefined.
int opennsl_port_learn_get ( int  unit,
opennsl_port_t  port,
uint32 flags 
)

Control the hardware and software learning support on a port.

Description
The learning mode configures what set of actions are taken by the device when an unknown source address is recognized on an ingressing packet. Each of the learning options can be configured independently, however the underlying switch device may not support all combinations. The possible learning modes are described in =OPENNSL_PORT_LEARN_table . opennsl_port_learn_set and opennsl_port_learn_get get and set the current learning mode based on the flags parameter. opennsl_port_learn_modify allows learning options to be removed and or added based on the add and remove parameters.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
flags[OUT] Learning flags as defined in table =OPENNSL_PORT_LEARN_table
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_UNAVAILRequested learning configuration not supported on device, the learning mode of the port is unchanged.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, port state undefined on set or modify, returned flags value undefined if retrieving status.
int opennsl_port_learn_set ( int  unit,
opennsl_port_t  port,
uint32  flags 
)

Control the hardware and software learning support on a port.

Description
The learning mode configures what set of actions are taken by the device when an unknown source address is recognized on an ingressing packet. Each of the learning options can be configured independently, however the underlying switch device may not support all combinations. The possible learning modes are described in =OPENNSL_PORT_LEARN_table . opennsl_port_learn_set and opennsl_port_learn_get get and set the current learning mode based on the flags parameter. opennsl_port_learn_modify allows learning options to be removed and or added based on the add and remove parameters.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
flags[IN] Learning flags as defined in table =OPENNSL_PORT_LEARN_table
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_UNAVAILRequested learning configuration not supported on device, the learning mode of the port is unchanged.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, port state undefined on set or modify, returned flags value undefined if retrieving status.
int opennsl_port_link_failed_clear ( int  unit,
opennsl_port_t  port 
)

Clear failed link status from a port which has undergone LAG failover.

Description
This function clears the OPENNSL_PORT_LINK_STATUS_FAILED state from a port which has transitioned into LAG failover. The port is moved to the OPENNSL_PORT_LINK_STATUS_DOWN state. The application is responsible for removing the port from trunk membership before calling this function. Linkscan (see =linkscan) must be running to use LAG failover.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
Return values
OPENNSL_E_NONEThe failed state of the port is cleared.
OPENNSL_E_INITLinkscan module not initialized
OPENNSL_E_PORTThe port is not valid, not in failed state, or still in the trunk.
int opennsl_port_link_status_get ( int  unit,
opennsl_port_t  port,
int *  status 
)

Retrieve the current link status of a port.

Description
This call returns the link status of the port. With linkscan running (see =linkscan ), the current link status is retrieved from the linkscan task. This is the normal mode of operation, as link status in the PHY registers is latched low. If multiple sources (threads) read the physical link status in the PHY register, the linkscan task and/or applications can miss a link down event. If linkscan is not running, the current link status is retrieved from the PHY directly. The possible values of status are:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number.
status[OUT] One of OPENNSL_PORT_LINK_STATUS_*.
Return values
OPENNSL_E_NONECurrent link state is returned in status
OPENNSL_E_INITPort module not initialized
OPENNSL_E_XXXError condition reported from lower layers of software. In the event of an error code other than OPENNSL_E_NONE, the up parameter is undefined on return.
int opennsl_port_linkscan_get ( int  unit,
opennsl_port_t  port,
int *  linkscan 
)

Get or set the current linkscan mode for the specified port.

Description
Link scanning is performed by the linkscan task ( =linkscan). For the OPENNSL interface, these functions are equivalent to functions =opennsl_linkscan_mode_set and =opennsl_linkscan_mode_set .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
linkscan[OUT] Linkscan mode, see table =OPENNSL_LINKSCAN_MODE_e
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMInvalid linkscan mode specified
OPENNSL_E_UNAVAILRequested operating mode is not supported.
OPENNSL_E_XXXOperation failed.
int opennsl_port_linkscan_set ( int  unit,
opennsl_port_t  port,
int  linkscan 
)

Get or set the current linkscan mode for the specified port.

Description
Link scanning is performed by the linkscan task ( =linkscan). For the OPENNSL interface, these functions are equivalent to functions =opennsl_linkscan_mode_set and =opennsl_linkscan_mode_set .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
linkscan[IN] Linkscan mode, see table =OPENNSL_LINKSCAN_MODE_e
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_PARAMInvalid linkscan mode specified
OPENNSL_E_UNAVAILRequested operating mode is not supported.
OPENNSL_E_XXXOperation failed.
int opennsl_port_local_get ( int  unit,
opennsl_gport_t  gport,
opennsl_port_t local_port 
)

Get local port number encoded within a GPORT ID.

Description
This API can be used to get a local port number encoded into a GPORT ID. This resulting port number will return FALSE on a OPENNSL_GPORT_IS_SET(port) test. To encode the result as a local port gport ID, use OPENNSL_GPORT_LOCAL_SET(gport_local, local_port); If the encoding of GPORT ID does not contain a local port on a device, this API will return an error. GPORT ID may be encoded as both MODPORT and DEVPORT.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID
local_port[OUT] Local port number
Return values
OPENNSL_E_NONESuccess
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_XXXError occurred

Referenced by main().

int opennsl_port_loopback_get ( int  unit,
opennsl_port_t  port,
int *  loopback 
)

Set or retrieve the current loopback mode of a port.

Description
Depending on the capabilities of a port, the port may be configured to operate in MAC loopback, PHY loopback or no loopback. No loopback is the normal operating mode for a device. The external configuration of a port may not support PHY loopback in some cases. To verify a port can support the desired loopback mode, the API call.
Parameters
unit[IN] Unit number.
port[IN] Port for which the loopback mode is being set or retrieved
loopback[OUT] Specifies the loopback mode; see table =OPENNSL_PORT_LB_m for values
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized
OPENNSL_E_XXXOperation failed, if retrieving current loopback states the contents of the parameter loopback are undefined.
int opennsl_port_loopback_set ( int  unit,
opennsl_port_t  port,
int  loopback 
)

Set or retrieve the current loopback mode of a port.

Description
Depending on the capabilities of a port, the port may be configured to operate in MAC loopback, PHY loopback or no loopback. No loopback is the normal operating mode for a device. The external configuration of a port may not support PHY loopback in some cases. To verify a port can support the desired loopback mode, the API call.
Parameters
unit[IN] Unit number.
port[IN] Port for which the loopback mode is being set or retrieved
loopback[IN] Specifies the loopback mode; see table =OPENNSL_PORT_LB_m for values
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized
OPENNSL_E_XXXOperation failed, if retrieving current loopback states the contents of the parameter loopback are undefined.

Referenced by example_policer_test().

char* opennsl_port_name ( int  unit,
int  port 
)
Parameters
unit[IN] Unit number.
port[IN]
Return values
OPENNSL_E_xxx
int opennsl_port_pause_addr_get ( int  unit,
opennsl_port_t  port,
opennsl_mac_t  mac 
)

Get or set the source MAC address transmitted in MAC control pause frames.

Description
MAC control pause frames are transmitted with a well known destination address (01:80:c2:00:00:01) that is not controllable. However, the source address can be set and retrieved using the opennsl_port_pause_addr_xxx calls. On switch initialization, the application software should set the pause frame source address for all ports. These values are persistent across calls that enable or disable the transmission of pause frames and need only be set once. Only MAC control pause frames generated by the MACs in the switch device will contain the specified source address. The CPU is able to generate MAC control packets with any source address that will be transmitted unchanged.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number.
mac[OUT] MAC address to transmit as the source address in MAC control pause frames.
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, if retrieving the previously set values the returned MAC address is undefined.
int opennsl_port_pause_addr_set ( int  unit,
opennsl_port_t  port,
opennsl_mac_t  mac 
)

Get or set the source MAC address transmitted in MAC control pause frames.

Description
MAC control pause frames are transmitted with a well known destination address (01:80:c2:00:00:01) that is not controllable. However, the source address can be set and retrieved using the opennsl_port_pause_addr_xxx calls. On switch initialization, the application software should set the pause frame source address for all ports. These values are persistent across calls that enable or disable the transmission of pause frames and need only be set once. Only MAC control pause frames generated by the MACs in the switch device will contain the specified source address. The CPU is able to generate MAC control packets with any source address that will be transmitted unchanged.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number.
mac[IN] MAC address to transmit as the source address in MAC control pause frames.
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, if retrieving the previously set values the returned MAC address is undefined.
int opennsl_port_pause_get ( int  unit,
opennsl_port_t  port,
int *  pause_tx,
int *  pause_rx 
)

Enable or disable transmission of pause frames and honoring received pause frames on a port.

Description
Depending on the port type, transmissions of pause frames and honoring received pause frames may be configured independently. If configuring independently (also known as asymmetric flow control) pause_tx and pause_rx need not be the same value. The API call =opennsl_port_ability_get can be used to determine if asymmetric pause is supported. Symmetric flow control, where both transmission of pause frames and honoring them on reception can be enable or disable by passing 1 or 0 for both pause_tx and pause_rx, respectively. Generally asymmetric flow control is used to limit data flow from end stations toward the device, however if the underlying hardware supports it, opennsl_port_pause_set will allow configuring the device for asymmetric flow control in either direction. The current settings of pause-based flow control can be determined using opennsl_port_pause_get. Configuration of asymmetric flow control may also be accomplished using the API call =opennsl_port_pause_sym_set . Code samples demonstrating two methods to configure the same flow control settings can be found in the description of =opennsl_port_pause_sym_set .
Parameters
unit[IN] Unit number.
port[IN] Device port or logical port number
pause_tx[OUT] 0 to disable transmission of pauseframes, 1 to enable.
pause_rx[OUT] 0 to ignore received pause frames, 1 to honor received pause frames.
Return values
OPENNSL_E_NONEOperation performed successfully.
OPENNSL_E_INITPort module not initialized ( must be called).
OPENNSL_E_XXXOperation failed, if retrieving current pause settings, pause_tx and pause_rx are undefined.
int opennsl_port_pause_set ( int  unit,
opennsl_port_t  port,
int  pause_tx,
int  pause_rx 
)

Enable or disable transmission of pause frames and honoring received pause frames on a port.

Description
Depending on the port type, transmissions of pause frames and honoring received pause frames may be configured independently. If configuring independently (also known as asymmetric flow control) pause_tx and pause_rx need not be the same value. The API call =opennsl_port_ability_get can be used to determine if asymmetric pause is supported. Symmetric flow control, where both transmission of pause frames and honoring them on reception can be enable or disable by passing 1 or 0 for both pause_tx and pause_rx, respectively. Generally asymmetric flow control is used to limit data flow from end stations toward the device, however if the underlying hardware supports it, opennsl_port_pause_set will allow configuring the device for asymmetric flow control in either direction. The current settings of pause-based flow control can be determined using opennsl_port_pause_get. Configuration of asymmetric flow control may also be accomplished using the API call =opennsl_port_pause_sym_set . Code samples demonstrating two methods to configure the same flow control settings can be found in the description of =opennsl_port_pause_sym_set .
Parameters
unit[IN] Unit number.
port[IN] Device port or logical port number
pause_tx[IN] 0 to disable transmission of pauseframes, 1 to enable.
pause_rx[IN] 0 to ignore received pause frames, 1 to honor received pause frames.
Return values
OPENNSL_E_NONEOperation performed successfully.
OPENNSL_E_INITPort module not initialized ( must be called).
OPENNSL_E_XXXOperation failed, if retrieving current pause settings, pause_tx and pause_rx are undefined.
int opennsl_port_pause_sym_get ( int  unit,
opennsl_port_t  port,
int *  pause 
)

Configure or retrieve asymmetric pause setting for a port.

Description
For complete description, see.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
pause[OUT] Requested or current pause settings, one of OPENNSL_PORT_PAUSE_SYM for symmetric pause, OPENNSL_PORT_PAUSE_ASYM_RX for asymmetric pause to honor received MAC control pause frames but not transmit, OPENNSL_PORT_PAUSE_ASYM_TX to ignore received pause frames but transmit, and OPENNSL_PORT_PAUSE_NONE to neither honor or transmit pause frames.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, if retrieving current mode the returned pause value is undefined.
int opennsl_port_pause_sym_set ( int  unit,
opennsl_port_t  port,
int  pause 
)

Configure or retrieve asymmetric pause setting for a port.

Description
For complete description, see.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
pause[IN] Requested or current pause settings, one of OPENNSL_PORT_PAUSE_SYM for symmetric pause, OPENNSL_PORT_PAUSE_ASYM_RX for asymmetric pause to honor received MAC control pause frames but not transmit, OPENNSL_PORT_PAUSE_ASYM_TX to ignore received pause frames but transmit, and OPENNSL_PORT_PAUSE_NONE to neither honor or transmit pause frames.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_XXXOperation failed, if retrieving current mode the returned pause value is undefined.
int opennsl_port_phy_control_get ( int  unit,
opennsl_port_t  port,
opennsl_port_phy_control_t  type,
uint32 value 
)

Set/Get PHY specific configurations.

Description
Set or get PHY specific configurations. All configurations enumerated in opennsl_port_phy_control_t may not be available on a PHY. The configuration types shown in =PORT_PHY_v .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
type[IN] Type of configuration to update
value[OUT] (for _set) Value of the configuration
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred
int opennsl_port_phy_control_set ( int  unit,
opennsl_port_t  port,
opennsl_port_phy_control_t  type,
uint32  value 
)

Set/Get PHY specific configurations.

Description
Set or get PHY specific configurations. All configurations enumerated in opennsl_port_phy_control_t may not be available on a PHY. The configuration types shown in =PORT_PHY_v .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
type[IN] Type of configuration to update
value[IN] (for _set) Value of the configuration
Return values
OPENNSL_E_NONENo Error
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_PORTInvalid Port number specified
OPENNSL_E_XXXError occurred
int opennsl_port_phy_modify ( int  unit,
opennsl_port_t  port,
uint32  flags,
uint32  phy_reg_addr,
uint32  phy_data,
uint32  phy_mask 
)

Read or write PHY registers associated with a port.

Description
Most PHY-related operations are performed automatically by the API to satisfy requests. When direct access to the PHY registers are required for diagnostic purposes or special configuration these functions can be used. Use of these routines may interfere with the normal operation of the API, extreme care must be taken when manipulating PHYs. Normal configuration of speed, duplicity, and auto-negotiation must be performed using the normal opennsl_port APIs. It allows to select the lane in the PHY register access through gport lane selection.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
flags[IN] Flags indicating how to access the PHY, and which PHY if the port has an internal serdes. See =OPENNSL_PORT_PHY_flags for details.
phy_reg_addr[IN] Register address in the PHY
phy_data[IN] Data to be written or data read
phy_mask[IN] Mask write data when modifying register
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILRequested operation not supported
OPENNSL_E_XXXOperation failed
int opennsl_port_priority_color_get ( int  unit,
opennsl_port_t  port,
int  prio,
opennsl_color_t color 
)

Set or retrieve color assignment for a given port and priority.

Description
Assign or examine the color with which packets are marked when they arrive on the given port with the specified priority in the VLAN control index. The network switch family of switches assign the color to configure the drop precedence (DP) value.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
prio[IN] VLAN priority (aka 802.1p CoS)
color[OUT] One of the OPENNSL color selections: opennslColorGreen, opennslColorYellow, opennslColorRed, opennslColorDropFirst, opennslColorPreserve
Return values
OPENNSL_E_UNAVAILNot supported.
OPENNSL_E_XXX
int opennsl_port_priority_color_set ( int  unit,
opennsl_port_t  port,
int  prio,
opennsl_color_t  color 
)

Set or retrieve color assignment for a given port and priority.

Description
Assign or examine the color with which packets are marked when they arrive on the given port with the specified priority in the VLAN control index. The network switch family of switches assign the color to configure the drop precedence (DP) value.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
prio[IN] VLAN priority (aka 802.1p CoS)
color[IN] One of the OPENNSL color selections: opennslColorGreen, opennslColorYellow, opennslColorRed, opennslColorDropFirst, opennslColorPreserve
Return values
OPENNSL_E_UNAVAILNot supported.
OPENNSL_E_XXX

Referenced by qos_pcp_map_create().

int opennsl_port_priority_group_config_get ( int  unit,
opennsl_gport_t  gport,
int  priority_group,
opennsl_port_priority_group_config_t prigrp_config 
)

Set/get the port priority group configuration.

Description
Set/get the port Priority Group configuration. The structure opennsl_port_priority_group_config_t is used to describte the attributes of a Priority Group.
Parameters
unit[IN] Unit number.
gport[IN] generic port
priority_group[IN] priority group id
prigrp_config[OUT] structure describes port priority group configuration
Return values
OPENNSL_E_NONESuccess
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_XXXError occurred
int opennsl_port_priority_group_config_set ( int  unit,
opennsl_gport_t  gport,
int  priority_group,
opennsl_port_priority_group_config_t prigrp_config 
)

Set/get the port priority group configuration.

Description
Set/get the port Priority Group configuration. The structure opennsl_port_priority_group_config_t is used to describte the attributes of a Priority Group.
Parameters
unit[IN] Unit number.
gport[IN] generic port
priority_group[IN] priority group id
prigrp_config[IN] structure describes port priority group configuration
Return values
OPENNSL_E_NONESuccess
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_XXXError occurred
void opennsl_port_priority_group_config_t_init ( opennsl_port_priority_group_config_t prigrp_config)

Initialize a port priority group configuration struct.

Description
Initializes a Priority Group configuration structure to default values. This function should be used to initialize any Priority Group configuration structure prior to filling it out and passing it to an API function.
Parameters
prigrp_config[IN,OUT] Pointer to the priority group configuration object struct.
Return values
None.
int opennsl_port_priority_group_mapping_get ( int  unit,
opennsl_gport_t  gport,
int  prio,
int *  priority_group 
)

Assign/retrieve the Priority Group mapped to the input priority.

Description
Assign/retrieve the Priority Group mapped to the input priority.
Parameters
unit[IN] Unit number.
gport[IN] generic port
prio[IN] input priority
priority_group[OUT] priority group ID that the input priority mapped to
Return values
OPENNSL_E_NONESuccess
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_XXXError occurred
int opennsl_port_priority_group_mapping_set ( int  unit,
opennsl_gport_t  gport,
int  prio,
int  priority_group 
)

Assign/retrieve the Priority Group mapped to the input priority.

Description
Assign/retrieve the Priority Group mapped to the input priority.
Parameters
unit[IN] Unit number.
gport[IN] generic port
prio[IN] input priority
priority_group[IN] priority group ID that the input priority mapped to
Return values
OPENNSL_E_NONESuccess
OPENNSL_E_UNAVAILFeature unavailable
OPENNSL_E_XXXError occurred
int opennsl_port_probe ( int  unit,
opennsl_pbmp_t  pbmp,
opennsl_pbmp_t okay_pbmp 
)

Probe the port to determine the proper MAC and PHY drivers.

Description
Under normal conditions this routine should not be called. =opennsl_port_init performs this function during initialization. When used in conjunction with =opennsl_port_detach, systems that supports adding and removing external PHY devices must use this routine to probe and attached newly added PHYs. On successful probe, the port subsystem installs internal drivers for the PHYs allowing the rest of the configuration to be completed using the opennsl_port_xxx APIs. Calls made to the OPENNSL API on ports that have not been successfully probed are undefined and may have catastrophic results. All port state is undefined after an attach, and should be explicitly programmed.
Parameters
unit[IN] Unit number.
pbmp[IN] Port bit map indicating the ports to probe
okay_pbmp[OUT] Return value indicating the ports successfully probed
Return values
OPENNSL_E_NONEAll ports successfully probed. The value okay_pbmp contains a map of ports that may be enabled.
OPENNSL_E_INITThe Port module not initialized. See .
OPENNSL_E_XXXFailed to probe ports, the contents of okay_pbmp are undefined.
int opennsl_port_queued_count_get ( int  unit,
opennsl_port_t  port,
uint32 count 
)

Get the current count of cells or packets queued on a port for transmission.

Description
Returns a count that is either the number of internal device cells (device specific) or the number of packets queued for egress on the specified port. In general, the count returned should only be considered as 0 (indicating there are no packets queued on the port) or >0 (indicating some packets are queued on the port).
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number.
count[OUT] Returned count of cells or packets queued for egress on the specified port.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_BADIDInvalid port number specified
OPENNSL_E_UNAVILOperation not supported on the specified port.
int opennsl_port_sample_rate_get ( int  unit,
opennsl_port_t  port,
int *  ingress_rate,
int *  egress_rate 
)

Control the sampling of packets ingressing or egressing a port.

Description
The Packet Sampling APIs are building blocks that can be used to implement the sFlow specification (RFC 3176). switch family?III chips can select a random sampling of ingressing or egressing packets and send them to the CPU for profiling purposes. There are also three related switch control parameters to support the implementation of sFlow; see =opennsl_switch_control_set and.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
ingress_rate[OUT] Every 1/ingress_rate ingressing packets will be sampled; 0 indicates no sampling while 1 indicates sampling all packets
egress_rate[OUT] Every 1/egress_rate egressing packets will be sampled; 0 indicates no sampling while 1 indicates sampling all packets
Return values
OPENNSL_E_UNAVAILFeature not supported by hardware
OPENNSL_E_XXXOther error

Referenced by main().

int opennsl_port_sample_rate_set ( int  unit,
opennsl_port_t  port,
int  ingress_rate,
int  egress_rate 
)

Control the sampling of packets ingressing or egressing a port.

Description
The Packet Sampling APIs are building blocks that can be used to implement the sFlow specification (RFC 3176). switch family?III chips can select a random sampling of ingressing or egressing packets and send them to the CPU for profiling purposes. There are also three related switch control parameters to support the implementation of sFlow; see =opennsl_switch_control_set and.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
ingress_rate[IN] Every 1/ingress_rate ingressing packets will be sampled; 0 indicates no sampling while 1 indicates sampling all packets
egress_rate[IN] Every 1/egress_rate egressing packets will be sampled; 0 indicates no sampling while 1 indicates sampling all packets
Return values
OPENNSL_E_UNAVAILFeature not supported by hardware
OPENNSL_E_XXXOther error

Referenced by main().

int opennsl_port_selective_get ( int  unit,
opennsl_port_t  port,
opennsl_port_info_t info 
)

Get or set multiple port characteristics.

Description
opennsl_port_info_get and opennsl_port_info_set get and set all valid settings for the specific device and port in question. For these calls the action_mask field of the opennsl_port_info_t structure is ignored on entry, but defined to contain the valid action mask bits on return. For all set operations, if both auto-negotiation is enabled and the speed or duplex are forced to a specific setting, the result is undefined. opennsl_port_selective_get and opennsl_port_selective_set operate similar to opennsl_port_info_get and opennsl_port_info_set with the exception that action_mask is used to determine which attributes to set or retrieve. opennsl_port_info_save and opennsl_port_info_restore provide a mechanism to save all valid port state and restore it later. The info parameter to opennsl_port_info_save must be passed unaltered to opennsl_port_info_restore to restore the previous port state. Any changes to the info structure results in undefined behavior. In the case of setting or restoring port configuration, if the API call returns an error the port state is undefined. Other than as is required for proper functionality, the order is which the configuration options are applied is undefined. Similarly when retrieving options, if an error is returned the entire contents of the info structure are undefined. For example, all three implementations of the function sample_port_speed_get below perform the same function.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
info[IN,OUT] Pointer to port information structure (see =PORT_INFORMATION_CONTROL).
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_XXXOperation failed, if retrieving information the contents of info are undefined. If setting configuration, the state of the port is undefined.
int opennsl_port_selective_set ( int  unit,
opennsl_port_t  port,
opennsl_port_info_t info 
)

Get or set multiple port characteristics.

Description
opennsl_port_info_get and opennsl_port_info_set get and set all valid settings for the specific device and port in question. For these calls the action_mask field of the opennsl_port_info_t structure is ignored on entry, but defined to contain the valid action mask bits on return. For all set operations, if both auto-negotiation is enabled and the speed or duplex are forced to a specific setting, the result is undefined. opennsl_port_selective_get and opennsl_port_selective_set operate similar to opennsl_port_info_get and opennsl_port_info_set with the exception that action_mask is used to determine which attributes to set or retrieve. opennsl_port_info_save and opennsl_port_info_restore provide a mechanism to save all valid port state and restore it later. The info parameter to opennsl_port_info_save must be passed unaltered to opennsl_port_info_restore to restore the previous port state. Any changes to the info structure results in undefined behavior. In the case of setting or restoring port configuration, if the API call returns an error the port state is undefined. Other than as is required for proper functionality, the order is which the configuration options are applied is undefined. Similarly when retrieving options, if an error is returned the entire contents of the info structure are undefined. For example, all three implementations of the function sample_port_speed_get below perform the same function.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
info[IN] Pointer to port information structure (see =PORT_INFORMATION_CONTROL).
Return values
OPENNSL_E_NONEOperation completed successfully.
OPENNSL_E_XXXOperation failed, if retrieving information the contents of info are undefined. If setting configuration, the state of the port is undefined.

Referenced by example_port_default_config().

int opennsl_port_speed_get ( int  unit,
opennsl_port_t  port,
int *  speed 
)

Get or set the current operating speed of a port.

Description
Set or get the speed of the specified port. opennsl_port_speed_set disables auto-negotiation if it is enabled. When setting a speed, if an error is returned the PHY and the MAC may not be properly set for operation. On 5656x, 5676x, 5686x and 5697x class of chips, setting a speed on a port that is not supported by the port block (because of the PLL parameters) may result in a failure during reconfiguration. There are also other restrictions in the chip for these class of chips (E.g., different ports within a port block cannot have different speeds when the port block is configured in oversub calendar) which can cause reconfiguring the port to fail. All the limitations/restrictions of the chip and port block will be documented in the data sheet for the respective chips. A value of 0 indicates, set max speed. For correct operation following an error, a valid speed must be set. When retrieving the current speed of a port, if auto-negotiation is enabled the current negotiated speed is returned. If auto-negotiation is in progress or there is no link, speed returned is undefined. If auto-negotiation is disabled, the forced speed of the port is returned regardless of the link state. opennsl_port_speed_max returns the maximum possible operating speed of the port based on the attributes of the MAC and the PHY.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
speed[OUT] Speed specified in Mbps.
Return values
OPENNSL_E_NONESpeed set or retrieved as requested.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_CONFIGThe requested port speed is not supported. In some configurations the actual speed of the MAC is derived from the PHY directly and can not be forced to a specific value.
OPENNSL_E_XXXError occurred, if retrieving port speed, the returned speed is undefined. If setting speed, the operational state of the port is undefined.
int opennsl_port_speed_max ( int  unit,
opennsl_port_t  port,
int *  speed 
)

Get or set the current operating speed of a port.

Description
Set or get the speed of the specified port. opennsl_port_speed_set disables auto-negotiation if it is enabled. When setting a speed, if an error is returned the PHY and the MAC may not be properly set for operation. On 5656x, 5676x, 5686x and 5697x class of chips, setting a speed on a port that is not supported by the port block (because of the PLL parameters) may result in a failure during reconfiguration. There are also other restrictions in the chip for these class of chips (E.g., different ports within a port block cannot have different speeds when the port block is configured in oversub calendar) which can cause reconfiguring the port to fail. All the limitations/restrictions of the chip and port block will be documented in the data sheet for the respective chips. A value of 0 indicates, set max speed. For correct operation following an error, a valid speed must be set. When retrieving the current speed of a port, if auto-negotiation is enabled the current negotiated speed is returned. If auto-negotiation is in progress or there is no link, speed returned is undefined. If auto-negotiation is disabled, the forced speed of the port is returned regardless of the link state. opennsl_port_speed_max returns the maximum possible operating speed of the port based on the attributes of the MAC and the PHY.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
speed[OUT] Speed specified in Mbps.
Return values
OPENNSL_E_NONESpeed set or retrieved as requested.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_CONFIGThe requested port speed is not supported. In some configurations the actual speed of the MAC is derived from the PHY directly and can not be forced to a specific value.
OPENNSL_E_XXXError occurred, if retrieving port speed, the returned speed is undefined. If setting speed, the operational state of the port is undefined.
int opennsl_port_speed_set ( int  unit,
opennsl_port_t  port,
int  speed 
)

Get or set the current operating speed of a port.

Description
Set or get the speed of the specified port. opennsl_port_speed_set disables auto-negotiation if it is enabled. When setting a speed, if an error is returned the PHY and the MAC may not be properly set for operation. On 5656x, 5676x, 5686x and 5697x class of chips, setting a speed on a port that is not supported by the port block (because of the PLL parameters) may result in a failure during reconfiguration. There are also other restrictions in the chip for these class of chips (E.g., different ports within a port block cannot have different speeds when the port block is configured in oversub calendar) which can cause reconfiguring the port to fail. All the limitations/restrictions of the chip and port block will be documented in the data sheet for the respective chips. A value of 0 indicates, set max speed. For correct operation following an error, a valid speed must be set. When retrieving the current speed of a port, if auto-negotiation is enabled the current negotiated speed is returned. If auto-negotiation is in progress or there is no link, speed returned is undefined. If auto-negotiation is disabled, the forced speed of the port is returned regardless of the link state. opennsl_port_speed_max returns the maximum possible operating speed of the port based on the attributes of the MAC and the PHY.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
speed[IN] Speed specified in Mbps.
Return values
OPENNSL_E_NONESpeed set or retrieved as requested.
OPENNSL_E_INITPort module not initialized, see .
OPENNSL_E_CONFIGThe requested port speed is not supported. In some configurations the actual speed of the MAC is derived from the PHY directly and can not be forced to a specific value.
OPENNSL_E_XXXError occurred, if retrieving port speed, the returned speed is undefined. If setting speed, the operational state of the port is undefined.
int opennsl_port_stat_enable_set ( int  unit,
opennsl_gport_t  port,
int  enable 
)

Enable/disable packet and byte counters for the selected gport.

Description
This API will initialize statistic collection for the given GPORT (enable=TRUE) or release the HW resources used for the tracking the statistics (enable=FALSE).
Parameters
unit[IN] Unit number.
port[IN] GPORT ID
enable[IN] Non-zero to enable counter collection, zero to disable.
Return values
OPENNSL_E_XXX
int opennsl_port_stp_get ( int  unit,
opennsl_port_t  port,
int *  state 
)

Set the spanning tree state for a port (single instance spanning tree only).

Description
Used only if there is a single instance of spanning tree running, these functions get and set the spanning tree state for a port. These routines do not interoperate with the multiple spanning tree support defined in =stg . The application must use either opennsl_port_stp_set and opennsl_port_spt_get or the multiple spanning tree support routines exclusively. No check is made for using both methods simultaneously and the results are undefined. On many switch devices, no distinction is made between the BLOCKING and LISTENING states. For this reason OPENNSL_STG_STP_BLOCK and OPENNSL_STG_STP_LISTEN should be considered equivalent when calling these APIs. For example, setting a port in BLOCKING state using:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
state[OUT] Spanning tree state, for valid values see =OPENNSL_STG_STP_e .
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on underlying device. This occurs on fabric devices.
OPENNSL_E_XXXOperation failed.
int opennsl_port_stp_set ( int  unit,
opennsl_port_t  port,
int  state 
)

Set the spanning tree state for a port (single instance spanning tree only).

Description
Used only if there is a single instance of spanning tree running, these functions get and set the spanning tree state for a port. These routines do not interoperate with the multiple spanning tree support defined in =stg . The application must use either opennsl_port_stp_set and opennsl_port_spt_get or the multiple spanning tree support routines exclusively. No check is made for using both methods simultaneously and the results are undefined. On many switch devices, no distinction is made between the BLOCKING and LISTENING states. For this reason OPENNSL_STG_STP_BLOCK and OPENNSL_STG_STP_LISTEN should be considered equivalent when calling these APIs. For example, setting a port in BLOCKING state using:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
state[IN] Spanning tree state, for valid values see =OPENNSL_STG_STP_e .
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on underlying device. This occurs on fabric devices.
OPENNSL_E_XXXOperation failed.
int opennsl_port_subsidiary_ports_get ( int  unit,
opennsl_port_t  port,
opennsl_pbmp_t pbmp 
)

Get the list of ancillary/flex ports belonging to the same port block as the controlling port.

Description
Given a controlling port, this API returns the set of ancillary/flex ports belonging to the group (port block) that can be created by performing Flex-IO operation on the controlling port using API opennsl_port_control_set(unit, port, opennslPortControlLanes, lanes). If the input port is not a controlling port, OPENNSL_E_PORT error will be returned.
Parameters
unit[IN] Unit number.
port[IN] Controlling port
pbmp[OUT] List of subsidiary ports in the same block as the controlling port
Return values
OPENNSL_E_XXX
int opennsl_port_untagged_priority_get ( int  unit,
opennsl_port_t  port,
int *  priority 
)

Get or set the default priority for packets that ingress untagged.

Description
All packets that ingress a port untagged are treated as if they were tagged with the value specified by opennsl_port_untagged_priority_set. This priority is used regardless of any ARL entry match.
Parameters
unit[IN] Unit number.
port[IN] Device port number or logical device
priority[OUT] Priority to assign to packets that ingress the port untagged. A negative value here has special meaning to certain SoC devices.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILThe specified port cannot have an untagged priority.
OPENNSL_E_PARAMInvalid port or priority.
OPENNSL_E_XXXOperation failed
int opennsl_port_untagged_priority_set ( int  unit,
opennsl_port_t  port,
int  priority 
)

Get or set the default priority for packets that ingress untagged.

Description
All packets that ingress a port untagged are treated as if they were tagged with the value specified by opennsl_port_untagged_priority_set. This priority is used regardless of any ARL entry match.
Parameters
unit[IN] Unit number.
port[IN] Device port number or logical device
priority[IN] Priority to assign to packets that ingress the port untagged. A negative value here has special meaning to certain SoC devices.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILThe specified port cannot have an untagged priority.
OPENNSL_E_PARAMInvalid port or priority.
OPENNSL_E_XXXOperation failed
int opennsl_port_untagged_vlan_get ( int  unit,
opennsl_port_t  port,
opennsl_vlan_t vid_ptr 
)

Get or set the default VLAN for packets that ingress untagged.

Description
All packets that ingress a port untagged are treated as if they were tagged with the value specified by opennsl_port_untagged_vlan_set. All ports are initially configured with the untagged VLAN set to the default VLAN (or VLAN 1). If the packet egresses on a port that is configured as a tagged port, the VLAN ID in the egressing packet is set to this value. If the (port,vid) resolves to a VLAN gport, untagged packets will be sent to the to the VLAN port, and not the default VLAN. Similarly, if (port,vid) resolves to a MPLS gport, untagged packets will be sent to the MPLS port and not to the default VLAN. In either case, the value does not affect the egress behavior of packets. To affect egress behavior of a VLAN gport, a GPORT ID is passed as the port parameter. The vid is used as the untagged vid on ingress into a PEP. Specifically, when an STAG only packet arrives on a provider port, and egresses a customer port, the given vid is added to the untagged packet on egress. These APIs can also be used for WLAN gports. They will set/get the default VLAN for untagged packets coming in from a WLAN source port.
Parameters
unit[IN] Unit number.
port[IN] Device port number or logical device
vid_ptr[OUT] Pointer to location to store current default VLAN ID.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILThe specified port cannot have an untagged VLAN.
OPENNSL_E_PARAMInvalid port or VLAN ID.
OPENNSL_E_XXXOperation failed
int opennsl_port_untagged_vlan_set ( int  unit,
opennsl_port_t  port,
opennsl_vlan_t  vid 
)

Get or set the default VLAN for packets that ingress untagged.

Description
All packets that ingress a port untagged are treated as if they were tagged with the value specified by opennsl_port_untagged_vlan_set. All ports are initially configured with the untagged VLAN set to the default VLAN (or VLAN 1). If the packet egresses on a port that is configured as a tagged port, the VLAN ID in the egressing packet is set to this value. If the (port,vid) resolves to a VLAN gport, untagged packets will be sent to the to the VLAN port, and not the default VLAN. Similarly, if (port,vid) resolves to a MPLS gport, untagged packets will be sent to the MPLS port and not to the default VLAN. In either case, the value does not affect the egress behavior of packets. To affect egress behavior of a VLAN gport, a GPORT ID is passed as the port parameter. The vid is used as the untagged vid on ingress into a PEP. Specifically, when an STAG only packet arrives on a provider port, and egresses a customer port, the given vid is added to the untagged packet on egress. These APIs can also be used for WLAN gports. They will set/get the default VLAN for untagged packets coming in from a WLAN source port.
Parameters
unit[IN] Unit number.
port[IN] Device port number or logical device
vid[IN] VLAN ID used for packets that ingress the port untagged.
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILThe specified port cannot have an untagged VLAN.
OPENNSL_E_PARAMInvalid port or VLAN ID.
OPENNSL_E_XXXOperation failed

Referenced by example_switch_default_vlan_config().

int opennsl_port_vlan_member_get ( int  unit,
opennsl_port_t  port,
uint32 flags 
)

Set or retrieve current behavior of tagged packets arriving/leaving on a port not a member of the specified VLAN.

Description
Ingress/egress filtering, if enabled, drops all packets arriving/leaving on a port with a VLAN tag identifying a VLAN of which the port is not a member. If disabled, packets will not be dropped if the port is not a member of the VLAN specified in the packet. It may however be dropped for other reasons such as spanning tree state, head of line blocking etc. For switch family?III, ingress filtering is also applied. Virtual Port(VP) will be assigned to a VP group or removed from a VP group through this API when filtering is enabled or disabled if flag OPENNSL_PORT_VLAN_MEMBER_VP_VLAN_MEMBERSHIP is not set. So if user uses un-managed VP group mechanism, API =opennsl_port_control_set() with opennslPortControlVlanVpGroupEgress/opennslPortControlVlanVpGroupIngress type should be called before =opennsl_port_vlan_member_set(). And if user use managed VP group mechanism, =opennsl_port_vlan_member_set should be called before API =opennsl_vlan_gport_add . Please refer to the DESCRIPTION of =opennsl_vlan_gport_add for more detail about VP group . OPENNSL_PORT_VLAN_MEMBER_VP_DO_NOT_CHECK is used with OPENNSL_PORT_VLAN_MEMBER_INGRESS/OPENNSL_PORT_VLAN_MEMBER_EGRESS for L2 tunnel cases. When the flag is set, VLAN filtering is performed on VLAN and phisical port, instead of on VFI and VP. This function supersedes =opennsl_port_ifilter_get . Valid settings for flags are described in =OPENNSL_PORT_VLAN_MEMBER_FLAGS_table .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
flags[OUT] Flags to indicate port filtering mode
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on underlying device
OPENNSL_E_XXXOperation failed.
int opennsl_port_vlan_member_set ( int  unit,
opennsl_port_t  port,
uint32  flags 
)

Set or retrieve current behavior of tagged packets arriving/leaving on a port not a member of the specified VLAN.

Description
Ingress/egress filtering, if enabled, drops all packets arriving/leaving on a port with a VLAN tag identifying a VLAN of which the port is not a member. If disabled, packets will not be dropped if the port is not a member of the VLAN specified in the packet. It may however be dropped for other reasons such as spanning tree state, head of line blocking etc. For switch family?III, ingress filtering is also applied. Virtual Port(VP) will be assigned to a VP group or removed from a VP group through this API when filtering is enabled or disabled if flag OPENNSL_PORT_VLAN_MEMBER_VP_VLAN_MEMBERSHIP is not set. So if user uses un-managed VP group mechanism, API =opennsl_port_control_set() with opennslPortControlVlanVpGroupEgress/opennslPortControlVlanVpGroupIngress type should be called before =opennsl_port_vlan_member_set(). And if user use managed VP group mechanism, =opennsl_port_vlan_member_set should be called before API =opennsl_vlan_gport_add . Please refer to the DESCRIPTION of =opennsl_vlan_gport_add for more detail about VP group . OPENNSL_PORT_VLAN_MEMBER_VP_DO_NOT_CHECK is used with OPENNSL_PORT_VLAN_MEMBER_INGRESS/OPENNSL_PORT_VLAN_MEMBER_EGRESS for L2 tunnel cases. When the flag is set, VLAN filtering is performed on VLAN and phisical port, instead of on VFI and VP. This function supersedes =opennsl_port_ifilter_get . Valid settings for flags are described in =OPENNSL_PORT_VLAN_MEMBER_FLAGS_table .
Parameters
unit[IN] Unit number.
port[IN] Device or logical port number
flags[IN] Flags to indicate port filtering mode
Return values
OPENNSL_E_NONEOperation completed successfully
OPENNSL_E_UNAVAILOperation not supported on underlying device
OPENNSL_E_XXXOperation failed.
int opennsl_port_vlan_priority_map_get ( int  unit,
opennsl_port_t  port,
int  pkt_pri,
int  cfi,
int *  internal_pri,
opennsl_color_t color 
)
Parameters
unit[IN] Unit number.
port[IN]
pkt_pri[IN]
cfi[IN]
internal_pri[OUT]
color[OUT]
Return values
OPENNSL_E_xxx
int opennsl_port_vlan_priority_map_set ( int  unit,
opennsl_port_t  port,
int  pkt_pri,
int  cfi,
int  internal_pri,
opennsl_color_t  color 
)
Parameters
unit[IN] Unit number.
port[IN]
pkt_pri[IN]
cfi[IN]
internal_pri[IN]
color[IN]
Return values
OPENNSL_E_xxx

Referenced by example_create_policy(), and qos_pcp_map_create().