aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@intel.com>2009-01-23 16:45:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:33 -0500
commit77fecfb88f8ad64420e06a96f1bd3b38498bfb4f (patch)
tree42f4f73214ef517c84bad6eb30e27db0dbf09568 /drivers/net/wireless/iwlwifi/iwl-scan.c
parent75bcfae97d71756263ccbffc2dcdd8b3020a1a0f (diff)
iwl3945: Use iwlcore scan code
A lot of the scanning related code is duplicated between 3945 and agn. Let's use the iwlcore one and get rid of the 3945. Signed-off-by: Samuel Ortiz <samuel.ortiz@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/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index e510f5165992..0ce122a17341 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -46,15 +46,6 @@
46#define IWL_ACTIVE_DWELL_FACTOR_24GHZ (3) 46#define IWL_ACTIVE_DWELL_FACTOR_24GHZ (3)
47#define IWL_ACTIVE_DWELL_FACTOR_52GHZ (2) 47#define IWL_ACTIVE_DWELL_FACTOR_52GHZ (2)
48 48
49/* For faster active scanning, scan will move to the next channel if fewer than
50 * PLCP_QUIET_THRESH packets are heard on this channel within
51 * ACTIVE_QUIET_TIME after sending probe request. This shortens the dwell
52 * time if it's a quiet channel (nothing responded to our probe, and there's
53 * no other traffic).
54 * Disable "quiet" feature by setting PLCP_QUIET_THRESH to 0. */
55#define IWL_PLCP_QUIET_THRESH __constant_cpu_to_le16(1) /* packets */
56#define IWL_ACTIVE_QUIET_TIME __constant_cpu_to_le16(10) /* msec */
57
58/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel. 49/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
59 * Must be set longer than active dwell time. 50 * Must be set longer than active dwell time.
60 * For the most reliable scan, set > AP beacon interval (typically 100msec). */ 51 * For the most reliable scan, set > AP beacon interval (typically 100msec). */
@@ -63,7 +54,6 @@
63#define IWL_PASSIVE_DWELL_BASE (100) 54#define IWL_PASSIVE_DWELL_BASE (100)
64#define IWL_CHANNEL_TUNE_TIME 5 55#define IWL_CHANNEL_TUNE_TIME 5
65 56
66#define IWL_SCAN_PROBE_MASK(n) cpu_to_le32((BIT(n) | (BIT(n) - BIT(1))))
67 57
68 58
69/** 59/**
@@ -296,9 +286,9 @@ void iwl_setup_rx_scan_handlers(struct iwl_priv *priv)
296} 286}
297EXPORT_SYMBOL(iwl_setup_rx_scan_handlers); 287EXPORT_SYMBOL(iwl_setup_rx_scan_handlers);
298 288
299static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, 289inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv,
300 enum ieee80211_band band, 290 enum ieee80211_band band,
301 u8 n_probes) 291 u8 n_probes)
302{ 292{
303 if (band == IEEE80211_BAND_5GHZ) 293 if (band == IEEE80211_BAND_5GHZ)
304 return IWL_ACTIVE_DWELL_TIME_52 + 294 return IWL_ACTIVE_DWELL_TIME_52 +
@@ -307,9 +297,10 @@ static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv,
307 return IWL_ACTIVE_DWELL_TIME_24 + 297 return IWL_ACTIVE_DWELL_TIME_24 +
308 IWL_ACTIVE_DWELL_FACTOR_24GHZ * (n_probes + 1); 298 IWL_ACTIVE_DWELL_FACTOR_24GHZ * (n_probes + 1);
309} 299}
300EXPORT_SYMBOL(iwl_get_active_dwell_time);
310 301
311static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, 302u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,
312 enum ieee80211_band band) 303 enum ieee80211_band band)
313{ 304{
314 u16 passive = (band == IEEE80211_BAND_2GHZ) ? 305 u16 passive = (band == IEEE80211_BAND_2GHZ) ?
315 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : 306 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
@@ -327,6 +318,7 @@ static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,
327 318
328 return passive; 319 return passive;
329} 320}
321EXPORT_SYMBOL(iwl_get_passive_dwell_time);
330 322
331static int iwl_get_channels_for_scan(struct iwl_priv *priv, 323static int iwl_get_channels_for_scan(struct iwl_priv *priv,
332 enum ieee80211_band band, 324 enum ieee80211_band band,
@@ -450,7 +442,7 @@ EXPORT_SYMBOL(iwl_scan_initiate);
450 442
451#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) 443#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
452 444
453static void iwl_bg_scan_check(struct work_struct *data) 445void iwl_bg_scan_check(struct work_struct *data)
454{ 446{
455 struct iwl_priv *priv = 447 struct iwl_priv *priv =
456 container_of(data, struct iwl_priv, scan_check.work); 448 container_of(data, struct iwl_priv, scan_check.work);
@@ -470,6 +462,8 @@ static void iwl_bg_scan_check(struct work_struct *data)
470 } 462 }
471 mutex_unlock(&priv->mutex); 463 mutex_unlock(&priv->mutex);
472} 464}
465EXPORT_SYMBOL(iwl_bg_scan_check);
466
473/** 467/**
474 * iwl_supported_rate_to_ie - fill in the supported rate in IE field 468 * iwl_supported_rate_to_ie - fill in the supported rate in IE field
475 * 469 *
@@ -527,10 +521,10 @@ static void iwl_ht_cap_to_ie(const struct ieee80211_supported_band *sband,
527 * iwl_fill_probe_req - fill in all required fields and IE for probe request 521 * iwl_fill_probe_req - fill in all required fields and IE for probe request
528 */ 522 */
529 523
530static u16 iwl_fill_probe_req(struct iwl_priv *priv, 524u16 iwl_fill_probe_req(struct iwl_priv *priv,
531 enum ieee80211_band band, 525 enum ieee80211_band band,
532 struct ieee80211_mgmt *frame, 526 struct ieee80211_mgmt *frame,
533 int left) 527 int left)
534{ 528{
535 int len = 0; 529 int len = 0;
536 u8 *pos = NULL; 530 u8 *pos = NULL;
@@ -624,6 +618,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
624 618
625 return (u16)len; 619 return (u16)len;
626} 620}
621EXPORT_SYMBOL(iwl_fill_probe_req);
627 622
628static void iwl_bg_request_scan(struct work_struct *data) 623static void iwl_bg_request_scan(struct work_struct *data)
629{ 624{
@@ -839,7 +834,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
839 mutex_unlock(&priv->mutex); 834 mutex_unlock(&priv->mutex);
840} 835}
841 836
842static void iwl_bg_abort_scan(struct work_struct *work) 837void iwl_bg_abort_scan(struct work_struct *work)
843{ 838{
844 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan); 839 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
845 840
@@ -853,8 +848,9 @@ static void iwl_bg_abort_scan(struct work_struct *work)
853 848
854 mutex_unlock(&priv->mutex); 849 mutex_unlock(&priv->mutex);
855} 850}
851EXPORT_SYMBOL(iwl_bg_abort_scan);
856 852
857static void iwl_bg_scan_completed(struct work_struct *work) 853void iwl_bg_scan_completed(struct work_struct *work)
858{ 854{
859 struct iwl_priv *priv = 855 struct iwl_priv *priv =
860 container_of(work, struct iwl_priv, scan_completed); 856 container_of(work, struct iwl_priv, scan_completed);
@@ -872,7 +868,7 @@ static void iwl_bg_scan_completed(struct work_struct *work)
872 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 868 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
873 mutex_unlock(&priv->mutex); 869 mutex_unlock(&priv->mutex);
874} 870}
875 871EXPORT_SYMBOL(iwl_bg_scan_completed);
876 872
877void iwl_setup_scan_deferred_work(struct iwl_priv *priv) 873void iwl_setup_scan_deferred_work(struct iwl_priv *priv)
878{ 874{