Date:2010-07-11 21:00:23 (13 years 8 months ago)
Author:hauke
Commit:0fac63b557411da51be201b7e60c78828b33866a
Message:kernel: fix build problems with recent kernel versions

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22137 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: package/acx-mac80211/Makefile (2 diffs)
package/acx/patches/007-2.6.33_fixes.patch (1 diff)
package/broadcom-wl/patches/003-compat-2.6.35.patch (1 diff)
package/carl9170/patches/120-2.6.35-compat.patch (1 diff)

Change Details

package/acx-mac80211/Makefile
6060    $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
6161    $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
6262
63ifneq ($(CONFIG_LINUX_2_6_25)$(CONFIG_LINUX_2_6_30)$(CONFIG_LINUX_2_6_31)$(CONFIG_LINUX_2_6_32),)
64  LINUX_AUTOCONF_FILE:= linux/autoconf.h
65else
66  LINUX_AUTOCONF_FILE:= generated/autoconf.h
67endif
68
6369define Build/Compile
6470    $(MAKE) -C "$(LINUX_DIR)" \
6571        ARCH="$(LINUX_KARCH)" \
...... 
6975        EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(2,6,34)\"" \
7076        LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include \
7177            -Iarch/$(LINUX_KARCH)/include \
72            -include linux/autoconf.h" \
78            -include $(LINUX_AUTOCONF_FILE)" \
7379        V="$(V)" \
7480        modules
7581endef
package/acx/patches/007-2.6.33_fixes.patch
1--- a/pci.c
2@@ -35,8 +35,12 @@
3
4 /* Linux 2.6.18+ uses <linux/utsrelease.h> */
5 #ifndef UTS_RELEASE
6+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
7+#include <generated/utsrelease.h>
8+#else
9 #include <linux/utsrelease.h>
10 #endif
11+#endif
12
13 #include <linux/compiler.h> /* required for Lx 2.6.8 ?? */
14 #include <linux/kernel.h>
package/broadcom-wl/patches/003-compat-2.6.35.patch
1--- a/driver/wl_linux.c
2@@ -2082,8 +2082,12 @@ static void
3 _wl_set_multicast_list(struct net_device *dev)
4 {
5     wl_info_t *wl;
6+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
7     struct dev_mc_list *mclist;
8- int i;
9+#else
10+ struct netdev_hw_addr *ha;
11+#endif
12+ int i = 0;
13
14     if (!dev)
15         return;
16@@ -2098,14 +2102,23 @@ _wl_set_multicast_list(struct net_device
17         wl->pub->allmulti = (dev->flags & IFF_ALLMULTI)? TRUE: FALSE;
18
19         /* copy the list of multicasts into our private table */
20+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
21         for (i = 0, mclist = dev->mc_list; mclist && (i < dev->mc_count);
22             i++, mclist = mclist->next) {
23+#else
24+ netdev_for_each_mc_addr(ha, dev) {
25+#endif
26             if (i >= MAXMULTILIST) {
27                 wl->pub->allmulti = TRUE;
28                 i = 0;
29                 break;
30             }
31+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
32             wl->pub->multicast[i] = *((struct ether_addr*) mclist->dmi_addr);
33+#else
34+ wl->pub->multicast[i] = *((struct ether_addr*) ha->addr);
35+ i++;
36+#endif
37         }
38         wl->pub->nmulticast = i;
39         wlc_set(wl->wlc, WLC_SET_PROMISC, (dev->flags & IFF_PROMISC));
package/carl9170/patches/120-2.6.35-compat.patch
1--- a/drivers/net/wireless/ath/carl9170/main.c
2@@ -591,21 +591,36 @@ out:
3     return err;
4 }
5
6+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
7+static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
8+ struct netdev_hw_addr_list *mclist)
9+#else
10 static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
11                        struct dev_addr_list *mclist)
12+#endif
13 {
14     u64 mchash;
15+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
16+ struct netdev_hw_addr *ha;
17+#else
18     int i;
19+#endif
20
21     /* always get broadcast frames */
22     mchash = 1ULL << (0xff >> 2);
23
24+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
25+ netdev_hw_addr_list_for_each(ha, mclist) {
26+ mchash |= 1ULL << (ha->addr[5] >> 2);
27+ }
28+#else
29     for (i = 0; i < mc_count; i++) {
30         if (WARN_ON(!mclist))
31             break;
32         mchash |= 1ULL << (mclist->dmi_addr[5] >> 2);
33         mclist = mclist->next;
34     }
35+#endif
36
37     return mchash;
38 }
39--- a/drivers/net/wireless/ath/carl9170/usb.c
40@@ -48,6 +48,11 @@
41 #include "fwcmd.h"
42 #include "usb.h"
43
44+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
45+#define usb_buffer_alloc(dev, size, mem_flags, dma) usb_alloc_coherent(dev, size, mem_flags, dma)
46+#define usb_buffer_free(dev, size, addr, dma) usb_free_coherent(dev, size, addr, dma)
47+#endif
48+
49 MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
50 MODULE_AUTHOR("Christian Lamparter <chunkeey@googlemail.com>");
51 MODULE_LICENSE("GPL");

Archive Download the corresponding diff file



interactive