OSDN Git Service

iwlwifi: dbg_ini: add version to dump header
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Sun, 17 Feb 2019 10:16:53 +0000 (12:16 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 3 Apr 2019 08:19:57 +0000 (11:19 +0300)
Add version to dump header to allow future changes of the dump struct,
once the ini debug flow becomes operational, without breaking backwards
compatibility.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h

index 78bca27..81ce8a4 100644 (file)
@@ -1380,6 +1380,8 @@ static void *iwl_dump_ini_mem_fill_header(struct iwl_fw_runtime *fwrt,
 {
        struct iwl_fw_ini_error_dump *dump = data;
 
+       dump->header.version = cpu_to_le32(IWL_INI_DUMP_MEM_VER);
+
        return dump->ranges;
 }
 
@@ -1402,6 +1404,7 @@ static void
                                               MON_BUFF_CYCLE_CNT_VER2);
        iwl_trans_release_nic_access(fwrt->trans, &flags);
 
+       mon_dump->header.version = cpu_to_le32(IWL_INI_DUMP_MONITOR_VER);
        mon_dump->write_ptr = cpu_to_le32(write_ptr);
        mon_dump->cycle_cnt = cpu_to_le32(cycle_cnt);
 
@@ -1414,6 +1417,8 @@ static void *iwl_dump_ini_fifo_fill_header(struct iwl_fw_runtime *fwrt,
 {
        struct iwl_fw_ini_fifo_error_dump *dump = data;
 
+       dump->header.version = cpu_to_le32(IWL_INI_DUMP_FIFO_VER);
+
        return dump->ranges;
 }
 
index ea55130..a233902 100644 (file)
@@ -278,6 +278,10 @@ struct iwl_fw_error_dump_mem {
        u8 data[];
 };
 
+#define IWL_INI_DUMP_MEM_VER 1
+#define IWL_INI_DUMP_MONITOR_VER 1
+#define IWL_INI_DUMP_FIFO_VER 1
+
 /**
  * struct iwl_fw_ini_error_dump_range - range of memory
  * @start_addr: the start address of this range
@@ -292,11 +296,13 @@ struct iwl_fw_ini_error_dump_range {
 
 /**
  * struct iwl_fw_ini_error_dump_header - ini region dump header
+ * @version: dump version
  * @num_of_ranges: number of ranges in this region
  * @name_len: number of bytes allocated to the name string of this region
  * @name: name of the region
  */
 struct iwl_fw_ini_error_dump_header {
+       __le32 version;
        __le32 num_of_ranges;
        __le32 name_len;
        u8 name[IWL_FW_INI_MAX_NAME];