kernel: fix build problems with recent kernel versions
[openwrt.git] / package / carl9170 / patches / 120-2.6.35-compat.patch
1 --- a/drivers/net/wireless/ath/carl9170/main.c
2 +++ b/drivers/net/wireless/ath/carl9170/main.c
3 @@ -591,21 +591,36 @@ out:
4 return err;
5 }
6
7 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
8 +static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
9 + struct netdev_hw_addr_list *mclist)
10 +#else
11 static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
12 struct dev_addr_list *mclist)
13 +#endif
14 {
15 u64 mchash;
16 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
17 + struct netdev_hw_addr *ha;
18 +#else
19 int i;
20 +#endif
21
22 /* always get broadcast frames */
23 mchash = 1ULL << (0xff >> 2);
24
25 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
26 + netdev_hw_addr_list_for_each(ha, mclist) {
27 + mchash |= 1ULL << (ha->addr[5] >> 2);
28 + }
29 +#else
30 for (i = 0; i < mc_count; i++) {
31 if (WARN_ON(!mclist))
32 break;
33 mchash |= 1ULL << (mclist->dmi_addr[5] >> 2);
34 mclist = mclist->next;
35 }
36 +#endif
37
38 return mchash;
39 }
40 --- a/drivers/net/wireless/ath/carl9170/usb.c
41 +++ b/drivers/net/wireless/ath/carl9170/usb.c
42 @@ -48,6 +48,11 @@
43 #include "fwcmd.h"
44 #include "usb.h"
45
46 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
47 +#define usb_buffer_alloc(dev, size, mem_flags, dma) usb_alloc_coherent(dev, size, mem_flags, dma)
48 +#define usb_buffer_free(dev, size, addr, dma) usb_free_coherent(dev, size, addr, dma)
49 +#endif
50 +
51 MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
52 MODULE_AUTHOR("Christian Lamparter <chunkeey@googlemail.com>");
53 MODULE_LICENSE("GPL");
This page took 0.043994 seconds and 5 git commands to generate.