Digi NS7520 manual W . d i g i . c o m

Models: NS7520

1 332
Download 332 pages 47.95 Kb
Page 219
Image 219

E t h e r n e t M o d u l e

*

*This routine creates a hash table based on the CRC values of

*the MAC addresses set up by eth_add_mca(). The CRC value of

*each MAC address is calculated and the lower six bits are used

*to generate a value between 0 and 64. The corresponding bit in

*the 64-bit hash table is then set.

*

*Parameters:

*

hash_table

pointer to buffer to store hash table in

*

 

 

*Return Values:

*none

*

*/

static void eth_make_has_table (WORD16 *hash_table)

{

int index:

memset (hash_table, 0, 8);

/* clear hash table*/

for (index = 0; index < mca_count; index++)/* for each mca address*/

{

set_has_bit ((BYTE *) hash_table, calculate_hash_bit mca_address [index]));

}

}

/*

*Function: void set_hash_bit (BYTE *table, int bit)

*Description:

*

*This routine sets the appropriate bit in the hash table.

*Parameters:

*

*table pointer to hash table

*

bit

position of bit to set

*

 

 

*

Return Values:

w w w . d i g i . c o m

2 0 5

Page 219
Image 219
Digi NS7520 manual W . d i g i . c o m