E F E c o n f i g u r a t i o n

Calculating hash table entries

The C code in this section describes how to calculate the hash table entries based on 6-byte Ethernet destination addresses.

static

ETH_ADDRESS mca_address[MAX_MCA];

/*list

of MCA addresses*/

static

INT16 mca_count;

/*# of

MCA addresses*/

/*

*Function: void eth_load_mca_table (void)

*Description:

*

*This routine loads the MCA table. It generates a hash table for

*the MCA addresses currently registered and then loads this table

*into the NS7520 chip.

*

*Parameters:

*none

*

*Return values

*none

*

*/

static void eth_load_mca_table (void)

{

WORD16 hash_table[4];

//create hash table for MAC address eth_make_hash_table (hash_table);

(*NS7520_EFE) .ht4.bits.data = SWAP16(hash_table[3]);

(*NS7520_EFE) .ht3.bits.data = SWAP16(hash_table[2]);

(*NS7520_EFE) .ht2.bits.data = SWAP16(hash_table[1]);

(*NS7520_EFE) .ht1.bits.data = SWAP16(hash_table[0]);

}

/*

*Function: void eth_make_hash_table

*Description:

2 0 4

N S 7 5 2 0 H a r d w a r e R e f e r e n c e , R e v . D 0 3 / 2 0 0 6

Page 218
Image 218
Digi NS7520 manual Calculating hash table entries