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/iwl4965-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/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 6be38ce701f5..b6e9a09b7e75 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -2649,9 +2649,6 @@ static void iwl4965_connection_init_rx_config(struct iwl4965_priv *priv) | |||
2649 | 2649 | ||
2650 | static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode) | 2650 | static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode) |
2651 | { | 2651 | { |
2652 | if (!iwl4965_is_ready_rf(priv)) | ||
2653 | return -EAGAIN; | ||
2654 | |||
2655 | if (mode == IEEE80211_IF_TYPE_IBSS) { | 2652 | if (mode == IEEE80211_IF_TYPE_IBSS) { |
2656 | const struct iwl4965_channel_info *ch_info; | 2653 | const struct iwl4965_channel_info *ch_info; |
2657 | 2654 | ||
@@ -2666,13 +2663,6 @@ static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode) | |||
2666 | } | 2663 | } |
2667 | } | 2664 | } |
2668 | 2665 | ||
2669 | cancel_delayed_work(&priv->scan_check); | ||
2670 | if (iwl4965_scan_cancel_timeout(priv, 100)) { | ||
2671 | IWL_WARNING("Aborted scan still in progress after 100ms\n"); | ||
2672 | IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); | ||
2673 | return -EAGAIN; | ||
2674 | } | ||
2675 | |||
2676 | priv->iw_mode = mode; | 2666 | priv->iw_mode = mode; |
2677 | 2667 | ||
2678 | iwl4965_connection_init_rx_config(priv); | 2668 | iwl4965_connection_init_rx_config(priv); |
@@ -2680,6 +2670,17 @@ static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode) | |||
2680 | 2670 | ||
2681 | iwl4965_clear_stations_table(priv); | 2671 | iwl4965_clear_stations_table(priv); |
2682 | 2672 | ||
2673 | /* dont commit rxon if rf-kill is on*/ | ||
2674 | if (!iwl4965_is_ready_rf(priv)) | ||
2675 | return -EAGAIN; | ||
2676 | |||
2677 | cancel_delayed_work(&priv->scan_check); | ||
2678 | if (iwl4965_scan_cancel_timeout(priv, 100)) { | ||
2679 | IWL_WARNING("Aborted scan still in progress after 100ms\n"); | ||
2680 | IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); | ||
2681 | return -EAGAIN; | ||
2682 | } | ||
2683 | |||
2683 | iwl4965_commit_rxon(priv); | 2684 | iwl4965_commit_rxon(priv); |
2684 | 2685 | ||
2685 | return 0; | 2686 | return 0; |
@@ -7458,6 +7459,12 @@ static void iwl4965_mac_stop(struct ieee80211_hw *hw) | |||
7458 | * RXON_FILTER_ASSOC_MSK BIT | 7459 | * RXON_FILTER_ASSOC_MSK BIT |
7459 | */ | 7460 | */ |
7460 | priv->is_open = 0; | 7461 | priv->is_open = 0; |
7462 | if (!iwl4965_is_ready_rf(priv)) { | ||
7463 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); | ||
7464 | mutex_unlock(&priv->mutex); | ||
7465 | return; | ||
7466 | } | ||
7467 | |||
7461 | iwl4965_scan_cancel_timeout(priv, 100); | 7468 | iwl4965_scan_cancel_timeout(priv, 100); |
7462 | cancel_delayed_work(&priv->post_associate); | 7469 | cancel_delayed_work(&priv->post_associate); |
7463 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7470 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
@@ -7743,6 +7750,9 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7743 | priv->ibss_beacon = conf->beacon; | 7750 | priv->ibss_beacon = conf->beacon; |
7744 | } | 7751 | } |
7745 | 7752 | ||
7753 | if (iwl4965_is_rfkill(priv)) | ||
7754 | goto done; | ||
7755 | |||
7746 | if (conf->bssid && !is_zero_ether_addr(conf->bssid) && | 7756 | if (conf->bssid && !is_zero_ether_addr(conf->bssid) && |
7747 | !is_multicast_ether_addr(conf->bssid)) { | 7757 | !is_multicast_ether_addr(conf->bssid)) { |
7748 | /* If there is currently a HW scan going on in the background | 7758 | /* If there is currently a HW scan going on in the background |
@@ -7777,6 +7787,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7777 | iwl4965_commit_rxon(priv); | 7787 | iwl4965_commit_rxon(priv); |
7778 | } | 7788 | } |
7779 | 7789 | ||
7790 | done: | ||
7780 | spin_lock_irqsave(&priv->lock, flags); | 7791 | spin_lock_irqsave(&priv->lock, flags); |
7781 | if (!conf->ssid_len) | 7792 | if (!conf->ssid_len) |
7782 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | 7793 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); |
@@ -7813,11 +7824,12 @@ static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, | |||
7813 | 7824 | ||
7814 | mutex_lock(&priv->mutex); | 7825 | mutex_lock(&priv->mutex); |
7815 | 7826 | ||
7816 | iwl4965_scan_cancel_timeout(priv, 100); | 7827 | if (iwl4965_is_ready_rf(priv)) { |
7817 | cancel_delayed_work(&priv->post_associate); | 7828 | iwl4965_scan_cancel_timeout(priv, 100); |
7818 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7829 | cancel_delayed_work(&priv->post_associate); |
7819 | iwl4965_commit_rxon(priv); | 7830 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
7820 | 7831 | iwl4965_commit_rxon(priv); | |
7832 | } | ||
7821 | if (priv->interface_id == conf->if_id) { | 7833 | if (priv->interface_id == conf->if_id) { |
7822 | priv->interface_id = 0; | 7834 | priv->interface_id = 0; |
7823 | memset(priv->bssid, 0, ETH_ALEN); | 7835 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -8130,6 +8142,12 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw) | |||
8130 | 8142 | ||
8131 | spin_unlock_irqrestore(&priv->lock, flags); | 8143 | spin_unlock_irqrestore(&priv->lock, flags); |
8132 | 8144 | ||
8145 | if (!iwl4965_is_ready_rf(priv)) { | ||
8146 | IWL_DEBUG_MAC80211("leave - not ready\n"); | ||
8147 | mutex_unlock(&priv->mutex); | ||
8148 | return; | ||
8149 | } | ||
8150 | |||
8133 | /* we are restarting association process | 8151 | /* we are restarting association process |
8134 | * clear RXON_FILTER_ASSOC_MSK bit | 8152 | * clear RXON_FILTER_ASSOC_MSK bit |
8135 | */ | 8153 | */ |
@@ -8147,12 +8165,6 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw) | |||
8147 | return; | 8165 | return; |
8148 | } | 8166 | } |
8149 | 8167 | ||
8150 | if (!iwl4965_is_ready_rf(priv)) { | ||
8151 | IWL_DEBUG_MAC80211("leave - not ready\n"); | ||
8152 | mutex_unlock(&priv->mutex); | ||
8153 | return; | ||
8154 | } | ||
8155 | |||
8156 | priv->only_active_channel = 0; | 8168 | priv->only_active_channel = 0; |
8157 | 8169 | ||
8158 | iwl4965_set_rate(priv); | 8170 | iwl4965_set_rate(priv); |