diff options
author | Sara Sharon <sara.sharon@intel.com> | 2016-03-01 05:18:22 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2016-03-07 06:33:00 -0500 |
commit | afd5b1704cb15eabc4358b7b0dd7f33099408eaa (patch) | |
tree | 5e1d9e2c485d5f8aa700f857fb7faaa184cb8f38 /drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | |
parent | 91f66a3c672065a3aca387ca7e0028504bb8f457 (diff) |
iwlwifi: refactor the code that reads the MAC address from the NVM
It makes it slightly easier to follow. Pass the pointer to
the transport which allows to read WFMP_MAC_ADDR_X register
only when needed and to use IWL_ERR instead of the less
commonly used IWL_ERR_DEV logger macro.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/nvm.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c index c446e0da9789..25a98401a64f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | |||
@@ -300,7 +300,6 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
300 | struct iwl_nvm_section *sections = mvm->nvm_sections; | 300 | struct iwl_nvm_section *sections = mvm->nvm_sections; |
301 | const __le16 *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; | 301 | const __le16 *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; |
302 | bool lar_enabled; | 302 | bool lar_enabled; |
303 | __le32 mac_addr0, mac_addr1; | ||
304 | 303 | ||
305 | /* Checking for required sections */ | 304 | /* Checking for required sections */ |
306 | if (mvm->trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) { | 305 | if (mvm->trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) { |
@@ -336,12 +335,6 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
336 | if (WARN_ON(!mvm->cfg)) | 335 | if (WARN_ON(!mvm->cfg)) |
337 | return NULL; | 336 | return NULL; |
338 | 337 | ||
339 | /* read the mac address from WFMP registers */ | ||
340 | mac_addr0 = cpu_to_le32(iwl_trans_read_prph(mvm->trans, | ||
341 | WFMP_MAC_ADDR_0)); | ||
342 | mac_addr1 = cpu_to_le32(iwl_trans_read_prph(mvm->trans, | ||
343 | WFMP_MAC_ADDR_1)); | ||
344 | |||
345 | hw = (const __le16 *)sections[mvm->cfg->nvm_hw_section_num].data; | 338 | hw = (const __le16 *)sections[mvm->cfg->nvm_hw_section_num].data; |
346 | sw = (const __le16 *)sections[NVM_SECTION_TYPE_SW].data; | 339 | sw = (const __le16 *)sections[NVM_SECTION_TYPE_SW].data; |
347 | calib = (const __le16 *)sections[NVM_SECTION_TYPE_CALIBRATION].data; | 340 | calib = (const __le16 *)sections[NVM_SECTION_TYPE_CALIBRATION].data; |
@@ -354,10 +347,10 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
354 | fw_has_capa(&mvm->fw->ucode_capa, | 347 | fw_has_capa(&mvm->fw->ucode_capa, |
355 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); | 348 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
356 | 349 | ||
357 | return iwl_parse_nvm_data(mvm->trans->dev, mvm->cfg, hw, sw, calib, | 350 | return iwl_parse_nvm_data(mvm->trans, mvm->cfg, hw, sw, calib, |
358 | regulatory, mac_override, phy_sku, | 351 | regulatory, mac_override, phy_sku, |
359 | mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant, | 352 | mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant, |
360 | lar_enabled, mac_addr0, mac_addr1); | 353 | lar_enabled); |
361 | } | 354 | } |
362 | 355 | ||
363 | #define MAX_NVM_FILE_LEN 16384 | 356 | #define MAX_NVM_FILE_LEN 16384 |