AM64x MCU+ SDK  08.00.00
APIs for ICSS-EMAC

Introduction

ICSS-EMAC (Industrial Communications Sub-system Ethernet Media Access Controller) APIs to transmit and receive packets with a firmware based Ethernet switch that has been implemented on PRUICSS.

Data Structures

struct  ICSS_EMAC_FwStaticMmap
 ICSS EMAC Static Firmware Memory Map offsets. These are offsets for PRU0 and PRU1 DRAM memory. More...
 
struct  ICSS_EMAC_FwDynamicMmap
 ICSS EMAC Dynamic Firmware Memory Map offsets. More...
 
struct  ICSS_EMAC_FwVlanFilterParams
 ICSS EMAC VLAN Filtering Parameters. More...
 
struct  ICSS_EMAC_FwMulticastFilterParams
 ICSS EMAC Multicast Filtering Parameters. More...
 
struct  ICSS_EMAC_Attrs
 
struct  ICSS_EMAC_InternalObject
 Opaque ICSS EMAC driver object. More...
 
struct  ICSS_EMAC_Config
 Base EMAC handle containing pointers to all modules required for driver to work. More...
 
struct  ICSS_EMAC_CallBackConfig
 Generic callback configuration for protocol specific callbacks.
ICSS_EMAC_CallBack is the function prototype used. While calling this, first argument is always of type ICSS_EMAC_Handle, second argument is specific to the callback (see ICSS_EMAC_CallBackObject), and third argument is userArg as specified in this structure. More...
 
struct  ICSS_EMAC_CallBackObject
 Different callbacks which can be registered.
While calling the function set in ICSS_EMAC_CallBack, first argument is always of type ICSS_EMAC_Handle, second argument is specific to the callback (as mentioned in the member descriptions), and third argument is userArg as specified in ICSS_EMAC_CallBackConfig. More...
 
struct  ICSS_EMAC_Params
 ICSS_EMAC Parameters. More...
 
struct  ICSS_EMAC_RxArgument
 Rx packet processing information block that needs to passed into call to ICSS_EMAC_RxPktGet. More...
 
struct  ICSS_EMAC_TxArgument
 Tx packet processing information block that needs to passed into call to ICSS_EMAC_TxPacket. More...
 
struct  ICSS_EMAC_IoctlCmd
 IOCTL command members for configuring switch/EMAC. More...
 
struct  ICSS_EMAC_PruStatistics
 Statistics structure for capturing statistics on PRU. More...
 

Functions

void ICSS_EMAC_init (void)
 This function initializes the ICSS_EMAC module. More...
 
void ICSS_EMAC_deinit (void)
 This function de-initializes the ICSS_EMAC module. More...
 
void ICSS_EMAC_Params_init (ICSS_EMAC_Params *params)
 Initialize the parmeters data structure with defaults. More...
 
ICSS_EMAC_Handle ICSS_EMAC_open (uint32_t idx, const ICSS_EMAC_Params *params)
 API to initialize and configure ICSS in MAC/Switch Mode. More...
 
void ICSS_EMAC_close (ICSS_EMAC_Handle icssEmacHandle)
 API to stop MAC/Switch Mode. More...
 
int32_t ICSS_EMAC_ioctl (ICSS_EMAC_Handle icssEmacHandle, uint32_t ioctlCommand, uint8_t portNo, void *ioctlParams)
 IOCTL Function for ICSS EMAC. More...
 
int32_t ICSS_EMAC_rxPktGet (ICSS_EMAC_RxArgument *rxArg, void *userArg)
 Retrieves a frame from a host queue and copies it in the allocated stack buffer. More...
 
int32_t ICSS_EMAC_rxPktInfo (ICSS_EMAC_Handle icssEmacHandle, int32_t *portNumber, int32_t *queueNumber)
 API to retrieve the information about the received frame which is then used to dequeue the frame from the host queues. More...
 
int32_t ICSS_EMAC_txPacket (const ICSS_EMAC_TxArgument *txArg, void *userArg)
 API to queue a frame which has to be transmitted on the specified port queue. More...
 

Typedefs

typedef struct ICSS_EMAC_Config_s * ICSS_EMAC_Handle
 Alias for ICSS EMAC Handle containing base addresses and modules. More...
 
typedef int32_t(* ICSS_EMAC_CallBack) (void *arg0, void *arg1, void *arg2)
 Definition for a generic callback function used in ICSS-EMAC.
