PDK API Guide for J721E
CPSW MAC Port API

Introduction

Data Structures

struct  CpswMacPort_Interface
 MAC port interface. More...
 
struct  CpswMacPort_SgmiiConfig
 SGMII configuration for MAC port. More...
 
struct  CpswMacPort_Config
 MAC port configuration. More...
 
struct  CpswMacPort_GenericInArgs
 Generic input args. More...
 
struct  CpswMacPort_PortStatus
 Port status. More...
 
struct  CpswMacPort_FifoStats
 FIFO related statistics of a MAC port. More...
 
struct  CpswMacPort_LinkConfig
 Link speed and duplexity configuration. More...
 
struct  CpswMacPort_SetTxPriorityInArgs
 Input args for CPSW_MACPORT_IOCTL_SET_TX_PRIORITY command. More...
 
struct  CpswMacPort_SetRxPriorityInArgs
 Input args for CPSW_MACPORT_IOCTL_SET_RX_PRIORITY command. More...
 
struct  CpswMacPort_SetRxDscpPriorityInArgs
 Input args for CPSW_MACPORT_IOCTL_SET_RX_DSCP_PRIORITY command. More...
 
struct  CpswMacPort_SetTrafficShapingInArgs
 Input args for CPSW_MACPORT_IOCTL_SET_TRAFFIC_SHAPING command. More...
 
struct  CpswMacPort_SetTxBlocksRemInArgs
 Input args for CPSW_MACPORT_IOCTL_SET_TX_BLOCKS_REM command. More...
 
struct  CpswMacPort_InterVlanRoutingParams
 Port interVLAN configuration info. More...
 
struct  CpswMacPort_TxShortGapConfig
 Configuration of transmit short inter packet gap feature. More...
 
struct  CpswMacPort_PortTxShortGapConfig
 Set transmit short inter packet gap feature input Args. More...
 
struct  CpswMacPort_IpTsConfig
 Port IP configuration for time synchronization events. More...
 
struct  CpswMacPort_TsEventConfig
 Port Configuration for Time Synchronization. More...
 
struct  CpswMacPort_EnableTsEventInArgs
 Enable Port Time Sync Event IOCTL inArgs. More...
 
struct  CpswPort_VlanConfig
 VLAN configuration parameters. More...
 
struct  CpswPort_TrafficShapingRates
 Traffic shaping parameters (committed and excess rates) More...
 
struct  CpswPort_TrafficShapingConfig
 Traffic shaping configuration for all priorities. More...
 
struct  CpswPort_TxPriority
 TX priority (header packet priority to switch priority) More...
 
struct  CpswPort_RxPriority
 RX priority (packet priority to header packet priority) More...
 
struct  CpswPort_DscpPriority
 DSCP priority. More...
 

Typedefs

typedef struct CpswMacPort_Obj_s * CpswMacPort_Handle
 MAC port submodule handle. More...
 

Enumerations

enum  CpswMacPort_Ioctls_e {
  CPSW_MACPORT_IOCTL_GET_STATUS = CPSW_MACPORT_PUBLIC_IOCTL(0U), CPSW_MACPORT_IOCTL_GET_FIFO_STATS = CPSW_MACPORT_PUBLIC_IOCTL(1U), CPSW_MACPORT_IOCTL_GET_LINK_CONFIG = CPSW_MACPORT_PUBLIC_IOCTL(2U), CPSW_MACPORT_IOCTL_IS_INBAND = CPSW_MACPORT_PUBLIC_IOCTL(3U),
  CPSW_MACPORT_IOCTL_SET_TX_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(4U), CPSW_MACPORT_IOCTL_GET_TX_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(5U), CPSW_MACPORT_IOCTL_SET_RX_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(6U), CPSW_MACPORT_IOCTL_GET_RX_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(7U),
  CPSW_MACPORT_IOCTL_SET_RX_DSCP_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(8U), CPSW_MACPORT_IOCTL_GET_RX_DSCP_PRIORITY = CPSW_MACPORT_PUBLIC_IOCTL(9U), CPSW_MACPORT_IOCTL_SET_TRAFFIC_SHAPING = CPSW_MACPORT_PUBLIC_IOCTL(10U), CPSW_MACPORT_IOCTL_GET_TRAFFIC_SHAPING = CPSW_MACPORT_PUBLIC_IOCTL(11U),
  CPSW_MACPORT_IOCTL_SET_TX_BLOCKS_REM = CPSW_MACPORT_PUBLIC_IOCTL(12U), CPSW_MACPORT_IOCTL_GET_TX_BLOCKS_REM = CPSW_MACPORT_PUBLIC_IOCTL(13U), CPSW_MACPORT_IOCTL_PRINT_REGS = CPSW_MACPORT_PUBLIC_IOCTL(14U), CPSW_MACPORT_IOCTL_GET_RX_MTU = CPSW_MACPORT_PUBLIC_IOCTL(15U),
  CPSW_MACPORT_IOCTL_ENABLE_CPTS_EVENT = CPSW_MACPORT_PUBLIC_IOCTL(16U), CPSW_MACPORT_IOCTL_DISABLE_CPTS_EVENT = CPSW_MACPORT_PUBLIC_IOCTL(17U)
}
 MAC port IOCTL commands. More...
 
