diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-04-01 17:22:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-03 17:22:15 -0400 |
commit | 22bedad3ce112d5ca1eaf043d4990fa2ed698c87 (patch) | |
tree | b6fba5688d48b1396f01d13ee53610dea7749c15 /drivers/net/smc9194.c | |
parent | a748ee2426817a95b1f03012d8f339c45c722ae1 (diff) |
net: convert multicast list to list_head
Converts the list and the core manipulating with it to be the same as uc_list.
+uses two functions for adding/removing mc address (normal and "global"
variant) instead of a function parameter.
+removes dev_mcast.c completely.
+exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
manipulation with lists on a sandbox (used in bonding and 80211 drivers)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smc9194.c')
-rw-r--r-- | drivers/net/smc9194.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c index ee1487791d55..9e5e9e792e86 100644 --- a/drivers/net/smc9194.c +++ b/drivers/net/smc9194.c | |||
@@ -417,7 +417,7 @@ static void smc_shutdown( int ioaddr ) | |||
417 | 417 | ||
418 | 418 | ||
419 | /* | 419 | /* |
420 | . Function: smc_setmulticast( int ioaddr, int count, dev_mc_list * adds ) | 420 | . Function: smc_setmulticast( int ioaddr, struct net_device *dev ) |
421 | . Purpose: | 421 | . Purpose: |
422 | . This sets the internal hardware table to filter out unwanted multicast | 422 | . This sets the internal hardware table to filter out unwanted multicast |
423 | . packets before they take up memory. | 423 | . packets before they take up memory. |
@@ -438,26 +438,23 @@ static void smc_setmulticast(int ioaddr, struct net_device *dev) | |||
438 | { | 438 | { |
439 | int i; | 439 | int i; |
440 | unsigned char multicast_table[ 8 ]; | 440 | unsigned char multicast_table[ 8 ]; |
441 | struct dev_mc_list *cur_addr; | 441 | struct netdev_hw_addr *ha; |
442 | /* table for flipping the order of 3 bits */ | 442 | /* table for flipping the order of 3 bits */ |
443 | unsigned char invert3[] = { 0, 4, 2, 6, 1, 5, 3, 7 }; | 443 | unsigned char invert3[] = { 0, 4, 2, 6, 1, 5, 3, 7 }; |
444 | 444 | ||
445 | /* start with a table of all zeros: reject all */ | 445 | /* start with a table of all zeros: reject all */ |
446 | memset( multicast_table, 0, sizeof( multicast_table ) ); | 446 | memset( multicast_table, 0, sizeof( multicast_table ) ); |
447 | 447 | ||
448 | netdev_for_each_mc_addr(cur_addr, dev) { | 448 | netdev_for_each_mc_addr(ha, dev) { |
449 | int position; | 449 | int position; |
450 | 450 | ||
451 | /* do we have a pointer here? */ | ||
452 | if ( !cur_addr ) | ||
453 | break; | ||
454 | /* make sure this is a multicast address - shouldn't this | 451 | /* make sure this is a multicast address - shouldn't this |
455 | be a given if we have it here ? */ | 452 | be a given if we have it here ? */ |
456 | if ( !( *cur_addr->dmi_addr & 1 ) ) | 453 | if (!(*ha->addr & 1)) |
457 | continue; | 454 | continue; |
458 | 455 | ||
459 | /* only use the low order bits */ | 456 | /* only use the low order bits */ |
460 | position = ether_crc_le(6, cur_addr->dmi_addr) & 0x3f; | 457 | position = ether_crc_le(6, ha->addr) & 0x3f; |
461 | 458 | ||
462 | /* do some messy swapping to put the bit in the right spot */ | 459 | /* do some messy swapping to put the bit in the right spot */ |
463 | multicast_table[invert3[position&7]] |= | 460 | multicast_table[invert3[position&7]] |= |