From: Jiri Pirko Date: Thu, 1 Apr 2010 21:22:57 +0000 (+0000) Subject: net: convert multicast list to list_head X-Git-Tag: bp-1.0.7~15 X-Git-Url: http://bbs.cooldavid.org/git/?p=jme.git;a=commitdiff_plain;h=8e14c278ad90df8fdeb4c0e8b95e3ae3c3835d83;hp=38d1bc091b7a441c6418020aa717dabebc242dfa 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 Signed-off-by: David S. Miller --- diff --git a/jme.c b/jme.c index 8f1e931..c5f9202 100644 --- a/jme.c +++ b/jme.c @@ -2122,7 +2122,11 @@ jme_set_multi(struct net_device *netdev) } else if (netdev->flags & IFF_ALLMULTI) { jme->reg_rxmcs |= RXMCS_ALLMULFRAME; } else if (netdev->flags & IFF_MULTICAST) { +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) struct dev_mc_list *mclist; +#else + struct netdev_hw_addr *ha; +#endif int bit_nr; jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED; @@ -2130,10 +2134,16 @@ jme_set_multi(struct net_device *netdev) for (i = 0, mclist = netdev->mc_list; mclist && i < netdev->mc_count; ++i, mclist = mclist->next) { -#else +#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) netdev_for_each_mc_addr(mclist, netdev) { +#else + netdev_for_each_mc_addr(ha, netdev) { #endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3F; +#else + bit_nr = ether_crc(ETH_ALEN, ha->addr) & 0x3F; +#endif mc_hash[bit_nr >> 5] |= 1 << (bit_nr & 0x1F); }