summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap
diff options
context:
space:
mode:
authorJouni Malinen <jkmaline@cc.hut.fi>2005-07-30 12:50:01 -0700
committerJeff Garzik <jgarzik@pobox.com>2005-07-30 18:17:22 -0400
commit72ca9c61cddb82a8596cee8141656d50aba42be5 (patch)
treefe2fa88ebe7d39538e6d4789d29db0e5a58b50b3 /drivers/net/wireless/hostap
parentf06ac319c05c6822f878f201ae80e54fbbe8be8c (diff)
downloadblackbird-op-linux-72ca9c61cddb82a8596cee8141656d50aba42be5.tar.gz
blackbird-op-linux-72ca9c61cddb82a8596cee8141656d50aba42be5.zip
[PATCH] hostap update
Added support for setting channel mask for scan requests ('iwpriv wlan0 scan_channels 0x00ff' masks scans to use channels 1-8). Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r--drivers/net/wireless/hostap/hostap_common.h1
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c18
-rw-r--r--drivers/net/wireless/hostap/hostap_wlan.h3
4 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h
index 1a9610add695..feec70e68d4e 100644
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -423,6 +423,7 @@ enum {
PRISM2_PARAM_PRIVACY_INVOKED = 37,
PRISM2_PARAM_TKIP_COUNTERMEASURES = 38,
PRISM2_PARAM_DROP_UNENCRYPTED = 39,
+ PRISM2_PARAM_SCAN_CHANNEL_MASK = 40,
};
enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1,
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 7572050db32d..b4f7feb669ef 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3374,6 +3374,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
* cnfDbmAdjust, if available */
local->auth_algs = PRISM2_AUTH_OPEN | PRISM2_AUTH_SHARED_KEY;
local->sram_type = -1;
+ local->scan_channel_mask = 0xffff;
#if defined(PRISM2_PCI) && defined(PRISM2_BUS_MASTER)
local->bus_master_threshold_rx = GET_INT_PARM(bus_master_threshold_rx,
card_idx);
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index e545ac9c1b10..4c236e7903f5 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1664,7 +1664,8 @@ static int prism2_request_hostscan(struct net_device *dev,
local = iface->local;
memset(&scan_req, 0, sizeof(scan_req));
- scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask);
+ scan_req.channel_list = cpu_to_le16(local->channel_mask &
+ local->scan_channel_mask);
scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
if (ssid) {
if (ssid_len > 32)
@@ -1693,7 +1694,8 @@ static int prism2_request_scan(struct net_device *dev)
local = iface->local;
memset(&scan_req, 0, sizeof(scan_req));
- scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask);
+ scan_req.channel_list = cpu_to_le16(local->channel_mask &
+ local->scan_channel_mask);
scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
/* FIX:
@@ -2338,6 +2340,10 @@ static const struct iw_priv_args prism2_priv[] = {
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "drop_unencrypte" },
{ PRISM2_PARAM_DROP_UNENCRYPTED,
0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getdrop_unencry" },
+ { PRISM2_PARAM_SCAN_CHANNEL_MASK,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "scan_channels" },
+ { PRISM2_PARAM_SCAN_CHANNEL_MASK,
+ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getscan_channel" },
};
@@ -2699,6 +2705,10 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
local->drop_unencrypted = value;
break;
+ case PRISM2_PARAM_SCAN_CHANNEL_MASK:
+ local->scan_channel_mask = value;
+ break;
+
default:
printk(KERN_DEBUG "%s: prism2_param: unknown param %d\n",
dev->name, param);
@@ -2890,6 +2900,10 @@ static int prism2_ioctl_priv_get_prism2_param(struct net_device *dev,
*param = local->drop_unencrypted;
break;
+ case PRISM2_PARAM_SCAN_CHANNEL_MASK:
+ *param = local->scan_channel_mask;
+ break;
+
default:
printk(KERN_DEBUG "%s: get_prism2_param: unknown param %d\n",
dev->name, *param);
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
index 4b32e2e887ba..91beee50c9c9 100644
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -680,7 +680,8 @@ struct local_info {
char essid[MAX_SSID_LEN + 1];
char name[MAX_NAME_LEN + 1];
int name_set;
- u16 channel_mask;
+ u16 channel_mask; /* mask of allowed channels */
+ u16 scan_channel_mask; /* mask of channels to be scanned */
struct comm_tallies_sums comm_tallies;
struct net_device_stats stats;
struct proc_dir_entry *proc;
OpenPOWER on IntegriCloud