Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183889
b: refs/heads/master
c: d4d59e8
h: refs/heads/master
i:
  183887: 9afe648
v: v3
  • Loading branch information
Wey-Yi Guy authored and John W. Linville committed Jan 25, 2010
1 parent 128858f commit 4e0c980
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 220575f78fb0b8d2a1c41cd28115d52ae8d132ee
refs/heads/master: d4d59e88cb746165c6fe33eacb6f582d525c6ef1
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ struct iwl_priv {
unsigned long scan_start;
unsigned long scan_pass_start;
unsigned long scan_start_tsf;
unsigned long last_internal_scan_jiffies;
void *scan;
int scan_bands;
struct cfg80211_scan_request *scan_request;
Expand Down
18 changes: 16 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf);
#endif

priv->next_scan_jiffies = 0;
if (!priv->is_internal_short_scan)
priv->next_scan_jiffies = 0;
}

/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
Expand Down Expand Up @@ -247,7 +248,11 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
goto reschedule;
}

priv->next_scan_jiffies = 0;
if (!priv->is_internal_short_scan)
priv->next_scan_jiffies = 0;
else
priv->last_internal_scan_jiffies = jiffies;

IWL_DEBUG_INFO(priv, "Setting scan to off\n");

clear_bit(STATUS_SCANNING, &priv->status);
Expand Down Expand Up @@ -546,6 +551,8 @@ EXPORT_SYMBOL(iwl_mac_hw_scan);
* internal short scan, this function should only been called while associated.
* It will reset and tune the radio to prevent possible RF related problem
*/
#define IWL_DELAY_NEXT_INTERNAL_SCAN (HZ*1)

int iwl_internal_short_hw_scan(struct iwl_priv *priv)
{
int ret = 0;
Expand All @@ -565,6 +572,13 @@ int iwl_internal_short_hw_scan(struct iwl_priv *priv)
ret = -EAGAIN;
goto out;
}
if (priv->last_internal_scan_jiffies &&
time_after(priv->last_internal_scan_jiffies +
IWL_DELAY_NEXT_INTERNAL_SCAN, jiffies)) {
IWL_DEBUG_SCAN(priv, "internal scan rejected\n");
goto out;
}

priv->scan_bands = 0;
if (priv->band == IEEE80211_BAND_5GHZ)
priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
Expand Down

0 comments on commit 4e0c980

Please sign in to comment.