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
@@ -328,7 +328,7 @@ static int cpmac_config(struct net_device *dev, struct ifmap *map)
|
||||
|
||||
static void cpmac_set_multicast_list(struct net_device *dev)
|
||||
{
|
||||
struct dev_mc_list *iter;
|
||||
struct netdev_hw_addr *ha;
|
||||
u8 tmp;
|
||||
u32 mbp, bit, hash[2] = { 0, };
|
||||
struct cpmac_priv *priv = netdev_priv(dev);
|
||||
@@ -348,19 +348,19 @@ static void cpmac_set_multicast_list(struct net_device *dev)
|
||||
* cpmac uses some strange mac address hashing
|
||||
* (not crc32)
|
||||
*/
|
||||
netdev_for_each_mc_addr(iter, dev) {
|
||||
netdev_for_each_mc_addr(ha, dev) {
|
||||
bit = 0;
|
||||
tmp = iter->dmi_addr[0];
|
||||
tmp = ha->addr[0];
|
||||
bit ^= (tmp >> 2) ^ (tmp << 4);
|
||||
tmp = iter->dmi_addr[1];
|
||||
tmp = ha->addr[1];
|
||||
bit ^= (tmp >> 4) ^ (tmp << 2);
|
||||
tmp = iter->dmi_addr[2];
|
||||
tmp = ha->addr[2];
|
||||
bit ^= (tmp >> 6) ^ tmp;
|
||||
tmp = iter->dmi_addr[3];
|
||||
tmp = ha->addr[3];
|
||||
bit ^= (tmp >> 2) ^ (tmp << 4);
|
||||
tmp = iter->dmi_addr[4];
|
||||
tmp = ha->addr[4];
|
||||
bit ^= (tmp >> 4) ^ (tmp << 2);
|
||||
tmp = iter->dmi_addr[5];
|
||||
tmp = ha->addr[5];
|
||||
bit ^= (tmp >> 6) ^ tmp;
|
||||
bit &= 0x3f;
|
||||
hash[bit / 32] |= 1 << (bit % 32);
|
||||
|
Reference in New Issue
Block a user