The ICSS-EMAC (Industrial Communications Subsystem Ethernet Media Access Controller) driver provide APIs to transmit and receive packets with a firmware based Ethernet switch that has been implemented on PRUICSS cores.
ICSS-EMAC runs on the host processor, provides a well defined set of APIs to configure the firmware, send packets to the firmware and receive packet from the firmware. Industrial Communication Protocol specific firmware (running on PRUICSS cores) implements a 2 port ethernet switch supporting 802.1d at 100 Mbps.
Abbreviation | Expansion |
---|---|
PRU-ICSS | Programmable Real-Time Unit Industrial Communication Subsystem |
EMAC | Ethernet MAC |
Rx/Tx | Packet Receive/Packet Transmit |
INTC | Interrupt Controller |
DLR | Device Level Ring (A redundancy protocol for EtherNet/IP) |
Host/CPU/Cortex | Used interchangeably and refers to the Application Processor |
ICSS-EMAC Design explains the driver design in detail.
ICSS-EMAC
under TI NETWORKING
in the left pane in SysConfig.ti_drivers_config.c
file. (This is an example, and exact code will vary based on the configured value in SysConfig)..bss.icss_emac_pktbuf_mem
section and and map it to a memory region, as shown in below snippet. (Only relevant code sections which should be added are shown)Cached+Sharable
for the CPU.This can be done via SysConfig, by adding additional MPU entries using the MPU
module under TI DRIVER PORTING LAYER (DPL)
in SysConfig. Following is an example:
Include the below file to access the APIs
${SDK_INSTALL_PATH}/source/industrial_comms/profinet_device/icss_fwhal/firmware/icss_emac_mmap.h
and ${SDK_INSTALL_PATH}/source/industrial_comms/ethernetip_adapter/icss_fwhal/firmware/icss_emac_mmap.h
respectively.ICSS_EMAC_rxPktGet is the API used for receving packets. Refer Rx Data Path for more details. Following is an example usage:
IOCTL implementation is identical to the Unix/Linux based IOCTL calls. They provide the application a convenient method to access driver space parameters or modify them. Users are expected to familiarize themselves with the full list of IOCTL calls so that they can utilize all the features provided.
The API for IOCTL is ICSS_EMAC_ioctl. An IOCTL call uses two parameters to find out which driver function to call internally.
ioctlCommand
: Used to locate the module which should be called. Allowed values are ICSS_EMAC_IOCTL_COMMANDS.ioctlParams
: Used to give module specific instructions. ioctlParams
consists ofcommand
: Indicates which specific command to execute. Allowed values for ioctlParams.command
are 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.ioctlVal
: Sometimes the command may require specific input, this is used to provide that.For example, to disable receive functionality on a port, following code is used.
ICSS-EMAC is dependent on the Application/Transport layer for proper functioning. Following dependencies should be handled by the application layer (example) :
ICSS-EMAC Debug Guide covers the most obvious use cases and debug scenarios encountered while using ICSS-EMAC.