diff options
author | Jouni Malinen <jkmaline@cc.hut.fi> | 2005-07-30 15:50:01 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-30 18:17:22 -0400 |
commit | 72ca9c61cddb82a8596cee8141656d50aba42be5 (patch) | |
tree | fe2fa88ebe7d39538e6d4789d29db0e5a58b50b3 | |
parent | f06ac319c05c6822f878f201ae80e54fbbe8be8c (diff) |
[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>
-rw-r--r-- | drivers/net/wireless/hostap/hostap_common.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_wlan.h | 3 |
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 1a9610add69..feec70e68d4 100644 --- a/drivers/net/wireless/hostap/hostap_common.h +++ b/drivers/net/wireless/hostap/hostap_common.h | |||
@@ -423,6 +423,7 @@ enum { | |||
423 | PRISM2_PARAM_PRIVACY_INVOKED = 37, | 423 | PRISM2_PARAM_PRIVACY_INVOKED = 37, |
424 | PRISM2_PARAM_TKIP_COUNTERMEASURES = 38, | 424 | PRISM2_PARAM_TKIP_COUNTERMEASURES = 38, |
425 | PRISM2_PARAM_DROP_UNENCRYPTED = 39, | 425 | PRISM2_PARAM_DROP_UNENCRYPTED = 39, |
426 | PRISM2_PARAM_SCAN_CHANNEL_MASK = 40, | ||
426 | }; | 427 | }; |
427 | 428 | ||
428 | enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1, | 429 | 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 7572050db32..b4f7feb669e 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, | |||
3374 | * cnfDbmAdjust, if available */ | 3374 | * cnfDbmAdjust, if available */ |
3375 | local->auth_algs = PRISM2_AUTH_OPEN | PRISM2_AUTH_SHARED_KEY; | 3375 | local->auth_algs = PRISM2_AUTH_OPEN | PRISM2_AUTH_SHARED_KEY; |
3376 | local->sram_type = -1; | 3376 | local->sram_type = -1; |
3377 | local->scan_channel_mask = 0xffff; | ||
3377 | #if defined(PRISM2_PCI) && defined(PRISM2_BUS_MASTER) | 3378 | #if defined(PRISM2_PCI) && defined(PRISM2_BUS_MASTER) |
3378 | local->bus_master_threshold_rx = GET_INT_PARM(bus_master_threshold_rx, | 3379 | local->bus_master_threshold_rx = GET_INT_PARM(bus_master_threshold_rx, |
3379 | card_idx); | 3380 | card_idx); |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index e545ac9c1b1..4c236e7903f 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, | |||
1664 | local = iface->local; | 1664 | local = iface->local; |
1665 | 1665 | ||
1666 | memset(&scan_req, 0, sizeof(scan_req)); | 1666 | memset(&scan_req, 0, sizeof(scan_req)); |
1667 | scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask); | 1667 | scan_req.channel_list = cpu_to_le16(local->channel_mask & |
1668 | local->scan_channel_mask); | ||
1668 | scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS); | 1669 | scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS); |
1669 | if (ssid) { | 1670 | if (ssid) { |
1670 | if (ssid_len > 32) | 1671 | if (ssid_len > 32) |
@@ -1693,7 +1694,8 @@ static int prism2_request_scan(struct net_device *dev) | |||
1693 | local = iface->local; | 1694 | local = iface->local; |
1694 | 1695 | ||
1695 | memset(&scan_req, 0, sizeof(scan_req)); | 1696 | memset(&scan_req, 0, sizeof(scan_req)); |
1696 | scan_req.channel_list = __constant_cpu_to_le16(local->channel_mask); | 1697 | scan_req.channel_list = cpu_to_le16(local->channel_mask & |
1698 | local->scan_channel_mask); | ||
1697 | scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS); | 1699 | scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS); |
1698 | 1700 | ||
1699 | /* FIX: | 1701 | /* FIX: |
@@ -2338,6 +2340,10 @@ static const struct iw_priv_args prism2_priv[] = { | |||
2338 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "drop_unencrypte" }, | 2340 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "drop_unencrypte" }, |
2339 | { PRISM2_PARAM_DROP_UNENCRYPTED, | 2341 | { PRISM2_PARAM_DROP_UNENCRYPTED, |
2340 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getdrop_unencry" }, | 2342 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getdrop_unencry" }, |
2343 | { PRISM2_PARAM_SCAN_CHANNEL_MASK, | ||
2344 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "scan_channels" }, | ||
2345 | { PRISM2_PARAM_SCAN_CHANNEL_MASK, | ||
2346 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getscan_channel" }, | ||
2341 | }; | 2347 | }; |
2342 | 2348 | ||
2343 | 2349 | ||
@@ -2699,6 +2705,10 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev, | |||
2699 | local->drop_unencrypted = value; | 2705 | local->drop_unencrypted = value; |
2700 | break; | 2706 | break; |
2701 | 2707 | ||
2708 | case PRISM2_PARAM_SCAN_CHANNEL_MASK: | ||
2709 | local->scan_channel_mask = value; | ||
2710 | break; | ||
2711 | |||
2702 | default: | 2712 | default: |
2703 | printk(KERN_DEBUG "%s: prism2_param: unknown param %d\n", | 2713 | printk(KERN_DEBUG "%s: prism2_param: unknown param %d\n", |
2704 | dev->name, param); | 2714 | dev->name, param); |
@@ -2890,6 +2900,10 @@ static int prism2_ioctl_priv_get_prism2_param(struct net_device *dev, | |||
2890 | *param = local->drop_unencrypted; | 2900 | *param = local->drop_unencrypted; |
2891 | break; | 2901 | break; |
2892 | 2902 | ||
2903 | case PRISM2_PARAM_SCAN_CHANNEL_MASK: | ||
2904 | *param = local->scan_channel_mask; | ||
2905 | break; | ||
2906 | |||
2893 | default: | 2907 | default: |
2894 | printk(KERN_DEBUG "%s: get_prism2_param: unknown param %d\n", | 2908 | printk(KERN_DEBUG "%s: get_prism2_param: unknown param %d\n", |
2895 | dev->name, *param); | 2909 | dev->name, *param); |
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h index 4b32e2e887b..91beee50c9c 100644 --- a/drivers/net/wireless/hostap/hostap_wlan.h +++ b/drivers/net/wireless/hostap/hostap_wlan.h | |||
@@ -680,7 +680,8 @@ struct local_info { | |||
680 | char essid[MAX_SSID_LEN + 1]; | 680 | char essid[MAX_SSID_LEN + 1]; |
681 | char name[MAX_NAME_LEN + 1]; | 681 | char name[MAX_NAME_LEN + 1]; |
682 | int name_set; | 682 | int name_set; |
683 | u16 channel_mask; | 683 | u16 channel_mask; /* mask of allowed channels */ |
684 | u16 scan_channel_mask; /* mask of channels to be scanned */ | ||
684 | struct comm_tallies_sums comm_tallies; | 685 | struct comm_tallies_sums comm_tallies; |
685 | struct net_device_stats stats; | 686 | struct net_device_stats stats; |
686 | struct proc_dir_entry *proc; | 687 | struct proc_dir_entry *proc; |