| .. | .. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * GPL LICENSE SUMMARY |
|---|
| 7 | 7 | * |
|---|
| 8 | | - * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. |
|---|
| 9 | 8 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 10 | 9 | * Copyright(c) 2016 Intel Deutschland GmbH |
|---|
| 11 | | - * Copyright(c) 2018 Intel Corporation |
|---|
| 10 | + * Copyright(c) 2008 - 2014, 2018 - 2020 Intel Corporation |
|---|
| 12 | 11 | * |
|---|
| 13 | 12 | * This program is free software; you can redistribute it and/or modify |
|---|
| 14 | 13 | * it under the terms of version 2 of the GNU General Public License as |
|---|
| .. | .. |
|---|
| 18 | 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 19 | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 20 | 19 | * 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 |
|---|
| 26 | 20 | * |
|---|
| 27 | 21 | * The full GNU General Public License is included in this distribution |
|---|
| 28 | 22 | * in the file called COPYING. |
|---|
| .. | .. |
|---|
| 36 | 30 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
|---|
| 37 | 31 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 38 | 32 | * Copyright(c) 2016 Intel Deutschland GmbH |
|---|
| 39 | | - * Copyright(c) 2018 Intel Corporation |
|---|
| 33 | + * Copyright(c) 2008 - 2014, 2018 - 2020 Intel Corporation |
|---|
| 40 | 34 | * All rights reserved. |
|---|
| 41 | 35 | * |
|---|
| 42 | 36 | * Redistribution and use in source and binary forms, with or without |
|---|
| .. | .. |
|---|
| 69 | 63 | #ifndef __iwl_fw_img_h__ |
|---|
| 70 | 64 | #define __iwl_fw_img_h__ |
|---|
| 71 | 65 | #include <linux/types.h> |
|---|
| 66 | + |
|---|
| 67 | +#include "api/dbg-tlv.h" |
|---|
| 72 | 68 | |
|---|
| 73 | 69 | #include "file.h" |
|---|
| 74 | 70 | #include "error-dump.h" |
|---|
| .. | .. |
|---|
| 108 | 104 | u32 n_scan_channels; |
|---|
| 109 | 105 | u32 standard_phy_calibration_size; |
|---|
| 110 | 106 | u32 flags; |
|---|
| 107 | + u32 error_log_addr; |
|---|
| 108 | + u32 error_log_size; |
|---|
| 109 | + u32 num_stations; |
|---|
| 111 | 110 | unsigned long _api[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_API)]; |
|---|
| 112 | 111 | 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; |
|---|
| 113 | 115 | }; |
|---|
| 114 | 116 | |
|---|
| 115 | 117 | static inline bool |
|---|
| .. | .. |
|---|
| 203 | 205 | }; |
|---|
| 204 | 206 | |
|---|
| 205 | 207 | /** |
|---|
| 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 | +/** |
|---|
| 206 | 231 | * struct iwl_fw - variables associated with the firmware |
|---|
| 207 | 232 | * |
|---|
| 208 | 233 | * @ucode_ver: ucode version from the ucode file |
|---|
| .. | .. |
|---|
| 222 | 247 | * @cipher_scheme: optional external cipher scheme. |
|---|
| 223 | 248 | * @human_readable: human readable version |
|---|
| 224 | 249 | * 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 |
|---|
| 231 | 250 | */ |
|---|
| 232 | 251 | struct iwl_fw { |
|---|
| 233 | 252 | u32 ucode_ver; |
|---|
| 234 | 253 | |
|---|
| 235 | | - char fw_version[ETHTOOL_FWVERS_LEN]; |
|---|
| 254 | + char fw_version[64]; |
|---|
| 236 | 255 | |
|---|
| 237 | 256 | /* ucode images */ |
|---|
| 238 | 257 | struct fw_img img[IWL_UCODE_TYPE_MAX]; |
|---|
| .. | .. |
|---|
| 255 | 274 | struct iwl_fw_cipher_scheme cs[IWL_UCODE_MAX_CS]; |
|---|
| 256 | 275 | u8 human_readable[FW_VER_HUMAN_READABLE_SZ]; |
|---|
| 257 | 276 | |
|---|
| 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; |
|---|
| 267 | 278 | }; |
|---|
| 268 | 279 | |
|---|
| 269 | 280 | static inline const char *get_fw_dbg_mode_string(int mode) |
|---|
| .. | .. |
|---|
| 285 | 296 | static inline bool |
|---|
| 286 | 297 | iwl_fw_dbg_conf_usniffer(const struct iwl_fw *fw, u8 id) |
|---|
| 287 | 298 | { |
|---|
| 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]; |
|---|
| 289 | 300 | |
|---|
| 290 | 301 | if (!conf_tlv) |
|---|
| 291 | 302 | return false; |
|---|
| .. | .. |
|---|
| 302 | 313 | return &fw->img[ucode_type]; |
|---|
| 303 | 314 | } |
|---|
| 304 | 315 | |
|---|
| 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); |
|---|
| 305 | 320 | #endif /* __iwl_fw_img_h__ */ |
|---|