Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134185
b: refs/heads/master
c: af0053d
h: refs/heads/master
i:
  134183: 2f4ed54
v: v3
  • Loading branch information
Winkler, Tomas authored and John W. Linville committed Jan 29, 2009
1 parent 555820b commit cb95ae2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 65 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: 42986796409a6293351207150edb7b4689b6013d
refs/heads/master: af0053d660f7c330ed1a5c6538938283fd79662f
76 changes: 12 additions & 64 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)) ||
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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");
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 = "
Expand Down

0 comments on commit cb95ae2

Please sign in to comment.