enum  CpswMac_LayerType { CPSW_MAC_LAYER_MII = 1U, CPSW_MAC_LAYER_GMII = 0U, CPSW_MAC_LAYER_XGMII = 2U }
 MAC interface layer type. More...
 
enum  CpswMac_SublayerType {
  CPSW_MAC_SUBLAYER_STANDARD = 0U, CPSW_MAC_SUBLAYER_REDUCED = 1U, CPSW_MAC_SUBLAYER_SERIAL = 2U, CPSW_MAC_SUBLAYER_QUAD_SERIAL_MAIN = 3U,
  CPSW_MAC_SUBLAYER_QUAD_SERIAL_SUB = 4U
}
 MAC interface sublayer type. More...
 
enum  CpswMac_VariantType { CPSW_MAC_VARIANT_NONE = 0U, CPSW_MAC_VARIANT_FORCED = 1U }
 MAC interface variant (only for specific interface types) More...
 
enum  CpswMacPort_InterVLANRouteId {
  CPSW_MACPORT_INTERVLAN_ROUTEID_FIRST, CPSW_MACPORT_INTERVLAN_ROUTEID_1 = CPSW_MACPORT_INTERVLAN_ROUTEID_FIRST, CPSW_MACPORT_INTERVLAN_ROUTEID_2, CPSW_MACPORT_INTERVLAN_ROUTEID_3,
  CPSW_MACPORT_INTERVLAN_ROUTEID_4, CPSW_MACPORT_INTERVLAN_ROUTEID_LAST = CPSW_MACPORT_INTERVLAN_ROUTEID_4
}
 MAC port interVLAN route identifier. More...
 
enum  CpswMacPort_VlanType { CPSW_MACPORT_VLAN_TYPE_NONE = 0x00U, CPSW_MACPORT_VLAN_TYPE_SINGLE_TAG = 0x01U, CPSW_MACPORT_VLAN_TYPE_STACKED_TAGS = 0x02U }
 Enum of VLAN usage type for CPTS packets. More...
 
enum  CpswMac_SgmiiModeType {
  CPSW_MAC_SGMIIMODE_INVALID = 0U, CPSW_MAC_SGMIIMODE_FIBER_WITH_PHY = 1U, CPSW_MAC_SGMIIMODE_SGMII_WITH_PHY = 2U, CPSW_MAC_SGMIIMODE_SGMII_AUTONEG_MASTER = 3U,
  CPSW_MAC_SGMIIMODE_SGMII_AUTONEG_SLAVE = 4U, CPSW_MAC_SGMIIMODE_SGMII_FORCEDLINK = 5U
}
 SGMII mode type. More...
 
enum  CpswPort_HeaderPacketPriority {
  CPSW_HEADER_PACKET_PRIORITY_0 = 0U, CPSW_HEADER_PACKET_PRIORITY_1 = 1U, CPSW_HEADER_PACKET_PRIORITY_2 = 2U, CPSW_HEADER_PACKET_PRIORITY_3 = 3U,
  CPSW_HEADER_PACKET_PRIORITY_4 = 4U, CPSW_HEADER_PACKET_PRIORITY_5 = 5U, CPSW_HEADER_PACKET_PRIORITY_6 = 6U, CPSW_HEADER_PACKET_PRIORITY_7 = 7U,
  CPSW_HEADER_PACKET_PRIORITY_NUM = 8U
}
 Header Packet Priority. More...
 
