iwlwifi: mvm: Prioritize external nvm values on top of the OTP values
authorEran Harary <[email protected]>
Tue, 25 Mar 2014 12:14:44 +0000 (14:14 +0200)
committerEmmanuel Grumbach <[email protected]>
Tue, 6 May 2014 17:40:02 +0000 (20:40 +0300)
Read first the nvm sections from the OTP, then read the nvm
sections from the external file and override the OTP values
(if there were any values in the OTP).

Signed-off-by: Eran Harary <[email protected]>
Reviewed-by: Dor Shaish <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
drivers/net/wireless/iwlwifi/mvm/nvm.c

index fe4c91e7c27c6962ac52ee655f9e9db0fd361e08..2cb6c29b0a9755644ee90ffd77714f19f141c9d2 100644 (file)
@@ -437,14 +437,7 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
        if (WARN_ON_ONCE(mvm->cfg->nvm_hw_section_num >= NVM_MAX_NUM_SECTIONS))
                return -EINVAL;
 
-       /* load external NVM if configured */
-       if (iwlwifi_mod_params.nvm_file) {
-               /* move to External NVM flow */
-               ret = iwl_mvm_read_external_nvm(mvm);
-               if (ret)
-                       return ret;
-       }
-
+       /* load NVM values from nic */
        if (read_nvm_from_nic) {
                /* list of NVM sections we are allowed/need to read */
                if (mvm->trans->cfg->device_family != IWL_DEVICE_FAMILY_8000) {
@@ -512,6 +505,15 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
                        return ret;
        }
 
+       /* load external NVM if configured */
+       if (iwlwifi_mod_params.nvm_file) {
+               /* move to External NVM flow */
+               ret = iwl_mvm_read_external_nvm(mvm);
+               if (ret)
+                       return ret;
+       }
+
+       /* parse the relevant nvm sections */
        mvm->nvm_data = iwl_parse_nvm_sections(mvm);
        if (!mvm->nvm_data)
                return -ENODATA;