summaryrefslogtreecommitdiffstats
path: root/package/broadcom-wl/src/wlcompat
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-01-06 19:28:07 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-01-06 19:28:07 +0000
commit90fba37c49479ed4e5233dc0d348cdf7d24c9ee1 (patch)
tree58af9e3b3204308a2b7853127331f4d693e1b744 /package/broadcom-wl/src/wlcompat
parentb59f896089edf83ce4cd1951001b6cc889bdd287 (diff)
update brcm-2.4 to 2.4.35.4, integrate new broadcom system code, update broadcom-wl to a contributed version (v4.150.10.5) - no bcm57xx support yet, will follow shortly
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10137 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-wl/src/wlcompat')
-rw-r--r--package/broadcom-wl/src/wlcompat/Makefile3
-rw-r--r--package/broadcom-wl/src/wlcompat/wlcompat.c26
2 files changed, 21 insertions, 8 deletions
diff --git a/package/broadcom-wl/src/wlcompat/Makefile b/package/broadcom-wl/src/wlcompat/Makefile
index 6f3224df1..31e54244e 100644
--- a/package/broadcom-wl/src/wlcompat/Makefile
+++ b/package/broadcom-wl/src/wlcompat/Makefile
@@ -15,6 +15,9 @@ ifneq ($(DEBUG),)
EXTRA_CFLAGS += -DDEBUG=1
_D=-debug
endif
+ifneq ($(WL_WEXT),)
+ EXTRA_CFLAGS += -DWL_WEXT=1
+endif
obj-m := wlcompat$(_D).o
modules: wlcompat$(_D).o
diff --git a/package/broadcom-wl/src/wlcompat/wlcompat.c b/package/broadcom-wl/src/wlcompat/wlcompat.c
index 2694a851c..5d2e74d41 100644
--- a/package/broadcom-wl/src/wlcompat/wlcompat.c
+++ b/package/broadcom-wl/src/wlcompat/wlcompat.c
@@ -30,6 +30,7 @@
#include <linux/wireless.h>
#include <linux/timer.h>
#include <linux/delay.h>
+#include <linux/random.h>
#include <net/iw_handler.h>
#include <asm/uaccess.h>
@@ -37,14 +38,15 @@
#include <bcmutils.h>
#include <wlioctl.h>
+char buf[WLC_IOCTL_MAXLEN];
static struct net_device *dev;
-static struct iw_statistics wstats;
#ifndef DEBUG
static int random = 1;
#endif
+#ifndef WL_WEXT
+static struct iw_statistics wstats;
static int last_mode = -1;
static int scan_cur = 0;
-char buf[WLC_IOCTL_MAXLEN];
/* The frequency of each channel in MHz */
const long channel_frequency[] = {
@@ -52,6 +54,7 @@ const long channel_frequency[] = {
2447, 2452, 2457, 2462, 2467, 2472, 2484
};
#define NUM_CHANNELS ( sizeof(channel_frequency) / sizeof(channel_frequency[0]) )
+#endif
#define SCAN_RETRY_MAX 5
#define RNG_POLL_FREQ 1
@@ -88,6 +91,7 @@ static int wl_ioctl(struct net_device *dev, int cmd, void *buf, int len)
return ret;
}
+#if !defined(DEBUG) || !defined(WL_WEXT)
static int
wl_iovar_getbuf(struct net_device *dev, char *iovar, void *param, int paramlen, void *bufptr, int buflen)
{
@@ -268,6 +272,9 @@ wl_bssiovar_get(struct net_device *dev, char *iovar, int bssidx, void *outbuf, i
return err;
}
#endif
+#endif
+
+#ifndef WL_WEXT
int get_primary_key(struct net_device *dev)
{
@@ -903,6 +910,7 @@ static const struct iw_handler_def wlcompat_handler_def =
.num_standard = sizeof(wlcompat_handler)/sizeof(iw_handler),
};
+#endif
#ifdef DEBUG
void print_buffer(int len, unsigned char *buf) {
@@ -923,8 +931,6 @@ void print_buffer(int len, unsigned char *buf) {
static int (*old_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
static int new_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
int ret = 0;
- struct iwreq *iwr = (struct iwreq *) ifr;
- struct iw_request_info info;
#ifdef DEBUG
printk("dev: %s ioctl: 0x%04x\n",dev->name,cmd);
@@ -975,23 +981,25 @@ static int __init wlcompat_init()
{
int found = 0, i;
char devname[4] = "wl0";
-
+
while (!found && (dev = dev_get_by_name(devname))) {
- if ((dev->wireless_handlers == NULL) && ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && i == WLC_IOCTL_MAGIC))
+ if ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && (i == WLC_IOCTL_MAGIC))
found = 1;
devname[2]++;
}
-
+
+
if (!found) {
printk("No Broadcom devices found.\n");
return -ENODEV;
}
-
old_ioctl = dev->do_ioctl;
dev->do_ioctl = new_ioctl;
+#ifndef WL_WEXT
dev->wireless_handlers = (struct iw_handler_def *)&wlcompat_handler_def;
dev->get_wireless_stats = wlcompat_get_wireless_stats;
+#endif
#ifndef DEBUG
if (random) {
@@ -1014,8 +1022,10 @@ static void __exit wlcompat_exit()
if (random)
del_timer(&rng_timer);
#endif
+#ifndef WL_WEXT
dev->get_wireless_stats = NULL;
dev->wireless_handlers = NULL;
+#endif
dev->do_ioctl = old_ioctl;
return;
}