diff options
author | Don Fry <donald.h.fry@intel.com> | 2011-11-10 09:55:26 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 12:32:56 -0500 |
commit | 1431b2166a83ba0cc46007269298caa53c86a6d0 (patch) | |
tree | 21593caf39531510694ad33e342f7d5008b1e0fc /drivers/net/wireless/iwlwifi | |
parent | 383b0874abc8c23f15a15773812fb09f23078311 (diff) |
iwlagn: Remove dependence of iwl_priv from eeprom routines.
Make the eeprom routines less dependent on the iwl_priv structure.
Don't use the priv when bus structure is sufficient.
Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index a4e43bd4a547..2fcde58382ff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -149,23 +149,23 @@ static const u8 iwl_eeprom_band_7[] = { /* 5.2 ht40 channel */ | |||
149 | * EEPROM chip, not a single event, so even reads could conflict if they | 149 | * EEPROM chip, not a single event, so even reads could conflict if they |
150 | * weren't arbitrated by the semaphore. | 150 | * weren't arbitrated by the semaphore. |
151 | */ | 151 | */ |
152 | static int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv) | 152 | static int iwl_eeprom_acquire_semaphore(struct iwl_bus *bus) |
153 | { | 153 | { |
154 | u16 count; | 154 | u16 count; |
155 | int ret; | 155 | int ret; |
156 | 156 | ||
157 | for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) { | 157 | for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) { |
158 | /* Request semaphore */ | 158 | /* Request semaphore */ |
159 | iwl_set_bit(bus(priv), CSR_HW_IF_CONFIG_REG, | 159 | iwl_set_bit(bus, CSR_HW_IF_CONFIG_REG, |
160 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM); | 160 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM); |
161 | 161 | ||
162 | /* See if we got it */ | 162 | /* See if we got it */ |
163 | ret = iwl_poll_bit(bus(priv), CSR_HW_IF_CONFIG_REG, | 163 | ret = iwl_poll_bit(bus, CSR_HW_IF_CONFIG_REG, |
164 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, | 164 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, |
165 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, | 165 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, |
166 | EEPROM_SEM_TIMEOUT); | 166 | EEPROM_SEM_TIMEOUT); |
167 | if (ret >= 0) { | 167 | if (ret >= 0) { |
168 | IWL_DEBUG_EEPROM(priv, | 168 | IWL_DEBUG_EEPROM(bus, |
169 | "Acquired semaphore after %d tries.\n", | 169 | "Acquired semaphore after %d tries.\n", |
170 | count+1); | 170 | count+1); |
171 | return ret; | 171 | return ret; |
@@ -175,9 +175,9 @@ static int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv) | |||
175 | return ret; | 175 | return ret; |
176 | } | 176 | } |
177 | 177 | ||
178 | static void iwl_eeprom_release_semaphore(struct iwl_priv *priv) | 178 | static void iwl_eeprom_release_semaphore(struct iwl_bus *bus) |
179 | { | 179 | { |
180 | iwl_clear_bit(bus(priv), CSR_HW_IF_CONFIG_REG, | 180 | iwl_clear_bit(bus, CSR_HW_IF_CONFIG_REG, |
181 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM); | 181 | CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM); |
182 | 182 | ||
183 | } | 183 | } |
@@ -302,19 +302,19 @@ void iwl_eeprom_get_mac(const struct iwl_priv *priv, u8 *mac) | |||
302 | * | 302 | * |
303 | ******************************************************************************/ | 303 | ******************************************************************************/ |
304 | 304 | ||
305 | static void iwl_set_otp_access(struct iwl_priv *priv, enum iwl_access_mode mode) | 305 | static void iwl_set_otp_access(struct iwl_bus *bus, enum iwl_access_mode mode) |
306 | { | 306 | { |
307 | iwl_read32(bus(priv), CSR_OTP_GP_REG); | 307 | iwl_read32(bus, CSR_OTP_GP_REG); |
308 | 308 | ||
309 | if (mode == IWL_OTP_ACCESS_ABSOLUTE) | 309 | if (mode == IWL_OTP_ACCESS_ABSOLUTE) |
310 | iwl_clear_bit(bus(priv), CSR_OTP_GP_REG, | 310 | iwl_clear_bit(bus, CSR_OTP_GP_REG, |
311 | CSR_OTP_GP_REG_OTP_ACCESS_MODE); | 311 | CSR_OTP_GP_REG_OTP_ACCESS_MODE); |
312 | else | 312 | else |
313 | iwl_set_bit(bus(priv), CSR_OTP_GP_REG, | 313 | iwl_set_bit(bus, CSR_OTP_GP_REG, |
314 | CSR_OTP_GP_REG_OTP_ACCESS_MODE); | 314 | CSR_OTP_GP_REG_OTP_ACCESS_MODE); |
315 | } | 315 | } |
316 | 316 | ||
317 | static int iwl_get_nvm_type(struct iwl_priv *priv, u32 hw_rev) | 317 | static int iwl_get_nvm_type(struct iwl_bus *bus, u32 hw_rev) |
318 | { | 318 | { |
319 | u32 otpgp; | 319 | u32 otpgp; |
320 | int nvm_type; | 320 | int nvm_type; |
@@ -322,7 +322,7 @@ static int iwl_get_nvm_type(struct iwl_priv *priv, u32 hw_rev) | |||
322 | /* OTP only valid for CP/PP and after */ | 322 | /* OTP only valid for CP/PP and after */ |
323 | switch (hw_rev & CSR_HW_REV_TYPE_MSK) { | 323 | switch (hw_rev & CSR_HW_REV_TYPE_MSK) { |
324 | case CSR_HW_REV_TYPE_NONE: | 324 | case CSR_HW_REV_TYPE_NONE: |
325 | IWL_ERR(priv, "Unknown hardware type\n"); | 325 | IWL_ERR(bus, "Unknown hardware type\n"); |
326 | return -ENOENT; | 326 | return -ENOENT; |
327 | case CSR_HW_REV_TYPE_5300: | 327 | case CSR_HW_REV_TYPE_5300: |
328 | case CSR_HW_REV_TYPE_5350: | 328 | case CSR_HW_REV_TYPE_5350: |
@@ -331,7 +331,7 @@ static int iwl_get_nvm_type(struct iwl_priv *priv, u32 hw_rev) | |||
331 | nvm_type = NVM_DEVICE_TYPE_EEPROM; | 331 | nvm_type = NVM_DEVICE_TYPE_EEPROM; |
332 | break; | 332 | break; |
333 | default: | 333 | default: |
334 | otpgp = iwl_read32(bus(priv), CSR_OTP_GP_REG); | 334 | otpgp = iwl_read32(bus, CSR_OTP_GP_REG); |
335 | if (otpgp & CSR_OTP_GP_REG_DEVICE_SELECT) | 335 | if (otpgp & CSR_OTP_GP_REG_DEVICE_SELECT) |
336 | nvm_type = NVM_DEVICE_TYPE_OTP; | 336 | nvm_type = NVM_DEVICE_TYPE_OTP; |
337 | else | 337 | else |
@@ -341,73 +341,73 @@ static int iwl_get_nvm_type(struct iwl_priv *priv, u32 hw_rev) | |||
341 | return nvm_type; | 341 | return nvm_type; |
342 | } | 342 | } |
343 | 343 | ||
344 | static int iwl_init_otp_access(struct iwl_priv *priv) | 344 | static int iwl_init_otp_access(struct iwl_bus *bus) |
345 | { | 345 | { |
346 | int ret; | 346 | int ret; |
347 | 347 | ||
348 | /* Enable 40MHz radio clock */ | 348 | /* Enable 40MHz radio clock */ |
349 | iwl_write32(bus(priv), CSR_GP_CNTRL, | 349 | iwl_write32(bus, CSR_GP_CNTRL, |
350 | iwl_read32(bus(priv), CSR_GP_CNTRL) | | 350 | iwl_read32(bus, CSR_GP_CNTRL) | |
351 | CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 351 | CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
352 | 352 | ||
353 | /* wait for clock to be ready */ | 353 | /* wait for clock to be ready */ |
354 | ret = iwl_poll_bit(bus(priv), CSR_GP_CNTRL, | 354 | ret = iwl_poll_bit(bus, CSR_GP_CNTRL, |
355 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 355 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
356 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 356 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
357 | 25000); | 357 | 25000); |
358 | if (ret < 0) | 358 | if (ret < 0) |
359 | IWL_ERR(priv, "Time out access OTP\n"); | 359 | IWL_ERR(bus, "Time out access OTP\n"); |
360 | else { | 360 | else { |
361 | iwl_set_bits_prph(bus(priv), APMG_PS_CTRL_REG, | 361 | iwl_set_bits_prph(bus, APMG_PS_CTRL_REG, |
362 | APMG_PS_CTRL_VAL_RESET_REQ); | 362 | APMG_PS_CTRL_VAL_RESET_REQ); |
363 | udelay(5); | 363 | udelay(5); |
364 | iwl_clear_bits_prph(bus(priv), APMG_PS_CTRL_REG, | 364 | iwl_clear_bits_prph(bus, APMG_PS_CTRL_REG, |
365 | APMG_PS_CTRL_VAL_RESET_REQ); | 365 | APMG_PS_CTRL_VAL_RESET_REQ); |
366 | 366 | ||
367 | /* | 367 | /* |
368 | * CSR auto clock gate disable bit - | 368 | * CSR auto clock gate disable bit - |
369 | * this is only applicable for HW with OTP shadow RAM | 369 | * this is only applicable for HW with OTP shadow RAM |
370 | */ | 370 | */ |
371 | if (priv->cfg->base_params->shadow_ram_support) | 371 | if (priv(bus)->cfg->base_params->shadow_ram_support) |
372 | iwl_set_bit(bus(priv), CSR_DBG_LINK_PWR_MGMT_REG, | 372 | iwl_set_bit(bus, CSR_DBG_LINK_PWR_MGMT_REG, |
373 | CSR_RESET_LINK_PWR_MGMT_DISABLED); | 373 | CSR_RESET_LINK_PWR_MGMT_DISABLED); |
374 | } | 374 | } |
375 | return ret; | 375 | return ret; |
376 | } | 376 | } |
377 | 377 | ||
378 | static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, __le16 *eeprom_data) | 378 | static int iwl_read_otp_word(struct iwl_bus *bus, u16 addr, __le16 *eeprom_data) |
379 | { | 379 | { |
380 | int ret = 0; | 380 | int ret = 0; |
381 | u32 r; | 381 | u32 r; |
382 | u32 otpgp; | 382 | u32 otpgp; |
383 | 383 | ||
384 | iwl_write32(bus(priv), CSR_EEPROM_REG, | 384 | iwl_write32(bus, CSR_EEPROM_REG, |
385 | CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); | 385 | CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); |
386 | ret = iwl_poll_bit(bus(priv), CSR_EEPROM_REG, | 386 | ret = iwl_poll_bit(bus, CSR_EEPROM_REG, |
387 | CSR_EEPROM_REG_READ_VALID_MSK, | 387 | CSR_EEPROM_REG_READ_VALID_MSK, |
388 | CSR_EEPROM_REG_READ_VALID_MSK, | 388 | CSR_EEPROM_REG_READ_VALID_MSK, |
389 | IWL_EEPROM_ACCESS_TIMEOUT); | 389 | IWL_EEPROM_ACCESS_TIMEOUT); |
390 | if (ret < 0) { | 390 | if (ret < 0) { |
391 | IWL_ERR(priv, "Time out reading OTP[%d]\n", addr); | 391 | IWL_ERR(bus, "Time out reading OTP[%d]\n", addr); |
392 | return ret; | 392 | return ret; |
393 | } | 393 | } |
394 | r = iwl_read32(bus(priv), CSR_EEPROM_REG); | 394 | r = iwl_read32(bus, CSR_EEPROM_REG); |
395 | /* check for ECC errors: */ | 395 | /* check for ECC errors: */ |
396 | otpgp = iwl_read32(bus(priv), CSR_OTP_GP_REG); | 396 | otpgp = iwl_read32(bus, CSR_OTP_GP_REG); |
397 | if (otpgp & CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK) { | 397 | if (otpgp & CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK) { |
398 | /* stop in this case */ | 398 | /* stop in this case */ |
399 | /* set the uncorrectable OTP ECC bit for acknowledgement */ | 399 | /* set the uncorrectable OTP ECC bit for acknowledgement */ |
400 | iwl_set_bit(bus(priv), CSR_OTP_GP_REG, | 400 | iwl_set_bit(bus, CSR_OTP_GP_REG, |
401 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); | 401 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); |
402 | IWL_ERR(priv, "Uncorrectable OTP ECC error, abort OTP read\n"); | 402 | IWL_ERR(bus, "Uncorrectable OTP ECC error, abort OTP read\n"); |
403 | return -EINVAL; | 403 | return -EINVAL; |
404 | } | 404 | } |
405 | if (otpgp & CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK) { | 405 | if (otpgp & CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK) { |
406 | /* continue in this case */ | 406 | /* continue in this case */ |
407 | /* set the correctable OTP ECC bit for acknowledgement */ | 407 | /* set the correctable OTP ECC bit for acknowledgement */ |
408 | iwl_set_bit(bus(priv), CSR_OTP_GP_REG, | 408 | iwl_set_bit(bus, CSR_OTP_GP_REG, |
409 | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK); | 409 | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK); |
410 | IWL_ERR(priv, "Correctable OTP ECC error, continue read\n"); | 410 | IWL_ERR(bus, "Correctable OTP ECC error, continue read\n"); |
411 | } | 411 | } |
412 | *eeprom_data = cpu_to_le16(r >> 16); | 412 | *eeprom_data = cpu_to_le16(r >> 16); |
413 | return 0; | 413 | return 0; |
@@ -416,20 +416,20 @@ static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, __le16 *eeprom_dat | |||
416 | /* | 416 | /* |
417 | * iwl_is_otp_empty: check for empty OTP | 417 | * iwl_is_otp_empty: check for empty OTP |
418 | */ | 418 | */ |
419 | static bool iwl_is_otp_empty(struct iwl_priv *priv) | 419 | static bool iwl_is_otp_empty(struct iwl_bus *bus) |
420 | { | 420 | { |
421 | u16 next_link_addr = 0; | 421 | u16 next_link_addr = 0; |
422 | __le16 link_value; | 422 | __le16 link_value; |
423 | bool is_empty = false; | 423 | bool is_empty = false; |
424 | 424 | ||
425 | /* locate the beginning of OTP link list */ | 425 | /* locate the beginning of OTP link list */ |
426 | if (!iwl_read_otp_word(priv, next_link_addr, &link_value)) { | 426 | if (!iwl_read_otp_word(bus, next_link_addr, &link_value)) { |
427 | if (!link_value) { | 427 | if (!link_value) { |
428 | IWL_ERR(priv, "OTP is empty\n"); | 428 | IWL_ERR(bus, "OTP is empty\n"); |
429 | is_empty = true; | 429 | is_empty = true; |
430 | } | 430 | } |
431 | } else { | 431 | } else { |
432 | IWL_ERR(priv, "Unable to read first block of OTP list.\n"); | 432 | IWL_ERR(bus, "Unable to read first block of OTP list.\n"); |
433 | is_empty = true; | 433 | is_empty = true; |
434 | } | 434 | } |
435 | 435 | ||
@@ -446,7 +446,7 @@ static bool iwl_is_otp_empty(struct iwl_priv *priv) | |||
446 | * we should read and used to configure the device. | 446 | * we should read and used to configure the device. |
447 | * only perform this operation if shadow RAM is disabled | 447 | * only perform this operation if shadow RAM is disabled |
448 | */ | 448 | */ |
449 | static int iwl_find_otp_image(struct iwl_priv *priv, | 449 | static int iwl_find_otp_image(struct iwl_bus *bus, |
450 | u16 *validblockaddr) | 450 | u16 *validblockaddr) |
451 | { | 451 | { |
452 | u16 next_link_addr = 0, valid_addr; | 452 | u16 next_link_addr = 0, valid_addr; |
@@ -454,10 +454,10 @@ static int iwl_find_otp_image(struct iwl_priv *priv, | |||
454 | int usedblocks = 0; | 454 | int usedblocks = 0; |
455 | 455 | ||
456 | /* set addressing mode to absolute to traverse the link list */ | 456 | /* set addressing mode to absolute to traverse the link list */ |
457 | iwl_set_otp_access(priv, IWL_OTP_ACCESS_ABSOLUTE); | 457 | iwl_set_otp_access(bus, IWL_OTP_ACCESS_ABSOLUTE); |
458 | 458 | ||
459 | /* checking for empty OTP or error */ | 459 | /* checking for empty OTP or error */ |
460 | if (iwl_is_otp_empty(priv)) | 460 | if (iwl_is_otp_empty(bus)) |
461 | return -EINVAL; | 461 | return -EINVAL; |
462 | 462 | ||
463 | /* | 463 | /* |
@@ -471,9 +471,9 @@ static int iwl_find_otp_image(struct iwl_priv *priv, | |||
471 | */ | 471 | */ |
472 | valid_addr = next_link_addr; | 472 | valid_addr = next_link_addr; |
473 | next_link_addr = le16_to_cpu(link_value) * sizeof(u16); | 473 | next_link_addr = le16_to_cpu(link_value) * sizeof(u16); |
474 | IWL_DEBUG_EEPROM(priv, "OTP blocks %d addr 0x%x\n", | 474 | IWL_DEBUG_EEPROM(bus, "OTP blocks %d addr 0x%x\n", |
475 | usedblocks, next_link_addr); | 475 | usedblocks, next_link_addr); |
476 | if (iwl_read_otp_word(priv, next_link_addr, &link_value)) | 476 | if (iwl_read_otp_word(bus, next_link_addr, &link_value)) |
477 | return -EINVAL; | 477 | return -EINVAL; |
478 | if (!link_value) { | 478 | if (!link_value) { |
479 | /* | 479 | /* |
@@ -488,10 +488,10 @@ static int iwl_find_otp_image(struct iwl_priv *priv, | |||
488 | } | 488 | } |
489 | /* more in the link list, continue */ | 489 | /* more in the link list, continue */ |
490 | usedblocks++; | 490 | usedblocks++; |
491 | } while (usedblocks <= priv->cfg->base_params->max_ll_items); | 491 | } while (usedblocks <= priv(bus)->cfg->base_params->max_ll_items); |
492 | 492 | ||
493 | /* OTP has no valid blocks */ | 493 | /* OTP has no valid blocks */ |
494 | IWL_DEBUG_EEPROM(priv, "OTP has no valid blocks\n"); | 494 | IWL_DEBUG_EEPROM(bus, "OTP has no valid blocks\n"); |
495 | return -EINVAL; | 495 | return -EINVAL; |
496 | } | 496 | } |
497 | 497 | ||
@@ -504,28 +504,28 @@ static int iwl_find_otp_image(struct iwl_priv *priv, | |||
504 | * iwl_get_max_txpower_avg - get the highest tx power from all chains. | 504 | * iwl_get_max_txpower_avg - get the highest tx power from all chains. |
505 | * find the highest tx power from all chains for the channel | 505 | * find the highest tx power from all chains for the channel |
506 | */ | 506 | */ |
507 | static s8 iwl_get_max_txpower_avg(struct iwl_priv *priv, | 507 | static s8 iwl_get_max_txpower_avg(struct iwl_cfg *cfg, |
508 | struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, | 508 | struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, |
509 | int element, s8 *max_txpower_in_half_dbm) | 509 | int element, s8 *max_txpower_in_half_dbm) |
510 | { | 510 | { |
511 | s8 max_txpower_avg = 0; /* (dBm) */ | 511 | s8 max_txpower_avg = 0; /* (dBm) */ |
512 | 512 | ||
513 | /* Take the highest tx power from any valid chains */ | 513 | /* Take the highest tx power from any valid chains */ |
514 | if ((priv->cfg->valid_tx_ant & ANT_A) && | 514 | if ((cfg->valid_tx_ant & ANT_A) && |
515 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) | 515 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) |
516 | max_txpower_avg = enhanced_txpower[element].chain_a_max; | 516 | max_txpower_avg = enhanced_txpower[element].chain_a_max; |
517 | if ((priv->cfg->valid_tx_ant & ANT_B) && | 517 | if ((cfg->valid_tx_ant & ANT_B) && |
518 | (enhanced_txpower[element].chain_b_max > max_txpower_avg)) | 518 | (enhanced_txpower[element].chain_b_max > max_txpower_avg)) |
519 | max_txpower_avg = enhanced_txpower[element].chain_b_max; | 519 | max_txpower_avg = enhanced_txpower[element].chain_b_max; |
520 | if ((priv->cfg->valid_tx_ant & ANT_C) && | 520 | if ((cfg->valid_tx_ant & ANT_C) && |
521 | (enhanced_txpower[element].chain_c_max > max_txpower_avg)) | 521 | (enhanced_txpower[element].chain_c_max > max_txpower_avg)) |
522 | max_txpower_avg = enhanced_txpower[element].chain_c_max; | 522 | max_txpower_avg = enhanced_txpower[element].chain_c_max; |
523 | if (((priv->cfg->valid_tx_ant == ANT_AB) | | 523 | if (((cfg->valid_tx_ant == ANT_AB) | |
524 | (priv->cfg->valid_tx_ant == ANT_BC) | | 524 | (cfg->valid_tx_ant == ANT_BC) | |
525 | (priv->cfg->valid_tx_ant == ANT_AC)) && | 525 | (cfg->valid_tx_ant == ANT_AC)) && |
526 | (enhanced_txpower[element].mimo2_max > max_txpower_avg)) | 526 | (enhanced_txpower[element].mimo2_max > max_txpower_avg)) |
527 | max_txpower_avg = enhanced_txpower[element].mimo2_max; | 527 | max_txpower_avg = enhanced_txpower[element].mimo2_max; |
528 | if ((priv->cfg->valid_tx_ant == ANT_ABC) && | 528 | if ((cfg->valid_tx_ant == ANT_ABC) && |
529 | (enhanced_txpower[element].mimo3_max > max_txpower_avg)) | 529 | (enhanced_txpower[element].mimo3_max > max_txpower_avg)) |
530 | max_txpower_avg = enhanced_txpower[element].mimo3_max; | 530 | max_txpower_avg = enhanced_txpower[element].mimo3_max; |
531 | 531 | ||
@@ -627,7 +627,7 @@ void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
627 | ((txp->delta_20_in_40 & 0xf0) >> 4), | 627 | ((txp->delta_20_in_40 & 0xf0) >> 4), |
628 | (txp->delta_20_in_40 & 0x0f)); | 628 | (txp->delta_20_in_40 & 0x0f)); |
629 | 629 | ||
630 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, | 630 | max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, |
631 | &max_txp_avg_halfdbm); | 631 | &max_txp_avg_halfdbm); |
632 | 632 | ||
633 | /* | 633 | /* |
@@ -660,7 +660,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
660 | u16 validblockaddr = 0; | 660 | u16 validblockaddr = 0; |
661 | u16 cache_addr = 0; | 661 | u16 cache_addr = 0; |
662 | 662 | ||
663 | priv->nvm_device_type = iwl_get_nvm_type(priv, hw_rev); | 663 | priv->nvm_device_type = iwl_get_nvm_type(bus(priv), hw_rev); |
664 | if (priv->nvm_device_type == -ENOENT) | 664 | if (priv->nvm_device_type == -ENOENT) |
665 | return -ENOENT; | 665 | return -ENOENT; |
666 | /* allocate eeprom */ | 666 | /* allocate eeprom */ |
@@ -683,7 +683,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
683 | } | 683 | } |
684 | 684 | ||
685 | /* Make sure driver (instead of uCode) is allowed to read EEPROM */ | 685 | /* Make sure driver (instead of uCode) is allowed to read EEPROM */ |
686 | ret = iwl_eeprom_acquire_semaphore(priv); | 686 | ret = iwl_eeprom_acquire_semaphore(bus(priv)); |
687 | if (ret < 0) { | 687 | if (ret < 0) { |
688 | IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); | 688 | IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n"); |
689 | ret = -ENOENT; | 689 | ret = -ENOENT; |
@@ -692,7 +692,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
692 | 692 | ||
693 | if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { | 693 | if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { |
694 | 694 | ||
695 | ret = iwl_init_otp_access(priv); | 695 | ret = iwl_init_otp_access(bus(priv)); |
696 | if (ret) { | 696 | if (ret) { |
697 | IWL_ERR(priv, "Failed to initialize OTP access.\n"); | 697 | IWL_ERR(priv, "Failed to initialize OTP access.\n"); |
698 | ret = -ENOENT; | 698 | ret = -ENOENT; |
@@ -707,7 +707,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
707 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); | 707 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); |
708 | /* traversing the linked list if no shadow ram supported */ | 708 | /* traversing the linked list if no shadow ram supported */ |
709 | if (!priv->cfg->base_params->shadow_ram_support) { | 709 | if (!priv->cfg->base_params->shadow_ram_support) { |
710 | if (iwl_find_otp_image(priv, &validblockaddr)) { | 710 | if (iwl_find_otp_image(bus(priv), &validblockaddr)) { |
711 | ret = -ENOENT; | 711 | ret = -ENOENT; |
712 | goto done; | 712 | goto done; |
713 | } | 713 | } |
@@ -716,7 +716,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
716 | addr += sizeof(u16)) { | 716 | addr += sizeof(u16)) { |
717 | __le16 eeprom_data; | 717 | __le16 eeprom_data; |
718 | 718 | ||
719 | ret = iwl_read_otp_word(priv, addr, &eeprom_data); | 719 | ret = iwl_read_otp_word(bus(priv), addr, &eeprom_data); |
720 | if (ret) | 720 | if (ret) |
721 | goto done; | 721 | goto done; |
722 | e[cache_addr / 2] = eeprom_data; | 722 | e[cache_addr / 2] = eeprom_data; |
@@ -750,7 +750,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
750 | 750 | ||
751 | ret = 0; | 751 | ret = 0; |
752 | done: | 752 | done: |
753 | iwl_eeprom_release_semaphore(priv); | 753 | iwl_eeprom_release_semaphore(bus(priv)); |
754 | 754 | ||
755 | err: | 755 | err: |
756 | if (ret) | 756 | if (ret) |