kernels/linux-2.4.0/drivers/net/sis900.c
/**
 *	sis900_compute_hashtable_index: - compute hashtable index 
 *	@addr: multicast address
 *
 *	SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast
 *	hash table, which makes this function a little bit different from other drivers
 */
- compute hashtable index
@addr: multicast address

SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast
hash table, which makes this function a little bit different from other drivers
- compute hashtable index @addr : multicast address SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast hash table which makes this function a little bit different from other drivers
static u16 sis900_compute_hashtable_index(u8 *addr)
{
#define POLYNOMIAL 0x04C11DB7L
	u32 crc = 0xffffffff, msb;
	int  i, j;
	u32  byte;
	for (i = 0; i < 6; i++) {
		byte = *addr++;
		for (j = 0; j < 8; j++) {
			msb = crc >> 31;
			crc <<= 1;
			if (msb ^ (byte & 1)) {
				crc ^= POLYNOMIAL;
			}
			byte >>= 1;
		}
	}
	return ((int)(crc >> 25));
}
static u16 sis900_compute_hashtable_index ( u8 * addr ) { #define POLYNOMIAL  0x04C11DB7L u32 crc = 0xffffffff , msb ; int i , j ; u32 byte ; for ( i = 0 ; i < 6 ; i ++ ) { byte = * addr ++ ; for ( j = 0 ; j < 8 ; j ++ ) { msb = crc >> 31 ; crc <<= 1 ; if ( msb ^ ( byte & 1 ) ) { crc ^= POLYNOMIAL ; } byte >>= 1 ; } } return ( ( int ) ( crc >> 25 ) ) ; }
sis900_compute_hashtable_index: - compute hashtable index
      @addr: multicast address
sis900_compute_hashtable_index : - compute hashtable index @addr : multicast address
/* what is the correct value of the POLYNOMIAL ??
   Donald Becker use 0x04C11DB7U
   Joseph Zbiciak im14u2c@primenet.com gives me the
   correct answer, thank you Joe !! */ /* leave 7 most siginifant bits */