EasyManua.ls Logo

Broadcom BCM5722 - Page 156

Broadcom BCM5722
593 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BCM5722 Programmer’s Guide
10/15/07
Broadcom Corporation
Page 97 Packet Filtering Document 5722-PG101-R
PACKET FILTERING
MULTICAST HASH TABLE SETUP/CONFIGURATION
The MAC hash registers are used to help discard unwanted multicast packets as they are received from the external media.
The destination address is fed into the normal CRC algorithm in order to generate a hash function. The most significant bits
of the CRC are then used without any inversion in reverse order to index into a hash table, which is comprised of these MAC
hash registers. If the CRC is calculated by shifting right, then the right-most bits of the CRC can be directly used with no
additional inversion or bit swapping required. See “Ethernet CRC Calculation” for more details on the CRC algorithm.
All four MAC hash registers are used so that register 1 bit-32 is the most significant hash table entry and register 4 bit-0 is
the least significant hash table entry. This follows the normal big-endian ordering used throughout the BCM5722 Ethernet
controller. Since there are 128 hash table entries, 7 bits are used from the CRC. When hash table is extended to 256 entries,
8bits from the CRC will be used as hash index.
The MAC hash registers are ignored if the receive MAC is in promiscuous mode.
ETHERNET CRC CALCULATION
The BCM5722 Ethernet controller uses the standard 32-bit CRC required by the Ethernet specification as its FCS in all
packets. The checksum is the 32-bit remainder of the polynomial division of the data taken as a bit stream of polynomial
coefficients and a predefined constant, which also represents binary polynomial coefficients. The checksum is optionally
appended most-significant bit first to a packet, which is to be sent down the wire. At the receiving side, the division is
repeated on the entire packet including the CRC checksum. The remainder is compared to a known constant. For details on
the mathematical basis for CRC checksums, see Tanenbaum's Computer Networks, Third Edition, c1996.
The 32-bit CRC polynomial divisor is shown below:
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1
GENERATING CRC
The following steps describe a method to calculate the CRC with the resulting 32-bit quantity having reversed bit order (i.e.,
most significant bit x31 of the remainder is right-most bit). The data should be treated as a stream of bytes. Set remainder
to 0xFFFFFFFF. For each bit of data starting with least-significant bit of each byte:
1. If right-most bit (bit-0) of the current remainder XORed with the data bit equal 1,
then remainder = (remainder shifted right one bit) XOR 0xEDB88320,
else remainder = (remainder shifted right one bit).
2. Invert remainder such that remainder = ~remainder.
Remainder is CRC checksum.
Right-most byte is the most significant and is to be sent first.
Swap bytes of CRC if big-endian byte ordering is desired.

Table of Contents