While calling this, first argument is always of type ICSS_EMAC_Handle, second argument is specific to the callback (see ICSS_EMAC_CallBackObject), and third argument is userArg as specified in ICSS_EMAC_CallBackConfig. More...
 

Macros

#define ICSS_EMAC_MAX_PORTS_PER_INSTANCE   (2)
 Maximum number of Ports in a single ICSS
More...
 
#define ICSS_EMAC_NUMQUEUES   ((uint32_t)17U)
 Total Queues available. More...
 
#define ICSS_EMAC_MAXMTU   (1518U)
 Maximum Valid size (incl header + VLAN TAG..., no CRC) More...
 
#define ICSS_EMAC_MINMTU   (14U)
 Minimum Valid size ( DA + SA + Ethertype) More...
 
#define ICSS_EMAC_PORT_0   (0)
 Used to specify host side port. More...
 
#define ICSS_EMAC_PORT_1   (1U)
 Used to specify physical port 1 MII 0 (tx) More...
 
#define ICSS_EMAC_PORT_2   (2U)
 Used to specify physical port 2 MII 1 (tx) More...
 
#define ICSS_EMAC_IOCTL_PORT_CTRL_DISABLE   (0u)
 ICSS_EMAC_IOCTL_PORT_CTRL options. More...
 
#define ICSS_EMAC_IOCTL_PORT_CTRL_ENABLE   (1u)
 Generic IOCTL Disable macro. More...
 
#define ICSS_EMAC_LEARNING_PORT_STATE_LEARNING   (0U)
 Macros for different port states in learning module. More...
 
#define ICSS_EMAC_LEARNING_PORT_STATE_NOT_LEARNING   (1U)
 
#define ICSS_EMAC_LEARNING_PORT_STATE_LOCKED   (2U)
 
#define ICSS_EMAC_OBJECT_SIZE_IN_BYTES   (42000)
 

ICSS EMAC Modes

#define ICSS_EMAC_MODE_MAC1   (1U)
 Single EMAC Mode. Port 1 Enabled. More...
 
#define ICSS_EMAC_MODE_MAC2   (2U)
 Single EMAC Mode. Port 2 Enabled. More...
 
#define ICSS_EMAC_MODE_SWITCH   (3U)
 Switch Mode. More...
 
#define ICSS_EMAC_MODE_DUALMAC   (4U)
 Dual MAC Mode. Both Ports Enabled. More...
 

ICSS EMAC PHY to MAC Interface Modes

#define ICSS_EMAC_MII_MODE   (0U)
 Media-independent Interface. More...
 
#define ICSS_EMAC_RGMII_MODE   (1U)
 Reduced Gigabit Media-independent Interface
More...
 

ICSS EMAC Learning Modes

#define ICSS_EMAC_LEARNING_DISABLE   (0U)
 Driver-based Learning Mode Disabled
More...
 
#define ICSS_EMAC_LEARNING_ENABLE   (1U)
 Driver-based Learning Mode Enabled
More...
 

ICSS EMAC Interrupt Pacing Configuration

#define ICSS_EMAC_ENABLE_PACING   (0)
 Interrupt pacing enabled. More...
 
#define ICSS_EMAC_DISABLE_PACING   (1)
 Interrupt pacing disabled. More...
 

ICSS EMAC Interrupt Pacing Modes

#define ICSS_EMAC_INTR_PACING_MODE1   (0)
 Frame Count based Interrupt pacing. More...
 

ICSS EMAC Queues

#define ICSS_EMAC_QUEUE1   ((uint32_t)0U)
 Priority Queue 1. More...
 
#define ICSS_EMAC_QUEUE2   ((uint32_t)1U)
 Priority Queue 2. More...
 
#define ICSS_EMAC_QUEUE3   ((uint32_t)2U)
 Priority Queue 3. More...
 
#define ICSS_EMAC_QUEUE4   ((uint32_t)3U)
 Priority Queue 4. More...
 
#define ICSS_EMAC_QUEUE5   ((uint32_t)4U)
 Priority Queue 5. More...
 
#define ICSS_EMAC_QUEUE6   ((uint32_t)5U)
 Priority Queue 6. More...
 
#define ICSS_EMAC_QUEUE7   ((uint32_t)6U)
 Priority Queue 7. More...
 
#define ICSS_EMAC_QUEUE8   ((uint32_t)7U)
 Priority Queue 8. More...
 
#define ICSS_EMAC_QUEUE9   ((uint32_t)8U)
 Priority Queue 9. More...
 
