Programmer’s Guide BCM5722
10/15/07
Broadcom Corporation
Document 5722-PG101-R Checksum Calculation Page 68
Class of Service Example
If either Start of IP Header, Start of TCP Header, or Start of UDP Header is specified, and the frame has no IP, TCP, or UDP
header, respectively, there is no frame match. The full set of rules provides a fairly rich selection and filtering criteria.
Example: If you wanted to set a Class of Service (CoS) of 2 based on the eighth byte in the data portion of an
encapsulated IPX frame using Ethernet Type 2 having a value greater than 6, you could set up the rules shown in
Figure 27.
Figure 27: Class of Service Example
CHECKSUM CALCULATION
Whether the host software NOS supports checksum offload or not, the BCM5722 Ethernet controller automatically calculates
the IP, TCP, and UDP of received packets as described in RFC 791, RFC 793, and RFC 768, respectively.
Which protocol checksum value is produced can be determined by reading the status flag field in the Receive Return Ring.
The valid flag values in the status flag field are IP_CHECKSUM and TCP_UDP_CHECKSUM. When a valid checksum is
produced, the values of the checksums are found in the corresponding receive buffer descriptor register. These values
should be 0xFFFF for a valid checksum or any other value if the checksum was incorrectly calculated. Assert the Receive
No Pseudo-header Checksum bit of the Mode Control register (see “Mode Control Register (Offset 0x6800)” on page 333)
to not to include Pseudo-header in TCP/UDP checksums.
Rule 1: Control = 0xc400020C
Where: Enable + And with next (chain with next rule)
Mask -Value/Mask is split into two 16-bit value
Class -Return Ring 2
Offset -12 bytes from start of frame
Mask/Value = 0xffff 8137
Where: Mask – 0xffff
Value - IPX
Rule 2: Control
= 0x84028207
Where: Enable
Mask – Value/Mask split into two 16-bit values
Comparison Operator –Greater Than
Header Type – Start of Data
Offset – 7 bytes from start of data
Mask/Value =0xff00 0600
Where: Mask – 0xff00
Value – 0600
Header Type – Start of Data
Comparison Operator –Equal
Class -Return Ring 2