#include <linux/device.h>
#include <linux/list.h>
#include <linux/kernel.h>
+#include <net/net_namespace.h>
+/* This comes from include/linux/input.h */
+#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any"
+ set = radio enabled */
+
+/* From kernel.h */
#define USHORT_MAX ((u16)(~0U))
#define SHORT_MAX ((s16)(USHORT_MAX>>1))
#define SHORT_MIN (-SHORT_MAX - 1)
__val = __val < __min ? __min: __val; \
__val > __max ? __max: __val; })
+/* This comes from include/net/net_namespace.h */
+
+#ifdef CONFIG_NET_NS
+static inline
+int net_eq(const struct net *net1, const struct net *net2)
+{
+ return net1 == net2;
+}
+#else
+static inline
+int net_eq(const struct net *net1, const struct net *net2)
+{
+ return 1;
+}
+#endif
+
+/* This comes from include/linux/netdevice.h */
+
+/*
+ * Net namespace inlines
+ */
+static inline
+struct net *dev_net(const struct net_device *dev)
+{
+#ifdef CONFIG_NET_NS
+ /*
+ * compat-wirelss backport note:
+ * For older kernels we may just need to always return init_net,
+ * not sure when we added dev->nd_net.
+ */
+ return dev->nd_net;
+#else
+ return &init_net;
+#endif
+}
+
/*
* 2.6.26 added its own unaligned API which the
/*
---- a/net/mac80211/iface.c 2009-07-07 13:29:43.631717242 -0700
-+++ b/net/mac80211/iface.c 2009-07-07 13:29:44.823680886 -0700
+--- a/net/mac80211/iface.c 2009-07-08 15:46:16.452255410 -0700
++++ b/net/mac80211/iface.c 2009-07-08 15:46:06.060257895 -0700
@@ -643,6 +643,7 @@
WARN_ON(flushed);
}
sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
MONITOR_FLAG_OTHER_BSS;
break;
-@@ -812,6 +832,10 @@
+@@ -771,6 +791,8 @@
+ if (!ndev)
+ return -ENOMEM;
+
++/* This is an optimization, just ignore for older kernels */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
+ ndev->needed_headroom = local->tx_headroom +
+ 4*6 /* four MAC addresses */
+ + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
+@@ -779,6 +801,7 @@
+ - ETH_HLEN /* ethernet hard_header_len */
+ + IEEE80211_ENCRYPT_HEADROOM;
+ ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
++#endif
+
+ ret = dev_alloc_name(ndev, ndev->name);
+ if (ret < 0)
+@@ -812,6 +835,10 @@
if (ret)
goto fail;
ifeq ($(shell test -e $(KLIB_BUILD)/Makefile && echo yes),yes)
KERNEL_SUBLEVEL = $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
-ifeq ($(shell test $(KERNEL_SUBLEVEL) -lt 26 && echo yes),yes)
-$(error "ERROR: You should use compat-wireless-2.6-old for older kernels, this one is for kernels >= 2.6.26")
+ifeq ($(shell test $(KERNEL_SUBLEVEL) -lt 25 && echo yes),yes)
+$(error "ERROR: You should use compat-wireless-2.6-old for older kernels, this one is for kernels >= 2.6.25")
endif
ifeq ($(CONFIG_CFG80211),y)
# This indicates which is the oldest kernel we support
# Update this if you are adding support for older kernels.
-OLDEST_KERNEL_SUPPORTED="2.6.26"
+OLDEST_KERNEL_SUPPORTED="2.6.25"
COMPAT_RELEASE="compat-release"
KERNEL_RELEASE="git-describe"
MULT_DEP_FILE=".compat_pivot_dep"