aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Gottlieb <matti.gottlieb@intel.com>2015-11-02 06:01:54 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-11-26 09:38:49 -0500
commit9a57f650d0c95b827cb795e69d824accda045a9d (patch)
tree6f79727240e5a45e3476b4a42f763c87bedcbd1a
parent72a3356885d13c4dd0b41034b931e3d5a0f807cc (diff)
iwlwifi: mvm: check FW's response for nvm access write cmd
In case of using an external NVM file, the driver sends to the FW the different nvm sections. In the response of the cmd, the FW states the status of the writing of the chunk. Currently the value is not checked by the driver. Check FW's response for writing the nvm chunk in the NVM_ACCESS_CMD. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/nvm.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 1edcfcc459f4..a9fcb15e9d1a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -104,13 +104,35 @@ static int iwl_nvm_write_chunk(struct iwl_mvm *mvm, u16 section,
104 struct iwl_host_cmd cmd = { 104 struct iwl_host_cmd cmd = {
105 .id = NVM_ACCESS_CMD, 105 .id = NVM_ACCESS_CMD,
106 .len = { sizeof(struct iwl_nvm_access_cmd), length }, 106 .len = { sizeof(struct iwl_nvm_access_cmd), length },
107 .flags = CMD_SEND_IN_RFKILL, 107 .flags = CMD_WANT_SKB | CMD_SEND_IN_RFKILL,
108 .data = { &nvm_access_cmd, data }, 108 .data = { &nvm_access_cmd, data },
109 /* data may come from vmalloc, so use _DUP */ 109 /* data may come from vmalloc, so use _DUP */
110 .dataflags = { 0, IWL_HCMD_DFL_DUP }, 110 .dataflags = { 0, IWL_HCMD_DFL_DUP },
111 }; 111 };
112 struct iwl_rx_packet *pkt;
113 struct iwl_nvm_access_resp *nvm_resp;
114 int ret;
115
116 ret = iwl_mvm_send_cmd(mvm, &cmd);
117 if (ret)
118 return ret;
112 119
113 return iwl_mvm_send_cmd(mvm, &cmd); 120 pkt = cmd.resp_pkt;
121 if (!pkt) {
122 IWL_ERR(mvm, "Error in NVM_ACCESS response\n");
123 return -EINVAL;
124 }
125 /* Extract & check NVM write response */
126 nvm_resp = (void *)pkt->data;
127 if (le16_to_cpu(nvm_resp->status) != READ_NVM_CHUNK_SUCCEED) {
128 IWL_ERR(mvm,
129 "NVM access write command failed for section %u (status = 0x%x)\n",
130 section, le16_to_cpu(nvm_resp->status));
131 ret = -EIO;
132 }
133
134 iwl_free_resp(&cmd);
135 return ret;
114} 136}
115 137
116static int iwl_nvm_read_chunk(struct iwl_mvm *mvm, u16 section, 138static int iwl_nvm_read_chunk(struct iwl_mvm *mvm, u16 section,