]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/tulip/de2104x.c
net: convert multicast list to list_head
[net-next-2.6.git] / drivers / net / tulip / de2104x.c
index 29330209ad8b2d145964066afe0f262ac904e712..a68b917646278c3b7391f86fdeb1eea92379016e 100644 (file)
@@ -670,25 +670,24 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 {
        struct de_private *de = netdev_priv(dev);
        u16 hash_table[32];
-       struct dev_mc_list *mclist;
+       struct netdev_hw_addr *ha;
        int i;
        u16 *eaddrs;
 
        memset(hash_table, 0, sizeof(hash_table));
        set_bit_le(255, hash_table);                    /* Broadcast entry */
        /* This should work on big-endian machines as well. */
-       for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-            i++, mclist = mclist->next) {
-               int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
+       netdev_for_each_mc_addr(ha, dev) {
+               int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
 
                set_bit_le(index, hash_table);
+       }
 
-               for (i = 0; i < 32; i++) {
-                       *setup_frm++ = hash_table[i];
-                       *setup_frm++ = hash_table[i];
-               }
-               setup_frm = &de->setup_frame[13*6];
+       for (i = 0; i < 32; i++) {
+               *setup_frm++ = hash_table[i];
+               *setup_frm++ = hash_table[i];
        }
+       setup_frm = &de->setup_frame[13*6];
 
        /* Fill the final entry with our physical address. */
        eaddrs = (u16 *)dev->dev_addr;
@@ -700,21 +699,19 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
 {
        struct de_private *de = netdev_priv(dev);
-       struct dev_mc_list *mclist;
-       int i;
+       struct netdev_hw_addr *ha;
        u16 *eaddrs;
 
        /* We have <= 14 addresses so we can use the wonderful
           16 address perfect filtering of the Tulip. */
-       for (i = 0, mclist = dev->mc_list; i < dev->mc_count;
-            i++, mclist = mclist->next) {
-               eaddrs = (u16 *)mclist->dmi_addr;
+       netdev_for_each_mc_addr(ha, dev) {
+               eaddrs = (u16 *) ha->addr;
                *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
                *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
                *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
        }
        /* Fill the unused entries with the broadcast address. */
-       memset(setup_frm, 0xff, (15-i)*12);
+       memset(setup_frm, 0xff, (15 - netdev_mc_count(dev)) * 12);
        setup_frm = &de->setup_frame[15*6];
 
        /* Fill the final entry with our physical address. */
@@ -741,7 +738,7 @@ static void __de_set_rx_mode (struct net_device *dev)
                goto out;
        }
 
-       if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) {
+       if ((netdev_mc_count(dev) > 1000) || (dev->flags & IFF_ALLMULTI)) {
                /* Too many to filter well -- accept all multicasts. */
                macmode |= AcceptAllMulticast;
                goto out;
@@ -749,7 +746,7 @@ static void __de_set_rx_mode (struct net_device *dev)
 
        /* Note that only the low-address shortword of setup_frame is valid!
           The values are doubled for big-endian architectures. */
-       if (dev->mc_count > 14) /* Must use a multicast hash table. */
+       if (netdev_mc_count(dev) > 14)  /* Must use a multicast hash table. */
                build_setup_frame_hash (de->setup_frame, dev);
        else
                build_setup_frame_perfect (de->setup_frame, dev);