Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[sfrench/cifs-2.6.git] / drivers / net / wireless / wl12xx / wl1271_main.c
index b0837255de6fe7a57b257714545acb80aef0fe8f..62e544041d0d738ad71beda7196d14e33cdedf66 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/vmalloc.h>
 #include <linux/inetdevice.h>
 #include <linux/platform_device.h>
+#include <linux/slab.h>
 
 #include "wl1271.h"
 #include "wl12xx_80211.h"
@@ -1343,12 +1344,12 @@ struct wl1271_filter_params {
        u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
 };
 
-static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
-                                      struct dev_addr_list *mc_list)
+static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
+                                      struct netdev_hw_addr_list *mc_list)
 {
        struct wl1271_filter_params *fp;
+       struct netdev_hw_addr *ha;
        struct wl1271 *wl = hw->priv;
-       int i;
 
        if (unlikely(wl->state == WL1271_STATE_OFF))
                return 0;
@@ -1360,21 +1361,16 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
        }
 
        /* update multicast filtering parameters */
-       fp->enabled = true;
-       if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
-               mc_count = 0;
-               fp->enabled = false;
-       }
-
        fp->mc_list_length = 0;
-       for (i = 0; i < mc_count; i++) {
-               if (mc_list->da_addrlen == ETH_ALEN) {
+       if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
+               fp->enabled = false;
+       } else {
+               fp->enabled = true;
+               netdev_hw_addr_list_for_each(ha, mc_list) {
                        memcpy(fp->mc_list[fp->mc_list_length],
-                              mc_list->da_addr, ETH_ALEN);
+                                       ha->addr, ETH_ALEN);
                        fp->mc_list_length++;
-               } else
-                       wl1271_warning("Unknown mc address length.");
-               mc_list = mc_list->next;
+               }
        }
 
        return (u64)(unsigned long)fp;