diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 6fcc7d586b24..c1eda9724f42 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -230,8 +230,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv) | |||
230 | eeprom_ver = iwl_eeprom_query16(priv->shrd, EEPROM_VERSION); | 230 | eeprom_ver = iwl_eeprom_query16(priv->shrd, EEPROM_VERSION); |
231 | calib_ver = iwl_eeprom_calib_version(priv->shrd); | 231 | calib_ver = iwl_eeprom_calib_version(priv->shrd); |
232 | 232 | ||
233 | if (eeprom_ver < priv->cfg->eeprom_ver || | 233 | if (eeprom_ver < cfg(priv)->eeprom_ver || |
234 | calib_ver < priv->cfg->eeprom_calib_ver) | 234 | calib_ver < cfg(priv)->eeprom_calib_ver) |
235 | goto err; | 235 | goto err; |
236 | 236 | ||
237 | IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n", | 237 | IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n", |
@@ -241,8 +241,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv) | |||
241 | err: | 241 | err: |
242 | IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x " | 242 | IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x " |
243 | "CALIB=0x%x < 0x%x\n", | 243 | "CALIB=0x%x < 0x%x\n", |
244 | eeprom_ver, priv->cfg->eeprom_ver, | 244 | eeprom_ver, cfg(priv)->eeprom_ver, |
245 | calib_ver, priv->cfg->eeprom_calib_ver); | 245 | calib_ver, cfg(priv)->eeprom_calib_ver); |
246 | return -EINVAL; | 246 | return -EINVAL; |
247 | 247 | ||
248 | } | 248 | } |
@@ -252,35 +252,35 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv) | |||
252 | struct iwl_shared *shrd = priv->shrd; | 252 | struct iwl_shared *shrd = priv->shrd; |
253 | u16 radio_cfg; | 253 | u16 radio_cfg; |
254 | 254 | ||
255 | if (!priv->cfg->sku) { | 255 | if (!cfg(priv)->sku) { |
256 | /* not using sku overwrite */ | 256 | /* not using sku overwrite */ |
257 | priv->cfg->sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP); | 257 | cfg(priv)->sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP); |
258 | if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE && | 258 | if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE && |
259 | !priv->cfg->ht_params) { | 259 | !cfg(priv)->ht_params) { |
260 | IWL_ERR(priv, "Invalid 11n configuration\n"); | 260 | IWL_ERR(priv, "Invalid 11n configuration\n"); |
261 | return -EINVAL; | 261 | return -EINVAL; |
262 | } | 262 | } |
263 | } | 263 | } |
264 | if (!priv->cfg->sku) { | 264 | if (!cfg(priv)->sku) { |
265 | IWL_ERR(priv, "Invalid device sku\n"); | 265 | IWL_ERR(priv, "Invalid device sku\n"); |
266 | return -EINVAL; | 266 | return -EINVAL; |
267 | } | 267 | } |
268 | 268 | ||
269 | IWL_INFO(priv, "Device SKU: 0X%x\n", priv->cfg->sku); | 269 | IWL_INFO(priv, "Device SKU: 0x%X\n", cfg(priv)->sku); |
270 | 270 | ||
271 | if (!priv->cfg->valid_tx_ant && !priv->cfg->valid_rx_ant) { | 271 | if (!cfg(priv)->valid_tx_ant && !cfg(priv)->valid_rx_ant) { |
272 | /* not using .cfg overwrite */ | 272 | /* not using .cfg overwrite */ |
273 | radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG); | 273 | radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG); |
274 | priv->cfg->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); | 274 | cfg(priv)->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); |
275 | priv->cfg->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); | 275 | cfg(priv)->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); |
276 | if (!priv->cfg->valid_tx_ant || !priv->cfg->valid_rx_ant) { | 276 | if (!cfg(priv)->valid_tx_ant || !cfg(priv)->valid_rx_ant) { |
277 | IWL_ERR(priv, "Invalid chain (0X%x, 0X%x)\n", | 277 | IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n", |
278 | priv->cfg->valid_tx_ant, | 278 | cfg(priv)->valid_tx_ant, |
279 | priv->cfg->valid_rx_ant); | 279 | cfg(priv)->valid_rx_ant); |
280 | return -EINVAL; | 280 | return -EINVAL; |
281 | } | 281 | } |
282 | IWL_INFO(priv, "Valid Tx ant: 0X%x, Valid Rx ant: 0X%x\n", | 282 | IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", |
283 | priv->cfg->valid_tx_ant, priv->cfg->valid_rx_ant); | 283 | cfg(priv)->valid_tx_ant, cfg(priv)->valid_rx_ant); |
284 | } | 284 | } |
285 | /* | 285 | /* |
286 | * for some special cases, | 286 | * for some special cases, |
@@ -369,7 +369,7 @@ static int iwl_init_otp_access(struct iwl_bus *bus) | |||
369 | * CSR auto clock gate disable bit - | 369 | * CSR auto clock gate disable bit - |
370 | * this is only applicable for HW with OTP shadow RAM | 370 | * this is only applicable for HW with OTP shadow RAM |
371 | */ | 371 | */ |
372 | if (priv(bus)->cfg->base_params->shadow_ram_support) | 372 | if (cfg(bus)->base_params->shadow_ram_support) |
373 | iwl_set_bit(bus, CSR_DBG_LINK_PWR_MGMT_REG, | 373 | iwl_set_bit(bus, CSR_DBG_LINK_PWR_MGMT_REG, |
374 | CSR_RESET_LINK_PWR_MGMT_DISABLED); | 374 | CSR_RESET_LINK_PWR_MGMT_DISABLED); |
375 | } | 375 | } |
@@ -489,7 +489,7 @@ static int iwl_find_otp_image(struct iwl_bus *bus, | |||
489 | } | 489 | } |
490 | /* more in the link list, continue */ | 490 | /* more in the link list, continue */ |
491 | usedblocks++; | 491 | usedblocks++; |
492 | } while (usedblocks <= priv(bus)->cfg->base_params->max_ll_items); | 492 | } while (usedblocks <= cfg(bus)->base_params->max_ll_items); |
493 | 493 | ||
494 | /* OTP has no valid blocks */ | 494 | /* OTP has no valid blocks */ |
495 | IWL_DEBUG_EEPROM(bus, "OTP has no valid blocks\n"); | 495 | IWL_DEBUG_EEPROM(bus, "OTP has no valid blocks\n"); |
@@ -629,7 +629,7 @@ void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
629 | ((txp->delta_20_in_40 & 0xf0) >> 4), | 629 | ((txp->delta_20_in_40 & 0xf0) >> 4), |
630 | (txp->delta_20_in_40 & 0x0f)); | 630 | (txp->delta_20_in_40 & 0x0f)); |
631 | 631 | ||
632 | max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, | 632 | max_txp_avg = iwl_get_max_txpower_avg(cfg(priv), txp_array, idx, |
633 | &max_txp_avg_halfdbm); | 633 | &max_txp_avg_halfdbm); |
634 | 634 | ||
635 | /* | 635 | /* |
@@ -667,7 +667,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
667 | if (trans(priv)->nvm_device_type == -ENOENT) | 667 | if (trans(priv)->nvm_device_type == -ENOENT) |
668 | return -ENOENT; | 668 | return -ENOENT; |
669 | /* allocate eeprom */ | 669 | /* allocate eeprom */ |
670 | sz = priv->cfg->base_params->eeprom_size; | 670 | sz = cfg(priv)->base_params->eeprom_size; |
671 | IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); | 671 | IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); |
672 | shrd->eeprom = kzalloc(sz, GFP_KERNEL); | 672 | shrd->eeprom = kzalloc(sz, GFP_KERNEL); |
673 | if (!shrd->eeprom) { | 673 | if (!shrd->eeprom) { |
@@ -709,7 +709,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) | |||
709 | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | | 709 | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | |
710 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); | 710 | CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); |
711 | /* traversing the linked list if no shadow ram supported */ | 711 | /* traversing the linked list if no shadow ram supported */ |
712 | if (!priv->cfg->base_params->shadow_ram_support) { | 712 | if (!cfg(priv)->base_params->shadow_ram_support) { |
713 | if (iwl_find_otp_image(bus(priv), &validblockaddr)) { | 713 | if (iwl_find_otp_image(bus(priv), &validblockaddr)) { |
714 | ret = -ENOENT; | 714 | ret = -ENOENT; |
715 | goto done; | 715 | goto done; |
@@ -776,7 +776,7 @@ static void iwl_init_band_reference(const struct iwl_priv *priv, | |||
776 | const u8 **eeprom_ch_index) | 776 | const u8 **eeprom_ch_index) |
777 | { | 777 | { |
778 | struct iwl_shared *shrd = priv->shrd; | 778 | struct iwl_shared *shrd = priv->shrd; |
779 | u32 offset = priv->cfg->lib-> | 779 | u32 offset = cfg(priv)->lib-> |
780 | eeprom_ops.regulatory_bands[eep_band - 1]; | 780 | eeprom_ops.regulatory_bands[eep_band - 1]; |
781 | switch (eep_band) { | 781 | switch (eep_band) { |
782 | case 1: /* 2.4GHz band */ | 782 | case 1: /* 2.4GHz band */ |
@@ -983,9 +983,9 @@ int iwl_init_channel_map(struct iwl_priv *priv) | |||
983 | } | 983 | } |
984 | 984 | ||
985 | /* Check if we do have HT40 channels */ | 985 | /* Check if we do have HT40 channels */ |
986 | if (priv->cfg->lib->eeprom_ops.regulatory_bands[5] == | 986 | if (cfg(priv)->lib->eeprom_ops.regulatory_bands[5] == |
987 | EEPROM_REGULATORY_BAND_NO_HT40 && | 987 | EEPROM_REGULATORY_BAND_NO_HT40 && |
988 | priv->cfg->lib->eeprom_ops.regulatory_bands[6] == | 988 | cfg(priv)->lib->eeprom_ops.regulatory_bands[6] == |
989 | EEPROM_REGULATORY_BAND_NO_HT40) | 989 | EEPROM_REGULATORY_BAND_NO_HT40) |
990 | return 0; | 990 | return 0; |
991 | 991 | ||
@@ -1021,8 +1021,8 @@ int iwl_init_channel_map(struct iwl_priv *priv) | |||
1021 | * driver need to process addition information | 1021 | * driver need to process addition information |
1022 | * to determine the max channel tx power limits | 1022 | * to determine the max channel tx power limits |
1023 | */ | 1023 | */ |
1024 | if (priv->cfg->lib->eeprom_ops.update_enhanced_txpower) | 1024 | if (cfg(priv)->lib->eeprom_ops.update_enhanced_txpower) |
1025 | priv->cfg->lib->eeprom_ops.update_enhanced_txpower(priv); | 1025 | cfg(priv)->lib->eeprom_ops.update_enhanced_txpower(priv); |
1026 | 1026 | ||
1027 | return 0; | 1027 | return 0; |
1028 | } | 1028 | } |