#define ICSS_EMAC_QUEUE10   ((uint32_t)9U)
 Priority Queue 10. More...
 
#define ICSS_EMAC_QUEUE11   ((uint32_t)10U)
 Priority Queue 11. More...
 
#define ICSS_EMAC_QUEUE12   ((uint32_t)11U)
 Priority Queue 12. More...
 
#define ICSS_EMAC_QUEUE13   ((uint32_t)12U)
 Priority Queue 13. More...
 
#define ICSS_EMAC_QUEUE14   ((uint32_t)13U)
 Priority Queue 14. More...
 
#define ICSS_EMAC_QUEUE15   ((uint32_t)14U)
 Priority Queue 15. More...
 
#define ICSS_EMAC_QUEUE16   ((uint32_t)15U)
 Priority Queue 16. More...
 
#define ICSS_EMAC_COLQUEUE   ((uint32_t)16U)
 Collision Queue. More...
 

ICSS-EMAC Storm Prevention IOCTL Command Options

#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE   (0u)
 IOCTL Storm Control Enable command. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE   (1u)
 IOCTL Storm Control Disable command. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS   (2u)
 IOCTL Storm Control set credit command. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_INIT   (3u)
 IOCTL Storm Control initialize command. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_RESET   (4u)
 IOCTL Storm Control reset command. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_BC   (5u)
 IOCTL Storm Control Enable command for BC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_BC   (6u)
 IOCTL Storm Control Disable command for BC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_BC   (7u)
 IOCTL Storm Control set credit command for BC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_INIT_BC   (8u)
 IOCTL Storm Control initialize command for BC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_RESET_BC   (9u)
 IOCTL Storm Control reset command for BC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_MC   (10u)
 IOCTL Storm Control Enable command for MC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_MC   (11u)
 IOCTL Storm Control Disable command for MC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_MC   (12u)
 IOCTL Storm Control set credit command for MC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_INIT_MC   (13u)
 IOCTL Storm Control initialize command for MC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_RESET_MC   (14u)
 IOCTL Storm Control reset command for MC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_UC   (15u)
 IOCTL Storm Control Enable command for UC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_UC   (16u)
 IOCTL Storm Control Disable command for UC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_UC   (17u)
 IOCTL Storm Control set credit command for UC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_INIT_UC   (18u)
 IOCTL Storm Control initialize command for UC traffic. More...
 
#define ICSS_EMAC_STORM_PREV_CTRL_RESET_UC   (19u)
 IOCTL Storm Control reset command for UC traffic. More...
 

ICSS-EMAC Learning Control IOCTL Command Options

#define ICSS_EMAC_LEARN_CTRL_UPDATE_TABLE   (0u)
 IOCTL Learning Table update command. More...
 
#define ICSS_EMAC_LEARN_CTRL_CLR_TABLE   (1u)
 IOCTL Learning Table clear table command. More...
 
#define ICSS_EMAC_LEARN_CTRL_AGEING   (2u)
 IOCTL Learning Table age out entry command. More...
 
#define ICSS_EMAC_LEARN_CTRL_FIND_MAC   (3u)
 IOCTL Learning Table find port from MAC ID command. More...
 
#define ICSS_EMAC_LEARN_CTRL_REMOVE_MAC   (4u)
 IOCTL Learning Table remove a MAC ID from table command. More...
 
#define ICSS_EMAC_LEARN_CTRL_INC_COUNTER   (5u)
 IOCTL Learning Table increment counters (for ageing) command. More...
 
#define ICSS_EMAC_LEARN_CTRL_INIT_TABLE   (6u)
 IOCTL Learning Table initialize command. More...
 
#define ICSS_EMAC_LEARN_CTRL_SET_PORTSTATE   (7u)
 IOCTL Learning Table set port state command. More...
 

ICSS-EMAC Statistics IOCTL Command Options

#define ICSS_EMAC_IOCTL_STAT_CTRL_GET   (0u)
 IOCTL Statistics get from PRU command. More...
 
#define ICSS_EMAC_IOCTL_STAT_CTRL_CLEAR   (1u)
 IOCTL Statistics clear all counters command. More...
 

ICSS-EMAC IOCTL Command for selecting a module

#define ICSS_EMAC_IOCTL_PORT_CTRL   (0u)
 IOCTL select port control APIs command. More...
 
#define ICSS_EMAC_IOCTL_LEARNING_CTRL   (1u)
 IOCTL select learning Table APIs command. More...
 
