]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/compat-wireless.git/blob - patches/25-multicast-list_head.patch
remove ksize compat for 2.6.28 kernels (irrelevant)
[wl12xx/compat-wireless.git] / patches / 25-multicast-list_head.patch
1 Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87:
2   net: convert multicast list to list_head
4   Converts the list and the core manipulating with it to be the same as uc_list.
6   +uses two functions for adding/removing mc address (normal and "global"
7    variant) instead of a function parameter.
8   +removes dev_mcast.c completely.
9   +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
10    manipulation with lists on a sandbox (used in bonding and 80211 drivers)
12 This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
14 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
15 +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
16 @@ -406,7 +406,11 @@ static void atl1c_set_multi(struct net_d
17  
18         /* comoute mc addresses' hash value ,and put it into hash table */
19         netdev_for_each_mc_addr(ha, netdev) {
20 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
21                 hash_value = atl1c_hash_mc_addr(hw, ha->addr);
22 +#else
23 +               hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
24 +#endif
25                 atl1c_hash_set(hw, hash_value);
26         }
27  }
28 --- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
29 +++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
30 @@ -308,7 +308,11 @@ static void atl1e_set_multi(struct net_d
31  
32         /* comoute mc addresses' hash value ,and put it into hash table */
33         netdev_for_each_mc_addr(ha, netdev) {
34 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
35                 hash_value = atl1e_hash_mc_addr(hw, ha->addr);
36 +#else
37 +               hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr);
38 +#endif
39                 atl1e_hash_set(hw, hash_value);
40         }
41  }
42 --- a/drivers/net/ethernet/atheros/atlx/atl2.c
43 +++ b/drivers/net/ethernet/atheros/atlx/atl2.c
44 @@ -159,7 +159,11 @@ static void atl2_set_multi(struct net_de
45  
46         /* comoute mc addresses' hash value ,and put it into hash table */
47         netdev_for_each_mc_addr(ha, netdev) {
48 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
49                 hash_value = atl2_hash_mc_addr(hw, ha->addr);
50 +#else
51 +               hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr);
52 +#endif
53                 atl2_hash_set(hw, hash_value);
54         }
55  }
56 --- a/drivers/net/ethernet/atheros/atlx/atlx.c
57 +++ b/drivers/net/ethernet/atheros/atlx/atlx.c
58 @@ -149,7 +149,11 @@ static void atlx_set_multi(struct net_de
59  
60         /* compute mc addresses' hash value ,and put it into hash table */
61         netdev_for_each_mc_addr(ha, netdev) {
62 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
63                 hash_value = atlx_hash_mc_addr(hw, ha->addr);
64 +#else
65 +               hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr);
66 +#endif
67                 atlx_hash_set(hw, hash_value);
68         }
69  }
70 --- a/drivers/net/ethernet/broadcom/b44.c
71 +++ b/drivers/net/ethernet/broadcom/b44.c
72 @@ -1687,7 +1687,11 @@ static int __b44_load_mcast(struct b44 *
73         netdev_for_each_mc_addr(ha, dev) {
74                 if (i == num_ents)
75                         break;
76 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
77                 __b44_cam_write(bp, ha->addr, i++ + 1);
78 +#else
79 +               __b44_cam_write(bp, ha->dmi_addr, i++ + 1);
80 +#endif
81         }
82         return i+1;
83  }
84 --- a/drivers/net/wireless/adm8211.c
85 +++ b/drivers/net/wireless/adm8211.c
86 @@ -1320,19 +1320,37 @@ static void adm8211_bss_info_changed(str
87  }
88  
89  static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw,
90 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
91                                      struct netdev_hw_addr_list *mc_list)
92 +#else
93 +                                    int mc_count, struct dev_addr_list *ha)
94 +#endif
95  {
96 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
97         unsigned int bit_nr;
98 -       u32 mc_filter[2];
99         struct netdev_hw_addr *ha;
100 +#else
101 +       unsigned int bit_nr, i;
102 +#endif
103 +       u32 mc_filter[2];
104  
105         mc_filter[1] = mc_filter[0] = 0;
106  
107 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
108         netdev_hw_addr_list_for_each(ha, mc_list) {
109                 bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
110 +#else
111 +       for (i = 0; i < mc_count; i++) {
112 +               if (!ha)
113 +                       break;
114 +               bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26;
115 +#endif
116  
117                 bit_nr &= 0x3F;
118                 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
119 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
120 +               ha = ha->next;
121 +#endif
122         }
123  
124         return mc_filter[0] | ((u64)(mc_filter[1]) << 32);
125 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
126 +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
127 @@ -312,20 +312,42 @@ ath5k_bss_info_changed(struct ieee80211_
128  
129  static u64
130  ath5k_prepare_multicast(struct ieee80211_hw *hw,
131 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
132                         struct netdev_hw_addr_list *mc_list)
133 +#else
134 +                       int mc_count, struct dev_addr_list *ha)
135 +#endif
136  {
137         u32 mfilt[2], val;
138         u8 pos;
139 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
140         struct netdev_hw_addr *ha;
141 +#else
142 +       int i;
143 +#endif
144  
145         mfilt[0] = 0;
146         mfilt[1] = 1;
147  
148 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
149         netdev_hw_addr_list_for_each(ha, mc_list) {
150 +#else
151 +       for (i = 0; i < mc_count; i++) {
152 +               if (!ha)
153 +                       break;
154 +#endif
155                 /* calculate XOR of eight 6-bit values */
156 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
157                 val = get_unaligned_le32(ha->addr + 0);
158 +#else
159 +               val = get_unaligned_le32(ha->dmi_addr + 0);
160 +#endif
161                 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
162 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
163                 val = get_unaligned_le32(ha->addr + 3);
164 +#else
165 +               val = get_unaligned_le32(ha->dmi_addr + 3);
166 +#endif
167                 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
168                 pos &= 0x3f;
169                 mfilt[pos / 32] |= (1 << (pos % 32));
170 @@ -334,6 +356,9 @@ ath5k_prepare_multicast(struct ieee80211
171                 * need to inform below not to reset the mcast */
172                 /* ath5k_hw_set_mcast_filterindex(ah,
173                  *      ha->addr[5]); */
174 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
175 +               ha = ha->next;
176 +#endif
177         }
178  
179         return ((u64)(mfilt[1]) << 32) | mfilt[0];
180 --- a/drivers/net/wireless/ath/carl9170/main.c
181 +++ b/drivers/net/wireless/ath/carl9170/main.c
182 @@ -896,17 +896,35 @@ out:
183         return err;
184  }
185  
186 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
187  static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw,
188                                          struct netdev_hw_addr_list *mc_list)
189 +#else
190 +static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
191 +                                        struct dev_addr_list *ha)
192 +#endif
193  {
194 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
195         struct netdev_hw_addr *ha;
196 +#else
197 +       int i;
198 +#endif
199         u64 mchash;
200  
201         /* always get broadcast frames */
202         mchash = 1ULL << (0xff >> 2);
203  
204 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
205         netdev_hw_addr_list_for_each(ha, mc_list)
206                 mchash |= 1ULL << (ha->addr[5] >> 2);
207 +#else
208 +       for (i = 0; i < mc_count; i++) {
209 +               if (WARN_ON(!ha))
210 +                       break;
211 +               mchash |= 1ULL << (ha->dmi_addr[5] >> 2);
212 +               ha = ha->next;
213 +       }
214 +#endif
215  
216         return mchash;
217  }
218 --- a/drivers/net/wireless/libertas/main.c
219 +++ b/drivers/net/wireless/libertas/main.c
220 @@ -343,18 +343,34 @@ static int lbs_add_mcast_addrs(struct cm
221         netif_addr_lock_bh(dev);
222         cnt = netdev_mc_count(dev);
223         netdev_for_each_mc_addr(ha, dev) {
224 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
225                 if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) {
226 +#else
227 +               if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) {
228 +#endif
229                         lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
230 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
231                                     ha->addr);
232 +#else
233 +                                   ha->dmi_addr);
234 +#endif
235                         cnt--;
236                         continue;
237                 }
238  
239                 if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
240                         break;
241 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
242                 memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN);
243 +#else
244 +               memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN);
245 +#endif
246                 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
247 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
248                             ha->addr);
249 +#else
250 +                           ha->dmi_addr);
251 +#endif
252                 i++;
253                 cnt--;
254         }
255 --- a/drivers/net/wireless/libertas_tf/main.c
256 +++ b/drivers/net/wireless/libertas_tf/main.c
257 @@ -419,20 +419,36 @@ static int lbtf_op_config(struct ieee802
258  }
259  
260  static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw,
261 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
262                                      struct netdev_hw_addr_list *mc_list)
263 +#else
264 +                                    int mc_count, struct dev_addr_list *ha)
265 +#endif
266  {
267         struct lbtf_private *priv = hw->priv;
268         int i;
269 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
270         struct netdev_hw_addr *ha;
271         int mc_count = netdev_hw_addr_list_count(mc_list);
272 +#endif
273  
274         if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE)
275                 return mc_count;
276  
277         priv->nr_of_multicastmacaddr = mc_count;
278 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
279         i = 0;
280         netdev_hw_addr_list_for_each(ha, mc_list)
281                 memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN);
282 +#else
283 +       for (i = 0; i < mc_count; i++) {
284 +               if (!ha)
285 +                       break;
286 +               memcpy(&priv->multicastlist[i], ha->da_addr,
287 +                               ETH_ALEN);
288 +               ha = ha->next;
289 +       }
290 +#endif
291  
292         return mc_count;
293  }
294 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c
295 +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
296 @@ -40,7 +40,11 @@ int mwifiex_copy_mcast_addr(struct mwifi
297         struct netdev_hw_addr *ha;
298  
299         netdev_for_each_mc_addr(ha, dev)
300 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
301                 memcpy(&mlist->mac_list[i++], ha->addr, ETH_ALEN);
302 +#else
303 +               memcpy(&mlist->mac_list[i++], ha->dmi_addr, ETH_ALEN);
304 +#endif
305  
306         return i;
307  }
308 --- a/drivers/net/wireless/mwifiex/debugfs.c
309 +++ b/drivers/net/wireless/mwifiex/debugfs.c
310 @@ -228,7 +228,11 @@ mwifiex_info_read(struct file *file, cha
311  
312                 netdev_for_each_mc_addr(ha, netdev)
313                         p += sprintf(p, "multicast_address[%d]=\"%pM\"\n",
314 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
315                                         i++, ha->addr);
316 +#else
317 +                                       i++, ha->dmi_addr);
318 +#endif
319         }
320  
321         p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes);
322 --- a/drivers/net/wireless/mwl8k.c
323 +++ b/drivers/net/wireless/mwl8k.c
324 @@ -2540,15 +2540,21 @@ struct mwl8k_cmd_mac_multicast_adr {
325  
326  static struct mwl8k_cmd_pkt *
327  __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
328 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
329                               struct netdev_hw_addr_list *mc_list)
330 +#else
331 +                             int mc_count, struct dev_addr_list *ha)
332 +#endif
333  {
334         struct mwl8k_priv *priv = hw->priv;
335         struct mwl8k_cmd_mac_multicast_adr *cmd;
336         int size;
337 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
338         int mc_count = 0;
339  
340         if (mc_list)
341                 mc_count = netdev_hw_addr_list_count(mc_list);
342 +#endif
343  
344         if (allmulti || mc_count > priv->num_mcaddrs) {
345                 allmulti = 1;
346 @@ -2569,13 +2575,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
347         if (allmulti) {
348                 cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST);
349         } else if (mc_count) {
350 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
351                 struct netdev_hw_addr *ha;
352                 int i = 0;
353 +#else
354 +               int i;
355 +#endif
356  
357                 cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
358                 cmd->numaddr = cpu_to_le16(mc_count);
359 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
360                 netdev_hw_addr_list_for_each(ha, mc_list) {
361                         memcpy(cmd->addr[i], ha->addr, ETH_ALEN);
362 +#else
363 +               for (i = 0; i < mc_count && ha; i++) {
364 +                       if (ha->da_addrlen != ETH_ALEN) {
365 +                               kfree(cmd);
366 +                               return NULL;
367 +                       }
368 +                       memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN);
369 +                       ha = ha->next;
370 +#endif
371                 }
372         }
373  
374 @@ -4723,7 +4743,11 @@ mwl8k_bss_info_changed(struct ieee80211_
375  }
376  
377  static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
378 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
379                                    struct netdev_hw_addr_list *mc_list)
380 +#else
381 +                                  int mc_count, struct dev_addr_list *ha)
382 +#endif
383  {
384         struct mwl8k_cmd_pkt *cmd;
385  
386 @@ -4734,7 +4758,11 @@ static u64 mwl8k_prepare_multicast(struc
387          * we'll end up throwing this packet away and creating a new
388          * one in mwl8k_configure_filter().
389          */
390 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
391         cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list);
392 +#else
393 +       cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha);
394 +#endif
395  
396         return (unsigned long)cmd;
397  }
398 @@ -4856,7 +4884,11 @@ static void mwl8k_configure_filter(struc
399          */
400         if (*total_flags & FIF_ALLMULTI) {
401                 kfree(cmd);
402 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
403                 cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL);
404 +#else
405 +               cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL);
406 +#endif
407         }
408  
409         if (cmd != NULL) {
410 --- a/drivers/net/wireless/orinoco/hw.c
411 +++ b/drivers/net/wireless/orinoco/hw.c
412 @@ -1093,7 +1093,11 @@ int __orinoco_hw_set_multicast_list(stru
413                 netdev_for_each_mc_addr(ha, dev) {
414                         if (i == mc_count)
415                                 break;
416 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
417                         memcpy(mclist.addr[i++], ha->addr, ETH_ALEN);
418 +#else
419 +                       memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN);
420 +#endif
421                 }
422  
423                 err = hw->ops->write_ltv(hw, USER_BAP,
424 --- a/drivers/net/wireless/orinoco/hw.h
425 +++ b/drivers/net/wireless/orinoco/hw.h
426 @@ -22,6 +22,9 @@
427  
428  /* Forward declarations */
429  struct orinoco_private;
430 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
431 +struct dev_addr_list;
432 +#endif
433  
434  int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
435                               size_t fw_name_len, u32 *hw_ver);
436 --- a/drivers/net/wireless/p54/main.c
437 +++ b/drivers/net/wireless/p54/main.c
438 @@ -360,11 +360,18 @@ out:
439         return ret;
440  }
441  
442 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
443  static u64 p54_prepare_multicast(struct ieee80211_hw *dev,
444                                  struct netdev_hw_addr_list *mc_list)
445 +#else
446 +static u64 p54_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
447 +                                struct dev_addr_list *ha)
448 +#endif
449  {
450         struct p54_common *priv = dev->priv;
451 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
452         struct netdev_hw_addr *ha;
453 +#endif
454         int i;
455  
456         BUILD_BUG_ON(ARRAY_SIZE(priv->mc_maclist) !=
457 @@ -374,12 +381,23 @@ static u64 p54_prepare_multicast(struct
458          * Otherwise the firmware will drop it and ARP will no longer work.
459          */
460         i = 1;
461 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
462         priv->mc_maclist_num = netdev_hw_addr_list_count(mc_list) + i;
463         netdev_hw_addr_list_for_each(ha, mc_list) {
464                 memcpy(&priv->mc_maclist[i], ha->addr, ETH_ALEN);
465 +#else
466 +       priv->mc_maclist_num = mc_count + i;
467 +       while (i <= mc_count) {
468 +               if (!ha)
469 +                       break;
470 +               memcpy(&priv->mc_maclist[i], ha->dmi_addr, ETH_ALEN);
471 +#endif
472                 i++;
473                 if (i >= ARRAY_SIZE(priv->mc_maclist))
474                         break;
475 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
476 +               ha = ha->next;
477 +#endif
478         }
479  
480         return 1; /* update */
481 --- a/drivers/net/wireless/rndis_wlan.c
482 +++ b/drivers/net/wireless/rndis_wlan.c
483 @@ -1659,7 +1659,11 @@ static void set_multicast_list(struct us
484  
485                 netdev_for_each_mc_addr(ha, usbdev->net)
486                         memcpy(mc_addrs + i++ * ETH_ALEN,
487 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
488                                ha->addr, ETH_ALEN);
489 +#else
490 +                              ha->dmi_addr, ETH_ALEN);
491 +#endif
492         }
493         netif_addr_unlock_bh(usbdev->net);
494  
495 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
496 +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
497 @@ -814,10 +814,19 @@ static void rtl8180_bss_info_changed(str
498         }
499  }
500  
501 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
502  static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev,
503                                      struct netdev_hw_addr_list *mc_list)
504 +#else
505 +static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
506 +                                    struct dev_addr_list *mc_list)
507 +#endif
508  {
509 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
510         return netdev_hw_addr_list_count(mc_list);
511 +#else
512 +       return mc_count;
513 +#endif
514  }
515  
516  static void rtl8180_configure_filter(struct ieee80211_hw *dev,
517 --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
518 +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
519 @@ -1205,9 +1205,17 @@ static void rtl8187_bss_info_changed(str
520  }
521  
522  static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
523 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
524                                      struct netdev_hw_addr_list *mc_list)
525 +#else
526 +                                    int mc_count, struct dev_addr_list *mc_list)
527 +#endif
528  {
529 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
530         return netdev_hw_addr_list_count(mc_list);
531 +#else
532 +       return mc_count;
533 +#endif
534  }
535  
536  static void rtl8187_configure_filter(struct ieee80211_hw *dev,
537 --- a/drivers/net/wireless/wl12xx/main.c
538 +++ b/drivers/net/wireless/wl12xx/main.c
539 @@ -2593,11 +2593,20 @@ struct wl1271_filter_params {
540         u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
541  };
542  
543 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
544  static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
545                                        struct netdev_hw_addr_list *mc_list)
546 +#else
547 +static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
548 +                                      struct dev_addr_list *mc_list)
549 +#endif
550  {
551         struct wl1271_filter_params *fp;
552 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
553         struct netdev_hw_addr *ha;
554 +#else
555 +       int i;
556 +#endif
557         struct wl1271 *wl = hw->priv;
558  
559         if (unlikely(wl->state == WL1271_STATE_OFF))
560 @@ -2610,16 +2619,40 @@ static u64 wl1271_op_prepare_multicast(s
561         }
562  
563         /* update multicast filtering parameters */
564 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
565         fp->mc_list_length = 0;
566         if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
567 +#else
568 +       fp->enabled = true;
569 +       if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
570 +               mc_count = 0;
571 +#endif
572                 fp->enabled = false;
573 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
574         } else {
575                 fp->enabled = true;
576                 netdev_hw_addr_list_for_each(ha, mc_list) {
577 +#else
578 +       }
580 +       fp->mc_list_length = 0;
581 +       for (i = 0; i < mc_count; i++) {
582 +               if (mc_list->da_addrlen == ETH_ALEN) {
583 +#endif
584                         memcpy(fp->mc_list[fp->mc_list_length],
585 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
586                                         ha->addr, ETH_ALEN);
587 +#else
588 +                              mc_list->da_addr, ETH_ALEN);
589 +#endif
590                         fp->mc_list_length++;
591 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
592                 }
593 +#else
594 +               } else
595 +                       wl1271_warning("Unknown mc address length.");
596 +               mc_list = mc_list->next;
597 +#endif
598         }
599  
600         return (u64)(unsigned long)fp;
601 --- a/drivers/net/wireless/zd1211rw/zd_mac.c
602 +++ b/drivers/net/wireless/zd1211rw/zd_mac.c
603 @@ -1195,17 +1195,34 @@ static void zd_process_intr(struct work_
604  
605  
606  static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw,
607 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
608                                    struct netdev_hw_addr_list *mc_list)
609 +#else
610 +                                  int mc_count, struct dev_addr_list *ha)
611 +#endif
612  {
613         struct zd_mac *mac = zd_hw_mac(hw);
614         struct zd_mc_hash hash;
615 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
616         struct netdev_hw_addr *ha;
617 +#else
618 +       int i;
619 +#endif
620  
621         zd_mc_clear(&hash);
622  
623 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
624         netdev_hw_addr_list_for_each(ha, mc_list) {
625                 dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr);
626                 zd_mc_add_addr(&hash, ha->addr);
627 +#else
628 +       for (i = 0; i < mc_count; i++) {
629 +               if (!ha)
630 +                       break;
631 +               dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr);
632 +               zd_mc_add_addr(&hash, ha->dmi_addr);
633 +               ha = ha->next;
634 +#endif
635         }
636  
637         return hash.low | ((u64)hash.high << 32);
638 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
639 +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
640 @@ -157,7 +157,11 @@ static void _brcmf_set_multicast_list(st
641         netdev_for_each_mc_addr(ha, ndev) {
642                 if (!cnt)
643                         break;
644 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
645                 memcpy(bufp, ha->addr, ETH_ALEN);
646 +#else
647 +               memcpy(bufp, ha->dmi_addr, ETH_ALEN);
648 +#endif
649                 bufp += ETH_ALEN;
650                 cnt--;
651         }
652 --- a/include/net/mac80211.h
653 +++ b/include/net/mac80211.h
654 @@ -2140,7 +2140,11 @@ struct ieee80211_ops {
655                                enum ieee80211_tx_sync_type type);
656  
657         u64 (*prepare_multicast)(struct ieee80211_hw *hw,
658 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
659                                  struct netdev_hw_addr_list *mc_list);
660 +#else
661 +                                int mc_count, struct dev_addr_list *mc_list);
662 +#endif
663         void (*configure_filter)(struct ieee80211_hw *hw,
664                                  unsigned int changed_flags,
665                                  unsigned int *total_flags,
666 --- a/net/bluetooth/bnep/netdev.c
667 +++ b/net/bluetooth/bnep/netdev.c
668 @@ -102,8 +102,13 @@ static void bnep_net_set_mc_list(struct
669                 netdev_for_each_mc_addr(ha, dev) {
670                         if (i == BNEP_MAX_MULTICAST_FILTERS)
671                                 break;
672 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
673                         memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
674                         memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
675 +#else
676 +                       memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
677 +                       memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
678 +#endif
679  
680                         i++;
681                 }
682 --- a/net/mac80211/driver-ops.h
683 +++ b/net/mac80211/driver-ops.h
684 @@ -204,14 +204,28 @@ static inline void drv_finish_tx_sync(st
685  }
686  
687  static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
688 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
689                                         struct netdev_hw_addr_list *mc_list)
690 +#else
691 +                                       int mc_count,
692 +                                       struct dev_addr_list *mc_list)
693 +#endif
694  {
695         u64 ret = 0;
696  
697 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
698         trace_drv_prepare_multicast(local, mc_list->count);
699 +#else
700 +       trace_drv_prepare_multicast(local, mc_count);
701 +#endif
702  
703         if (local->ops->prepare_multicast)
704 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
705                 ret = local->ops->prepare_multicast(&local->hw, mc_list);
706 +#else
707 +               ret = local->ops->prepare_multicast(&local->hw, mc_count,
708 +                                                   mc_list);
709 +#endif
710  
711         trace_drv_return_u64(local, ret);
712  
713 --- a/net/mac80211/ieee80211_i.h
714 +++ b/net/mac80211/ieee80211_i.h
715 @@ -797,7 +797,12 @@ struct ieee80211_local {
716         struct work_struct recalc_smps;
717  
718         /* aggregated multicast list */
719 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
720         struct netdev_hw_addr_list mc_list;
721 +#else
722 +       struct dev_addr_list *mc_list;
723 +       int mc_count;
724 +#endif
725  
726         bool tim_in_locked_section; /* see ieee80211_beacon_get() */
727  
728 --- a/net/mac80211/iface.c
729 +++ b/net/mac80211/iface.c
730 @@ -447,8 +447,13 @@ static void ieee80211_do_stop(struct iee
731  
732         netif_addr_lock_bh(sdata->dev);
733         spin_lock_bh(&local->filter_lock);
734 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
735         __hw_addr_unsync(&local->mc_list, &sdata->dev->mc,
736                          sdata->dev->addr_len);
737 +#else
738 +       __dev_addr_unsync(&local->mc_list, &local->mc_count,
739 +                         &sdata->dev->mc_list, &sdata->dev->mc_count);
740 +#endif
741         spin_unlock_bh(&local->filter_lock);
742         netif_addr_unlock_bh(sdata->dev);
743  
744 @@ -616,7 +621,12 @@ static void ieee80211_set_multicast_list
745                 sdata->flags ^= IEEE80211_SDATA_PROMISC;
746         }
747         spin_lock_bh(&local->filter_lock);
748 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
749         __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
750 +#else
751 +       __dev_addr_sync(&local->mc_list, &local->mc_count,
752 +                       &dev->mc_list, &dev->mc_count);
753 +#endif
754         spin_unlock_bh(&local->filter_lock);
755         ieee80211_queue_work(&local->hw, &local->reconfig_filter);
756  }
757 --- a/net/mac80211/main.c
758 +++ b/net/mac80211/main.c
759 @@ -71,7 +71,11 @@ void ieee80211_configure_filter(struct i
760         spin_lock_bh(&local->filter_lock);
761         changed_flags = local->filter_flags ^ new_flags;
762  
763 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
764         mc = drv_prepare_multicast(local, &local->mc_list);
765 +#else
766 +       mc = drv_prepare_multicast(local, local->mc_count, local->mc_list);
767 +#endif
768         spin_unlock_bh(&local->filter_lock);
769  
770         /* be a bit nasty */
771 @@ -607,9 +611,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
772         wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask;
773  
774         INIT_LIST_HEAD(&local->interfaces);
775 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
776  
777         __hw_addr_init(&local->mc_list);
778  
779 +#endif
780         mutex_init(&local->iflist_mtx);
781         mutex_init(&local->mtx);
782