Commit af0053d6 authored by Winkler, Tomas's avatar Winkler, Tomas Committed by John W. Linville
Browse files

iwlwifi: kill iwl3945_scan_cancel and iwl3945_scan_cancel_timeout



This patch removes iwl3945_scan_cancel and iwl3945_scan_cancel_timeout
because iwl_scan_cancel iwl_scan_cancel_timeout are just same.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 42986796
......@@ -1734,58 +1734,6 @@ static int iwl3945_send_power_mode(struct iwl_priv *priv, u32 mode)
return rc;
}
/**
* iwl3945_scan_cancel - Cancel any currently executing HW scan
*
* NOTE: priv->mutex is not required before calling this function
*/
static int iwl3945_scan_cancel(struct iwl_priv *priv)
{
if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
clear_bit(STATUS_SCANNING, &priv->status);
return 0;
}
if (test_bit(STATUS_SCANNING, &priv->status)) {
if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
IWL_DEBUG_SCAN("Queuing scan abort.\n");
set_bit(STATUS_SCAN_ABORTING, &priv->status);
queue_work(priv->workqueue, &priv->abort_scan);
} else
IWL_DEBUG_SCAN("Scan abort already in progress.\n");
return test_bit(STATUS_SCANNING, &priv->status);
}
return 0;
}
/**
* iwl3945_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
*/
static int iwl3945_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
{
unsigned long now = jiffies;
int ret;
ret = iwl3945_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);
return test_bit(STATUS_SCANNING, &priv->status);
}
return ret;
}
#define MAX_UCODE_BEACON_INTERVAL 1024
#define INTEL_CONN_LISTEN_INTERVAL __constant_cpu_to_le16(0xA)
......@@ -2022,7 +1970,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
return -EAGAIN;
cancel_delayed_work(&priv->scan_check);
if (iwl3945_scan_cancel_timeout(priv, 100)) {
if (iwl_scan_cancel_timeout(priv, 100)) {
IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
return -EAGAIN;
......@@ -2502,7 +2450,7 @@ static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
disable_radio ? "OFF" : "ON");
if (disable_radio) {
iwl3945_scan_cancel(priv);
iwl_scan_cancel(priv);
/* FIXME: This is a workaround for AP */
if (priv->iw_mode != NL80211_IFTYPE_AP) {
spin_lock_irqsave(&priv->lock, flags);
......@@ -3014,7 +2962,7 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
else
clear_bit(STATUS_RF_KILL_SW, &priv->status);
iwl3945_scan_cancel(priv);
iwl_scan_cancel(priv);
if ((test_bit(STATUS_RF_KILL_HW, &status) !=
test_bit(STATUS_RF_KILL_HW, &priv->status)) ||
......@@ -5800,7 +5748,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
if (!priv->vif || !priv->is_open)
return;
iwl3945_scan_cancel_timeout(priv, 200);
iwl_scan_cancel_timeout(priv, 200);
conf = ieee80211_get_hw_conf(priv->hw);
......@@ -6001,7 +5949,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
* RXON_FILTER_ASSOC_MSK BIT
*/
mutex_lock(&priv->mutex);
iwl3945_scan_cancel_timeout(priv, 100);
iwl_scan_cancel_timeout(priv, 100);
mutex_unlock(&priv->mutex);
}
......@@ -6279,7 +6227,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
!is_multicast_ether_addr(conf->bssid)) {
/* If there is currently a HW scan going on in the background
* then we need to cancel it else the RXON below will fail. */
if (iwl3945_scan_cancel_timeout(priv, 100)) {
if (iwl_scan_cancel_timeout(priv, 100)) {
IWL_WARN(priv, "Aborted scan still in progress "
"after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
......@@ -6304,7 +6252,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
}
} else {
iwl3945_scan_cancel_timeout(priv, 100);
iwl_scan_cancel_timeout(priv, 100);
priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv);
}
......@@ -6372,7 +6320,7 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&priv->mutex);
if (iwl_is_ready_rf(priv)) {
iwl3945_scan_cancel_timeout(priv, 100);
iwl_scan_cancel_timeout(priv, 100);
priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv);
}
......@@ -6520,7 +6468,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
mutex_lock(&priv->mutex);
iwl3945_scan_cancel_timeout(priv, 100);
iwl_scan_cancel_timeout(priv, 100);
switch (cmd) {
case SET_KEY:
......@@ -6670,7 +6618,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
* clear RXON_FILTER_ASSOC_MSK bit
*/
if (priv->iw_mode != NL80211_IFTYPE_AP) {
iwl3945_scan_cancel_timeout(priv, 100);
iwl_scan_cancel_timeout(priv, 100);
priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv);
}
......@@ -6829,7 +6777,7 @@ static ssize_t store_flags(struct device *d,
mutex_lock(&priv->mutex);
if (le32_to_cpu(priv->staging39_rxon.flags) != flags) {
/* Cancel any currently running scans... */
if (iwl3945_scan_cancel_timeout(priv, 100))
if (iwl_scan_cancel_timeout(priv, 100))
IWL_WARN(priv, "Could not cancel scan.\n");
else {
IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n",
......@@ -6864,7 +6812,7 @@ static ssize_t store_filter_flags(struct device *d,
mutex_lock(&priv->mutex);
if (le32_to_cpu(priv->staging39_rxon.filter_flags) != filter_flags) {
/* Cancel any currently running scans... */
if (iwl3945_scan_cancel_timeout(priv, 100))
if (iwl_scan_cancel_timeout(priv, 100))
IWL_WARN(priv, "Could not cancel scan.\n");
else {
IWL_DEBUG_INFO("Committing rxon.filter_flags = "
......
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