enum  CpswPort_SwitchPriority {
  CPSW_SWITCH_PRIORITY_0 = 0U, CPSW_SWITCH_PRIORITY_1 = 1U, CPSW_SWITCH_PRIORITY_2 = 2U, CPSW_SWITCH_PRIORITY_3 = 3U,
  CPSW_SWITCH_PRIORITY_4 = 4U, CPSW_SWITCH_PRIORITY_5 = 5U, CPSW_SWITCH_PRIORITY_6 = 6U, CPSW_SWITCH_PRIORITY_7 = 7U,
  CPSW_SWITCH_PRIORITY_NUM = 8U
}
 Switch Priority. More...
 
enum  CpswPort_TxPriorityType { CPSW_TX_PRIORITY_TYPE_FIXED = 0U, CPSW_TX_PRIORITY_TYPE_ESCALATE = 1U }
 Port priority type. More...
 

Macros

#define CPSW_MACPORT_PUBLIC_IOCTL(x)   (CPSW_IOCTL_MACPORT_BASE | CPSW_IOCTL_MIN(x))
 Helper macro to create IOCTL commands for MAC port submodule. More...
 
#define CPSW_PACKET_PRIORITY_NUM   (8U)
 CPSW packet priority. More...
 

Macro Definition Documentation

#define CPSW_MACPORT_PUBLIC_IOCTL (   x)    (CPSW_IOCTL_MACPORT_BASE | CPSW_IOCTL_MIN(x))

Helper macro to create IOCTL commands for MAC port submodule.

#define CPSW_PACKET_PRIORITY_NUM   (8U)

CPSW packet priority.

Typedef Documentation

typedef struct CpswMacPort_Obj_s* CpswMacPort_Handle

MAC port submodule handle.

MAC port submodule opaque handle used to call any port related APIs on that given MAC port.

Enumeration Type Documentation

MAC port IOCTL commands.

Enumerator
CPSW_MACPORT_IOCTL_GET_STATUS 

Get MAC port status.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_FIFO_STATS 

Get MAC port FIFO statistics.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_LINK_CONFIG 

Get MAC link configuration (speed, duplexity)

IOCTL parameters:

CPSW_MACPORT_IOCTL_IS_INBAND 

Check if MAC port is in in-band mode.

IOCTL parameters:

CPSW_MACPORT_IOCTL_SET_TX_PRIORITY 

Set TX priority map (Header Packet Priority to Switch Priority)

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_TX_PRIORITY 

Get TX priority map (Header Packet Priority to Switch Priority)

IOCTL parameters:

CPSW_MACPORT_IOCTL_SET_RX_PRIORITY 

Set Rx priority map (Packet Priority to Header Packet Priority)

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_RX_PRIORITY 

Get Rx priority map (Packet Priority to Header Packet Priority)

IOCTL parameters:

CPSW_MACPORT_IOCTL_SET_RX_DSCP_PRIORITY 

Set RX DSCP priority (TOS) map.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_RX_DSCP_PRIORITY 

Get RX DSCP priority (TOS) map.

IOCTL parameters:

CPSW_MACPORT_IOCTL_SET_TRAFFIC_SHAPING 

Set traffic shaping configuration.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_TRAFFIC_SHAPING 

Set traffic shaping configuration.

IOCTL parameters:

CPSW_MACPORT_IOCTL_SET_TX_BLOCKS_REM 

Set the number of unused blocks remaining in TX FIFOs for rate limiting.

Sets the number of blocks in each of the MAC port TX FIFOs that must be unused for bulk traffic to be enabled.

This IOCTL should be used along with CPSW_HOSTPORT_IOCTL_SET_TRAFFIC_SHAPING for host port receive rate limiting.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_TX_BLOCKS_REM 

Get the number of unused blocks remaining in TX FIFOs for rate limiting.

Gets the number of blocks in each of the MAC port TX FIFOs that must be unused for bulk traffic to be enabled.

IOCTL parameters:

CPSW_MACPORT_IOCTL_PRINT_REGS 

Print MAC port registers.

IOCTL parameters:

CPSW_MACPORT_IOCTL_GET_RX_MTU 

Get Rx MTU.

IOCTL parameters:

CPSW_MACPORT_IOCTL_ENABLE_CPTS_EVENT 

Enable Ethernet Port CPTS Event.

IOCTL parameters:

CPSW_MACPORT_IOCTL_DISABLE_CPTS_EVENT 

Disable Ethernet Port CPTS Event.

IOCTL parameters:

MAC interface layer type.

Enumerator
CPSW_MAC_LAYER_MII 

Media-Independent Interface (MII) layer

