EasyManua.ls Logo

Broadcom BCM5722 - Page 158

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 99 Packet Filtering Document 5722-PG101-R
// The most significant 7 bits of the CRC32 (no inversion),
// are used to index into one of the possible 128 bit positions.
Bitpos = ~Crc32 & 0x7f;
// Hash register index.
RegIndex = (Bitpos & 0x60) >> 5;
// Bit to turn on within a hash register.
Bitpos &= 0x1f;
// Enable the multicast bit.
HashReg[RegIndex] |= (1 << Bitpos);
}
The following C routine computes the Ethernet CRC32 value from a given byte stream. The routine is called from the above
code fragment.
// Routine for generating CRC32.
unsigned long
ComputeCrc32(
unsigned char *pBuffer, // Buffer containing the byte stream.
unsigned long BufferSize) // Size of the buffer.
{
unsigned long Reg;
unsigned long Tmp;
unsigned long j, k;
Reg = 0xffffffff;
for(j = 0; j < BufferSize; j++)
{
Reg ^= pBuffer[j];
for(k = 0; k < 8; k++)
{
Tmp = Reg & 0x01;
Reg >>= 1;
if(Tmp)
{
Reg ^= 0xedb88320;
}
}
}
return ~Reg;
}
PROMISCUOUS MODE SETUP/CONFIGURATION
The host software may enable promiscuous mode by setting the Promiscous_Mode bit (bit 8) of the Receive_MAC_Mode
register (offset 0x468). The Promiscous_Mode bit defaults to disabled after reset, and host software must explicitly set this
bit for promiscuous mode. In promiscuous mode of operation, the BCM5722 Ethernet controller accepts all incoming frames
that are not filtered by the active receive rules regardless of the destination MAC address. In other words, the BCM5722
Ethernet controller operating in promiscuous mode ignores multicast and MAC address filtering (“Multicast Hash Table
Setup/Configuration” on page 97 and “MAC Address Setup/Configuration” on page 96) but applies Receive Rules.

Table of Contents