PDK API Guide for AM65xx
|
The Enet LLD APIs can be broadly divided into two categories: control and data path. The control APIs can be used to configure all Ethernet hardware submodules like FDB, MAC port, host port, MDIO, statistics, as well as PHY drivers and resource management. The data path APIs are exclusive for the DMA-based data transfers between the TI SoC processing cores and the Ethernet peripheral.
The main APIs of the Enet LLD are the following:
It's worth noting that the control path APIs are mainly IOCTL-based, and the data path APIs are direct functions in order to avoid any additional overhead associated with IOCTL calls as DMA data operations occur highly frequently.
IOCTLs are system calls that take an argument specifying the command code and can take none or additional parameters via Enet_IoctlPrms argument. IOCTL are used by all Enet submodules except for DMA.
The Enet_IoctlPrms parameter structure consists of input and output argument pointers and their corresponding size. The following helper macros are provided to help construct the IOCTL params:
where prms
in a pointer to Enet_IoctlPrms variable, in
is the pointer to IOCTL input argument and out
is the pointer to IOCTL output argument.
It's recommended that the application doesn't set the Enet_IoctlPrms members individually, but only through the helper macros listed above.
Please refer to the individual IOCTL command to find out if it requires input and/or output parameters.
Developers who wish to add network connectivity to the applications running on TI SoCs, will have to integrate Enet LLD by following the below sequence:
Each of these sequences will be covered in detail in the following sections.
This is a one-time initialization where the application sets the OSAL and utils functions that Enet LLD will use throughout its lifecycle.
At this stage Enet LLD also initializes its SoC layer which contains data about the Ethernet hardware available in the TI device.
The application should follow the next steps:
utilsCfg.print = UART_printf; utilsCfg.physToVirt = &myPhysToVirtFxn; utilsCfg.virtToPhys = &myVirtToPhysFxn;
This is an initialization that needs to be done for each peripheral in the system. The configuration parameters described in this section are peripheral specific.
Application should follow the next steps:
EnetAppMemUtils
to take care of all memory allocation and freeing operations. The developer can take this as reference or can implement their own memory allocation functions.ICSSG Switch runs in VLAN aware mode, so it requires the following IOCTLs to setup the VLAN:
Refer to Enet Multiport example for a reference implementation.
The MAC ports can be opened in MAC-to-PHY or MAC-to-MAC mode. In MAC-to-PHY mode, Enet LLD's PHY driver state machine will be used to configure the Ethernet PHY. In MAC-to-MAC mode, the PHY driver will be bypassed entirely.
The link speed and duplexity in MAC-to-PHY can be fixed or auto-negotiated, while in MAC-to-MAC, both link speed and duplexity can be fixed only and must be provided by application.
The steps to open and configure ports in either MAC-to-PHY or MAC-to-MAC modes are shown below.
Forward
state using CPSW_ALE_IOCTL_SET_PORT_STATE IOCTL command.Forward
state using ICSSG_PER_IOCTL_SET_PORT_STATE IOCTL command.The following code snippet shows how a MAC-PHY link is opened (step 1-6 above). CPSW MAC port 1 connected to a DP83867 RGMII PHY has been chosen for this example.
Forward
state using CPSW_ALE_IOCTL_SET_PORT_STATE IOCTL command.Forward
state using ICSSG_PER_IOCTL_SET_PORT_STATE IOCTL command.The following code snippet shows how a MAC-to-MAC link is opened (steps 1-6 above). CPSW MAC port 1 connected to partner MAC using RGMII interface at 1 Gbps.
arg
parameter.arg
parameter must always be set to ENET_MAC_PORT_1.arg
parameter must be set to ENET_MAC_PORT_1 or ENET_MAC_PORT_2.This is one-time deinitialization sequence that must be followed when the application no longer wants to use the Enet LLD.
The following sections discuss lower level details on how the ICSSG Dual-MAC and its buffer pool configuration parameters are passed. This is relevant for readers who are looking to replace the default Dual-MAC firmware or have packet buffer requirements not met with the default buffer pool configuration.
Enet LLD provides default firmware for ICSSG Dual-MAC, which is available at <enet>/src/per/firmware/icssg/dualmac
. This firmware is tightly coupled with a corresponding firmware initialization done internally in Enet LLD.
The firmware information is populated into the ICSSG internal objects (see Icssg_Obj::fw) by Enet LLD in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
There are three firmware blobs that must be loaded, one per core in the ICSSG slice: PRU, RTU and TX PRU. It's done as follows:
Peripheral | PRU | RTU | TX PRU |
---|---|---|---|
ICSSG0 MAC port 1 (enetType: ENET_ICSSG_DUALMAC, instId: 0) | RX_PRU_SLICE0_b00_DMac | RTU0_SLICE0_b00_DMac | TX_PRU_SLICE0_b00_DMac |
ICSSG0 MAC port 2 (enetType: ENET_ICSSG_DUALMAC, instId: 1) | RX_PRU_SLICE1_b00_DMac | RTU0_SLICE1_b00_DMac | TX_PRU_SLICE1_b00_DMac |
ICSSG1 MAC port 1 (enetType: ENET_ICSSG_DUALMAC, instId: 2) | RX_PRU_SLICE0_b00_DMac | RTU0_SLICE0_b00_DMac | TX_PRU_SLICE0_b00_DMac |
ICSSG1 MAC port 2 (enetType: ENET_ICSSG_DUALMAC, instId: 3) | RX_PRU_SLICE1_b00_DMac | RTU0_SLICE1_b00_DMac | TX_PRU_SLICE1_b00_DMac |
ICSSG2 MAC port 1 (enetType: ENET_ICSSG_DUALMAC, instId: 4) | RX_PRU_SLICE0_b00_DMac | RTU0_SLICE0_b00_DMac | TX_PRU_SLICE0_b00_DMac |
ICSSG2 MAC port 2 (enetType: ENET_ICSSG_DUALMAC, instId: 5) | RX_PRU_SLICE1_b00_DMac | RTU0_SLICE1_b00_DMac | TX_PRU_SLICE1_b00_DMac |
It's worth noting that from application perspective, the ICSSG firmware blobs to be loaded and the firmware configuration is completely transparent as it doesn't require any application intervention.
ICSSG firmware requires internal memory for buffer pools and queues to be specified at firmware configuration time. This firmware memory is passed into the ICSSG internal objects (see Icssg_Obj::fwPoolMem) by Enet LLD in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
There are certain memory requirements for each buffer type for Dual-MAC as shown below:
Buffer Type | Number of pools per slice | Size per buffer pool (bytes) | Config parameters |
---|---|---|---|
Port buffer pools | 0 | 0 | Icssg_FwPoolMem::portBufferPoolMem Icssg_FwPoolMem::portBufferPoolSize Icssg_FwPoolMem::portBufferPoolNum |
Host buffer pools | ICSSG_DUALMAC_HOST_BUFFER_POOL_NUM | Configurable | Icssg_FwPoolMem::hostBufferPoolMem Icssg_FwPoolMem::hostBufferPoolSize Icssg_FwPoolMem::hostBufferPoolNum |
Host egress queues | ICSSG_DUALMAC_HOST_EGRESS_QUEUE_NUM | Configurable. It must include fixed padding size of ICSSG_HOST_EGRESS_BUFFER_PADDING | Icssg_FwPoolMem::hostEgressQueueMem Icssg_FwPoolMem::hostEgressQueueSize Icssg_FwPoolMem::hostEgressQueueNum |
Scratch buffer | 1 | ICSSG_SCRATCH_BUFFER_SIZE | Icssg_FwPoolMem::scratchBufferMem Icssg_FwPoolMem::scratchBufferSize |
Enet LLD provides a default firmware memory configuration in order to reduce the configuration burden on applications. The selection of firmware buffer sizes is a trade-off between the desired amount of packet buffering, the available memory and ICSSG MAC concurrency.
The buffer sizes provided by default in Enet LLD enable simultaneous use of all ICSSGs MACs in the SoC. The table below shows the default buffer sizes per ICSSG MAC.
Buffer Type | Number of pools | Buffer pool size | Slices | Total size |
---|---|---|---|---|
Port buffer pools | 0 | 0 | 1 | 0 |
Host buffer pools | 8 | 8 kB | 1 | 64 kB |
Host egress queues | 2 | 8 kB | 1 | 16 kB |
Scratch buffer | 1 | 2 kB | 1 | 2 kB |
If these firmware memory sizes don't meet the requirements of the application, they must be changed in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
The following sections discuss lower level details on how the ICSSG Switch and its buffer pool configuration parameters are passed. This is relevant for readers who are looking to replace the default Switch firmware or have packet buffer requirements not met with the default buffer pool configuration.
Enet LLD provides default firmware for ICSSG Switch which is available at <enet>/src/per/firmware/icssg/switch
. This firmware is tightly coupled with a corresponding firmware initialization done internally in Enet LLD.
The firmware information is populated into the ICSSG internal objects (see Icssg_Obj::fw) by Enet LLD in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
There are six firmware blobs that must be supplied by the application, one for each core of the two ICSSG slices: PRU, RTU and TX PRU.
Peripheral | PRU | RTU | TX PRU |
---|---|---|---|
ICSSG0 (enetType: ENET_ICSSG_SWITCH, instId: 0) | RX_PRU_SLICE0_b00_Swt RX_PRU_SLICE1_b00_Swt | RTU0_SLICE0_b00_Swt RTU0_SLICE1_b00_Swt | TX_PRU_SLICE0_b00_Swt TX_PRU_SLICE1_b00_Swt |
ICSSG1 (enetType: ENET_ICSSG_SWITCH, instId: 1) | RX_PRU_SLICE0_b00_Swt RX_PRU_SLICE1_b00_Swt | RTU0_SLICE0_b00_Swt RTU0_SLICE1_b00_Swt | TX_PRU_SLICE0_b00_Swt TX_PRU_SLICE1_b00_Swt |
ICSSG2 (enetType: ENET_ICSSG_SWITCH, instId: 2) | RX_PRU_SLICE0_b00_Swt RX_PRU_SLICE1_b00_Swt | RTU0_SLICE0_b00_Swt RTU0_SLICE1_b00_Swt | TX_PRU_SLICE0_b00_Swt TX_PRU_SLICE1_b00_Swt |
ICSSG firmware requires internal memory for buffer pools and queues to be specified at firmware configuration time. This firmware memory is passed into the ICSSG internal objects (see Icssg_Obj::fwPoolMem) by Enet LLD in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
There are certain memory requirements for each buffer type for Switch as shown below:
Buffer Type | Number of pools per slice | Size per buffer pool (bytes) | Config parameters |
---|---|---|---|
Port buffer pools | ICSSG_SWITCH_PORT_BUFFER_POOL_NUM | Configurable | Icssg_FwPoolMem::portBufferPoolMem Icssg_FwPoolMem::portBufferPoolSize Icssg_FwPoolMem::portBufferPoolNum |
Host buffer pools | ICSSG_SWITCH_HOST_BUFFER_POOL_NUM | Configurable | Icssg_FwPoolMem::hostBufferPoolMem Icssg_FwPoolMem::hostBufferPoolSize Icssg_FwPoolMem::hostBufferPoolNum |
Host egress queues | ICSSG_SWITCH_HOST_EGRESS_QUEUE_NUM | Configurable. It must include fixed padding size of ICSSG_HOST_EGRESS_BUFFER_PADDING | Icssg_FwPoolMem::hostEgressQueueMem Icssg_FwPoolMem::hostEgressQueueSize Icssg_FwPoolMem::hostEgressQueueNum |
Scratch buffer | 1 | ICSSG_SCRATCH_BUFFER_SIZE | Icssg_FwPoolMem::scratchBufferMem Icssg_FwPoolMem::scratchBufferSize |
Enet LLD provides a default firmware memory configuration in order to reduce the configuration burden on applications. The selection of firmware buffer sizes is a trade-off between the desired amount of packet buffering, the available memory and ICSSG Switch concurrency.
The buffer sizes provided by default in Enet LLD enable simultaneous use of all ICSSGs Switches in the SoC. The table below shows the default buffer sizes per ICSSG MAC.
Buffer Type | Number of pools | Buffer pool size | Slices | Total size |
---|---|---|---|---|
Port buffer pools | 8 | 6 kB | 2 | 96 kB |
Host buffer pools | 16 | 6 kB | 2 | 192 kB |
Host egress queues | 2 | 8 kB | 2 | 32 kB |
Scratch buffer | 1 | 2 kB | 2 | 4 kB |
If these firmware memory sizes don't meet the requirements of the application, they must be changed in the corresponding Enet SoC file, i.e. <enet>/soc/j7x/am65xx/enet_soc.c
for AM65xx devices.
EMAC LLD and Enet LLD differ in the kind of parameters passed at open time. EMAC LLD's emac_open()
takes a port number, and Enet LLD's Enet_open() takes a peripheral type and instance id.
Dual-MAC is implemented as separate Enet peripherals of the same type (ENET_ICSSG_DUALMAC). Instance number goes from 0 to 5 for AM65xx device as there are a total of 3 ICSSG instances, each having 2 MAC ports.
The following tables show the equivalent parameters to use in Enet_open() for ICSSG Dual-MAC.
EMAC LLD Port Number | Enet LLD Peripheral |
---|---|
EMAC_ICSSG0_PORT0 | enetType: ENET_ICSSG_DUALMAC instId: 0 |
EMAC_ICSSG0_PORT1 | enetType: ENET_ICSSG_DUALMAC instId: 1 |
EMAC_ICSSG1_PORT0 | enetType: ENET_ICSSG_DUALMAC instId: 2 |
EMAC_ICSSG1_PORT1 | enetType: ENET_ICSSG_DUALMAC instId: 3 |
EMAC_ICSSG2_PORT0 | enetType: ENET_ICSSG_DUALMAC instId: 4 |
EMAC_ICSSG2_PORT1 | enetType: ENET_ICSSG_DUALMAC instId: 5 |
ICSSG Switch is implemented as separate Enet peripherals of the same type (ENET_ICSSG_SWITCH). Instance number goes from 0 to 3 for AM65xx device as there are a total of 3 ICSSG instances.
The following tables show the equivalent parameters to use in Enet_open() for ICSSG Switch.
EMAC LLD Port Number | Enet LLD Peripheral |
---|---|
EMAC_SWITCH_PORT | enetType: ENET_ICSSG_SWITCH instId: 0 |
EMAC_ICSSG0_SWITCH_PORT | enetType: ENET_ICSSG_SWITCH instId: 0 |
EMAC_ICSSG1_SWITCH_PORT | enetType: ENET_ICSSG_SWITCH instId: 1 |
EMAC_ICSSG2_SWITCH_PORT | enetType: ENET_ICSSG_SWITCH instId: 2 |
Enet LLD Enet_open() returns a handle of Enet_Handle type, this handle is used in all other Enet LLD APIs. This is an important difference with respect to EMAC LLD, as port number is still required in other EMAC LLD APIs, i.e. emac_ioctl
.
EMAC LLD's emac_ioctl()
uses a port number as a means to indicate whether the command is to be run on a Dual-MAC or a Switch, and also to convey information about whether the command is MAC port or host port related:
emac_open()
. There is no additional port number for host port IOCTL commands.EMAC_ICSSGn_SWITCH_PORT
used for global settings.EMAC_ICSSGn_SWITCH_PORT0
used for host port related IOCTLs.EMAC_ICSSGn_SWITCH_PORT1
used for MAC port 1 related IOCTLs.EMAC_ICSSGn_SWITCH_PORT2
used for MAC port 2 related IOCTLs.Note that in the Switch case, the last three port numbers are not used at open time.
In Enet LLD, Enet_ioctl() doesn't take the port number in all cases, but only for MAC port related IOCTL commands.
IOCTLs that are MAC port related will take the MAC port number (Enet_MacPort) as IOCTL input args. For example, ENET_MACPORT_IOCTL_SET_PRI_REGEN_MAP command is MAC port related and it takes the MAC port number in its input arguments EnetMacPort_SetPriorityRegenMapInArgs::macPort.
IOCTLs that are host port related will not take a port number. For example, ICSSG_PER_IOCTL_VLAN_SET_HOSTPORT_DFLT_VID.
In EMAC LLD, asynchronous IOCTLs return EMAC_DRV_RESULT_IOCTL_IN_PROGRESS
in emac_ioctl()
call which is used to indicate that the application must poll for the operation completion. Polling is done via emac_poll_ctrl()
function.
Enet LLD implements asynchronous IOCTLs using a similar mechanism. First, the application must register an IOCTL completion callback funcion via Enet_registerEventCb(). When application has called an asynchronous IOCTL, Enet LLD will return ENET_SINPROGRESS and the application must call Enet_poll() with event type ENET_EVT_ASYNC_CMD_RESP until the registered callback is called.
Refer to section Synchronous and Asynchronous IOCTLs of the Enet LLD IOCTL interface document for further details.
The following table shows the mapping between EMAC LLD IOCTL commands/subcommands and Enet LLD IOCTLs.
EMAC LLD IOCTL cmd | EMAC LLD IOCTL subcmd | Enet LLD IOCTL cmd |
---|---|---|
EMAC_IOCTL_PROMISCOUS_MODE_CTRL | ICSSG_MACPORT_IOCTL_ENABLE_PROMISC_MODE ICSSG_MACPORT_IOCTL_DISABLE_PROMISC_MODE | |
EMAC_IOCTL_UC_FLOODING_CTRL | EMAC_IOCTL_PORT_UC_FLOODING_ENABLE | ICSSG_MACPORT_IOCTL_ENABLE_UCAST_FLOOD |
EMAC_IOCTL_PORT_UC_FLOODING_DISABLE | ICSSG_MACPORT_IOCTL_DISABLE_UCAST_FLOOD | |
EMAC_IOCTL_MC_FLOODING_CTRL | EMAC_IOCTL_PORT_MC_FLOODING_ENABLE | ICSSG_MACPORT_IOCTL_ENABLE_MCAST_FLOOD |
EMAC_IOCTL_PORT_MC_FLOODING_DISABLE | ICSSG_MACPORT_IOCTL_DISABLE_MCAST_FLOOD | |
EMAC_IOCTL_PORT_STATE_CTRL | EMAC_IOCTL_PORT_STATE_DISABLE | ICSSG_PER_IOCTL_SET_PORT_STATE |
EMAC_IOCTL_PORT_STATE_BLOCKING | ICSSG_PER_IOCTL_SET_PORT_STATE | |
EMAC_IOCTL_PORT_STATE_FORWARD | ICSSG_PER_IOCTL_SET_PORT_STATE | |
EMAC_IOCTL_PORT_STATE_FORWARD_WO_LEARNING | ICSSG_PER_IOCTL_SET_PORT_STATE | |
EMAC_IOCTL_ACCEPTABLE_FRAME_CHECK_CTRL | EMAC_IOCTL_ACCEPTABLE_FRAME_CHECK_ONLY_VLAN_TAGGED | ICSSG_MACPORT_IOCTL_SET_ACCEPT_FRAME_CHECK |
EMAC_IOCTL_ACCEPTABLE_FRAME_CHECK_ONLY_UN_TAGGED_PRIO_TAGGED | ICSSG_MACPORT_IOCTL_SET_ACCEPT_FRAME_CHECK | |
EMAC_IOCTL_ACCEPTABLE_FRAME_CHECK_ALL_FRAMES | ICSSG_MACPORT_IOCTL_SET_ACCEPT_FRAME_CHECK | |
EMAC_IOCTL_VLAN_CTRL | EMAC_IOCTL_VLAN_SET_DEFAULT_TBL | ICSSG_PER_IOCTL_VLAN_RESET_TABLE |
EMAC_IOCTL_VLAN_SET_ENTRY | ICSSG_PER_IOCTL_VLAN_SET_ENTRY | |
EMAC_IOCTL_VLAN_SET_DEFAULT_VLAN_ID | ICSSG_PER_IOCTL_VLAN_SET_HOSTPORT_DFLT_VID ICSSG_PER_IOCTL_VLAN_SET_MACPORT_DFLT_VID | |
EMAC_IOCTL_VLAN_GET_ENTRY | ICSSG_PER_IOCTL_VLAN_GET_ENTRY | |
EMAC_IOCTL_PORT_PRIO_MAPPING_CTRL | ENET_MACPORT_IOCTL_SET_EGRESS_QOS_PRI_MAP | |
EMAC_IOCTL_PRIO_REGEN_CTRL | ENET_MACPORT_IOCTL_SET_PRI_REGEN_MAP | |
EMAC_IOCTL_SPECIAL_FRAME_PRIO_CONFIG | IcssgMacPort_Cfg::specialFramePrio | |
EMAC_IOCTL_FDB_AGEING_TIMEOUT_CTRL | ICSSG_FDB_IOCTL_SET_AGING_PERIOD | |
EMAC_IOCTL_FDB_ENTRY_CTRL | EMAC_IOCTL_FDB_ENTRY_ADD | ICSSG_FDB_IOCTL_ADD_ENTRY |
EMAC_IOCTL_FDB_ENTRY_DELETE | ICSSG_FDB_IOCTL_REMOVE_ENTRY | |
EMAC_IOCTL_FDB_ENTRY_DELETE_ALL | ICSSG_FDB_IOCTL_REMOVE_ALL_ENTRIES | |
EMAC_IOCTL_FDB_ENTRY_DELETE_ALL_AGEABLE | ICSSG_FDB_IOCTL_REMOVE_AGEABLE_ENTRIES | |
EMAC_IOCTL_INTERFACE_MAC_CONFIG | EMAC_IOCTL_INTERFACE_MAC_ADD | ICSSG_HOSTPORT_IOCTL_SET_MACADDR ICSSG_MACPORT_IOCTL_SET_MACADDR |
EMAC_IOCTL_INGRESS_RATE_LIMIT_CTRL | ICSSG_MACPORT_IOCTL_SET_INGRESS_RATE_LIM | |
EMAC_IOCTL_FRAME_PREEMPTION_CTRL | EMAC_IOCTL_PREEMPT_TX_ENABLE | ICSSG_MACPORT_IOCTL_PREEMPT_TX_ENABLE |
EMAC_IOCTL_PREEMPT_TX_DISABLE | ICSSG_MACPORT_IOCTL_PREEMPT_TX_DISABLE | |
EMAC_IOCTL_PREEMPT_GET_TX_ENABLE_STATUS | ICSSG_MACPORT_IOCTL_PREEMPT_GET_TX_ENABLE_STATUS | |
EMAC_IOCTL_PREEMPT_GET_TX_ACTIVE_STATUS | ICSSG_MACPORT_IOCTL_PREEMPT_GET_TX_ACTIVE_STATUS | |
EMAC_IOCTL_PREEMPT_VERIFY_ENABLE | ICSSG_MACPORT_IOCTL_PREEMPT_VERIFY_ENABLE | |
EMAC_IOCTL_PREEMPT_VERIFY_DISABLE | ICSSG_MACPORT_IOCTL_PREEMPT_VERIFY_DISABLE | |
EMAC_IOCTL_PREEMPT_GET_VERIFY_STATE | ICSSG_MACPORT_IOCTL_PREEMPT_GET_VERIFY_STATE | |
EMAC_IOCTL_PREEMPT_GET_MIN_FRAG_SIZE_LOCAL | ICSSG_MACPORT_IOCTL_PREEMPT_GET_MIN_FRAG_SIZE_LOCAL | |
EMAC_IOCTL_PREEMPT_SET_MIN_FRAG_SIZE_REMOTE | ICSSG_MACPORT_IOCTL_PREEMPT_SET_MIN_FRAG_SIZE_REMOTE | |
EMAC_IOCTL_CUT_THROUGH_PREEMPT_SELECT | IcssgMacPort_Cfg::queuePreemptMode IcssgMacPort_Cfg::queueForwardMode | |
EMAC_IOCTL_SPEED_DUPLEXITY_CTRL | EMAC_IOCTL_SPEED_DUPLEXITY_10HD | No longer available as explicit IOCTLs. Speed and duplexity are passed as arguments to ENET_PER_IOCTL_OPEN_PORT_LINK in either auto-negotiation or manual modes. |
EMAC_IOCTL_SPEED_DUPLEXITY_10FD | ||
EMAC_IOCTL_SPEED_DUPLEXITY_100HD | ||
EMAC_IOCTL_SPEED_DUPLEXITY_100FD | ||
EMAC_IOCTL_SPEED_DUPLEXITY_GIGABIT | ||
EMAC_IOCTL_SPEED_DUPLEXITY_DISABLE |
EMAC LLD relies on emac_send()
and emac_poll_pkt()
for packet transmission and reception, respectively.
emac_send()
. The descriptor provides fields for packet buffer, packet length, traffic class, etc.rx_pkt_cb
) at open time, which will be called by the driver when application calls emac_poll_pkt()
and packets have been received.Internally, EMAC LLD would open all required TX channels and RX flows.
Enet LLD takes a different approach, provides a queue oriented mechanism for packet submission and retrieval.
Enet LLD API | Description |
---|---|
EnetDma_retrieveRxPktQ() | Called by application to retrieve ready packets from the driver, that is, new full packets. |
EnetDma_submitRxPktQ() | Callen by application to return free packets that the application has consumed and is ready to recycle. |
EnetDma_submitTxPktQ() | Called by application to submit ready packets to the driver for transmission. |
EnetDma_retrieveTxPktQ() | Called by application to retrieve done packets which the driver has already used for transmission and are ready to be reused for future transmission. |
The queues passed to above APIs are created by the application using EnetQueue APIs, such as EnetQueue_initQ(), EnetQueue_enq() and EnetQueue_deq().
The queues are composed of EnetDma_Pkt objects, which is the abstraction provided by Enet LLD for a packet. The native type of the packet object in AM65xx/J721E devices is EnetUdma_PktInfo. Note that this same packet object type is used for transmission and reception.