aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-eeprom.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-10-24 10:49:25 -0400
committerStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 05:17:00 -0500
commit46bc8d4b0e73ac75de323646d75a2333f47b84c3 (patch)
treea11a89b1a3480135e1510aacd5909485ab2e5be7 /drivers/net/wireless/iwlegacy/iwl-eeprom.c
parente2ebc8337d116acdc25469ec8547ae665f50a4c1 (diff)
iwlegacy: rename priv to il
Make code shorter. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-eeprom.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-eeprom.c158
1 files changed, 79 insertions, 79 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
index 1075f1d7f01..5edec73a505 100644
--- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
@@ -87,7 +87,7 @@
87 * is contained in the eeprom map itself. 87 * is contained in the eeprom map itself.
88 * 88 *
89 * During init, we copy the eeprom information and channel map 89 * During init, we copy the eeprom information and channel map
90 * information into priv->channel_info_24/52 and priv->channel_map_24/52 90 * information into il->channel_info_24/52 and il->channel_map_24/52
91 * 91 *
92 * channel_map_24/52 provides the index in the channel_info array for a 92 * channel_map_24/52 provides the index in the channel_info array for a
93 * given channel. We have to have two separate maps as there is channel 93 * given channel. We have to have two separate maps as there is channel
@@ -142,18 +142,18 @@ static const u8 iwlegacy_eeprom_band_7[] = { /* 5.2 ht40 channel */
142 * 142 *
143******************************************************************************/ 143******************************************************************************/
144 144
145static int il_eeprom_verify_signature(struct il_priv *priv) 145static int il_eeprom_verify_signature(struct il_priv *il)
146{ 146{
147 u32 gp = il_read32(priv, CSR_EEPROM_GP) & CSR_EEPROM_GP_VALID_MSK; 147 u32 gp = il_read32(il, CSR_EEPROM_GP) & CSR_EEPROM_GP_VALID_MSK;
148 int ret = 0; 148 int ret = 0;
149 149
150 IL_DEBUG_EEPROM(priv, "EEPROM signature=0x%08x\n", gp); 150 IL_DEBUG_EEPROM(il, "EEPROM signature=0x%08x\n", gp);
151 switch (gp) { 151 switch (gp) {
152 case CSR_EEPROM_GP_GOOD_SIG_EEP_LESS_THAN_4K: 152 case CSR_EEPROM_GP_GOOD_SIG_EEP_LESS_THAN_4K:
153 case CSR_EEPROM_GP_GOOD_SIG_EEP_MORE_THAN_4K: 153 case CSR_EEPROM_GP_GOOD_SIG_EEP_MORE_THAN_4K:
154 break; 154 break;
155 default: 155 default:
156 IL_ERR(priv, "bad EEPROM signature," 156 IL_ERR(il, "bad EEPROM signature,"
157 "EEPROM_GP=0x%08x\n", gp); 157 "EEPROM_GP=0x%08x\n", gp);
158 ret = -ENOENT; 158 ret = -ENOENT;
159 break; 159 break;
@@ -162,59 +162,59 @@ static int il_eeprom_verify_signature(struct il_priv *priv)
162} 162}
163 163
164const u8 164const u8
165*il_eeprom_query_addr(const struct il_priv *priv, size_t offset) 165*il_eeprom_query_addr(const struct il_priv *il, size_t offset)
166{ 166{
167 BUG_ON(offset >= priv->cfg->base_params->eeprom_size); 167 BUG_ON(offset >= il->cfg->base_params->eeprom_size);
168 return &priv->eeprom[offset]; 168 return &il->eeprom[offset];
169} 169}
170EXPORT_SYMBOL(il_eeprom_query_addr); 170EXPORT_SYMBOL(il_eeprom_query_addr);
171 171
172u16 il_eeprom_query16(const struct il_priv *priv, size_t offset) 172u16 il_eeprom_query16(const struct il_priv *il, size_t offset)
173{ 173{
174 if (!priv->eeprom) 174 if (!il->eeprom)
175 return 0; 175 return 0;
176 return (u16)priv->eeprom[offset] | ((u16)priv->eeprom[offset + 1] << 8); 176 return (u16)il->eeprom[offset] | ((u16)il->eeprom[offset + 1] << 8);
177} 177}
178EXPORT_SYMBOL(il_eeprom_query16); 178EXPORT_SYMBOL(il_eeprom_query16);
179 179
180/** 180/**
181 * il_eeprom_init - read EEPROM contents 181 * il_eeprom_init - read EEPROM contents
182 * 182 *
183 * Load the EEPROM contents from adapter into priv->eeprom 183 * Load the EEPROM contents from adapter into il->eeprom
184 * 184 *
185 * NOTE: This routine uses the non-debug IO access functions. 185 * NOTE: This routine uses the non-debug IO access functions.
186 */ 186 */
187int il_eeprom_init(struct il_priv *priv) 187int il_eeprom_init(struct il_priv *il)
188{ 188{
189 __le16 *e; 189 __le16 *e;
190 u32 gp = il_read32(priv, CSR_EEPROM_GP); 190 u32 gp = il_read32(il, CSR_EEPROM_GP);
191 int sz; 191 int sz;
192 int ret; 192 int ret;
193 u16 addr; 193 u16 addr;
194 194
195 /* allocate eeprom */ 195 /* allocate eeprom */
196 sz = priv->cfg->base_params->eeprom_size; 196 sz = il->cfg->base_params->eeprom_size;
197 IL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); 197 IL_DEBUG_EEPROM(il, "NVM size = %d\n", sz);
198 priv->eeprom = kzalloc(sz, GFP_KERNEL); 198 il->eeprom = kzalloc(sz, GFP_KERNEL);
199 if (!priv->eeprom) { 199 if (!il->eeprom) {
200 ret = -ENOMEM; 200 ret = -ENOMEM;
201 goto alloc_err; 201 goto alloc_err;
202 } 202 }
203 e = (__le16 *)priv->eeprom; 203 e = (__le16 *)il->eeprom;
204 204
205 priv->cfg->ops->lib->apm_ops.init(priv); 205 il->cfg->ops->lib->apm_ops.init(il);
206 206
207 ret = il_eeprom_verify_signature(priv); 207 ret = il_eeprom_verify_signature(il);
208 if (ret < 0) { 208 if (ret < 0) {
209 IL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp); 209 IL_ERR(il, "EEPROM not found, EEPROM_GP=0x%08x\n", gp);
210 ret = -ENOENT; 210 ret = -ENOENT;
211 goto err; 211 goto err;
212 } 212 }
213 213
214 /* Make sure driver (instead of uCode) is allowed to read EEPROM */ 214 /* Make sure driver (instead of uCode) is allowed to read EEPROM */
215 ret = priv->cfg->ops->lib->eeprom_ops.acquire_semaphore(priv); 215 ret = il->cfg->ops->lib->eeprom_ops.acquire_semaphore(il);
216 if (ret < 0) { 216 if (ret < 0) {
217 IL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); 217 IL_ERR(il, "Failed to acquire EEPROM semaphore.\n");
218 ret = -ENOENT; 218 ret = -ENOENT;
219 goto err; 219 goto err;
220 } 220 }
@@ -223,95 +223,95 @@ int il_eeprom_init(struct il_priv *priv)
223 for (addr = 0; addr < sz; addr += sizeof(u16)) { 223 for (addr = 0; addr < sz; addr += sizeof(u16)) {
224 u32 r; 224 u32 r;
225 225
226 _il_write32(priv, CSR_EEPROM_REG, 226 _il_write32(il, CSR_EEPROM_REG,
227 CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); 227 CSR_EEPROM_REG_MSK_ADDR & (addr << 1));
228 228
229 ret = il_poll_bit(priv, CSR_EEPROM_REG, 229 ret = il_poll_bit(il, CSR_EEPROM_REG,
230 CSR_EEPROM_REG_READ_VALID_MSK, 230 CSR_EEPROM_REG_READ_VALID_MSK,
231 CSR_EEPROM_REG_READ_VALID_MSK, 231 CSR_EEPROM_REG_READ_VALID_MSK,
232 IL_EEPROM_ACCESS_TIMEOUT); 232 IL_EEPROM_ACCESS_TIMEOUT);
233 if (ret < 0) { 233 if (ret < 0) {
234 IL_ERR(priv, "Time out reading EEPROM[%d]\n", 234 IL_ERR(il, "Time out reading EEPROM[%d]\n",
235 addr); 235 addr);
236 goto done; 236 goto done;
237 } 237 }
238 r = _il_read_direct32(priv, CSR_EEPROM_REG); 238 r = _il_read_direct32(il, CSR_EEPROM_REG);
239 e[addr / 2] = cpu_to_le16(r >> 16); 239 e[addr / 2] = cpu_to_le16(r >> 16);
240 } 240 }
241 241
242 IL_DEBUG_EEPROM(priv, "NVM Type: %s, version: 0x%x\n", 242 IL_DEBUG_EEPROM(il, "NVM Type: %s, version: 0x%x\n",
243 "EEPROM", 243 "EEPROM",
244 il_eeprom_query16(priv, EEPROM_VERSION)); 244 il_eeprom_query16(il, EEPROM_VERSION));
245 245
246 ret = 0; 246 ret = 0;
247done: 247done:
248 priv->cfg->ops->lib->eeprom_ops.release_semaphore(priv); 248 il->cfg->ops->lib->eeprom_ops.release_semaphore(il);
249 249
250err: 250err:
251 if (ret) 251 if (ret)
252 il_eeprom_free(priv); 252 il_eeprom_free(il);
253 /* Reset chip to save power until we load uCode during "up". */ 253 /* Reset chip to save power until we load uCode during "up". */
254 il_apm_stop(priv); 254 il_apm_stop(il);
255alloc_err: 255alloc_err:
256 return ret; 256 return ret;
257} 257}
258EXPORT_SYMBOL(il_eeprom_init); 258EXPORT_SYMBOL(il_eeprom_init);
259 259
260void il_eeprom_free(struct il_priv *priv) 260void il_eeprom_free(struct il_priv *il)
261{ 261{
262 kfree(priv->eeprom); 262 kfree(il->eeprom);
263 priv->eeprom = NULL; 263 il->eeprom = NULL;
264} 264}
265EXPORT_SYMBOL(il_eeprom_free); 265EXPORT_SYMBOL(il_eeprom_free);
266 266
267static void il_init_band_reference(const struct il_priv *priv, 267static void il_init_band_reference(const struct il_priv *il,
268 int eep_band, int *eeprom_ch_count, 268 int eep_band, int *eeprom_ch_count,
269 const struct il_eeprom_channel **eeprom_ch_info, 269 const struct il_eeprom_channel **eeprom_ch_info,
270 const u8 **eeprom_ch_index) 270 const u8 **eeprom_ch_index)
271{ 271{
272 u32 offset = priv->cfg->ops->lib-> 272 u32 offset = il->cfg->ops->lib->
273 eeprom_ops.regulatory_bands[eep_band - 1]; 273 eeprom_ops.regulatory_bands[eep_band - 1];
274 switch (eep_band) { 274 switch (eep_band) {
275 case 1: /* 2.4GHz band */ 275 case 1: /* 2.4GHz band */
276 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_1); 276 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_1);
277 *eeprom_ch_info = (struct il_eeprom_channel *) 277 *eeprom_ch_info = (struct il_eeprom_channel *)
278 il_eeprom_query_addr(priv, offset); 278 il_eeprom_query_addr(il, offset);
279 *eeprom_ch_index = iwlegacy_eeprom_band_1; 279 *eeprom_ch_index = iwlegacy_eeprom_band_1;
280 break; 280 break;
281 case 2: /* 4.9GHz band */ 281 case 2: /* 4.9GHz band */
282 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_2); 282 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_2);
283 *eeprom_ch_info = (struct il_eeprom_channel *) 283 *eeprom_ch_info = (struct il_eeprom_channel *)
284 il_eeprom_query_addr(priv, offset); 284 il_eeprom_query_addr(il, offset);
285 *eeprom_ch_index = iwlegacy_eeprom_band_2; 285 *eeprom_ch_index = iwlegacy_eeprom_band_2;
286 break; 286 break;
287 case 3: /* 5.2GHz band */ 287 case 3: /* 5.2GHz band */
288 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_3); 288 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_3);
289 *eeprom_ch_info = (struct il_eeprom_channel *) 289 *eeprom_ch_info = (struct il_eeprom_channel *)
290 il_eeprom_query_addr(priv, offset); 290 il_eeprom_query_addr(il, offset);
291 *eeprom_ch_index = iwlegacy_eeprom_band_3; 291 *eeprom_ch_index = iwlegacy_eeprom_band_3;
292 break; 292 break;
293 case 4: /* 5.5GHz band */ 293 case 4: /* 5.5GHz band */
294 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_4); 294 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_4);
295 *eeprom_ch_info = (struct il_eeprom_channel *) 295 *eeprom_ch_info = (struct il_eeprom_channel *)
296 il_eeprom_query_addr(priv, offset); 296 il_eeprom_query_addr(il, offset);
297 *eeprom_ch_index = iwlegacy_eeprom_band_4; 297 *eeprom_ch_index = iwlegacy_eeprom_band_4;
298 break; 298 break;
299 case 5: /* 5.7GHz band */ 299 case 5: /* 5.7GHz band */
300 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_5); 300 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_5);
301 *eeprom_ch_info = (struct il_eeprom_channel *) 301 *eeprom_ch_info = (struct il_eeprom_channel *)
302 il_eeprom_query_addr(priv, offset); 302 il_eeprom_query_addr(il, offset);
303 *eeprom_ch_index = iwlegacy_eeprom_band_5; 303 *eeprom_ch_index = iwlegacy_eeprom_band_5;
304 break; 304 break;
305 case 6: /* 2.4GHz ht40 channels */ 305 case 6: /* 2.4GHz ht40 channels */
306 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_6); 306 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_6);
307 *eeprom_ch_info = (struct il_eeprom_channel *) 307 *eeprom_ch_info = (struct il_eeprom_channel *)
308 il_eeprom_query_addr(priv, offset); 308 il_eeprom_query_addr(il, offset);
309 *eeprom_ch_index = iwlegacy_eeprom_band_6; 309 *eeprom_ch_index = iwlegacy_eeprom_band_6;
310 break; 310 break;
311 case 7: /* 5 GHz ht40 channels */ 311 case 7: /* 5 GHz ht40 channels */
312 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_7); 312 *eeprom_ch_count = ARRAY_SIZE(iwlegacy_eeprom_band_7);
313 *eeprom_ch_info = (struct il_eeprom_channel *) 313 *eeprom_ch_info = (struct il_eeprom_channel *)
314 il_eeprom_query_addr(priv, offset); 314 il_eeprom_query_addr(il, offset);
315 *eeprom_ch_index = iwlegacy_eeprom_band_7; 315 *eeprom_ch_index = iwlegacy_eeprom_band_7;
316 break; 316 break;
317 default: 317 default:
@@ -322,11 +322,11 @@ static void il_init_band_reference(const struct il_priv *priv,
322#define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \ 322#define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \
323 ? # x " " : "") 323 ? # x " " : "")
324/** 324/**
325 * il_mod_ht40_chan_info - Copy ht40 channel info into driver's priv. 325 * il_mod_ht40_chan_info - Copy ht40 channel info into driver's il.
326 * 326 *
327 * Does not set up a command, or touch hardware. 327 * Does not set up a command, or touch hardware.
328 */ 328 */
329static int il_mod_ht40_chan_info(struct il_priv *priv, 329static int il_mod_ht40_chan_info(struct il_priv *il,
330 enum ieee80211_band band, u16 channel, 330 enum ieee80211_band band, u16 channel,
331 const struct il_eeprom_channel *eeprom_ch, 331 const struct il_eeprom_channel *eeprom_ch,
332 u8 clear_ht40_extension_channel) 332 u8 clear_ht40_extension_channel)
@@ -334,12 +334,12 @@ static int il_mod_ht40_chan_info(struct il_priv *priv,
334 struct il_channel_info *ch_info; 334 struct il_channel_info *ch_info;
335 335
336 ch_info = (struct il_channel_info *) 336 ch_info = (struct il_channel_info *)
337 il_get_channel_info(priv, band, channel); 337 il_get_channel_info(il, band, channel);
338 338
339 if (!il_is_channel_valid(ch_info)) 339 if (!il_is_channel_valid(ch_info))
340 return -1; 340 return -1;
341 341
342 IL_DEBUG_EEPROM(priv, "HT40 Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):" 342 IL_DEBUG_EEPROM(il, "HT40 Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):"
343 " Ad-Hoc %ssupported\n", 343 " Ad-Hoc %ssupported\n",
344 ch_info->channel, 344 ch_info->channel,
345 il_is_channel_a_band(ch_info) ? 345 il_is_channel_a_band(ch_info) ?
@@ -371,7 +371,7 @@ static int il_mod_ht40_chan_info(struct il_priv *priv,
371/** 371/**
372 * il_init_channel_map - Set up driver's info for all possible channels 372 * il_init_channel_map - Set up driver's info for all possible channels
373 */ 373 */
374int il_init_channel_map(struct il_priv *priv) 374int il_init_channel_map(struct il_priv *il)
375{ 375{
376 int eeprom_ch_count = 0; 376 int eeprom_ch_count = 0;
377 const u8 *eeprom_ch_index = NULL; 377 const u8 *eeprom_ch_index = NULL;
@@ -379,39 +379,39 @@ int il_init_channel_map(struct il_priv *priv)
379 int band, ch; 379 int band, ch;
380 struct il_channel_info *ch_info; 380 struct il_channel_info *ch_info;
381 381
382 if (priv->channel_count) { 382 if (il->channel_count) {
383 IL_DEBUG_EEPROM(priv, "Channel map already initialized.\n"); 383 IL_DEBUG_EEPROM(il, "Channel map already initialized.\n");
384 return 0; 384 return 0;
385 } 385 }
386 386
387 IL_DEBUG_EEPROM(priv, "Initializing regulatory info from EEPROM\n"); 387 IL_DEBUG_EEPROM(il, "Initializing regulatory info from EEPROM\n");
388 388
389 priv->channel_count = 389 il->channel_count =
390 ARRAY_SIZE(iwlegacy_eeprom_band_1) + 390 ARRAY_SIZE(iwlegacy_eeprom_band_1) +
391 ARRAY_SIZE(iwlegacy_eeprom_band_2) + 391 ARRAY_SIZE(iwlegacy_eeprom_band_2) +
392 ARRAY_SIZE(iwlegacy_eeprom_band_3) + 392 ARRAY_SIZE(iwlegacy_eeprom_band_3) +
393 ARRAY_SIZE(iwlegacy_eeprom_band_4) + 393 ARRAY_SIZE(iwlegacy_eeprom_band_4) +
394 ARRAY_SIZE(iwlegacy_eeprom_band_5); 394 ARRAY_SIZE(iwlegacy_eeprom_band_5);
395 395
396 IL_DEBUG_EEPROM(priv, "Parsing data for %d channels.\n", 396 IL_DEBUG_EEPROM(il, "Parsing data for %d channels.\n",
397 priv->channel_count); 397 il->channel_count);
398 398
399 priv->channel_info = kzalloc(sizeof(struct il_channel_info) * 399 il->channel_info = kzalloc(sizeof(struct il_channel_info) *
400 priv->channel_count, GFP_KERNEL); 400 il->channel_count, GFP_KERNEL);
401 if (!priv->channel_info) { 401 if (!il->channel_info) {
402 IL_ERR(priv, "Could not allocate channel_info\n"); 402 IL_ERR(il, "Could not allocate channel_info\n");
403 priv->channel_count = 0; 403 il->channel_count = 0;
404 return -ENOMEM; 404 return -ENOMEM;
405 } 405 }
406 406
407 ch_info = priv->channel_info; 407 ch_info = il->channel_info;
408 408
409 /* Loop through the 5 EEPROM bands adding them in order to the 409 /* Loop through the 5 EEPROM bands adding them in order to the
410 * channel map we maintain (that contains additional information than 410 * channel map we maintain (that contains additional information than
411 * what just in the EEPROM) */ 411 * what just in the EEPROM) */
412 for (band = 1; band <= 5; band++) { 412 for (band = 1; band <= 5; band++) {
413 413
414 il_init_band_reference(priv, band, &eeprom_ch_count, 414 il_init_band_reference(il, band, &eeprom_ch_count,
415 &eeprom_ch_info, &eeprom_ch_index); 415 &eeprom_ch_info, &eeprom_ch_index);
416 416
417 /* Loop through each band adding each of the channels */ 417 /* Loop through each band adding each of the channels */
@@ -433,7 +433,7 @@ int il_init_channel_map(struct il_priv *priv)
433 IEEE80211_CHAN_NO_HT40; 433 IEEE80211_CHAN_NO_HT40;
434 434
435 if (!(il_is_channel_valid(ch_info))) { 435 if (!(il_is_channel_valid(ch_info))) {
436 IL_DEBUG_EEPROM(priv, 436 IL_DEBUG_EEPROM(il,
437 "Ch. %d Flags %x [%sGHz] - " 437 "Ch. %d Flags %x [%sGHz] - "
438 "No traffic\n", 438 "No traffic\n",
439 ch_info->channel, 439 ch_info->channel,
@@ -450,7 +450,7 @@ int il_init_channel_map(struct il_priv *priv)
450 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; 450 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
451 ch_info->min_power = 0; 451 ch_info->min_power = 0;
452 452
453 IL_DEBUG_EEPROM(priv, "Ch. %d [%sGHz] " 453 IL_DEBUG_EEPROM(il, "Ch. %d [%sGHz] "
454 "%s%s%s%s%s%s(0x%02x %ddBm):" 454 "%s%s%s%s%s%s(0x%02x %ddBm):"
455 " Ad-Hoc %ssupported\n", 455 " Ad-Hoc %ssupported\n",
456 ch_info->channel, 456 ch_info->channel,
@@ -475,9 +475,9 @@ int il_init_channel_map(struct il_priv *priv)
475 } 475 }
476 476
477 /* Check if we do have HT40 channels */ 477 /* Check if we do have HT40 channels */
478 if (priv->cfg->ops->lib->eeprom_ops.regulatory_bands[5] == 478 if (il->cfg->ops->lib->eeprom_ops.regulatory_bands[5] ==
479 EEPROM_REGULATORY_BAND_NO_HT40 && 479 EEPROM_REGULATORY_BAND_NO_HT40 &&
480 priv->cfg->ops->lib->eeprom_ops.regulatory_bands[6] == 480 il->cfg->ops->lib->eeprom_ops.regulatory_bands[6] ==
481 EEPROM_REGULATORY_BAND_NO_HT40) 481 EEPROM_REGULATORY_BAND_NO_HT40)
482 return 0; 482 return 0;
483 483
@@ -485,7 +485,7 @@ int il_init_channel_map(struct il_priv *priv)
485 for (band = 6; band <= 7; band++) { 485 for (band = 6; band <= 7; band++) {
486 enum ieee80211_band ieeeband; 486 enum ieee80211_band ieeeband;
487 487
488 il_init_band_reference(priv, band, &eeprom_ch_count, 488 il_init_band_reference(il, band, &eeprom_ch_count,
489 &eeprom_ch_info, &eeprom_ch_index); 489 &eeprom_ch_info, &eeprom_ch_index);
490 490
491 /* EEPROM band 6 is 2.4, band 7 is 5 GHz */ 491 /* EEPROM band 6 is 2.4, band 7 is 5 GHz */
@@ -495,13 +495,13 @@ int il_init_channel_map(struct il_priv *priv)
495 /* Loop through each band adding each of the channels */ 495 /* Loop through each band adding each of the channels */
496 for (ch = 0; ch < eeprom_ch_count; ch++) { 496 for (ch = 0; ch < eeprom_ch_count; ch++) {
497 /* Set up driver's info for lower half */ 497 /* Set up driver's info for lower half */
498 il_mod_ht40_chan_info(priv, ieeeband, 498 il_mod_ht40_chan_info(il, ieeeband,
499 eeprom_ch_index[ch], 499 eeprom_ch_index[ch],
500 &eeprom_ch_info[ch], 500 &eeprom_ch_info[ch],
501 IEEE80211_CHAN_NO_HT40PLUS); 501 IEEE80211_CHAN_NO_HT40PLUS);
502 502
503 /* Set up driver's info for upper half */ 503 /* Set up driver's info for upper half */
504 il_mod_ht40_chan_info(priv, ieeeband, 504 il_mod_ht40_chan_info(il, ieeeband,
505 eeprom_ch_index[ch] + 4, 505 eeprom_ch_index[ch] + 4,
506 &eeprom_ch_info[ch], 506 &eeprom_ch_info[ch],
507 IEEE80211_CHAN_NO_HT40MINUS); 507 IEEE80211_CHAN_NO_HT40MINUS);
@@ -515,34 +515,34 @@ EXPORT_SYMBOL(il_init_channel_map);
515/* 515/*
516 * il_free_channel_map - undo allocations in il_init_channel_map 516 * il_free_channel_map - undo allocations in il_init_channel_map
517 */ 517 */
518void il_free_channel_map(struct il_priv *priv) 518void il_free_channel_map(struct il_priv *il)
519{ 519{
520 kfree(priv->channel_info); 520 kfree(il->channel_info);
521 priv->channel_count = 0; 521 il->channel_count = 0;
522} 522}
523EXPORT_SYMBOL(il_free_channel_map); 523EXPORT_SYMBOL(il_free_channel_map);
524 524
525/** 525/**
526 * il_get_channel_info - Find driver's private channel info 526 * il_get_channel_info - Find driver's ilate channel info
527 * 527 *
528 * Based on band and channel number. 528 * Based on band and channel number.
529 */ 529 */
530const struct 530const struct
531il_channel_info *il_get_channel_info(const struct il_priv *priv, 531il_channel_info *il_get_channel_info(const struct il_priv *il,
532 enum ieee80211_band band, u16 channel) 532 enum ieee80211_band band, u16 channel)
533{ 533{
534 int i; 534 int i;
535 535
536 switch (band) { 536 switch (band) {
537 case IEEE80211_BAND_5GHZ: 537 case IEEE80211_BAND_5GHZ:
538 for (i = 14; i < priv->channel_count; i++) { 538 for (i = 14; i < il->channel_count; i++) {
539 if (priv->channel_info[i].channel == channel) 539 if (il->channel_info[i].channel == channel)
540 return &priv->channel_info[i]; 540 return &il->channel_info[i];
541 } 541 }
542 break; 542 break;
543 case IEEE80211_BAND_2GHZ: 543 case IEEE80211_BAND_2GHZ:
544 if (channel >= 1 && channel <= 14) 544 if (channel >= 1 && channel <= 14)
545 return &priv->channel_info[channel - 1]; 545 return &il->channel_info[channel - 1];
546 break; 546 break;
547 default: 547 default:
548 BUG(); 548 BUG();