compat-wireless: make atk6kl build with older kernels
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 11 Sep 2010 16:18:27 +0000 (09:18 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 13 Sep 2010 18:25:04 +0000 (11:25 -0700)
Now it will be build for kernel < 2.6.28. CONFIG_STAGING was introduced
with that kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
config.mk
patches/33-autoconf.patch [new file with mode: 0644]
patches/34-backport-bin_attribute.patch [new file with mode: 0644]

index 3c6d41663773ae38fbe176f974e2a710458ed072..458de29c5252afdf0d0476d3bce314b848b1ed89 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -490,7 +490,6 @@ CONFIG_BT_HCIBTSDIO=m
 CONFIG_BT_MRVL_SDIO=m
 
 ifneq ($(CONFIG_COMPAT_STAGING),)
-ifdef CONFIG_COMPAT_KERNEL_32
 CONFIG_ATH6KL_CFG80211=y
 CONFIG_ATH6KL_DEBUG=y
 # CONFIG_ATH6KL_DISABLE_TARGET_DBGLOGS is not set
@@ -502,7 +501,6 @@ CONFIG_ATH6KL_ENABLE_TARGET_DEBUG_PRINTS=y
 # CONFIG_ATH6KL_SKIP_ABI_VERSION_CHECK is not set
 CONFIG_ATH6KL_VIRTUAL_SCATTER_GATHER=y
 CONFIG_ATH6K_LEGACY=m
-endif #CONFIG_COMPAT_KERNEL_32
 endif
 
 
diff --git a/patches/33-autoconf.patch b/patches/33-autoconf.patch
new file mode 100644 (file)
index 0000000..5d767fd
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
++++ b/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
+@@ -27,7 +27,12 @@
+ #include <linux/version.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+ #include <generated/autoconf.h>
++#else
++#include <linux/autoconf.h>
++#endif
++#include <linux/compat_autoconf.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
diff --git a/patches/34-backport-bin_attribute.patch b/patches/34-backport-bin_attribute.patch
new file mode 100644 (file)
index 0000000..ce53635
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
++++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+@@ -334,12 +334,20 @@ static void ar6000_refill_amsdu_rxbufs(A
+ static void ar6000_cleanup_amsdu_rxbufs(AR_SOFTC_T *ar);
+ static ssize_t
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34))
+ ar6000_sysfs_bmi_read(struct file *fp, struct kobject *kobj,
++#else
++ar6000_sysfs_bmi_read(struct kobject *kobj,
++#endif
+                       struct bin_attribute *bin_attr,
+                       char *buf, loff_t pos, size_t count);
+ static ssize_t
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34))
+ ar6000_sysfs_bmi_write(struct file *fp, struct kobject *kobj,
++#else
++ar6000_sysfs_bmi_write(struct kobject *kobj,
++#endif
+                        struct bin_attribute *bin_attr,
+                        char *buf, loff_t pos, size_t count);
+@@ -799,7 +807,11 @@ static struct bin_attribute bmi_attr = {
+ };
+ static ssize_t
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34))
+ ar6000_sysfs_bmi_read(struct file *fp, struct kobject *kobj,
++#else
++ar6000_sysfs_bmi_read(struct kobject *kobj,
++#endif
+                       struct bin_attribute *bin_attr,
+                       char *buf, loff_t pos, size_t count)
+ {
+@@ -826,7 +838,11 @@ ar6000_sysfs_bmi_read(struct file *fp, s
+ }
+ static ssize_t
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34))
+ ar6000_sysfs_bmi_write(struct file *fp, struct kobject *kobj,
++#else
++ar6000_sysfs_bmi_write(struct kobject *kobj,
++#endif
+                        struct bin_attribute *bin_attr,
+                        char *buf, loff_t pos, size_t count)
+ {