aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-19 16:52:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:56 -0400
commit4e05c2347a50f1d0892ff3475d7609eec428f781 (patch)
tree023ecf1104a7b819d08d11a02517eb8488999213 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent45af81956e990440fe78d6d41f847664cb620609 (diff)
iwlwifi: scan requested channels only
When userspace requests only certain channels to be scanned, we currently ignore that request entirely. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> 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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cb9bd4c8f25e..016567f3e88e 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1844,7 +1844,7 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
1844 u8 is_active, u8 n_probes, 1844 u8 is_active, u8 n_probes,
1845 struct iwl3945_scan_channel *scan_ch) 1845 struct iwl3945_scan_channel *scan_ch)
1846{ 1846{
1847 const struct ieee80211_channel *channels = NULL; 1847 struct ieee80211_channel *chan;
1848 const struct ieee80211_supported_band *sband; 1848 const struct ieee80211_supported_band *sband;
1849 const struct iwl_channel_info *ch_info; 1849 const struct iwl_channel_info *ch_info;
1850 u16 passive_dwell = 0; 1850 u16 passive_dwell = 0;
@@ -1855,19 +1855,19 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
1855 if (!sband) 1855 if (!sband)
1856 return 0; 1856 return 0;
1857 1857
1858 channels = sband->channels;
1859
1860 active_dwell = iwl_get_active_dwell_time(priv, band, n_probes); 1858 active_dwell = iwl_get_active_dwell_time(priv, band, n_probes);
1861 passive_dwell = iwl_get_passive_dwell_time(priv, band); 1859 passive_dwell = iwl_get_passive_dwell_time(priv, band);
1862 1860
1863 if (passive_dwell <= active_dwell) 1861 if (passive_dwell <= active_dwell)
1864 passive_dwell = active_dwell + 1; 1862 passive_dwell = active_dwell + 1;
1865 1863
1866 for (i = 0, added = 0; i < sband->n_channels; i++) { 1864 for (i = 0, added = 0; i < priv->scan_request->n_channels; i++) {
1867 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 1865 chan = priv->scan_request->channels[i];
1866
1867 if (chan->band != band)
1868 continue; 1868 continue;
1869 1869
1870 scan_ch->channel = channels[i].hw_value; 1870 scan_ch->channel = chan->hw_value;
1871 1871
1872 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel); 1872 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);
1873 if (!is_channel_valid(ch_info)) { 1873 if (!is_channel_valid(ch_info)) {
@@ -1882,7 +1882,7 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
1882 * and use long active_dwell time. 1882 * and use long active_dwell time.
1883 */ 1883 */
1884 if (!is_active || is_channel_passive(ch_info) || 1884 if (!is_active || is_channel_passive(ch_info) ||
1885 (channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN)) { 1885 (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) {
1886 scan_ch->type = 0; /* passive */ 1886 scan_ch->type = 0; /* passive */
1887 if (IWL_UCODE_API(priv->ucode_ver) == 1) 1887 if (IWL_UCODE_API(priv->ucode_ver) == 1)
1888 scan_ch->active_dwell = cpu_to_le16(passive_dwell - 1); 1888 scan_ch->active_dwell = cpu_to_le16(passive_dwell - 1);