compat: add a wrapper for rfkill.h
authorFelix Fietkau <nbd@openwrt.org>
Wed, 10 Nov 2010 23:38:55 +0000 (15:38 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 10 Nov 2010 23:38:55 +0000 (15:38 -0800)
With this we can get rid of some of the rfkill related patching mess.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
include/linux/rfkill.h [new file with mode: 0644]

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
new file mode 100644 (file)
index 0000000..d615ac9
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __COMPAT_RFKILL_H
+#define __COMPAT_RFKILL_H
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
+
+#include_next <linux/rfkill.h>
+
+#else
+
+#include <linux/compat-2.6.h>
+
+#undef CONFIG_RFKILL
+#undef CONFIG_RFKILL_INPUT
+#undef CONFIG_RFKILL_LEDS
+
+#ifdef CONFIG_RFKILL_BACKPORT
+#define CONFIG_RFKILL 1
+#endif
+
+#ifdef CONFIG_RFKILL_BACKPORT_INPUT
+#define CONFIG_RFKILL_INPUT
+#endif
+
+#ifdef CONFIG_RFKILL_BACKPORT_LEDS
+#define CONFIG_RFKILL_LEDS
+#endif
+
+#include <linux/rfkill_backport.h>
+
+#endif
+
+#endif