CPSW_MAC_LAYER_GMII 

Gigabit Media-Independent Interface (GMII) layer

CPSW_MAC_LAYER_XGMII 

10-Gigabit Media-Independent Interface (XGMII) layer

MAC interface sublayer type.

Enumerator
CPSW_MAC_SUBLAYER_STANDARD 

Standard interface sublayer

CPSW_MAC_SUBLAYER_REDUCED 

Reduced interface sublayer

CPSW_MAC_SUBLAYER_SERIAL 

Serial interface sublayer

CPSW_MAC_SUBLAYER_QUAD_SERIAL_MAIN 

Quad-serial interface sublayer (main port)

CPSW_MAC_SUBLAYER_QUAD_SERIAL_SUB 

Quad-serial interface sublayer (sub port)

MAC interface variant (only for specific interface types)

Enumerator
CPSW_MAC_VARIANT_NONE 

No variant

CPSW_MAC_VARIANT_FORCED 

Forced mode (out of band)

MAC port interVLAN route identifier.

Enumerator
CPSW_MACPORT_INTERVLAN_ROUTEID_FIRST 

First interVLAN route Id

CPSW_MACPORT_INTERVLAN_ROUTEID_1 

InterVLAN route Id 1

CPSW_MACPORT_INTERVLAN_ROUTEID_2 

InterVLAN route Id 2

CPSW_MACPORT_INTERVLAN_ROUTEID_3 

InterVLAN route Id 3

CPSW_MACPORT_INTERVLAN_ROUTEID_4 

InterVLAN route Id 4

CPSW_MACPORT_INTERVLAN_ROUTEID_LAST 

Last interVLAN route Id

Enum of VLAN usage type for CPTS packets.

Enumerator
CPSW_MACPORT_VLAN_TYPE_NONE 

No VLAN tag

CPSW_MACPORT_VLAN_TYPE_SINGLE_TAG 

Single VLAN tag

CPSW_MACPORT_VLAN_TYPE_STACKED_TAGS 

Stacked VLAN tag

SGMII mode type.

Enumerator
CPSW_MAC_SGMIIMODE_INVALID 

Invalid mode. Set to when port is used in non Q/SGMII modes

CPSW_MAC_SGMIIMODE_FIBER_WITH_PHY 

SGMII in fiber mode with PHY connection

CPSW_MAC_SGMIIMODE_SGMII_WITH_PHY 

SGMII in SGMII mode with PHY connection

CPSW_MAC_SGMIIMODE_SGMII_AUTONEG_MASTER 

SGMII in MAC to MAC with auto-neg master mode

CPSW_MAC_SGMIIMODE_SGMII_AUTONEG_SLAVE 

SGMII in MAC to MAC with auto-neg slave mode

CPSW_MAC_SGMIIMODE_SGMII_FORCEDLINK 

SGMII in MAC to MAC with forced master mode

Header Packet Priority.

Enumerator
CPSW_HEADER_PACKET_PRIORITY_0 

Header Packet Priority 0

CPSW_HEADER_PACKET_PRIORITY_1 

Header Packet Priority 1

CPSW_HEADER_PACKET_PRIORITY_2 

Header Packet Priority 2

CPSW_HEADER_PACKET_PRIORITY_3 

Header Packet Priority 3

CPSW_HEADER_PACKET_PRIORITY_4 

Header Packet Priority 4

CPSW_HEADER_PACKET_PRIORITY_5 

Header Packet Priority 5

CPSW_HEADER_PACKET_PRIORITY_6 

Header Packet Priority 6

CPSW_HEADER_PACKET_PRIORITY_7 

Header Packet Priority 7

CPSW_HEADER_PACKET_PRIORITY_NUM 

Number of Header Packet Priority levels

Switch Priority.

Enumerator
CPSW_SWITCH_PRIORITY_0 
CPSW_SWITCH_PRIORITY_1 
CPSW_SWITCH_PRIORITY_2 
CPSW_SWITCH_PRIORITY_3 
CPSW_SWITCH_PRIORITY_4 
CPSW_SWITCH_PRIORITY_5 
CPSW_SWITCH_PRIORITY_6 
CPSW_SWITCH_PRIORITY_7 
CPSW_SWITCH_PRIORITY_NUM 

Port priority type.

Enumerator
CPSW_TX_PRIORITY_TYPE_FIXED 

Fixed priority

CPSW_TX_PRIORITY_TYPE_ESCALATE 

Escalate priority