Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214653
b: refs/heads/master
c: e693a80
h: refs/heads/master
i:
  214651: ed7a7ea
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Sep 14, 2010
1 parent 4c8acd5 commit 68bbf9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd44600fdd89832c0bc898189270a81be0db01cd
refs/heads/master: e693a802f06f538b711333a32a83e2732dc4773d
25 changes: 12 additions & 13 deletions trunk/drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
int iwl_scan_cancel(struct iwl_priv *priv)
{
IWL_DEBUG_SCAN(priv, "Queuing abort scan\n");
schedule_work(&priv->abort_scan);
queue_work(priv->workqueue, &priv->abort_scan);
return 0;
}
EXPORT_SYMBOL(iwl_scan_cancel);
Expand All @@ -135,25 +135,24 @@ EXPORT_SYMBOL(iwl_scan_cancel);
* iwl_scan_cancel_timeout - Cancel any currently executing HW scan
* @ms: amount of time to wait (in milliseconds) for scan to abort
*
* NOTE: priv->mutex must be held before calling this function
*/
int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
{
unsigned long now = jiffies;
int ret;
unsigned long timeout = jiffies + msecs_to_jiffies(ms);

lockdep_assert_held(&priv->mutex);

ret = iwl_scan_cancel(priv);
if (ret && ms) {
mutex_unlock(&priv->mutex);
while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
test_bit(STATUS_SCANNING, &priv->status))
msleep(1);
mutex_lock(&priv->mutex);
IWL_DEBUG_SCAN(priv, "Scan cancel timeout\n");

return test_bit(STATUS_SCANNING, &priv->status);
iwl_do_scan_abort(priv);

while (time_before_eq(jiffies, timeout)) {
if (!test_bit(STATUS_SCAN_HW, &priv->status))
break;
msleep(20);
}

return ret;
return test_bit(STATUS_SCAN_HW, &priv->status);
}
EXPORT_SYMBOL(iwl_scan_cancel_timeout);

Expand Down

0 comments on commit 68bbf9b

Please sign in to comment.