summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorMatti Gottlieb <matti.gottlieb@intel.com>2013-07-04 14:47:30 +0300
committerJohannes Berg <johannes.berg@intel.com>2013-07-16 13:15:03 +0300
commit0c393d4eac31912ad6ea362d4f9bf78aa1fe9a69 (patch)
tree420c70be14c87d5c47d7e35f66b968fb491d7536 /drivers/net/wireless/iwlwifi/mvm/utils.c
parent961de6a5ee568881321cf97e826cc37e6f9bcf84 (diff)
downloadop-kernel-dev-0c393d4eac31912ad6ea362d4f9bf78aa1fe9a69.zip
op-kernel-dev-0c393d4eac31912ad6ea362d4f9bf78aa1fe9a69.tar.gz
iwlwifi: mvm: sram hex dump on NIC error
Add sram dump on NIC error for debug improvement. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index 1e13328..a9c3574 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -453,6 +453,29 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
IWL_ERR(mvm, "0x%08X | flow_handler\n", table.flow_handler);
}
+void iwl_mvm_dump_sram(struct iwl_mvm *mvm)
+{
+ const struct fw_img *img;
+ int ofs, len = 0;
+ u8 *buf;
+
+ if (!mvm->ucode_loaded)
+ return;
+
+ img = &mvm->fw->img[mvm->cur_ucode];
+ ofs = img->sec[IWL_UCODE_SECTION_DATA].offset;
+ len = img->sec[IWL_UCODE_SECTION_DATA].len;
+
+ buf = kzalloc(len, GFP_KERNEL);
+ if (!buf)
+ return;
+
+ iwl_trans_read_mem_bytes(mvm->trans, ofs, buf, len);
+ iwl_print_hex_error(mvm->trans, buf, len);
+
+ kfree(buf);
+}
+
/**
* iwl_mvm_send_lq_cmd() - Send link quality command
* @init: This command is sent as part of station initialization right
OpenPOWER on IntegriCloud