hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/wireless/intel/iwlwifi/fw/img.h
....@@ -5,10 +5,9 @@
55 *
66 * GPL LICENSE SUMMARY
77 *
8
- * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
98 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
109 * Copyright(c) 2016 Intel Deutschland GmbH
11
- * Copyright(c) 2018 Intel Corporation
10
+ * Copyright(c) 2008 - 2014, 2018 - 2020 Intel Corporation
1211 *
1312 * This program is free software; you can redistribute it and/or modify
1413 * it under the terms of version 2 of the GNU General Public License as
....@@ -18,11 +17,6 @@
1817 * WITHOUT ANY WARRANTY; without even the implied warranty of
1918 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2019 * General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; if not, write to the Free Software
24
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25
- * USA
2620 *
2721 * The full GNU General Public License is included in this distribution
2822 * in the file called COPYING.
....@@ -36,7 +30,7 @@
3630 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3731 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3832 * Copyright(c) 2016 Intel Deutschland GmbH
39
- * Copyright(c) 2018 Intel Corporation
33
+ * Copyright(c) 2008 - 2014, 2018 - 2020 Intel Corporation
4034 * All rights reserved.
4135 *
4236 * Redistribution and use in source and binary forms, with or without
....@@ -69,6 +63,8 @@
6963 #ifndef __iwl_fw_img_h__
7064 #define __iwl_fw_img_h__
7165 #include <linux/types.h>
66
+
67
+#include "api/dbg-tlv.h"
7268
7369 #include "file.h"
7470 #include "error-dump.h"
....@@ -108,8 +104,14 @@
108104 u32 n_scan_channels;
109105 u32 standard_phy_calibration_size;
110106 u32 flags;
107
+ u32 error_log_addr;
108
+ u32 error_log_size;
109
+ u32 num_stations;
111110 unsigned long _api[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_API)];
112111 unsigned long _capa[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_CAPA)];
112
+
113
+ const struct iwl_fw_cmd_version *cmd_versions;
114
+ u32 n_cmd_versions;
113115 };
114116
115117 static inline bool
....@@ -203,6 +205,29 @@
203205 };
204206
205207 /**
208
+ * struct iwl_fw_dbg - debug data
209
+ *
210
+ * @dest_tlv: points to debug destination TLV (typically SRAM or DRAM)
211
+ * @n_dest_reg: num of reg_ops in dest_tlv
212
+ * @conf_tlv: array of pointers to configuration HCMDs
213
+ * @trigger_tlv: array of pointers to triggers TLVs
214
+ * @trigger_tlv_len: lengths of the @dbg_trigger_tlv entries
215
+ * @mem_tlv: Runtime addresses to dump
216
+ * @n_mem_tlv: number of runtime addresses
217
+ * @dump_mask: bitmask of dump regions
218
+*/
219
+struct iwl_fw_dbg {
220
+ struct iwl_fw_dbg_dest_tlv_v1 *dest_tlv;
221
+ u8 n_dest_reg;
222
+ struct iwl_fw_dbg_conf_tlv *conf_tlv[FW_DBG_CONF_MAX];
223
+ struct iwl_fw_dbg_trigger_tlv *trigger_tlv[FW_DBG_TRIGGER_MAX];
224
+ size_t trigger_tlv_len[FW_DBG_TRIGGER_MAX];
225
+ struct iwl_fw_dbg_mem_seg_tlv *mem_tlv;
226
+ size_t n_mem_tlv;
227
+ u32 dump_mask;
228
+};
229
+
230
+/**
206231 * struct iwl_fw - variables associated with the firmware
207232 *
208233 * @ucode_ver: ucode version from the ucode file
....@@ -222,17 +247,11 @@
222247 * @cipher_scheme: optional external cipher scheme.
223248 * @human_readable: human readable version
224249 * we get the ALIVE from the uCode
225
- * @dbg_dest_tlv: points to the destination TLV for debug
226
- * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
227
- * @dbg_conf_tlv_len: lengths of the @dbg_conf_tlv entries
228
- * @dbg_trigger_tlv: array of pointers to triggers TLVs
229
- * @dbg_trigger_tlv_len: lengths of the @dbg_trigger_tlv entries
230
- * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv
231250 */
232251 struct iwl_fw {
233252 u32 ucode_ver;
234253
235
- char fw_version[ETHTOOL_FWVERS_LEN];
254
+ char fw_version[64];
236255
237256 /* ucode images */
238257 struct fw_img img[IWL_UCODE_TYPE_MAX];
....@@ -255,15 +274,7 @@
255274 struct iwl_fw_cipher_scheme cs[IWL_UCODE_MAX_CS];
256275 u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
257276
258
- struct iwl_fw_dbg_dest_tlv_v1 *dbg_dest_tlv;
259
- struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX];
260
- size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX];
261
- struct iwl_fw_dbg_trigger_tlv *dbg_trigger_tlv[FW_DBG_TRIGGER_MAX];
262
- struct iwl_fw_dbg_mem_seg_tlv *dbg_mem_tlv;
263
- size_t n_dbg_mem_tlv;
264
- size_t dbg_trigger_tlv_len[FW_DBG_TRIGGER_MAX];
265
- u8 dbg_dest_reg_num;
266
- u32 dbg_dump_mask;
277
+ struct iwl_fw_dbg dbg;
267278 };
268279
269280 static inline const char *get_fw_dbg_mode_string(int mode)
....@@ -285,7 +296,7 @@
285296 static inline bool
286297 iwl_fw_dbg_conf_usniffer(const struct iwl_fw *fw, u8 id)
287298 {
288
- const struct iwl_fw_dbg_conf_tlv *conf_tlv = fw->dbg_conf_tlv[id];
299
+ const struct iwl_fw_dbg_conf_tlv *conf_tlv = fw->dbg.conf_tlv[id];
289300
290301 if (!conf_tlv)
291302 return false;
....@@ -302,4 +313,8 @@
302313 return &fw->img[ucode_type];
303314 }
304315
316
+u8 iwl_fw_lookup_cmd_ver(const struct iwl_fw *fw, u8 grp, u8 cmd, u8 def);
317
+
318
+u8 iwl_fw_lookup_notif_ver(const struct iwl_fw *fw, u8 grp, u8 cmd, u8 def);
319
+const char *iwl_fw_lookup_assert_desc(u32 num);
305320 #endif /* __iwl_fw_img_h__ */