aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-06-04 21:04:02 -0400
committerGuido Guenther <agx@sigxcpu.org>2007-06-05 08:59:34 +0200
commite6039cdebd9c680500c20fda8f043686a412076f (patch)
treee093537f00be0a1d04c86d56ad390df921f670a3
parent85f3acf80050a2dedfbd0867e0d6cd3132ff684e (diff)
[PATCH] Remove support for channel scanning in monitor mode
This should be implemented by the userspace. No other Linux driver does that. The expected behavior is that the driver stays on the same channel while in monitor mode. Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--at76_usb.c43
-rw-r--r--at76_usb.h3
2 files changed, 8 insertions, 38 deletions
diff --git a/at76_usb.c b/at76_usb.c
index 758a2b8..cf684ac 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -183,8 +183,6 @@ static int preamble_type = PREAMBLE_TYPE_LONG;
static int auth_mode;
static int international_roaming; /* = IR_OFF */
static int default_iw_mode = IW_MODE_INFRA;
-static int monitor_scan_min_time = 50;
-static int monitor_scan_max_time = 600;
/* the supported rates of this hardware, bit7 marks a basic rate */
static const u8 hw_rates[] = { 0x82, 0x84, 0x0b, 0x16 };
@@ -1502,11 +1500,7 @@ static int at76_start_scan(struct at76_priv *priv, int use_essid, int ir_step)
/* INFO: For probe_delay, not multiplying by 1024 as this will be
slightly less than min_channel_time
(per spec: probe delay < min. channel time) */
- if (priv->istate == MONITORING) {
- scan.min_channel_time = cpu_to_le16(priv->monitor_scan_min_time);
- scan.max_channel_time = cpu_to_le16(priv->monitor_scan_max_time);
- scan.probe_delay = cpu_to_le16(priv->monitor_scan_min_time * 1000);
- } else {
+ if (priv->istate != MONITORING) {
scan.min_channel_time = cpu_to_le16(priv->scan_min_time);
scan.max_channel_time = cpu_to_le16(priv->scan_max_time);
scan.probe_delay = cpu_to_le16(priv->scan_min_time * 1000);
@@ -2811,20 +2805,11 @@ static int at76_iw_handler_set_scan(struct net_device *netdev,
priv->scan_mode = SCAN_TYPE_ACTIVE;
/* Sanity check values? */
- if (req->min_channel_time > 0) {
- if (priv->istate == MONITORING)
- priv->monitor_scan_min_time =
- req->min_channel_time;
- else
- priv->scan_min_time = req->min_channel_time;
- }
- if (req->max_channel_time > 0) {
- if (priv->istate == MONITORING)
- priv->monitor_scan_max_time =
- req->max_channel_time;
- else
- priv->scan_max_time = req->max_channel_time;
- }
+ if (req->min_channel_time > 0)
+ priv->scan_min_time = req->min_channel_time;
+
+ if (req->max_channel_time > 0)
+ priv->scan_max_time = req->max_channel_time;
}
/* change to scanning state */
@@ -3476,14 +3461,8 @@ static int at76_iw_set_scan_times(struct net_device *netdev,
if (mint <= 0 || maxt <= 0 || mint > maxt) {
ret = -EINVAL;
} else {
- if (priv->istate == MONITORING) {
- priv->monitor_scan_min_time = mint;
- priv->monitor_scan_max_time = maxt;
- ret = 0;
- } else {
- priv->scan_min_time = mint;
- priv->scan_max_time = maxt;
- }
+ priv->scan_min_time = mint;
+ priv->scan_max_time = maxt;
}
return ret;
@@ -4113,8 +4092,6 @@ static int at76_init_new_device(struct at76_priv *priv)
priv->scan_min_time = scan_min_time;
priv->scan_max_time = scan_max_time;
priv->scan_mode = scan_mode;
- priv->monitor_scan_min_time = monitor_scan_min_time;
- priv->monitor_scan_max_time = monitor_scan_max_time;
netdev->flags &= ~IFF_MULTICAST; /* not yet or never */
netdev->open = at76_open;
@@ -6378,10 +6355,6 @@ module_param(international_roaming, int, 0400);
MODULE_PARM_DESC(international_roaming, "enable international roaming: 0 (no, default), 1 (yes)");
module_param(default_iw_mode, int, 0400);
MODULE_PARM_DESC(default_iw_mode, "default IW mode for a new device: 1 (ad-hoc), 2 (infrastructure, def.), 6 (monitor mode)");
-module_param(monitor_scan_min_time, int, 0400);
-MODULE_PARM_DESC(monitor_scan_min_time, "scan min channel time in MONITOR MODE (default: 50)");
-module_param(monitor_scan_max_time, int, 0400);
-MODULE_PARM_DESC(monitor_scan_max_time, "scan max channel time in MONITOR MODE (default: 600)");
module_init(at76_mod_init);
module_exit(at76_mod_exit);
diff --git a/at76_usb.h b/at76_usb.h
index 7b7db30..a97c042 100644
--- a/at76_usb.h
+++ b/at76_usb.h
@@ -584,9 +584,6 @@ struct at76_priv {
struct set_mib_buffer mib_buf; /* global buffer for set_mib calls */
/* beacon counting */
- int monitor_scan_min_time;
- int monitor_scan_max_time;
-
int beacon_period; /* period of mgmt beacons */
int beacons_received;
unsigned long beacons_last_qual; /* last time we reset beacons_received = 0 */