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>
This commit is contained in:
committed by
David S. Miller
parent
a748ee2426
commit
22bedad3ce
@@ -1413,7 +1413,7 @@ static void smc_set_multicast_list(struct net_device *dev)
|
||||
* within that register.
|
||||
*/
|
||||
else if (!netdev_mc_empty(dev)) {
|
||||
struct dev_mc_list *cur_addr;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
/* table for flipping the order of 3 bits */
|
||||
static const unsigned char invert3[] = {0, 4, 2, 6, 1, 5, 3, 7};
|
||||
@@ -1421,16 +1421,16 @@ static void smc_set_multicast_list(struct net_device *dev)
|
||||
/* start with a table of all zeros: reject all */
|
||||
memset(multicast_table, 0, sizeof(multicast_table));
|
||||
|
||||
netdev_for_each_mc_addr(cur_addr, dev) {
|
||||
netdev_for_each_mc_addr(ha, dev) {
|
||||
int position;
|
||||
|
||||
/* make sure this is a multicast address -
|
||||
shouldn't this be a given if we have it here ? */
|
||||
if (!(*cur_addr->dmi_addr & 1))
|
||||
if (!(*ha->addr & 1))
|
||||
continue;
|
||||
|
||||
/* only use the low order bits */
|
||||
position = crc32_le(~0, cur_addr->dmi_addr, 6) & 0x3f;
|
||||
position = crc32_le(~0, ha->addr, 6) & 0x3f;
|
||||
|
||||
/* do some messy swapping to put the bit in the right spot */
|
||||
multicast_table[invert3[position&7]] |=
|
||||
|
Reference in New Issue
Block a user