#define ICSS_EMAC_IOCTL_STORM_PREV_CTRL   (2u)
 IOCTL select Storm Prevention APIs command. More...
 
#define ICSS_EMAC_IOCTL_STATS_CTRL   (3u)
 IOCTL select Statistics APIs command. More...
 
#define ICSS_EMAC_IOCTL_PROMISCUOUS_CTRL   (4u)
 IOCTL select Promiscuous Mode APIs command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL   (5u)
 IOCTL select Multicast filtering APIs command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL   (6u)
 IOCTL select Vlan filtering APIs command. More...
 

ICSS-EMAC Multicast Filtering IOCTL Command Options

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ENABLE   (0u)
 IOCTL Multicast filter Control Enable command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_DISABLE   (1u)
 IOCTL Multicast filter Control Disable command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_OVERRIDE_HASHMASK   (2u)
 IOCTL Multicast filter Control override hashmask command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ADD_MACID   (3u)
 IOCTL Multicast filter Control allow MC MAC ID command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_REMOVE_MACID   (4u)
 IOCTL Multicast filter Control do not allow MC MAC ID command. More...
 
#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_GET_DROPPED   (5u)
 IOCTL Multicast filter Control do not allow MC MAC ID command. More...
 

ICSS-EMAC VLAN Filtering IOCTL Command Options

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ENABLE_CMD   (0u)
 IOCTL Vlan filter Control Enable command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_DISABLE_CMD   (1u)
 IOCTL Vlan filter Control Disable command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_ALL_CMD   (2u)
 IOCTL Vlan filter allow Untagged frames Host Receive command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_NAL_CMD   (3u)
 IOCTL Vlan filter do not allow Untagged frames Host Receive command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_ALL_CMD   (4u)
 IOCTL Vlan filter allow Priority Tag frames Host Receive command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_NAL_CMD   (5u)
 IOCTL Vlan filter do not allow Priority Tag frames Host Receive command. More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ADD_VID_CMD   (6u)
 IOCTL Vlan filter 4096 VIDs, 1 bit VIDs => 4096 bits = 512 bytes, ADD VLAN ID to allow packet to host
More...
 
#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_REMOVE_VID_CMD   (7u)
 IOCTL Vlan filter 4096 VIDs, 1 bit VIDs => 4096 bits = 512 bytes, Remove VLAN ID to do not allow packet to host
More...
 

Macro Definition Documentation

◆ ICSS_EMAC_MAX_PORTS_PER_INSTANCE

#define ICSS_EMAC_MAX_PORTS_PER_INSTANCE   (2)

Maximum number of Ports in a single ICSS

◆ ICSS_EMAC_MODE_MAC1

#define ICSS_EMAC_MODE_MAC1   (1U)

Single EMAC Mode. Port 1 Enabled.

◆ ICSS_EMAC_MODE_MAC2

#define ICSS_EMAC_MODE_MAC2   (2U)

Single EMAC Mode. Port 2 Enabled.

◆ ICSS_EMAC_MODE_SWITCH

#define ICSS_EMAC_MODE_SWITCH   (3U)

Switch Mode.

◆ ICSS_EMAC_MODE_DUALMAC

#define ICSS_EMAC_MODE_DUALMAC   (4U)

Dual MAC Mode. Both Ports Enabled.

◆ ICSS_EMAC_MII_MODE

#define ICSS_EMAC_MII_MODE   (0U)

Media-independent Interface.

◆ ICSS_EMAC_RGMII_MODE

#define ICSS_EMAC_RGMII_MODE   (1U)

Reduced Gigabit Media-independent Interface

◆ ICSS_EMAC_LEARNING_DISABLE

#define ICSS_EMAC_LEARNING_DISABLE   (0U)

Driver-based Learning Mode Disabled

◆ ICSS_EMAC_LEARNING_ENABLE

#define ICSS_EMAC_LEARNING_ENABLE   (1U)

Driver-based Learning Mode Enabled

◆ ICSS_EMAC_ENABLE_PACING

#define ICSS_EMAC_ENABLE_PACING   (0)

Interrupt pacing enabled.

◆ ICSS_EMAC_DISABLE_PACING

#define ICSS_EMAC_DISABLE_PACING   (1)

Interrupt pacing disabled.

◆ ICSS_EMAC_INTR_PACING_MODE1

#define ICSS_EMAC_INTR_PACING_MODE1   (0)

Frame Count based Interrupt pacing.

◆ ICSS_EMAC_QUEUE1

