aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c18
1 files changed, 16 insertions, 2 deletions
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
549int iwl_internal_short_hw_scan(struct iwl_priv *priv) 556int 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);