Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a81e9f3 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

e1000: convert to use netdev_for_each_mc_addr

parent 0ddf477b
Loading
Loading
Loading
Loading
+17 −20
Original line number Diff line number Diff line
@@ -2161,23 +2161,9 @@ static void e1000_set_rx_mode(struct net_device *netdev)

	WARN_ON(i == rar_entries);

	mc_ptr = netdev->mc_list;

	for (; i < rar_entries; i++) {
		if (mc_ptr) {
			e1000_rar_set(hw, mc_ptr->da_addr, i);
			mc_ptr = mc_ptr->next;
		} else {
			E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
			E1000_WRITE_FLUSH();
			E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
			E1000_WRITE_FLUSH();
		}
	}

	netdev_for_each_mc_addr(mc_ptr, netdev) {
		if (i == rar_entries) {
			/* load any remaining addresses into the hash table */

	for (; mc_ptr; mc_ptr = mc_ptr->next) {
			u32 hash_reg, hash_bit, mta;
			hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
			hash_reg = (hash_value >> 5) & 0x7F;
@@ -2185,6 +2171,17 @@ static void e1000_set_rx_mode(struct net_device *netdev)
			mta = (1 << hash_bit);
			mcarray[hash_reg] |= mta;
		}
		else {
			e1000_rar_set(hw, mc_ptr->da_addr, i++);
		}
	}

	for (; i < rar_entries; i++) {
		E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
		E1000_WRITE_FLUSH();
		E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
		E1000_WRITE_FLUSH();
	}

	/* write the hash table completely, write from bottom to avoid
	 * both stupid write combining chipsets, and flushing each write */