aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-22 04:10:44 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-22 18:45:51 -0500
commit7a81e9f3ca712db82344ea3ab2a5879241f59c48 (patch)
tree0fb735aa960e09d3fb4109412f7ba06cf6c9b4b0 /drivers/net/e1000
parent0ddf477b8a9b02412a6cabd51c486998811c7dd1 (diff)
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>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_main.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 3b14dd718ab4..c99f95c1b418 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2161,29 +2161,26 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2161 2161
2162 WARN_ON(i == rar_entries); 2162 WARN_ON(i == rar_entries);
2163 2163
2164 mc_ptr = netdev->mc_list; 2164 netdev_for_each_mc_addr(mc_ptr, netdev) {
2165 2165 if (i == rar_entries) {
2166 for (; i < rar_entries; i++) { 2166 /* load any remaining addresses into the hash table */
2167 if (mc_ptr) { 2167 u32 hash_reg, hash_bit, mta;
2168 e1000_rar_set(hw, mc_ptr->da_addr, i); 2168 hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
2169 mc_ptr = mc_ptr->next; 2169 hash_reg = (hash_value >> 5) & 0x7F;
2170 } else { 2170 hash_bit = hash_value & 0x1F;
2171 E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0); 2171 mta = (1 << hash_bit);
2172 E1000_WRITE_FLUSH(); 2172 mcarray[hash_reg] |= mta;
2173 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0); 2173 }
2174 E1000_WRITE_FLUSH(); 2174 else {
2175 e1000_rar_set(hw, mc_ptr->da_addr, i++);
2175 } 2176 }
2176 } 2177 }
2177 2178
2178 /* load any remaining addresses into the hash table */ 2179 for (; i < rar_entries; i++) {
2179 2180 E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
2180 for (; mc_ptr; mc_ptr = mc_ptr->next) { 2181 E1000_WRITE_FLUSH();
2181 u32 hash_reg, hash_bit, mta; 2182 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
2182 hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr); 2183 E1000_WRITE_FLUSH();
2183 hash_reg = (hash_value >> 5) & 0x7F;
2184 hash_bit = hash_value & 0x1F;
2185 mta = (1 << hash_bit);
2186 mcarray[hash_reg] |= mta;
2187 } 2184 }
2188 2185
2189 /* write the hash table completely, write from bottom to avoid 2186 /* write the hash table completely, write from bottom to avoid