kernel: fix build problems with recent kernel versions
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 11 Jul 2010 19:00:23 +0000 (19:00 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 11 Jul 2010 19:00:23 +0000 (19:00 +0000)
SVN-Revision: 22137

package/acx-mac80211/Makefile
package/acx/patches/007-2.6.33_fixes.patch [new file with mode: 0644]
package/broadcom-wl/patches/003-compat-2.6.35.patch [new file with mode: 0644]
package/carl9170/patches/120-2.6.35-compat.patch [new file with mode: 0644]

index fb2216ff0dace30bde4206b5c25853d5412b987e..c7f2c8819c0ffaee61aef3086b1d2f95e469cc8b 100644 (file)
@@ -60,6 +60,12 @@ PKG_EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
 
+ifneq ($(CONFIG_LINUX_2_6_25)$(CONFIG_LINUX_2_6_30)$(CONFIG_LINUX_2_6_31)$(CONFIG_LINUX_2_6_32),)
+  LINUX_AUTOCONF_FILE:= linux/autoconf.h
+else
+  LINUX_AUTOCONF_FILE:= generated/autoconf.h
+endif
+
 define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
                ARCH="$(LINUX_KARCH)" \
@@ -69,7 +75,7 @@ define Build/Compile
                EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(2,6,34)\"" \
                LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include \
                        -Iarch/$(LINUX_KARCH)/include \
-                       -include linux/autoconf.h" \
+                       -include $(LINUX_AUTOCONF_FILE)" \
                V="$(V)" \
                modules
 endef
diff --git a/package/acx/patches/007-2.6.33_fixes.patch b/package/acx/patches/007-2.6.33_fixes.patch
new file mode 100644 (file)
index 0000000..338b1c6
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/pci.c
++++ b/pci.c
+@@ -35,8 +35,12 @@
+ /* Linux 2.6.18+ uses <linux/utsrelease.h> */
+ #ifndef UTS_RELEASE
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
++#include <generated/utsrelease.h>
++#else
+ #include <linux/utsrelease.h>
+ #endif
++#endif
+ #include <linux/compiler.h> /* required for Lx 2.6.8 ?? */
+ #include <linux/kernel.h>
diff --git a/package/broadcom-wl/patches/003-compat-2.6.35.patch b/package/broadcom-wl/patches/003-compat-2.6.35.patch
new file mode 100644 (file)
index 0000000..3bb786c
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/driver/wl_linux.c
++++ b/driver/wl_linux.c
+@@ -2082,8 +2082,12 @@ static void
+ _wl_set_multicast_list(struct net_device *dev)
+ {
+       wl_info_t *wl;
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
+       struct dev_mc_list *mclist;
+-      int i;
++#else
++      struct netdev_hw_addr *ha;
++#endif
++      int i = 0;
+       if (!dev)
+               return;
+@@ -2098,14 +2102,23 @@ _wl_set_multicast_list(struct net_device
+               wl->pub->allmulti = (dev->flags & IFF_ALLMULTI)? TRUE: FALSE;
+               /* copy the list of multicasts into our private table */
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
+               for (i = 0, mclist = dev->mc_list; mclist && (i < dev->mc_count);
+                       i++, mclist = mclist->next) {
++#else
++              netdev_for_each_mc_addr(ha, dev) {
++#endif
+                       if (i >= MAXMULTILIST) {
+                               wl->pub->allmulti = TRUE;
+                               i = 0;
+                               break;
+                       }
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
+                       wl->pub->multicast[i] = *((struct ether_addr*) mclist->dmi_addr);
++#else
++                      wl->pub->multicast[i] = *((struct ether_addr*) ha->addr);
++                      i++;
++#endif
+               }
+               wl->pub->nmulticast = i;
+               wlc_set(wl->wlc, WLC_SET_PROMISC, (dev->flags & IFF_PROMISC));
diff --git a/package/carl9170/patches/120-2.6.35-compat.patch b/package/carl9170/patches/120-2.6.35-compat.patch
new file mode 100644 (file)
index 0000000..e413edf
--- /dev/null
@@ -0,0 +1,53 @@
+--- a/drivers/net/wireless/ath/carl9170/main.c
++++ b/drivers/net/wireless/ath/carl9170/main.c
+@@ -591,21 +591,36 @@ out:
+       return err;
+ }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
++static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
++                                     struct netdev_hw_addr_list *mclist)
++#else
+ static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
+                                      struct dev_addr_list *mclist)
++#endif
+ {
+       u64 mchash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
++      struct netdev_hw_addr *ha;
++#else
+       int i;
++#endif
+       /* always get broadcast frames */
+       mchash = 1ULL << (0xff >> 2);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
++      netdev_hw_addr_list_for_each(ha, mclist) {
++              mchash |= 1ULL << (ha->addr[5] >> 2);
++      }
++#else
+       for (i = 0; i < mc_count; i++) {
+               if (WARN_ON(!mclist))
+                       break;
+               mchash |= 1ULL << (mclist->dmi_addr[5] >> 2);
+               mclist = mclist->next;
+       }
++#endif
+       return mchash;
+ }
+--- a/drivers/net/wireless/ath/carl9170/usb.c
++++ b/drivers/net/wireless/ath/carl9170/usb.c
+@@ -48,6 +48,11 @@
+ #include "fwcmd.h"
+ #include "usb.h"
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
++#define usb_buffer_alloc(dev, size, mem_flags, dma)   usb_alloc_coherent(dev, size, mem_flags, dma)
++#define usb_buffer_free(dev, size, addr, dma) usb_free_coherent(dev, size, addr, dma)
++#endif
++
+ MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+ MODULE_AUTHOR("Christian Lamparter <chunkeey@googlemail.com>");
+ MODULE_LICENSE("GPL");