Commit f6aa45f6 authored by Liad Kaufman's avatar Liad Kaufman Committed by Luca Coelho

iwlwifi: mvm: support fw reading empty OTP

If the OTP is empty, the NVM_GET_INFO command returns
with flags' bit(0) on. This means the FW returns the
default values for working with. This is allowed, so
use this returned data.

Fixes: e9e1ba3d ("iwlwifi: mvm: support getting nvm data from firmware")
Signed-off-by: default avatarLiad Kaufman <liad.kaufman@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent c1b68c19
...@@ -163,9 +163,17 @@ struct iwl_nvm_get_info { ...@@ -163,9 +163,17 @@ struct iwl_nvm_get_info {
__le32 reserved; __le32 reserved;
} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */ } __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
/**
* enum iwl_nvm_info_general_flags - flags in NVM_GET_INFO resp
* @NVM_GENERAL_FLAGS_EMPTY_OTP: 1 if OTP is empty
*/
enum iwl_nvm_info_general_flags {
NVM_GENERAL_FLAGS_EMPTY_OTP = BIT(0),
};
/** /**
* struct iwl_nvm_get_info_general - general NVM data * struct iwl_nvm_get_info_general - general NVM data
* @flags: 1 - empty, 0 - valid * @flags: bit 0: 1 - empty, 0 - non-empty
* @nvm_version: nvm version * @nvm_version: nvm version
* @board_type: board type * @board_type: board type
* @reserved: reserved * @reserved: reserved
......
...@@ -576,11 +576,8 @@ int iwl_mvm_nvm_get_from_fw(struct iwl_mvm *mvm) ...@@ -576,11 +576,8 @@ int iwl_mvm_nvm_get_from_fw(struct iwl_mvm *mvm)
} }
rsp = (void *)hcmd.resp_pkt->data; rsp = (void *)hcmd.resp_pkt->data;
if (le32_to_cpu(rsp->general.flags)) { if (le32_to_cpu(rsp->general.flags) & NVM_GENERAL_FLAGS_EMPTY_OTP)
IWL_ERR(mvm, "Invalid NVM data from FW\n"); IWL_INFO(mvm, "OTP is empty\n");
ret = -EINVAL;
goto out;
}
mvm->nvm_data = kzalloc(sizeof(*mvm->nvm_data) + mvm->nvm_data = kzalloc(sizeof(*mvm->nvm_data) +
sizeof(struct ieee80211_channel) * sizeof(struct ieee80211_channel) *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment