aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorEran Harary <eran.harary@intel.com>2014-03-06 02:25:30 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-04-06 03:18:47 -0400
commit749f1fe1bb49135e62cd64133f9e3875f2840d66 (patch)
tree301d2ff9d01a163e4ccb55b35e25770b27b8f0f8 /drivers/net/wireless
parent198890258fc0f9e3270ed1c1794b7610dad92ada (diff)
iwlwifi: mvm: fix the number of channels in family 8000
Number of channels changed from 40 to 50 Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-nvm-parse.c25
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h8
2 files changed, 20 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
index 6be30c698506..4049c0d626ba 100644
--- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
@@ -134,12 +134,13 @@ static const u8 iwl_nvm_channels_family_8000[] = {
134 149, 153, 157, 161, 165, 169, 173, 177, 181 134 149, 153, 157, 161, 165, 169, 173, 177, 181
135}; 135};
136 136
137#define IWL_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels) 137#define IWL_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels)
138#define IWL_NUM_CHANNELS_FAMILY_8000 ARRAY_SIZE(iwl_nvm_channels_family_8000) 138#define IWL_NUM_CHANNELS_FAMILY_8000 ARRAY_SIZE(iwl_nvm_channels_family_8000)
139#define NUM_2GHZ_CHANNELS 14 139#define NUM_2GHZ_CHANNELS 14
140#define FIRST_2GHZ_HT_MINUS 5 140#define NUM_2GHZ_CHANNELS_FAMILY_8000 13
141#define LAST_2GHZ_HT_PLUS 9 141#define FIRST_2GHZ_HT_MINUS 5
142#define LAST_5GHZ_HT 161 142#define LAST_2GHZ_HT_PLUS 9
143#define LAST_5GHZ_HT 161
143 144
144#define DEFAULT_MAX_TX_POWER 16 145#define DEFAULT_MAX_TX_POWER 16
145 146
@@ -202,21 +203,23 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
202 struct ieee80211_channel *channel; 203 struct ieee80211_channel *channel;
203 u16 ch_flags; 204 u16 ch_flags;
204 bool is_5ghz; 205 bool is_5ghz;
205 int num_of_ch; 206 int num_of_ch, num_2ghz_channels;
206 const u8 *nvm_chan; 207 const u8 *nvm_chan;
207 208
208 if (cfg->device_family != IWL_DEVICE_FAMILY_8000) { 209 if (cfg->device_family != IWL_DEVICE_FAMILY_8000) {
209 num_of_ch = IWL_NUM_CHANNELS; 210 num_of_ch = IWL_NUM_CHANNELS;
210 nvm_chan = &iwl_nvm_channels[0]; 211 nvm_chan = &iwl_nvm_channels[0];
212 num_2ghz_channels = NUM_2GHZ_CHANNELS;
211 } else { 213 } else {
212 num_of_ch = IWL_NUM_CHANNELS_FAMILY_8000; 214 num_of_ch = IWL_NUM_CHANNELS_FAMILY_8000;
213 nvm_chan = &iwl_nvm_channels_family_8000[0]; 215 nvm_chan = &iwl_nvm_channels_family_8000[0];
216 num_2ghz_channels = NUM_2GHZ_CHANNELS_FAMILY_8000;
214 } 217 }
215 218
216 for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { 219 for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
217 ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx); 220 ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx);
218 221
219 if (ch_idx >= NUM_2GHZ_CHANNELS && 222 if (ch_idx >= num_2ghz_channels &&
220 !data->sku_cap_band_52GHz_enable) 223 !data->sku_cap_band_52GHz_enable)
221 ch_flags &= ~NVM_CHANNEL_VALID; 224 ch_flags &= ~NVM_CHANNEL_VALID;
222 225
@@ -225,7 +228,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
225 "Ch. %d Flags %x [%sGHz] - No traffic\n", 228 "Ch. %d Flags %x [%sGHz] - No traffic\n",
226 nvm_chan[ch_idx], 229 nvm_chan[ch_idx],
227 ch_flags, 230 ch_flags,
228 (ch_idx >= NUM_2GHZ_CHANNELS) ? 231 (ch_idx >= num_2ghz_channels) ?
229 "5.2" : "2.4"); 232 "5.2" : "2.4");
230 continue; 233 continue;
231 } 234 }
@@ -234,7 +237,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
234 n_channels++; 237 n_channels++;
235 238
236 channel->hw_value = nvm_chan[ch_idx]; 239 channel->hw_value = nvm_chan[ch_idx];
237 channel->band = (ch_idx < NUM_2GHZ_CHANNELS) ? 240 channel->band = (ch_idx < num_2ghz_channels) ?
238 IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; 241 IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
239 channel->center_freq = 242 channel->center_freq =
240 ieee80211_channel_to_frequency( 243 ieee80211_channel_to_frequency(
@@ -242,7 +245,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
242 245
243 /* TODO: Need to be dependent to the NVM */ 246 /* TODO: Need to be dependent to the NVM */
244 channel->flags = IEEE80211_CHAN_NO_HT40; 247 channel->flags = IEEE80211_CHAN_NO_HT40;
245 if (ch_idx < NUM_2GHZ_CHANNELS && 248 if (ch_idx < num_2ghz_channels &&
246 (ch_flags & NVM_CHANNEL_40MHZ)) { 249 (ch_flags & NVM_CHANNEL_40MHZ)) {
247 if (nvm_chan[ch_idx] <= LAST_2GHZ_HT_PLUS) 250 if (nvm_chan[ch_idx] <= LAST_2GHZ_HT_PLUS)
248 channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS; 251 channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS;
@@ -250,7 +253,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
250 channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS; 253 channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS;
251 } else if (nvm_chan[ch_idx] <= LAST_5GHZ_HT && 254 } else if (nvm_chan[ch_idx] <= LAST_5GHZ_HT &&
252 (ch_flags & NVM_CHANNEL_40MHZ)) { 255 (ch_flags & NVM_CHANNEL_40MHZ)) {
253 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0) 256 if ((ch_idx - num_2ghz_channels) % 2 == 0)
254 channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS; 257 channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS;
255 else 258 else
256 channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS; 259 channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS;
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
index 9426905de6b2..02856e061115 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
@@ -169,8 +169,12 @@ enum iwl_scan_type {
169 SCAN_TYPE_DISCOVERY_FORCED = 6, 169 SCAN_TYPE_DISCOVERY_FORCED = 6,
170}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */ 170}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
171 171
172/* Maximal number of channels to scan */ 172/**
173#define MAX_NUM_SCAN_CHANNELS 0x24 173 * Maximal number of channels to scan
174 * it should be equal to:
175 * max(IWL_NUM_CHANNELS, IWL_NUM_CHANNELS_FAMILY_8000)
176 */
177#define MAX_NUM_SCAN_CHANNELS 50
174 178
175/** 179/**
176 * struct iwl_scan_cmd - scan request command 180 * struct iwl_scan_cmd - scan request command