aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-07-10 07:20:47 (GMT)
committerJouni Malinen <j@w1.fi>2003-07-10 07:20:47 (GMT)
commitbdb841412163e5f3a0c874041aae7e723b0ee133 (patch)
tree7085cbbccb0209f1240d2e592694a6f28a5840f8
parentd27bebc92fcadaf8f2fdee5532fe98351ad87fb5 (diff)
downloadhostap-history-bdb841412163e5f3a0c874041aae7e723b0ee133.zip
hostap-history-bdb841412163e5f3a0c874041aae7e723b0ee133.tar.gz
hostap-history-bdb841412163e5f3a0c874041aae7e723b0ee133.tar.bz2
Moved Linux Wireless Extensions compatibility code into a new header file,
hostap_wext.h.
-rw-r--r--driver/modules/hostap.c8
-rw-r--r--driver/modules/hostap_cs.c7
-rw-r--r--driver/modules/hostap_hw.c7
-rw-r--r--driver/modules/hostap_ioctl.c42
-rw-r--r--driver/modules/hostap_pci.c7
-rw-r--r--driver/modules/hostap_plx.c7
-rw-r--r--driver/modules/hostap_wext.h87
-rw-r--r--driver/modules/hostap_wlan.h19
8 files changed, 92 insertions, 92 deletions
diff --git a/driver/modules/hostap.c b/driver/modules/hostap.c
index 65b54ea..cba2c44 100644
--- a/driver/modules/hostap.c
+++ b/driver/modules/hostap.c
@@ -31,13 +31,7 @@
#include <linux/workqueue.h>
#endif
#include <linux/kmod.h>
-#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
-#include <linux/wireless.h>
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-#endif /* WIRELESS_EXT > 12 */
-#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
-
+#include "hostap_wext.h"
#include <asm/uaccess.h>
diff --git a/driver/modules/hostap_cs.c b/driver/modules/hostap_cs.c
index aecda1b..d18dc98 100644
--- a/driver/modules/hostap_cs.c
+++ b/driver/modules/hostap_cs.c
@@ -17,12 +17,7 @@
#else
#include <linux/workqueue.h>
#endif
-#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
-#include <linux/wireless.h>
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-#endif /* WIRELESS_EXT > 12 */
-#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+#include "hostap_wext.h"
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
diff --git a/driver/modules/hostap_hw.c b/driver/modules/hostap_hw.c
index 05d6a56..1cbcb67 100644
--- a/driver/modules/hostap_hw.c
+++ b/driver/modules/hostap_hw.c
@@ -45,12 +45,7 @@
#include <linux/random.h>
#include <linux/wait.h>
#include <linux/sched.h>
-#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
-#include <linux/wireless.h>
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-#endif /* WIRELESS_EXT > 12 */
-#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+#include "hostap_wext.h"
#include <asm/irq.h>
diff --git a/driver/modules/hostap_ioctl.c b/driver/modules/hostap_ioctl.c
index c356c74..4ad04f6 100644
--- a/driver/modules/hostap_ioctl.c
+++ b/driver/modules/hostap_ioctl.c
@@ -7,48 +7,6 @@
#include <linux/smp_lock.h>
#endif
-/* Conversion to new driver API by Jean II */
-
-#if WIRELESS_EXT <= 12
-/* Wireless extensions backward compatibility */
-
-/* Dummy prototype, as we don't really need it */
-struct iw_request_info;
-#endif /* WIRELESS_EXT <= 12 */
-
-
-#if WIRELESS_EXT >= 15
-/* Wireless ext ver15 allows verification of iwpriv support and sub-ioctls can
- * be included even if not especially configured. */
-#ifndef PRISM2_USE_WE_SUB_IOCTLS
-#define PRISM2_USE_WE_SUB_IOCTLS
-#endif /* PRISM2_USE_WE_SUB_IOCTLS */
-
-/* Assume that hosts using new wireless ext also have new wireless tools
- * (ver >= 25) */
-#ifndef PRISM2_USE_WE_TYPE_ADDR
-#define PRISM2_USE_WE_TYPE_ADDR
-#endif /* PRISM2_USE_WE_TYPE_ADDR */
-#endif /* WIRELESS_EXT >= 15 */
-
-
-#ifdef PRISM2_USE_WE_TYPE_ADDR
-/* Added in WIRELESS_EXT 15, but can be used with older versions assuming
- * iwpriv ver >= 25 */
-#ifndef IW_PRIV_TYPE_ADDR
-#define IW_PRIV_TYPE_ADDR 0x6000
-#endif /* IW_PRIV_TYPE_ADDR */
-#endif /* PRISM2_USE_WE_TYPE_ADDR */
-
-
-#if WIRELESS_EXT < 9
-struct iw_point {
- caddr_t pointer;
- __u16 length;
- __u16 flags;
-};
-#endif /* WIRELESS_EXT < 9 */
-
static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
{
diff --git a/driver/modules/hostap_pci.c b/driver/modules/hostap_pci.c
index bb6c32d..7c8dc05 100644
--- a/driver/modules/hostap_pci.c
+++ b/driver/modules/hostap_pci.c
@@ -16,12 +16,7 @@
#else
#include <linux/workqueue.h>
#endif
-#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
-#include <linux/wireless.h>
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-#endif /* WIRELESS_EXT > 12 */
-#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+#include "hostap_wext.h"
#include <linux/ioport.h>
#include <linux/pci.h>
diff --git a/driver/modules/hostap_plx.c b/driver/modules/hostap_plx.c
index adac5a0..404d670 100644
--- a/driver/modules/hostap_plx.c
+++ b/driver/modules/hostap_plx.c
@@ -19,12 +19,7 @@
#else
#include <linux/workqueue.h>
#endif
-#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
-#include <linux/wireless.h>
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-#endif /* WIRELESS_EXT > 12 */
-#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+#include "hostap_wext.h"
#include <linux/ioport.h>
#include <linux/pci.h>
diff --git a/driver/modules/hostap_wext.h b/driver/modules/hostap_wext.h
new file mode 100644
index 0000000..88f3777
--- /dev/null
+++ b/driver/modules/hostap_wext.h
@@ -0,0 +1,87 @@
+#ifndef HOSTAP_WEXT_H
+#define HOSTAP_WEXT_H
+
+/* Linux Wireless Extensions compatibility code */
+
+#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO)
+#include <linux/wireless.h>
+#if WIRELESS_EXT > 12
+#include <net/iw_handler.h>
+#endif /* WIRELESS_EXT > 12 */
+#if WIRELESS_EXT < 9
+#warning Linux wireless extensions versions older than 9 are not supported
+/* Compile limited version without wireless ext support */
+#undef WIRELESS_EXT
+#endif /* WIRELESS_EXT < 9 */
+#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+
+
+/* if wireless ext is not supported */
+#ifndef IW_MODE_ADHOC
+#define IW_MODE_ADHOC 1
+#endif
+#ifndef IW_MODE_INFRA
+#define IW_MODE_INFRA 2
+#endif
+#ifndef IW_MODE_MASTER
+#define IW_MODE_MASTER 3
+#endif
+#ifndef IW_MODE_REPEAT
+#define IW_MODE_REPEAT 4
+#endif
+#ifndef IW_MODE_SECOND
+#define IW_MODE_SECOND 5
+#endif
+#ifndef IW_MODE_MONITOR
+#define IW_MODE_MONITOR 6
+#endif
+
+
+
+#ifdef WIRELESS_EXT
+/* Conversion to new driver API by Jean II */
+
+#if WIRELESS_EXT <= 12
+/* Wireless extensions backward compatibility */
+
+/* Dummy prototype, as we don't really need it */
+struct iw_request_info;
+#endif /* WIRELESS_EXT <= 12 */
+
+
+#if WIRELESS_EXT >= 15
+/* Wireless ext ver15 allows verification of iwpriv support and sub-ioctls can
+ * be included even if not especially configured. */
+#ifndef PRISM2_USE_WE_SUB_IOCTLS
+#define PRISM2_USE_WE_SUB_IOCTLS
+#endif /* PRISM2_USE_WE_SUB_IOCTLS */
+
+/* Assume that hosts using new wireless ext also have new wireless tools
+ * (ver >= 25) */
+#ifndef PRISM2_USE_WE_TYPE_ADDR
+#define PRISM2_USE_WE_TYPE_ADDR
+#endif /* PRISM2_USE_WE_TYPE_ADDR */
+#endif /* WIRELESS_EXT >= 15 */
+
+
+#ifdef PRISM2_USE_WE_TYPE_ADDR
+/* Added in WIRELESS_EXT 15, but can be used with older versions assuming
+ * iwpriv ver >= 25 */
+#ifndef IW_PRIV_TYPE_ADDR
+#define IW_PRIV_TYPE_ADDR 0x6000
+#endif /* IW_PRIV_TYPE_ADDR */
+#endif /* PRISM2_USE_WE_TYPE_ADDR */
+
+
+#if WIRELESS_EXT < 9
+struct iw_point {
+ caddr_t pointer;
+ __u16 length;
+ __u16 flags;
+};
+#endif /* WIRELESS_EXT < 9 */
+
+#endif /* WIRELESS_EXT */
+
+
+#endif /* HOSTAP_WEXT_H */
diff --git a/driver/modules/hostap_wlan.h b/driver/modules/hostap_wlan.h
index f7dbe93..85f33cd 100644
--- a/driver/modules/hostap_wlan.h
+++ b/driver/modules/hostap_wlan.h
@@ -1328,25 +1328,6 @@ struct local_info {
* specific blocks. */
};
-/* if wireless ext is not supported */
-#ifndef IW_MODE_ADHOC
-#define IW_MODE_ADHOC 1
-#endif
-#ifndef IW_MODE_INFRA
-#define IW_MODE_INFRA 2
-#endif
-#ifndef IW_MODE_MASTER
-#define IW_MODE_MASTER 3
-#endif
-#ifndef IW_MODE_REPEAT
-#define IW_MODE_REPEAT 4
-#endif
-#ifndef IW_MODE_SECOND
-#define IW_MODE_SECOND 5
-#endif
-#ifndef IW_MODE_MONITOR
-#define IW_MODE_MONITOR 6
-#endif
#ifndef PRISM2_NO_DEBUG