#define ICSS_EMAC_QUEUE1   ((uint32_t)0U)

Priority Queue 1.

◆ ICSS_EMAC_QUEUE2

#define ICSS_EMAC_QUEUE2   ((uint32_t)1U)

Priority Queue 2.

◆ ICSS_EMAC_QUEUE3

#define ICSS_EMAC_QUEUE3   ((uint32_t)2U)

Priority Queue 3.

◆ ICSS_EMAC_QUEUE4

#define ICSS_EMAC_QUEUE4   ((uint32_t)3U)

Priority Queue 4.

◆ ICSS_EMAC_QUEUE5

#define ICSS_EMAC_QUEUE5   ((uint32_t)4U)

Priority Queue 5.

◆ ICSS_EMAC_QUEUE6

#define ICSS_EMAC_QUEUE6   ((uint32_t)5U)

Priority Queue 6.

◆ ICSS_EMAC_QUEUE7

#define ICSS_EMAC_QUEUE7   ((uint32_t)6U)

Priority Queue 7.

◆ ICSS_EMAC_QUEUE8

#define ICSS_EMAC_QUEUE8   ((uint32_t)7U)

Priority Queue 8.

◆ ICSS_EMAC_QUEUE9

#define ICSS_EMAC_QUEUE9   ((uint32_t)8U)

Priority Queue 9.

◆ ICSS_EMAC_QUEUE10

#define ICSS_EMAC_QUEUE10   ((uint32_t)9U)

Priority Queue 10.

◆ ICSS_EMAC_QUEUE11

#define ICSS_EMAC_QUEUE11   ((uint32_t)10U)

Priority Queue 11.

◆ ICSS_EMAC_QUEUE12

#define ICSS_EMAC_QUEUE12   ((uint32_t)11U)

Priority Queue 12.

◆ ICSS_EMAC_QUEUE13

#define ICSS_EMAC_QUEUE13   ((uint32_t)12U)

Priority Queue 13.

◆ ICSS_EMAC_QUEUE14

#define ICSS_EMAC_QUEUE14   ((uint32_t)13U)

Priority Queue 14.

◆ ICSS_EMAC_QUEUE15

#define ICSS_EMAC_QUEUE15   ((uint32_t)14U)

Priority Queue 15.

◆ ICSS_EMAC_QUEUE16

#define ICSS_EMAC_QUEUE16   ((uint32_t)15U)

Priority Queue 16.

◆ ICSS_EMAC_COLQUEUE

#define ICSS_EMAC_COLQUEUE   ((uint32_t)16U)

Collision Queue.

◆ ICSS_EMAC_NUMQUEUES

#define ICSS_EMAC_NUMQUEUES   ((uint32_t)17U)

Total Queues available.

◆ ICSS_EMAC_MAXMTU

#define ICSS_EMAC_MAXMTU   (1518U)

Maximum Valid size (incl header + VLAN TAG..., no CRC)

◆ ICSS_EMAC_MINMTU

#define ICSS_EMAC_MINMTU   (14U)

Minimum Valid size ( DA + SA + Ethertype)

◆ ICSS_EMAC_PORT_0

#define ICSS_EMAC_PORT_0   (0)

Used to specify host side port.

◆ ICSS_EMAC_PORT_1

#define ICSS_EMAC_PORT_1   (1U)

Used to specify physical port 1 MII 0 (tx)

◆ ICSS_EMAC_PORT_2

#define ICSS_EMAC_PORT_2   (2U)

Used to specify physical port 2 MII 1 (tx)

◆ ICSS_EMAC_IOCTL_PORT_CTRL_DISABLE

#define ICSS_EMAC_IOCTL_PORT_CTRL_DISABLE   (0u)

ICSS_EMAC_IOCTL_PORT_CTRL options.

Generic IOCTL Enable macro

◆ ICSS_EMAC_IOCTL_PORT_CTRL_ENABLE

#define ICSS_EMAC_IOCTL_PORT_CTRL_ENABLE   (1u)

Generic IOCTL Disable macro.

◆ ICSS_EMAC_STORM_PREV_CTRL_ENABLE

#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE   (0u)

IOCTL Storm Control Enable command.

◆ ICSS_EMAC_STORM_PREV_CTRL_DISABLE

#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE   (1u)

IOCTL Storm Control Disable command.

◆ ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS

#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS   (2u)

IOCTL Storm Control set credit command.

◆ ICSS_EMAC_STORM_PREV_CTRL_INIT

