diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-08 16:44:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-11 15:23:57 -0400 |
commit | 19cc10870ece942d287241937944c237130f50f4 (patch) | |
tree | bda1c1eb5750159c3470ca66607e7050dfc8d49c /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 44033f80cefd1d7b474efdabc412476d4bafb8f4 (diff) |
iwlwifi: do proper hw restart
When the microcode fails for any reason, ask mac80211 to
recover instead of trying ourselves and failing at it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@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 | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index f6c1489a0c4a..271e5d1f8425 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1837,23 +1837,6 @@ static void iwl3945_dump_nic_event_log(struct iwl_priv *priv) | |||
1837 | iwl_release_nic_access(priv); | 1837 | iwl_release_nic_access(priv); |
1838 | } | 1838 | } |
1839 | 1839 | ||
1840 | static void iwl3945_error_recovery(struct iwl_priv *priv) | ||
1841 | { | ||
1842 | unsigned long flags; | ||
1843 | |||
1844 | memcpy(&priv->staging_rxon, &priv->recovery_rxon, | ||
1845 | sizeof(priv->staging_rxon)); | ||
1846 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
1847 | iwlcore_commit_rxon(priv); | ||
1848 | |||
1849 | priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 1, 0, NULL); | ||
1850 | |||
1851 | spin_lock_irqsave(&priv->lock, flags); | ||
1852 | priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id); | ||
1853 | priv->error_recovering = 0; | ||
1854 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1855 | } | ||
1856 | |||
1857 | static void iwl3945_irq_tasklet(struct iwl_priv *priv) | 1840 | static void iwl3945_irq_tasklet(struct iwl_priv *priv) |
1858 | { | 1841 | { |
1859 | u32 inta, handled = 0; | 1842 | u32 inta, handled = 0; |
@@ -2683,9 +2666,6 @@ static void iwl3945_alive_start(struct iwl_priv *priv) | |||
2683 | /* After the ALIVE response, we can send commands to 3945 uCode */ | 2666 | /* After the ALIVE response, we can send commands to 3945 uCode */ |
2684 | set_bit(STATUS_ALIVE, &priv->status); | 2667 | set_bit(STATUS_ALIVE, &priv->status); |
2685 | 2668 | ||
2686 | /* Clear out the uCode error bit if it is set */ | ||
2687 | clear_bit(STATUS_FW_ERROR, &priv->status); | ||
2688 | |||
2689 | if (iwl_is_rfkill(priv)) | 2669 | if (iwl_is_rfkill(priv)) |
2690 | return; | 2670 | return; |
2691 | 2671 | ||
@@ -2722,9 +2702,6 @@ static void iwl3945_alive_start(struct iwl_priv *priv) | |||
2722 | set_bit(STATUS_READY, &priv->status); | 2702 | set_bit(STATUS_READY, &priv->status); |
2723 | wake_up_interruptible(&priv->wait_command_queue); | 2703 | wake_up_interruptible(&priv->wait_command_queue); |
2724 | 2704 | ||
2725 | if (priv->error_recovering) | ||
2726 | iwl3945_error_recovery(priv); | ||
2727 | |||
2728 | /* reassociate for ADHOC mode */ | 2705 | /* reassociate for ADHOC mode */ |
2729 | if (priv->vif && (priv->iw_mode == NL80211_IFTYPE_ADHOC)) { | 2706 | if (priv->vif && (priv->iw_mode == NL80211_IFTYPE_ADHOC)) { |
2730 | struct sk_buff *beacon = ieee80211_beacon_get(priv->hw, | 2707 | struct sk_buff *beacon = ieee80211_beacon_get(priv->hw, |
@@ -3231,8 +3208,17 @@ static void iwl3945_bg_restart(struct work_struct *data) | |||
3231 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 3208 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
3232 | return; | 3209 | return; |
3233 | 3210 | ||
3234 | iwl3945_down(priv); | 3211 | if (test_and_clear_bit(STATUS_FW_ERROR, &priv->status)) { |
3235 | queue_work(priv->workqueue, &priv->up); | 3212 | mutex_lock(&priv->mutex); |
3213 | priv->vif = NULL; | ||
3214 | priv->is_open = 0; | ||
3215 | mutex_unlock(&priv->mutex); | ||
3216 | iwl3945_down(priv); | ||
3217 | ieee80211_restart_hw(priv->hw); | ||
3218 | } else { | ||
3219 | iwl3945_down(priv); | ||
3220 | queue_work(priv->workqueue, &priv->up); | ||
3221 | } | ||
3236 | } | 3222 | } |
3237 | 3223 | ||
3238 | static void iwl3945_bg_rx_replenish(struct work_struct *data) | 3224 | static void iwl3945_bg_rx_replenish(struct work_struct *data) |