aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 1004cfc403b..0f292a210ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1119,10 +1119,9 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
1119 struct iwl_scan_channel *scan_ch) 1119 struct iwl_scan_channel *scan_ch)
1120{ 1120{
1121 const struct ieee80211_supported_band *sband; 1121 const struct ieee80211_supported_band *sband;
1122 const struct iwl_channel_info *ch_info;
1123 u16 passive_dwell = 0; 1122 u16 passive_dwell = 0;
1124 u16 active_dwell = 0; 1123 u16 active_dwell = 0;
1125 int i, added = 0; 1124 int added = 0;
1126 u16 channel = 0; 1125 u16 channel = 0;
1127 1126
1128 sband = iwl_get_hw_mode(priv, band); 1127 sband = iwl_get_hw_mode(priv, band);
@@ -1137,32 +1136,7 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
1137 if (passive_dwell <= active_dwell) 1136 if (passive_dwell <= active_dwell)
1138 passive_dwell = active_dwell + 1; 1137 passive_dwell = active_dwell + 1;
1139 1138
1140 /* only scan single channel, good enough to reset the RF */ 1139 channel = iwl_get_single_channel_number(priv, band);
1141 /* pick the first valid not in-use channel */
1142 if (band == IEEE80211_BAND_5GHZ) {
1143 for (i = 14; i < priv->channel_count; i++) {
1144 if (priv->channel_info[i].channel !=
1145 le16_to_cpu(priv->staging_rxon.channel)) {
1146 channel = priv->channel_info[i].channel;
1147 ch_info = iwl_get_channel_info(priv,
1148 band, channel);
1149 if (is_channel_valid(ch_info))
1150 break;
1151 }
1152 }
1153 } else {
1154 for (i = 0; i < 14; i++) {
1155 if (priv->channel_info[i].channel !=
1156 le16_to_cpu(priv->staging_rxon.channel)) {
1157 channel =
1158 priv->channel_info[i].channel;
1159 ch_info = iwl_get_channel_info(priv,
1160 band, channel);
1161 if (is_channel_valid(ch_info))
1162 break;
1163 }
1164 }
1165 }
1166 if (channel) { 1140 if (channel) {
1167 scan_ch->channel = cpu_to_le16(channel); 1141 scan_ch->channel = cpu_to_le16(channel);
1168 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; 1142 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;