#define ICSS_EMAC_STORM_PREV_CTRL_INIT   (3u)

IOCTL Storm Control initialize command.

◆ ICSS_EMAC_STORM_PREV_CTRL_RESET

#define ICSS_EMAC_STORM_PREV_CTRL_RESET   (4u)

IOCTL Storm Control reset command.

◆ ICSS_EMAC_STORM_PREV_CTRL_ENABLE_BC

#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_BC   (5u)

IOCTL Storm Control Enable command for BC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_DISABLE_BC

#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_BC   (6u)

IOCTL Storm Control Disable command for BC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_BC

#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_BC   (7u)

IOCTL Storm Control set credit command for BC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_INIT_BC

#define ICSS_EMAC_STORM_PREV_CTRL_INIT_BC   (8u)

IOCTL Storm Control initialize command for BC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_RESET_BC

#define ICSS_EMAC_STORM_PREV_CTRL_RESET_BC   (9u)

IOCTL Storm Control reset command for BC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_ENABLE_MC

#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_MC   (10u)

IOCTL Storm Control Enable command for MC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_DISABLE_MC

#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_MC   (11u)

IOCTL Storm Control Disable command for MC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_MC

#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_MC   (12u)

IOCTL Storm Control set credit command for MC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_INIT_MC

#define ICSS_EMAC_STORM_PREV_CTRL_INIT_MC   (13u)

IOCTL Storm Control initialize command for MC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_RESET_MC

#define ICSS_EMAC_STORM_PREV_CTRL_RESET_MC   (14u)

IOCTL Storm Control reset command for MC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_ENABLE_UC

#define ICSS_EMAC_STORM_PREV_CTRL_ENABLE_UC   (15u)

IOCTL Storm Control Enable command for UC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_DISABLE_UC

#define ICSS_EMAC_STORM_PREV_CTRL_DISABLE_UC   (16u)

IOCTL Storm Control Disable command for UC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_UC

#define ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS_UC   (17u)

IOCTL Storm Control set credit command for UC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_INIT_UC

#define ICSS_EMAC_STORM_PREV_CTRL_INIT_UC   (18u)

IOCTL Storm Control initialize command for UC traffic.

◆ ICSS_EMAC_STORM_PREV_CTRL_RESET_UC

#define ICSS_EMAC_STORM_PREV_CTRL_RESET_UC   (19u)

IOCTL Storm Control reset command for UC traffic.

◆ ICSS_EMAC_LEARN_CTRL_UPDATE_TABLE

#define ICSS_EMAC_LEARN_CTRL_UPDATE_TABLE   (0u)

IOCTL Learning Table update command.

◆ ICSS_EMAC_LEARN_CTRL_CLR_TABLE

#define ICSS_EMAC_LEARN_CTRL_CLR_TABLE   (1u)

IOCTL Learning Table clear table command.

◆ ICSS_EMAC_LEARN_CTRL_AGEING

#define ICSS_EMAC_LEARN_CTRL_AGEING   (2u)

IOCTL Learning Table age out entry command.

◆ ICSS_EMAC_LEARN_CTRL_FIND_MAC

#define ICSS_EMAC_LEARN_CTRL_FIND_MAC   (3u)

IOCTL Learning Table find port from MAC ID command.

◆ ICSS_EMAC_LEARN_CTRL_REMOVE_MAC

#define ICSS_EMAC_LEARN_CTRL_REMOVE_MAC   (4u)

IOCTL Learning Table remove a MAC ID from table command.

◆ ICSS_EMAC_LEARN_CTRL_INC_COUNTER

#define ICSS_EMAC_LEARN_CTRL_INC_COUNTER   (5u)

IOCTL Learning Table increment counters (for ageing) command.

◆ ICSS_EMAC_LEARN_CTRL_INIT_TABLE

#define ICSS_EMAC_LEARN_CTRL_INIT_TABLE   (6u)

IOCTL Learning Table initialize command.

◆ ICSS_EMAC_LEARN_CTRL_SET_PORTSTATE

#define ICSS_EMAC_LEARN_CTRL_SET_PORTSTATE   (7u)

IOCTL Learning Table set port state command.

◆ ICSS_EMAC_IOCTL_STAT_CTRL_GET

#define ICSS_EMAC_IOCTL_STAT_CTRL_GET   (0u)

IOCTL Statistics get from PRU command.

◆ ICSS_EMAC_IOCTL_STAT_CTRL_CLEAR

