lib/linux-5.18-rc3-smdk/drivers/net/ethernet/ti/davinci_emac.c
/**
 * emac_hash_del - Hash function to delete mac addr from hash table
 * @priv: The DaVinci EMAC private adapter structure
 * @mac_addr: mac address to delete from hash table
 *
 * Removes mac address from the internal hash table
 *
 */
Hash function to delete mac addr from hash table
@priv: The DaVinci EMAC private adapter structure
@mac_addr: mac address to delete from hash table

Removes mac address from the internal hash table
Hash function to delete mac addr from hash table @priv : The DaVinci EMAC private adapter structure @mac_addr : mac address to delete from hash table Removes mac address from the internal hash table
static int emac_hash_del(struct emac_priv *priv, u8 *mac_addr)
{
	u32 hash_value;
	u32 hash_bit;
	hash_value = hash_get(mac_addr);
	if (priv->multicast_hash_cnt[hash_value] > 0) {
		--priv->multicast_hash_cnt[hash_value];
	}
	if (priv->multicast_hash_cnt[hash_value] > 0)
		return 0;
	if (hash_value < 32) {
		hash_bit = BIT(hash_value);
		priv->mac_hash1 &= ~hash_bit;
	} else {
		hash_bit = BIT((hash_value - 32));
		priv->mac_hash2 &= ~hash_bit;
	}
	return 1;
}
static int emac_hash_del ( struct emac_priv * priv , u8 * mac_addr ) { u32 hash_value ; u32 hash_bit ; hash_value = hash_get ( mac_addr ) ; if ( priv -> multicast_hash_cnt [ hash_value ] > 0 ) { -- priv -> multicast_hash_cnt [ hash_value ] ; } if ( priv -> multicast_hash_cnt [ hash_value ] > 0 ) return 0 ; if ( hash_value < 32 ) { hash_bit = BIT ( hash_value ) ; priv -> mac_hash1 &= ~ hash_bit ; } else { hash_bit = BIT ( ( hash_value - 32 ) ) ; priv -> mac_hash2 &= ~ hash_bit ; } return 1 ; }
emac_hash_del - Hash function to delete mac addr from hash table
 @priv: The DaVinci EMAC private adapter structure
 @mac_addr: mac address to delete from hash table
emac_hash_del - Hash function to delete mac addr from hash table @priv : The DaVinci EMAC private adapter structure @mac_addr : mac address to delete from hash table
/* dec cntr for num of mcast addr's mapped to this hash bit */ /* if counter still > 0, at least one multicast address refers
	 * to this hash bit. so return 0 */ /* return 1 to indicate change in mac_hash registers reqd */