]> bbs.cooldavid.org Git - jme.git/commitdiff
net: convert multicast list to list_head
authorJiri Pirko <jpirko@redhat.com>
Thu, 1 Apr 2010 21:22:57 +0000 (21:22 +0000)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Tue, 3 Aug 2010 13:08:56 +0000 (21:08 +0800)
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>
jme.c

diff --git a/jme.c b/jme.c
index 8f1e931b22eead03b8816daa7365868315260e48..c5f92023afa456322cf1042eca14af0e0270d0e1 100644 (file)
--- 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) {
        } 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;
                struct dev_mc_list *mclist;
+#else
+               struct netdev_hw_addr *ha;
+#endif
                int bit_nr;
 
                jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED;
                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) {
                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) {
                netdev_for_each_mc_addr(mclist, netdev) {
+#else
+               netdev_for_each_mc_addr(ha, netdev) {
 #endif
 #endif
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
                        bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3F;
                        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);
                }
 
                        mc_hash[bit_nr >> 5] |= 1 << (bit_nr & 0x1F);
                }