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/smc911x.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/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 0f97b5af91e4..6278734c735f 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -1341,7 +1341,7 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1341 | * within that register. | 1341 | * within that register. |
1342 | */ | 1342 | */ |
1343 | else if (!netdev_mc_empty(dev)) { | 1343 | else if (!netdev_mc_empty(dev)) { |
1344 | struct dev_mc_list *cur_addr; | 1344 | struct netdev_hw_addr *ha; |
1345 | 1345 | ||
1346 | /* Set the Hash perfec mode */ | 1346 | /* Set the Hash perfec mode */ |
1347 | mcr |= MAC_CR_HPFILT_; | 1347 | mcr |= MAC_CR_HPFILT_; |
@@ -1349,19 +1349,16 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1349 | /* start with a table of all zeros: reject all */ | 1349 | /* start with a table of all zeros: reject all */ |
1350 | memset(multicast_table, 0, sizeof(multicast_table)); | 1350 | memset(multicast_table, 0, sizeof(multicast_table)); |
1351 | 1351 | ||
1352 | netdev_for_each_mc_addr(cur_addr, dev) { | 1352 | netdev_for_each_mc_addr(ha, dev) { |
1353 | u32 position; | 1353 | u32 position; |
1354 | 1354 | ||
1355 | /* do we have a pointer here? */ | ||
1356 | if (!cur_addr) | ||
1357 | break; | ||
1358 | /* make sure this is a multicast address - | 1355 | /* make sure this is a multicast address - |
1359 | shouldn't this be a given if we have it here ? */ | 1356 | shouldn't this be a given if we have it here ? */ |
1360 | if (!(*cur_addr->dmi_addr & 1)) | 1357 | if (!(*ha->addr & 1)) |
1361 | continue; | 1358 | continue; |
1362 | 1359 | ||
1363 | /* upper 6 bits are used as hash index */ | 1360 | /* upper 6 bits are used as hash index */ |
1364 | position = ether_crc(ETH_ALEN, cur_addr->dmi_addr)>>26; | 1361 | position = ether_crc(ETH_ALEN, ha->addr)>>26; |
1365 | 1362 | ||
1366 | multicast_table[position>>5] |= 1 << (position&0x1f); | 1363 | multicast_table[position>>5] |= 1 << (position&0x1f); |
1367 | } | 1364 | } |