diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-01-22 17:22:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-25 16:36:20 -0500 |
commit | d4d59e88cb746165c6fe33eacb6f582d525c6ef1 (patch) | |
tree | b6c573eb1ee11119273704193a30208cf21d30fb /drivers/net/wireless | |
parent | 220575f78fb0b8d2a1c41cd28115d52ae8d132ee (diff) |
iwlwifi: Logic to control how frequent radio should be reset if needed
Add additional logic for internal scan routine to control how
frequent this function should be performed.
The intent of this function is to reset/re-tune the radio and bring the
RF/PHY back to normal state, it does not make sense calling it too
frequent,
if reset the radio can not bring it back to normal state, it indicate
there are other reason to cause the radio not operate correctly.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 42cf1810b451..86d38ae2ec7e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1076,6 +1076,7 @@ struct iwl_priv { | |||
1076 | unsigned long scan_start; | 1076 | unsigned long scan_start; |
1077 | unsigned long scan_pass_start; | 1077 | unsigned long scan_pass_start; |
1078 | unsigned long scan_start_tsf; | 1078 | unsigned long scan_start_tsf; |
1079 | unsigned long last_internal_scan_jiffies; | ||
1079 | void *scan; | 1080 | void *scan; |
1080 | int scan_bands; | 1081 | int scan_bands; |
1081 | struct cfg80211_scan_request *scan_request; | 1082 | struct cfg80211_scan_request *scan_request; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 07fabbbfd567..08faafae8497 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -201,7 +201,8 @@ static void iwl_rx_scan_results_notif(struct iwl_priv *priv, | |||
201 | le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf); | 201 | le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf); |
202 | #endif | 202 | #endif |
203 | 203 | ||
204 | priv->next_scan_jiffies = 0; | 204 | if (!priv->is_internal_short_scan) |
205 | priv->next_scan_jiffies = 0; | ||
205 | } | 206 | } |
206 | 207 | ||
207 | /* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ | 208 | /* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ |
@@ -247,7 +248,11 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
247 | goto reschedule; | 248 | goto reschedule; |
248 | } | 249 | } |
249 | 250 | ||
250 | priv->next_scan_jiffies = 0; | 251 | if (!priv->is_internal_short_scan) |
252 | priv->next_scan_jiffies = 0; | ||
253 | else | ||
254 | priv->last_internal_scan_jiffies = jiffies; | ||
255 | |||
251 | IWL_DEBUG_INFO(priv, "Setting scan to off\n"); | 256 | IWL_DEBUG_INFO(priv, "Setting scan to off\n"); |
252 | 257 | ||
253 | clear_bit(STATUS_SCANNING, &priv->status); | 258 | clear_bit(STATUS_SCANNING, &priv->status); |
@@ -546,6 +551,8 @@ EXPORT_SYMBOL(iwl_mac_hw_scan); | |||
546 | * internal short scan, this function should only been called while associated. | 551 | * internal short scan, this function should only been called while associated. |
547 | * It will reset and tune the radio to prevent possible RF related problem | 552 | * It will reset and tune the radio to prevent possible RF related problem |
548 | */ | 553 | */ |
554 | #define IWL_DELAY_NEXT_INTERNAL_SCAN (HZ*1) | ||
555 | |||
549 | int iwl_internal_short_hw_scan(struct iwl_priv *priv) | 556 | int iwl_internal_short_hw_scan(struct iwl_priv *priv) |
550 | { | 557 | { |
551 | int ret = 0; | 558 | int ret = 0; |
@@ -565,6 +572,13 @@ int iwl_internal_short_hw_scan(struct iwl_priv *priv) | |||
565 | ret = -EAGAIN; | 572 | ret = -EAGAIN; |
566 | goto out; | 573 | goto out; |
567 | } | 574 | } |
575 | if (priv->last_internal_scan_jiffies && | ||
576 | time_after(priv->last_internal_scan_jiffies + | ||
577 | IWL_DELAY_NEXT_INTERNAL_SCAN, jiffies)) { | ||
578 | IWL_DEBUG_SCAN(priv, "internal scan rejected\n"); | ||
579 | goto out; | ||
580 | } | ||
581 | |||
568 | priv->scan_bands = 0; | 582 | priv->scan_bands = 0; |
569 | if (priv->band == IEEE80211_BAND_5GHZ) | 583 | if (priv->band == IEEE80211_BAND_5GHZ) |
570 | priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ); | 584 | priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ); |