e1000: convert to use netdev_for_each_mc_addr
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0ddf477b8a
commit
7a81e9f3ca
|
@ -2161,29 +2161,26 @@ static void e1000_set_rx_mode(struct net_device *netdev)
|
||||||
|
|
||||||
WARN_ON(i == rar_entries);
|
WARN_ON(i == rar_entries);
|
||||||
|
|
||||||
mc_ptr = netdev->mc_list;
|
netdev_for_each_mc_addr(mc_ptr, netdev) {
|
||||||
|
if (i == rar_entries) {
|
||||||
for (; i < rar_entries; i++) {
|
/* load any remaining addresses into the hash table */
|
||||||
if (mc_ptr) {
|
u32 hash_reg, hash_bit, mta;
|
||||||
e1000_rar_set(hw, mc_ptr->da_addr, i);
|
hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
|
||||||
mc_ptr = mc_ptr->next;
|
hash_reg = (hash_value >> 5) & 0x7F;
|
||||||
} else {
|
hash_bit = hash_value & 0x1F;
|
||||||
E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
|
mta = (1 << hash_bit);
|
||||||
E1000_WRITE_FLUSH();
|
mcarray[hash_reg] |= mta;
|
||||||
E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
|
}
|
||||||
E1000_WRITE_FLUSH();
|
else {
|
||||||
|
e1000_rar_set(hw, mc_ptr->da_addr, i++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load any remaining addresses into the hash table */
|
for (; i < rar_entries; i++) {
|
||||||
|
E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
|
||||||
for (; mc_ptr; mc_ptr = mc_ptr->next) {
|
E1000_WRITE_FLUSH();
|
||||||
u32 hash_reg, hash_bit, mta;
|
E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
|
||||||
hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
|
E1000_WRITE_FLUSH();
|
||||||
hash_reg = (hash_value >> 5) & 0x7F;
|
|
||||||
hash_bit = hash_value & 0x1F;
|
|
||||||
mta = (1 << hash_bit);
|
|
||||||
mcarray[hash_reg] |= mta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write the hash table completely, write from bottom to avoid
|
/* write the hash table completely, write from bottom to avoid
|
||||||
|
|
Loading…
Reference in New Issue