/* Generates a multicast address hash value which is used to determine the multicast filter table array address and new table value. See igb_mta_set()  */
static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
/* Generates a multicast address hash value which is used to determine the multicast filter table array address and new table value. See igb_mta_set()  */
static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
{
	u32 hash_value, hash_mask;
	u8 bit_shift = 0;
	hash_mask = (hw->mac.mta_reg_count * 32) - 1;
	while (hash_mask >> bit_shift != 0xFF)
		bit_shift++;
	switch (hw->mac.mc_filter_type) {
	default:
	case 0:
		break;
	case 1:
		bit_shift += 1;
		break;
	case 2:
		bit_shift += 2;
		break;
	case 3:
		bit_shift += 4;
		break;
	}
	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
				  (((u16) mc_addr[5]) << bit_shift)));
	return hash_value;
}