]> Pileus Git - ~andy/linux/blobdiff - drivers/net/wireless/iwlwifi/mvm/utils.c
iwlwifi: mvm: sram hex dump on NIC error
[~andy/linux] / drivers / net / wireless / iwlwifi / mvm / utils.c
index 1e1332839e4a745b2a57f9d837b112fff52d75bd..a9c3574914348ad3583fd19387a6c48211530f8d 100644 (file)
@@ -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