chelsio: convert to use netdev_for_each_mc_addr
authorJiri Pirko <jpirko@redhat.com>
Wed, 17 Feb 2010 11:56:45 +0000 (11:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Feb 2010 23:59:48 +0000 (15:59 -0800)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/chelsio/common.h
drivers/net/chelsio/cxgb2.c
drivers/net/chelsio/pm3393.c

index bb159d9603bfc3a31597b169a9d97d03a9f8634e..9f89fd600643c9dcc28048f4c23d786b8897edc0 100644 (file)
 typedef struct adapter adapter_t;
 
 struct t1_rx_mode {
-       struct net_device *dev;
-       u32 idx;
-       struct dev_mc_list *list;
+       struct net_device *dev;
 };
 
 #define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC)
 #define t1_rx_mode_allmulti(rm)        (rm->dev->flags & IFF_ALLMULTI)
 #define t1_rx_mode_mc_cnt(rm)  (netdev_mc_count(rm->dev))
-
-static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm)
-{
-       u8 *addr = NULL;
-
-       if (rm->idx++ < t1_rx_mode_mc_cnt(rm)) {
-               addr = rm->list->dmi_addr;
-               rm->list = rm->list->next;
-       }
-       return addr;
-}
+#define t1_get_netdev(rm)      (rm->dev)
 
 #define        MAX_NPORTS 4
 #define PORT_MASK ((1 << MAX_NPORTS) - 1)
index 082cdb28b5101fd4bfc1cf0d1f174170da3dfbbd..a54a32b1649843c9bd93322ada71c5e3fa54ed7d 100644 (file)
@@ -125,8 +125,6 @@ static void t1_set_rxmode(struct net_device *dev)
        struct t1_rx_mode rm;
 
        rm.dev = dev;
-       rm.idx = 0;
-       rm.list = dev->mc_list;
        mac->ops->set_rx_mode(mac, &rm);
 }
 
index 2117c4fbb10724aeee68cbb6b7372e4e3a703515..33d674f36722e6c24544248dff5db9ecd49444fa 100644 (file)
@@ -375,12 +375,12 @@ static int pm3393_set_rx_mode(struct cmac *cmac, struct t1_rx_mode *rm)
                rx_mode |= SUNI1x10GEXP_BITMSK_RXXG_MHASH_EN;
        } else if (t1_rx_mode_mc_cnt(rm)) {
                /* Accept one or more multicast(s). */
-               u8 *addr;
+               struct dev_mc_list *dmi;
                int bit;
                u16 mc_filter[4] = { 0, };
 
-               while ((addr = t1_get_next_mcaddr(rm))) {
-                       bit = (ether_crc(ETH_ALEN, addr) >> 23) & 0x3f; /* bit[23:28] */
+               netdev_for_each_mc_addr(dmi, t1_get_netdev(rm)) {
+                       bit = (ether_crc(ETH_ALEN, dmi->dmi_addr) >> 23) & 0x3f; /* bit[23:28] */
                        mc_filter[bit >> 4] |= 1 << (bit & 0xf);
                }
                pmwrite(cmac, SUNI1x10GEXP_REG_RXXG_MULTICAST_HASH_LOW, mc_filter[0]);