mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-11 03:48:00 +00:00
iwlagn: refactor scan complete
We'll need to be able to run scan complete inline, not from the workqueue, so refactor it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
98efb4a52b
commit
f253247a94
@ -1013,18 +1013,14 @@ static void iwl_bg_abort_scan(struct work_struct *work)
|
|||||||
mutex_unlock(&priv->shrd->mutex);
|
mutex_unlock(&priv->shrd->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iwl_bg_scan_completed(struct work_struct *work)
|
static void iwl_process_scan_complete(struct iwl_priv *priv)
|
||||||
{
|
{
|
||||||
struct iwl_priv *priv =
|
|
||||||
container_of(work, struct iwl_priv, scan_completed);
|
|
||||||
bool aborted;
|
bool aborted;
|
||||||
|
|
||||||
IWL_DEBUG_SCAN(priv, "Completed scan.\n");
|
IWL_DEBUG_SCAN(priv, "Completed scan.\n");
|
||||||
|
|
||||||
cancel_delayed_work(&priv->scan_check);
|
cancel_delayed_work(&priv->scan_check);
|
||||||
|
|
||||||
mutex_lock(&priv->shrd->mutex);
|
|
||||||
|
|
||||||
aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status);
|
aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status);
|
||||||
if (aborted)
|
if (aborted)
|
||||||
IWL_DEBUG_SCAN(priv, "Aborted scan completed.\n");
|
IWL_DEBUG_SCAN(priv, "Aborted scan completed.\n");
|
||||||
@ -1057,7 +1053,7 @@ static void iwl_bg_scan_completed(struct work_struct *work)
|
|||||||
goto out_complete;
|
goto out_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
goto out;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_complete:
|
out_complete:
|
||||||
@ -1066,11 +1062,18 @@ out_complete:
|
|||||||
out_settings:
|
out_settings:
|
||||||
/* Can we still talk to firmware ? */
|
/* Can we still talk to firmware ? */
|
||||||
if (!iwl_is_ready_rf(priv->shrd))
|
if (!iwl_is_ready_rf(priv->shrd))
|
||||||
goto out;
|
return;
|
||||||
|
|
||||||
iwlagn_post_scan(priv);
|
iwlagn_post_scan(priv);
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
static void iwl_bg_scan_completed(struct work_struct *work)
|
||||||
|
{
|
||||||
|
struct iwl_priv *priv =
|
||||||
|
container_of(work, struct iwl_priv, scan_completed);
|
||||||
|
|
||||||
|
mutex_lock(&priv->shrd->mutex);
|
||||||
|
iwl_process_scan_complete(priv);
|
||||||
mutex_unlock(&priv->shrd->mutex);
|
mutex_unlock(&priv->shrd->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user