Digi NS7520 DJ Equipment User Manual


 
EFE configuration
204       
NS7520 Hardware Reference, Rev. D 03/2006
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: