diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2008-01-28 11:28:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:19:12 -0500 |
commit | 8816edcea9009b66570bef10acde5a552a9b3b3c (patch) | |
tree | 7f5f3844dbdd32d1b5a885a417dd991f342c5830 /drivers/net/wireless/libertas | |
parent | 23ff50361f23355334bffe33de84f0b52aa34b9d (diff) |
libertas: rename/document scan_channel
Rename last_scanned_channel to scan_channel, just so that a
grep for struct bss_descriptor's last_scanned element doesn't
show up so many positives.
Also documented the variable and moved it to other scan related
entries in lbs_private.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 22 |
3 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index fd67b770dd78..b600f2439b57 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -315,7 +315,7 @@ static ssize_t lbs_setuserscan(struct file *file, | |||
315 | 315 | ||
316 | lbs_scan_networks(priv, scan_cfg, 1); | 316 | lbs_scan_networks(priv, scan_cfg, 1); |
317 | wait_event_interruptible(priv->cmd_pending, | 317 | wait_event_interruptible(priv->cmd_pending, |
318 | priv->surpriseremoved || !priv->last_scanned_channel); | 318 | priv->surpriseremoved || !priv->scan_channel); |
319 | 319 | ||
320 | if (priv->surpriseremoved) | 320 | if (priv->surpriseremoved) |
321 | goto out_scan_cfg; | 321 | goto out_scan_cfg; |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 5a69f2b60865..fd1fcc748010 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -143,9 +143,12 @@ struct lbs_private { | |||
143 | wait_queue_head_t waitq; | 143 | wait_queue_head_t waitq; |
144 | struct workqueue_struct *work_thread; | 144 | struct workqueue_struct *work_thread; |
145 | 145 | ||
146 | /** Scanning */ | ||
146 | struct delayed_work scan_work; | 147 | struct delayed_work scan_work; |
147 | struct delayed_work assoc_work; | 148 | struct delayed_work assoc_work; |
148 | struct work_struct sync_channel; | 149 | struct work_struct sync_channel; |
150 | /* remember which channel was scanned last, != 0 if currently scanning */ | ||
151 | int scan_channel; | ||
149 | 152 | ||
150 | /** Hardware access */ | 153 | /** Hardware access */ |
151 | int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); | 154 | int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); |
@@ -321,7 +324,6 @@ struct lbs_private { | |||
321 | struct cmd_ds_802_11_get_log logmsg; | 324 | struct cmd_ds_802_11_get_log logmsg; |
322 | 325 | ||
323 | u32 monitormode; | 326 | u32 monitormode; |
324 | int last_scanned_channel; | ||
325 | u8 fw_ready; | 327 | u8 fw_ready; |
326 | }; | 328 | }; |
327 | 329 | ||
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 37b9684bf29c..7d4f3afa8cc5 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -612,13 +612,13 @@ int lbs_scan_networks(struct lbs_private *priv, | |||
612 | } | 612 | } |
613 | 613 | ||
614 | /* Prepare to continue an interrupted scan */ | 614 | /* Prepare to continue an interrupted scan */ |
615 | lbs_deb_scan("chan_count %d, last_scanned_channel %d\n", | 615 | lbs_deb_scan("chan_count %d, scan_channel %d\n", |
616 | chan_count, priv->last_scanned_channel); | 616 | chan_count, priv->scan_channel); |
617 | curr_chans = chan_list; | 617 | curr_chans = chan_list; |
618 | /* advance channel list by already-scanned-channels */ | 618 | /* advance channel list by already-scanned-channels */ |
619 | if (priv->last_scanned_channel > 0) { | 619 | if (priv->scan_channel > 0) { |
620 | curr_chans += priv->last_scanned_channel; | 620 | curr_chans += priv->scan_channel; |
621 | chan_count -= priv->last_scanned_channel; | 621 | chan_count -= priv->scan_channel; |
622 | } | 622 | } |
623 | 623 | ||
624 | /* Send scan command(s) | 624 | /* Send scan command(s) |
@@ -644,10 +644,10 @@ int lbs_scan_networks(struct lbs_private *priv, | |||
644 | !full_scan && | 644 | !full_scan && |
645 | !priv->surpriseremoved) { | 645 | !priv->surpriseremoved) { |
646 | /* -1 marks just that we're currently scanning */ | 646 | /* -1 marks just that we're currently scanning */ |
647 | if (priv->last_scanned_channel < 0) | 647 | if (priv->scan_channel < 0) |
648 | priv->last_scanned_channel = to_scan; | 648 | priv->scan_channel = to_scan; |
649 | else | 649 | else |
650 | priv->last_scanned_channel += to_scan; | 650 | priv->scan_channel += to_scan; |
651 | cancel_delayed_work(&priv->scan_work); | 651 | cancel_delayed_work(&priv->scan_work); |
652 | queue_delayed_work(priv->work_thread, &priv->scan_work, | 652 | queue_delayed_work(priv->work_thread, &priv->scan_work, |
653 | msecs_to_jiffies(300)); | 653 | msecs_to_jiffies(300)); |
@@ -671,7 +671,7 @@ int lbs_scan_networks(struct lbs_private *priv, | |||
671 | #endif | 671 | #endif |
672 | 672 | ||
673 | out2: | 673 | out2: |
674 | priv->last_scanned_channel = 0; | 674 | priv->scan_channel = 0; |
675 | 675 | ||
676 | out: | 676 | out: |
677 | if (priv->connect_status == LBS_CONNECTED) { | 677 | if (priv->connect_status == LBS_CONNECTED) { |
@@ -1393,7 +1393,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, | |||
1393 | queue_delayed_work(priv->work_thread, &priv->scan_work, | 1393 | queue_delayed_work(priv->work_thread, &priv->scan_work, |
1394 | msecs_to_jiffies(50)); | 1394 | msecs_to_jiffies(50)); |
1395 | /* set marker that currently a scan is taking place */ | 1395 | /* set marker that currently a scan is taking place */ |
1396 | priv->last_scanned_channel = -1; | 1396 | priv->scan_channel = -1; |
1397 | 1397 | ||
1398 | if (priv->surpriseremoved) | 1398 | if (priv->surpriseremoved) |
1399 | return -EIO; | 1399 | return -EIO; |
@@ -1427,7 +1427,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, | |||
1427 | lbs_deb_enter(LBS_DEB_SCAN); | 1427 | lbs_deb_enter(LBS_DEB_SCAN); |
1428 | 1428 | ||
1429 | /* iwlist should wait until the current scan is finished */ | 1429 | /* iwlist should wait until the current scan is finished */ |
1430 | if (priv->last_scanned_channel) | 1430 | if (priv->scan_channel) |
1431 | return -EAGAIN; | 1431 | return -EAGAIN; |
1432 | 1432 | ||
1433 | /* Update RSSI if current BSS is a locally created ad-hoc BSS */ | 1433 | /* Update RSSI if current BSS is a locally created ad-hoc BSS */ |