Commit 8816edce authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville

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: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 23ff5036
...@@ -315,7 +315,7 @@ static ssize_t lbs_setuserscan(struct file *file, ...@@ -315,7 +315,7 @@ static ssize_t lbs_setuserscan(struct file *file,
lbs_scan_networks(priv, scan_cfg, 1); lbs_scan_networks(priv, scan_cfg, 1);
wait_event_interruptible(priv->cmd_pending, wait_event_interruptible(priv->cmd_pending,
priv->surpriseremoved || !priv->last_scanned_channel); priv->surpriseremoved || !priv->scan_channel);
if (priv->surpriseremoved) if (priv->surpriseremoved)
goto out_scan_cfg; goto out_scan_cfg;
......
...@@ -143,9 +143,12 @@ struct lbs_private { ...@@ -143,9 +143,12 @@ struct lbs_private {
wait_queue_head_t waitq; wait_queue_head_t waitq;
struct workqueue_struct *work_thread; struct workqueue_struct *work_thread;
/** Scanning */
struct delayed_work scan_work; struct delayed_work scan_work;
struct delayed_work assoc_work; struct delayed_work assoc_work;
struct work_struct sync_channel; struct work_struct sync_channel;
/* remember which channel was scanned last, != 0 if currently scanning */
int scan_channel;
/** Hardware access */ /** Hardware access */
int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
...@@ -321,7 +324,6 @@ struct lbs_private { ...@@ -321,7 +324,6 @@ struct lbs_private {
struct cmd_ds_802_11_get_log logmsg; struct cmd_ds_802_11_get_log logmsg;
u32 monitormode; u32 monitormode;
int last_scanned_channel;
u8 fw_ready; u8 fw_ready;
}; };
......
...@@ -612,13 +612,13 @@ int lbs_scan_networks(struct lbs_private *priv, ...@@ -612,13 +612,13 @@ int lbs_scan_networks(struct lbs_private *priv,
} }
/* Prepare to continue an interrupted scan */ /* Prepare to continue an interrupted scan */
lbs_deb_scan("chan_count %d, last_scanned_channel %d\n", lbs_deb_scan("chan_count %d, scan_channel %d\n",
chan_count, priv->last_scanned_channel); chan_count, priv->scan_channel);
curr_chans = chan_list; curr_chans = chan_list;
/* advance channel list by already-scanned-channels */ /* advance channel list by already-scanned-channels */
if (priv->last_scanned_channel > 0) { if (priv->scan_channel > 0) {
curr_chans += priv->last_scanned_channel; curr_chans += priv->scan_channel;
chan_count -= priv->last_scanned_channel; chan_count -= priv->scan_channel;
} }
/* Send scan command(s) /* Send scan command(s)
...@@ -644,10 +644,10 @@ int lbs_scan_networks(struct lbs_private *priv, ...@@ -644,10 +644,10 @@ int lbs_scan_networks(struct lbs_private *priv,
!full_scan && !full_scan &&
!priv->surpriseremoved) { !priv->surpriseremoved) {
/* -1 marks just that we're currently scanning */ /* -1 marks just that we're currently scanning */
if (priv->last_scanned_channel < 0) if (priv->scan_channel < 0)
priv->last_scanned_channel = to_scan; priv->scan_channel = to_scan;
else else
priv->last_scanned_channel += to_scan; priv->scan_channel += to_scan;
cancel_delayed_work(&priv->scan_work); cancel_delayed_work(&priv->scan_work);
queue_delayed_work(priv->work_thread, &priv->scan_work, queue_delayed_work(priv->work_thread, &priv->scan_work,
msecs_to_jiffies(300)); msecs_to_jiffies(300));
...@@ -671,7 +671,7 @@ int lbs_scan_networks(struct lbs_private *priv, ...@@ -671,7 +671,7 @@ int lbs_scan_networks(struct lbs_private *priv,
#endif #endif
out2: out2:
priv->last_scanned_channel = 0; priv->scan_channel = 0;
out: out:
if (priv->connect_status == LBS_CONNECTED) { if (priv->connect_status == LBS_CONNECTED) {
...@@ -1393,7 +1393,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -1393,7 +1393,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
queue_delayed_work(priv->work_thread, &priv->scan_work, queue_delayed_work(priv->work_thread, &priv->scan_work,
msecs_to_jiffies(50)); msecs_to_jiffies(50));
/* set marker that currently a scan is taking place */ /* set marker that currently a scan is taking place */
priv->last_scanned_channel = -1; priv->scan_channel = -1;
if (priv->surpriseremoved) if (priv->surpriseremoved)
return -EIO; return -EIO;
...@@ -1427,7 +1427,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -1427,7 +1427,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_SCAN); lbs_deb_enter(LBS_DEB_SCAN);
/* iwlist should wait until the current scan is finished */ /* iwlist should wait until the current scan is finished */
if (priv->last_scanned_channel) if (priv->scan_channel)
return -EAGAIN; return -EAGAIN;
/* Update RSSI if current BSS is a locally created ad-hoc BSS */ /* Update RSSI if current BSS is a locally created ad-hoc BSS */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment