aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-09-17 10:52:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-21 14:32:33 -0400
commit44c852ead55b7450c8cff0dc90a3d48310300210 (patch)
treee8c56c564e83753da840080202766553c397d699 /drivers/net/igb
parentbb5a9ad2b81bba0cccc1c78f101e38ea785c56b3 (diff)
igb: resolve namespacecheck warning for igb_hash_mc_addr
This patch resolves a warning seen when doing namespace checking via "make namespacecheck" Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/e1000_mac.c72
-rw-r--r--drivers/net/igb/e1000_mac.h1
2 files changed, 36 insertions, 37 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index a0231cd079f1..7d76bb085e10 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -286,41 +286,6 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
286} 286}
287 287
288/** 288/**
289 * igb_update_mc_addr_list - Update Multicast addresses
290 * @hw: pointer to the HW structure
291 * @mc_addr_list: array of multicast addresses to program
292 * @mc_addr_count: number of multicast addresses to program
293 *
294 * Updates entire Multicast Table Array.
295 * The caller must have a packed mc_addr_list of multicast addresses.
296 **/
297void igb_update_mc_addr_list(struct e1000_hw *hw,
298 u8 *mc_addr_list, u32 mc_addr_count)
299{
300 u32 hash_value, hash_bit, hash_reg;
301 int i;
302
303 /* clear mta_shadow */
304 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
305
306 /* update mta_shadow from mc_addr_list */
307 for (i = 0; (u32) i < mc_addr_count; i++) {
308 hash_value = igb_hash_mc_addr(hw, mc_addr_list);
309
310 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
311 hash_bit = hash_value & 0x1F;
312
313 hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
314 mc_addr_list += (ETH_ALEN);
315 }
316
317 /* replace the entire MTA table */
318 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
319 array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
320 wrfl();
321}
322
323/**
324 * igb_hash_mc_addr - Generate a multicast hash value 289 * igb_hash_mc_addr - Generate a multicast hash value
325 * @hw: pointer to the HW structure 290 * @hw: pointer to the HW structure
326 * @mc_addr: pointer to a multicast address 291 * @mc_addr: pointer to a multicast address
@@ -329,7 +294,7 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
329 * the multicast filter table array address and new table value. See 294 * the multicast filter table array address and new table value. See
330 * igb_mta_set() 295 * igb_mta_set()
331 **/ 296 **/
332u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) 297static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
333{ 298{
334 u32 hash_value, hash_mask; 299 u32 hash_value, hash_mask;
335 u8 bit_shift = 0; 300 u8 bit_shift = 0;
@@ -392,6 +357,41 @@ u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
392} 357}
393 358
394/** 359/**
360 * igb_update_mc_addr_list - Update Multicast addresses
361 * @hw: pointer to the HW structure
362 * @mc_addr_list: array of multicast addresses to program
363 * @mc_addr_count: number of multicast addresses to program
364 *
365 * Updates entire Multicast Table Array.
366 * The caller must have a packed mc_addr_list of multicast addresses.
367 **/
368void igb_update_mc_addr_list(struct e1000_hw *hw,
369 u8 *mc_addr_list, u32 mc_addr_count)
370{
371 u32 hash_value, hash_bit, hash_reg;
372 int i;
373
374 /* clear mta_shadow */
375 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
376
377 /* update mta_shadow from mc_addr_list */
378 for (i = 0; (u32) i < mc_addr_count; i++) {
379 hash_value = igb_hash_mc_addr(hw, mc_addr_list);
380
381 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
382 hash_bit = hash_value & 0x1F;
383
384 hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
385 mc_addr_list += (ETH_ALEN);
386 }
387
388 /* replace the entire MTA table */
389 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
390 array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
391 wrfl();
392}
393
394/**
395 * igb_clear_hw_cntrs_base - Clear base hardware counters 395 * igb_clear_hw_cntrs_base - Clear base hardware counters
396 * @hw: pointer to the HW structure 396 * @hw: pointer to the HW structure
397 * 397 *
diff --git a/drivers/net/igb/e1000_mac.h b/drivers/net/igb/e1000_mac.h
index 7518af8cbbf5..bca17d882417 100644
--- a/drivers/net/igb/e1000_mac.h
+++ b/drivers/net/igb/e1000_mac.h
@@ -88,6 +88,5 @@ enum e1000_mng_mode {
88#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2 88#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2
89 89
90extern void e1000_init_function_pointers_82575(struct e1000_hw *hw); 90extern void e1000_init_function_pointers_82575(struct e1000_hw *hw);
91extern u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
92 91
93#endif 92#endif