diff options
author | Mohamed Abbas <mabbas@linux.intel.com> | 2007-11-28 22:10:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:37 -0500 |
commit | fde3571fd8613483f1203d11394ae316c6b79a03 (patch) | |
tree | 1cf86bcf3b5fc5cfd1990d0eeb96bc607093ac87 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 5c0eef960bdb87a53ba390aab7b069b2bc8d7f6d (diff) |
iwlwifi: avoid firmware command sending if rfkill is enabled
This patch fixed a ucode timeout issue and worked code with suspend
to disk.
Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 3272608ced83..dbb6eff7b8e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2546,9 +2546,6 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
2546 | 2546 | ||
2547 | static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | 2547 | static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) |
2548 | { | 2548 | { |
2549 | if (!iwl3945_is_ready_rf(priv)) | ||
2550 | return -EAGAIN; | ||
2551 | |||
2552 | if (mode == IEEE80211_IF_TYPE_IBSS) { | 2549 | if (mode == IEEE80211_IF_TYPE_IBSS) { |
2553 | const struct iwl3945_channel_info *ch_info; | 2550 | const struct iwl3945_channel_info *ch_info; |
2554 | 2551 | ||
@@ -2563,13 +2560,6 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | |||
2563 | } | 2560 | } |
2564 | } | 2561 | } |
2565 | 2562 | ||
2566 | cancel_delayed_work(&priv->scan_check); | ||
2567 | if (iwl3945_scan_cancel_timeout(priv, 100)) { | ||
2568 | IWL_WARNING("Aborted scan still in progress after 100ms\n"); | ||
2569 | IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); | ||
2570 | return -EAGAIN; | ||
2571 | } | ||
2572 | |||
2573 | priv->iw_mode = mode; | 2563 | priv->iw_mode = mode; |
2574 | 2564 | ||
2575 | iwl3945_connection_init_rx_config(priv); | 2565 | iwl3945_connection_init_rx_config(priv); |
@@ -2577,6 +2567,17 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | |||
2577 | 2567 | ||
2578 | iwl3945_clear_stations_table(priv); | 2568 | iwl3945_clear_stations_table(priv); |
2579 | 2569 | ||
2570 | /* dont commit rxon if rf-kill is on*/ | ||
2571 | if (!iwl3945_is_ready_rf(priv)) | ||
2572 | return -EAGAIN; | ||
2573 | |||
2574 | cancel_delayed_work(&priv->scan_check); | ||
2575 | if (iwl3945_scan_cancel_timeout(priv, 100)) { | ||
2576 | IWL_WARNING("Aborted scan still in progress after 100ms\n"); | ||
2577 | IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); | ||
2578 | return -EAGAIN; | ||
2579 | } | ||
2580 | |||
2580 | iwl3945_commit_rxon(priv); | 2581 | iwl3945_commit_rxon(priv); |
2581 | 2582 | ||
2582 | return 0; | 2583 | return 0; |
@@ -7020,6 +7021,12 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw) | |||
7020 | * RXON_FILTER_ASSOC_MSK BIT | 7021 | * RXON_FILTER_ASSOC_MSK BIT |
7021 | */ | 7022 | */ |
7022 | priv->is_open = 0; | 7023 | priv->is_open = 0; |
7024 | if (!iwl3945_is_ready_rf(priv)) { | ||
7025 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); | ||
7026 | mutex_unlock(&priv->mutex); | ||
7027 | return; | ||
7028 | } | ||
7029 | |||
7023 | iwl3945_scan_cancel_timeout(priv, 100); | 7030 | iwl3945_scan_cancel_timeout(priv, 100); |
7024 | cancel_delayed_work(&priv->post_associate); | 7031 | cancel_delayed_work(&priv->post_associate); |
7025 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7032 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
@@ -7291,6 +7298,9 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7291 | priv->ibss_beacon = conf->beacon; | 7298 | priv->ibss_beacon = conf->beacon; |
7292 | } | 7299 | } |
7293 | 7300 | ||
7301 | if (iwl3945_is_rfkill(priv)) | ||
7302 | goto done; | ||
7303 | |||
7294 | if (conf->bssid && !is_zero_ether_addr(conf->bssid) && | 7304 | if (conf->bssid && !is_zero_ether_addr(conf->bssid) && |
7295 | !is_multicast_ether_addr(conf->bssid)) { | 7305 | !is_multicast_ether_addr(conf->bssid)) { |
7296 | /* If there is currently a HW scan going on in the background | 7306 | /* If there is currently a HW scan going on in the background |
@@ -7325,6 +7335,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7325 | iwl3945_commit_rxon(priv); | 7335 | iwl3945_commit_rxon(priv); |
7326 | } | 7336 | } |
7327 | 7337 | ||
7338 | done: | ||
7328 | spin_lock_irqsave(&priv->lock, flags); | 7339 | spin_lock_irqsave(&priv->lock, flags); |
7329 | if (!conf->ssid_len) | 7340 | if (!conf->ssid_len) |
7330 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | 7341 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); |
@@ -7361,11 +7372,12 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | |||
7361 | 7372 | ||
7362 | mutex_lock(&priv->mutex); | 7373 | mutex_lock(&priv->mutex); |
7363 | 7374 | ||
7364 | iwl3945_scan_cancel_timeout(priv, 100); | 7375 | if (iwl3945_is_ready_rf(priv)) { |
7365 | cancel_delayed_work(&priv->post_associate); | 7376 | iwl3945_scan_cancel_timeout(priv, 100); |
7366 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7377 | cancel_delayed_work(&priv->post_associate); |
7367 | iwl3945_commit_rxon(priv); | 7378 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
7368 | 7379 | iwl3945_commit_rxon(priv); | |
7380 | } | ||
7369 | if (priv->interface_id == conf->if_id) { | 7381 | if (priv->interface_id == conf->if_id) { |
7370 | priv->interface_id = 0; | 7382 | priv->interface_id = 0; |
7371 | memset(priv->bssid, 0, ETH_ALEN); | 7383 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -7636,6 +7648,12 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) | |||
7636 | 7648 | ||
7637 | spin_unlock_irqrestore(&priv->lock, flags); | 7649 | spin_unlock_irqrestore(&priv->lock, flags); |
7638 | 7650 | ||
7651 | if (!iwl3945_is_ready_rf(priv)) { | ||
7652 | IWL_DEBUG_MAC80211("leave - not ready\n"); | ||
7653 | mutex_unlock(&priv->mutex); | ||
7654 | return; | ||
7655 | } | ||
7656 | |||
7639 | /* we are restarting association process | 7657 | /* we are restarting association process |
7640 | * clear RXON_FILTER_ASSOC_MSK bit | 7658 | * clear RXON_FILTER_ASSOC_MSK bit |
7641 | */ | 7659 | */ |
@@ -7653,12 +7671,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) | |||
7653 | return; | 7671 | return; |
7654 | } | 7672 | } |
7655 | 7673 | ||
7656 | if (!iwl3945_is_ready_rf(priv)) { | ||
7657 | IWL_DEBUG_MAC80211("leave - not ready\n"); | ||
7658 | mutex_unlock(&priv->mutex); | ||
7659 | return; | ||
7660 | } | ||
7661 | |||
7662 | priv->only_active_channel = 0; | 7674 | priv->only_active_channel = 0; |
7663 | 7675 | ||
7664 | iwl3945_set_rate(priv); | 7676 | iwl3945_set_rate(priv); |