diff options
author | Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> | 2012-03-14 18:55:13 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-04-12 17:23:33 -0400 |
commit | 66cd9e39c6c0a870f12828b5f5b9e1d2e7c70313 (patch) | |
tree | e927e457ad4b9b829c636dec27caa2e9ffc236f0 | |
parent | 1591129d545760e6925bd48b15ce1ff7c25a5df8 (diff) |
iwlwifi: move iwl_force_rf_reset to iwl-agn-rx.c
Move this function as part of iwl-core.c cleanup.
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 39 |
2 files changed, 39 insertions, 39 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index aba1da231d70..93a687175fa6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -284,6 +284,45 @@ static bool iwlagn_good_plcp_health(struct iwl_priv *priv, | |||
284 | return true; | 284 | return true; |
285 | } | 285 | } |
286 | 286 | ||
287 | int iwl_force_rf_reset(struct iwl_priv *priv, bool external) | ||
288 | { | ||
289 | struct iwl_rf_reset *rf_reset; | ||
290 | |||
291 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
292 | return -EAGAIN; | ||
293 | |||
294 | if (!iwl_is_any_associated(priv)) { | ||
295 | IWL_DEBUG_SCAN(priv, "force reset rejected: not associated\n"); | ||
296 | return -ENOLINK; | ||
297 | } | ||
298 | |||
299 | rf_reset = &priv->rf_reset; | ||
300 | rf_reset->reset_request_count++; | ||
301 | if (!external && rf_reset->last_reset_jiffies && | ||
302 | time_after(rf_reset->last_reset_jiffies + | ||
303 | IWL_DELAY_NEXT_FORCE_RF_RESET, jiffies)) { | ||
304 | IWL_DEBUG_INFO(priv, "RF reset rejected\n"); | ||
305 | rf_reset->reset_reject_count++; | ||
306 | return -EAGAIN; | ||
307 | } | ||
308 | rf_reset->reset_success_count++; | ||
309 | rf_reset->last_reset_jiffies = jiffies; | ||
310 | |||
311 | /* | ||
312 | * There is no easy and better way to force reset the radio, | ||
313 | * the only known method is switching channel which will force to | ||
314 | * reset and tune the radio. | ||
315 | * Use internal short scan (single channel) operation to should | ||
316 | * achieve this objective. | ||
317 | * Driver should reset the radio when number of consecutive missed | ||
318 | * beacon, or any other uCode error condition detected. | ||
319 | */ | ||
320 | IWL_DEBUG_INFO(priv, "perform radio reset.\n"); | ||
321 | iwl_internal_short_hw_scan(priv); | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | |||
287 | static void iwlagn_recover_from_statistics(struct iwl_priv *priv, | 326 | static void iwlagn_recover_from_statistics(struct iwl_priv *priv, |
288 | struct statistics_rx_phy *cur_ofdm, | 327 | struct statistics_rx_phy *cur_ofdm, |
289 | struct statistics_rx_ht_phy *cur_ofdm_ht, | 328 | struct statistics_rx_ht_phy *cur_ofdm_ht, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index ae542b7575c3..26eb7fafff76 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -277,45 +277,6 @@ void iwl_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len) | |||
277 | } | 277 | } |
278 | #endif | 278 | #endif |
279 | 279 | ||
280 | int iwl_force_rf_reset(struct iwl_priv *priv, bool external) | ||
281 | { | ||
282 | struct iwl_rf_reset *rf_reset; | ||
283 | |||
284 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
285 | return -EAGAIN; | ||
286 | |||
287 | if (!iwl_is_any_associated(priv)) { | ||
288 | IWL_DEBUG_SCAN(priv, "force reset rejected: not associated\n"); | ||
289 | return -ENOLINK; | ||
290 | } | ||
291 | |||
292 | rf_reset = &priv->rf_reset; | ||
293 | rf_reset->reset_request_count++; | ||
294 | if (!external && rf_reset->last_reset_jiffies && | ||
295 | time_after(rf_reset->last_reset_jiffies + | ||
296 | IWL_DELAY_NEXT_FORCE_RF_RESET, jiffies)) { | ||
297 | IWL_DEBUG_INFO(priv, "RF reset rejected\n"); | ||
298 | rf_reset->reset_reject_count++; | ||
299 | return -EAGAIN; | ||
300 | } | ||
301 | rf_reset->reset_success_count++; | ||
302 | rf_reset->last_reset_jiffies = jiffies; | ||
303 | |||
304 | /* | ||
305 | * There is no easy and better way to force reset the radio, | ||
306 | * the only known method is switching channel which will force to | ||
307 | * reset and tune the radio. | ||
308 | * Use internal short scan (single channel) operation to should | ||
309 | * achieve this objective. | ||
310 | * Driver should reset the radio when number of consecutive missed | ||
311 | * beacon, or any other uCode error condition detected. | ||
312 | */ | ||
313 | IWL_DEBUG_INFO(priv, "perform radio reset.\n"); | ||
314 | iwl_internal_short_hw_scan(priv); | ||
315 | return 0; | ||
316 | } | ||
317 | |||
318 | |||
319 | int iwl_cmd_echo_test(struct iwl_priv *priv) | 280 | int iwl_cmd_echo_test(struct iwl_priv *priv) |
320 | { | 281 | { |
321 | int ret; | 282 | int ret; |