kernels/linux-2.4.0/drivers/net/dmfe.c
/* Send a setup frame for DM9132
   This setup frame initilize DM910X addres filter mode
 */
Send a setup frame for DM9132
This setup frame initilize DM910X addres filter mode
Send a setup frame for DM9132 This setup frame initilize DM910X addres filter mode
static void dm9132_id_table(struct net_device *dev, int mc_cnt)
{
	struct dev_mc_list *mcptr;
	u16 *addrptr;
	u32 ioaddr = dev->base_addr + 0xc0;	
	u32 hash_val;
	u16 i, hash_table[4];
	DMFE_DBUG(0, "dm9132_id_table()", 0);
	addrptr = (u16 *) dev->dev_addr;
	outw(addrptr[0], ioaddr);
	ioaddr += 4;
	outw(addrptr[1], ioaddr);
	ioaddr += 4;
	outw(addrptr[2], ioaddr);
	ioaddr += 4;
	for (i = 0; i < 4; i++)
		hash_table[i] = 0x0;
	hash_table[3] = 0x8000;
	for (mcptr = dev->mc_list, i = 0; i < mc_cnt; i++, mcptr = mcptr->next) {
		hash_val = cal_CRC((char *) mcptr->dmi_addr, 6, 0) & 0x3f;
		hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
	}
	for (i = 0; i < 4; i++, ioaddr += 4) {
		outw(hash_table[i], ioaddr);
	}
}
static void dm9132_id_table ( struct net_device * dev , int mc_cnt ) { struct dev_mc_list * mcptr ; u16 * addrptr ; u32 ioaddr = dev -> base_addr + 0xc0 ; u32 hash_val ; u16 i , hash_table [ 4 ] ; DMFE_DBUG ( 0 , " " , 0 ) ; addrptr = ( u16 * ) dev -> dev_addr ; outw ( addrptr [ 0 ] , ioaddr ) ; ioaddr += 4 ; outw ( addrptr [ 1 ] , ioaddr ) ; ioaddr += 4 ; outw ( addrptr [ 2 ] , ioaddr ) ; ioaddr += 4 ; for ( i = 0 ; i < 4 ; i ++ ) hash_table [ i ] = 0x0 ; hash_table [ 3 ] = 0x8000 ; for ( mcptr = dev -> mc_list , i = 0 ; i < mc_cnt ; i ++ , mcptr = mcptr -> next ) { hash_val = cal_CRC ( ( char * ) mcptr -> dmi_addr , 6 , 0 ) & 0x3f ; hash_table [ hash_val / 16 ] |= ( u16 ) 1 << ( hash_val % 16 ) ; } for ( i = 0 ; i < 4 ; i ++ , ioaddr += 4 ) { outw ( hash_table [ i ] , ioaddr ) ; } }
Send a setup frame for DM9132
This setup frame initilize DM910X addres filter mode
Send a setup frame for DM9132 This setup frame initilize DM910X addres filter mode
/* ID Table */ /* Node address */ /* Clear Hash Table */ /* broadcast address */ /* the multicast address in Hash Table : 64 bits */ /* Write the hash table to MAC MD table */