aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/e1000_mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/igb/e1000_mac.c')
-rw-r--r--drivers/net/igb/e1000_mac.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index 60343b58364d..46e27e98254a 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -261,6 +261,41 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
261} 261}
262 262
263/** 263/**
264 * igb_update_mc_addr_list - Update Multicast addresses
265 * @hw: pointer to the HW structure
266 * @mc_addr_list: array of multicast addresses to program
267 * @mc_addr_count: number of multicast addresses to program
268 *
269 * Updates entire Multicast Table Array.
270 * The caller must have a packed mc_addr_list of multicast addresses.
271 **/
272void igb_update_mc_addr_list(struct e1000_hw *hw,
273 u8 *mc_addr_list, u32 mc_addr_count)
274{
275 u32 hash_value, hash_bit, hash_reg;
276 int i;
277
278 /* clear mta_shadow */
279 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
280
281 /* update mta_shadow from mc_addr_list */
282 for (i = 0; (u32) i < mc_addr_count; i++) {
283 hash_value = igb_hash_mc_addr(hw, mc_addr_list);
284
285 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
286 hash_bit = hash_value & 0x1F;
287
288 hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
289 mc_addr_list += (ETH_ALEN);
290 }
291
292 /* replace the entire MTA table */
293 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
294 array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
295 wrfl();
296}
297
298/**
264 * igb_hash_mc_addr - Generate a multicast hash value 299 * igb_hash_mc_addr - Generate a multicast hash value
265 * @hw: pointer to the HW structure 300 * @hw: pointer to the HW structure
266 * @mc_addr: pointer to a multicast address 301 * @mc_addr: pointer to a multicast address