#define ICSS_EMAC_IOCTL_STAT_CTRL_CLEAR   (1u)

IOCTL Statistics clear all counters command.

◆ ICSS_EMAC_IOCTL_PORT_CTRL

#define ICSS_EMAC_IOCTL_PORT_CTRL   (0u)

IOCTL select port control APIs command.

◆ ICSS_EMAC_IOCTL_LEARNING_CTRL

#define ICSS_EMAC_IOCTL_LEARNING_CTRL   (1u)

IOCTL select learning Table APIs command.

◆ ICSS_EMAC_IOCTL_STORM_PREV_CTRL

#define ICSS_EMAC_IOCTL_STORM_PREV_CTRL   (2u)

IOCTL select Storm Prevention APIs command.

◆ ICSS_EMAC_IOCTL_STATS_CTRL

#define ICSS_EMAC_IOCTL_STATS_CTRL   (3u)

IOCTL select Statistics APIs command.

◆ ICSS_EMAC_IOCTL_PROMISCUOUS_CTRL

#define ICSS_EMAC_IOCTL_PROMISCUOUS_CTRL   (4u)

IOCTL select Promiscuous Mode APIs command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL   (5u)

IOCTL select Multicast filtering APIs command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL   (6u)

IOCTL select Vlan filtering APIs command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ENABLE

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ENABLE   (0u)

IOCTL Multicast filter Control Enable command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_DISABLE

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_DISABLE   (1u)

IOCTL Multicast filter Control Disable command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_OVERRIDE_HASHMASK

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_OVERRIDE_HASHMASK   (2u)

IOCTL Multicast filter Control override hashmask command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ADD_MACID

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_ADD_MACID   (3u)

IOCTL Multicast filter Control allow MC MAC ID command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_REMOVE_MACID

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_REMOVE_MACID   (4u)

IOCTL Multicast filter Control do not allow MC MAC ID command.

◆ ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_GET_DROPPED

#define ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_GET_DROPPED   (5u)

IOCTL Multicast filter Control do not allow MC MAC ID command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ENABLE_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ENABLE_CMD   (0u)

IOCTL Vlan filter Control Enable command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_DISABLE_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_DISABLE_CMD   (1u)

IOCTL Vlan filter Control Disable command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_ALL_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_ALL_CMD   (2u)

IOCTL Vlan filter allow Untagged frames Host Receive command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_NAL_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_UNTAG_HOST_RCV_NAL_CMD   (3u)

IOCTL Vlan filter do not allow Untagged frames Host Receive command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_ALL_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_ALL_CMD   (4u)

IOCTL Vlan filter allow Priority Tag frames Host Receive command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_NAL_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_PRIOTAG_HOST_RCV_NAL_CMD   (5u)

IOCTL Vlan filter do not allow Priority Tag frames Host Receive command.

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ADD_VID_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_ADD_VID_CMD   (6u)

IOCTL Vlan filter 4096 VIDs, 1 bit VIDs => 4096 bits = 512 bytes, ADD VLAN ID to allow packet to host

◆ ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_REMOVE_VID_CMD

#define ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_REMOVE_VID_CMD   (7u)

IOCTL Vlan filter 4096 VIDs, 1 bit VIDs => 4096 bits = 512 bytes, Remove VLAN ID to do not allow packet to host

◆ ICSS_EMAC_LEARNING_PORT_STATE_LEARNING

#define ICSS_EMAC_LEARNING_PORT_STATE_LEARNING   (0U)

Macros for different port states in learning module.

◆ ICSS_EMAC_LEARNING_PORT_STATE_NOT_LEARNING

#define ICSS_EMAC_LEARNING_PORT_STATE_NOT_LEARNING   (1U)

◆ ICSS_EMAC_LEARNING_PORT_STATE_LOCKED

#define ICSS_EMAC_LEARNING_PORT_STATE_LOCKED   (2U)

◆ ICSS_EMAC_OBJECT_SIZE_IN_BYTES

#define ICSS_EMAC_OBJECT_SIZE_IN_BYTES   (42000)

Typedef Documentation

◆ ICSS_EMAC_Handle

typedef struct ICSS_EMAC_Config_s* ICSS_EMAC_Handle

Alias for ICSS EMAC Handle containing base addresses and modules.

◆ ICSS_EMAC_CallBack

typedef int32_t(* ICSS_EMAC_CallBack) (void *arg0, void *arg1, void *arg2)

