kernels/linux-2.4.0/drivers/net/dmfe.c
/*
   Calculate the CRC valude of the Rx packet
   flag = 1 : return the reverse CRC (for the received packet CRC)
   0 : return the normal CRC (for Hash Table index)
 */
Calculate the CRC valude of the Rx packet
flag = 1 : return the reverse CRC (for the received packet CRC)
0 : return the normal CRC (for Hash Table index)
Calculate the CRC valude of the Rx packet flag = 1 : return the reverse CRC ( for the received packet CRC ) 0 : return the normal CRC ( for Hash Table index )
unsigned long cal_CRC(unsigned char *Data, unsigned int Len, u8 flag)
{
	unsigned long Crc = 0xffffffff;
	while (Len--) {
		Crc = CrcTable[(Crc ^ *Data++) & 0xFF] ^ (Crc >> 8);
	}
	if (flag)
		return ~Crc;
	else
		return Crc;
}
unsigned long cal_CRC ( unsigned char * Data , unsigned int Len , u8 flag ) { unsigned long Crc = 0xffffffff ; while ( Len -- ) { Crc = CrcTable [ ( Crc ^ * Data ++ ) & 0xFF ] ^ ( Crc >> 8 ) ; } if ( flag ) return ~ Crc ; else return Crc ; }
Calculate the CRC valude of the Rx packet
flag = 1 : return the reverse CRC (for the received packet CRC)
0 : return the normal CRC (for Hash Table index)
Calculate the CRC valude of the Rx packet flag = 1 : return the reverse CRC ( for the received packet CRC ) 0 : return the normal CRC ( for Hash Table index )