09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> Ethernet (ETH): media access control (MAC) with DMA controller<br />

the Status words for the frames that were flushed. The Transmit FIFO Flush control register<br />

bit is then cleared. At this point, new frames from the application (DMA) are accepted. All<br />

data presented for transmission after a Flush operation are discarded unless they start with<br />

an SOF marker.<br />

Transmit status word<br />

At the end of the Ethernet frame transfer to the MAC core and after the core has completed<br />

the transmission of the frame, the transmit status is given to the application. The detailed<br />

description of the Transmit Status is the same as for bits [23:0] in TDES0. If IEEE 1588 time<br />

stamping is enabled, a specific frames’ 64-bit time stamp is returned, along with the transmit<br />

status.<br />

Transmit checksum offload<br />

Communication protocols such as TCP and UDP implement checksum fields, which helps<br />

determine the integrity of data transmitted over a network. Because the most widespread<br />

use of Ethernet is to encapsulate TCP and UDP over IP datagrams, the Ethernet controller<br />

has a transmit checksum offload feature that supports checksum calculation and insertion in<br />

the transmit path, and error detection in the receive path. This section explains the operation<br />

of the checksum offload feature for transmitted frames.<br />

Note: The checksum for TCP, UDP or ICMP is calculated over a complete frame, then inserted into<br />

its corresponding header field. Due to this requirement, this function is enabled only when<br />

the Transmit FIFO is configured for Store-and-forward mode (that is, when the TSF bit is set<br />

in the ETH_ETH_DMAOMR register). If the core is configured for Threshold (cut-through)<br />

mode, the Transmit checksum offload is bypassed.<br />

You must make sure the Transmit FIFO is deep enough to store a complete frame before<br />

that frame is transferred to the MAC Core transmitter. If the FIFO depth is less than the input<br />

Ethernet frame size, the payload (TCP/UDP/ICMP) checksum insertion function is bypassed<br />

and only the frame’s IPv4 Header checksum is modified, even in Store-and-forward mode.<br />

The transmit checksum offload supports two types of checksum calculation and insertion.<br />

This checksum can be controlled for each frame by setting the CIC bits (Bits 28:27 in<br />

TDES1, described in TDES1: Transmit descriptor Word1 on page 951).<br />

See IETF specifications RFC 791, RFC 793, RFC 768, RFC 792, RFC 2460 and RFC 4443<br />

for IPv4, TCP, UDP, ICMP, IPv6 and ICMPv6 packet header specifications, respectively.<br />

● IP header checksum<br />

In IPv4 datagrams, the integrity of the header fields is indicated by the 16-bit header<br />

checksum field (the eleventh and twelfth bytes of the IPv4 datagram). The checksum<br />

offload detects an IPv4 datagram when the Ethernet frame’s Type field has the value<br />

0x0800 and the IP datagram’s Version field has the value 0x4. The input frame’s<br />

checksum field is ignored during calculation and replaced by the calculated value. IPv6<br />

headers do not have a checksum field; thus, the checksum offload does not modify<br />

IPv6 header fields. The result of this IP header checksum calculation is indicated by the<br />

IP Header Error status bit in the Transmit status (Bit 16). This status bit is set whenever<br />

the values of the Ethernet Type field and the IP header’s Version field are not<br />

consistent, or when the Ethernet frame does not have enough data, as indicated by the<br />

Doc ID 018909 Rev 3 918/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!