Definition for a generic callback function used in ICSS-EMAC.
While calling this, first argument is always of type ICSS_EMAC_Handle, second argument is specific to the callback (see ICSS_EMAC_CallBackObject), and third argument is userArg as specified in ICSS_EMAC_CallBackConfig.

Function Documentation

◆ ICSS_EMAC_init()

void ICSS_EMAC_init ( void  )

This function initializes the ICSS_EMAC module.

◆ ICSS_EMAC_deinit()

void ICSS_EMAC_deinit ( void  )

This function de-initializes the ICSS_EMAC module.

◆ ICSS_EMAC_Params_init()

void ICSS_EMAC_Params_init ( ICSS_EMAC_Params params)

Initialize the parmeters data structure with defaults.

Parameters
params[out] Initialized parameters

◆ ICSS_EMAC_open()

ICSS_EMAC_Handle ICSS_EMAC_open ( uint32_t  idx,
const ICSS_EMAC_Params params 
)

API to initialize and configure ICSS in MAC/Switch Mode.

Parameters
[in]idxICSS_EMAC instance number
[in]paramsStructure of type ICSS_EMAC_Params
Returns
ICSS_EMAC_Handle in case of success, NULL otherwise

◆ ICSS_EMAC_close()

void ICSS_EMAC_close ( ICSS_EMAC_Handle  icssEmacHandle)

API to stop MAC/Switch Mode.

Parameters
[in]icssEmacHandleHandle to ICSS_EMAC instance

◆ ICSS_EMAC_ioctl()

int32_t ICSS_EMAC_ioctl ( ICSS_EMAC_Handle  icssEmacHandle,
uint32_t  ioctlCommand,
uint8_t  portNo,
void *  ioctlParams 
)

IOCTL Function for ICSS EMAC.

    This Function can be used to configure various ICSS EMAC Functionalities.
    The Supported features are:
    (1)Port Enable/Disable       (2)StormControl
    (3)Learning configuration    (4)Statistics module
    (5)Multicast filterring      (6)VLAN filtering
Parameters
[in]icssEmacHandleHandle to ICSS_EMAC instance
[in]ioctlCommandCommand from ICSS_EMAC_IOCTL_COMMANDS
[in]portNoPort number for IOCTL
[in,out]ioctlParamsPointer to structure of type ICSS_EMAC_IoctlCmd Please see following for setting ioctlParams.command ICSS_EMAC_IOCTL_STORM_PREV_CTRL_COMMANDS, ICSS_EMAC_IOCTL_LEARNING_CTRL_COMMANDS, ICSS_EMAC_IOCTL_STATISTICS_COMMANDS, ICSS_EMAC_IOCTL_MULTICAST_FILTER_CTRL_COMMANDS, ICSS_EMAC_IOCTL_VLAN_FILTER_CTRL_COMMANDS
Returns
SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

◆ ICSS_EMAC_rxPktGet()

int32_t ICSS_EMAC_rxPktGet ( ICSS_EMAC_RxArgument rxArg,
void *  userArg 
)

Retrieves a frame from a host queue and copies it in the allocated stack buffer.

Parameters
[in]rxArgPointer to ICSS_EMAC_RxArgument structure
[in]userArgCustom Rx packet callback packet options only required for custom RxPacket implementations, default to NULL when calling ICSS_EMAC_RxPktGet which is default Rx Packet API
Returns
Length of the frame received in number of bytes or SystemP_FAILURE on failure

◆ ICSS_EMAC_rxPktInfo()

int32_t ICSS_EMAC_rxPktInfo ( ICSS_EMAC_Handle  icssEmacHandle,
int32_t *  portNumber,
int32_t *  queueNumber 
)

API to retrieve the information about the received frame which is then used to dequeue the frame from the host queues.

Parameters
[in]icssEmacHandleHandle to ICSS_EMAC instance
[out]portNumberReturn pointer of port number where frame was received
[out]queueNumberReturn pointer of host queue where the received frame is queued
Returns
Length of packet or SystemP_FAILURE if no packet found

◆ ICSS_EMAC_txPacket()

int32_t ICSS_EMAC_txPacket ( const ICSS_EMAC_TxArgument txArg,
void *  userArg 
)

API to queue a frame which has to be transmitted on the specified port queue.

Parameters
[in]txArgPointer to ICSS_EMAC_TxArgument
[in]userArgCustom Tx packet callback packet options only required for custom TxPacket implementations, default to NULL when calling ICSS_EMAC_TxPacket which is default Tx Packet API
Returns
SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise