xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2012-2014, 2018, 2020-2021, 2024-2025 Intel Corporation
4  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6  */
7 #ifndef __iwl_fw_api_alive_h__
8 #define __iwl_fw_api_alive_h__
9 
10 /* alive response is_valid values */
11 #define ALIVE_RESP_UCODE_OK	BIT(0)
12 #define ALIVE_RESP_RFKILL	BIT(1)
13 
14 /* alive response ver_type values */
15 enum {
16 	FW_TYPE_HW = 0,
17 	FW_TYPE_PROT = 1,
18 	FW_TYPE_AP = 2,
19 	FW_TYPE_WOWLAN = 3,
20 	FW_TYPE_TIMING = 4,
21 	FW_TYPE_WIPAN = 5
22 };
23 
24 /* alive response ver_subtype values */
25 enum {
26 	FW_SUBTYPE_FULL_FEATURE = 0,
27 	FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
28 	FW_SUBTYPE_REDUCED = 2,
29 	FW_SUBTYPE_ALIVE_ONLY = 3,
30 	FW_SUBTYPE_WOWLAN = 4,
31 	FW_SUBTYPE_AP_SUBTYPE = 5,
32 	FW_SUBTYPE_WIPAN = 6,
33 	FW_SUBTYPE_INITIALIZE = 9
34 };
35 
36 #define IWL_ALIVE_STATUS_ERR 0xDEAD
37 #define IWL_ALIVE_STATUS_OK 0xCAFE
38 
39 #define IWL_ALIVE_FLG_RFKILL	BIT(0)
40 
41 struct iwl_lmac_debug_addrs {
42 	__le32 error_event_table_ptr;	/* SRAM address for error log */
43 	__le32 log_event_table_ptr;	/* SRAM address for LMAC event log */
44 	__le32 cpu_register_ptr;
45 	__le32 dbgm_config_ptr;
46 	__le32 alive_counter_ptr;
47 	__le32 scd_base_ptr;		/* SRAM address for SCD */
48 	__le32 st_fwrd_addr;		/* pointer to Store and forward */
49 	__le32 st_fwrd_size;
50 } __packed; /* UCODE_DEBUG_ADDRS_API_S_VER_2 */
51 
52 struct iwl_lmac_alive {
53 	__le32 ucode_major;
54 	__le32 ucode_minor;
55 	u8 ver_subtype;
56 	u8 ver_type;
57 	u8 mac;
58 	u8 opt;
59 	__le32 timestamp;
60 	struct iwl_lmac_debug_addrs dbg_ptrs;
61 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
62 
63 struct iwl_umac_debug_addrs {
64 	__le32 error_info_addr;		/* SRAM address for UMAC error log */
65 	__le32 dbg_print_buff_addr;
66 } __packed; /* UMAC_DEBUG_ADDRS_API_S_VER_1 */
67 
68 struct iwl_umac_alive {
69 	__le32 umac_major;		/* UMAC version: major */
70 	__le32 umac_minor;		/* UMAC version: minor */
71 	struct iwl_umac_debug_addrs dbg_ptrs;
72 } __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
73 
74 struct iwl_sku_id {
75 	__le32 data[3];
76 } __packed; /* SKU_ID_API_S_VER_1 */
77 
78 struct iwl_alive_ntf_v3 {
79 	__le16 status;
80 	__le16 flags;
81 	struct iwl_lmac_alive lmac_data;
82 	struct iwl_umac_alive umac_data;
83 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
84 
85 struct iwl_imr_alive_info {
86 	__le64 base_addr;
87 	__le32 size;
88 	__le32 enabled;
89 } __packed; /* IMR_ALIVE_INFO_API_S_VER_1 */
90 
91 struct iwl_alive_ntf_v6 {
92 	__le16 status;
93 	__le16 flags;
94 	struct iwl_lmac_alive lmac_data[2];
95 	struct iwl_umac_alive umac_data;
96 	struct iwl_sku_id sku_id;
97 	struct iwl_imr_alive_info imr;
98 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_6 */
99 
100 struct iwl_alive_ntf {
101 	__le16 status;
102 	__le16 flags;
103 	struct iwl_lmac_alive lmac_data[2];
104 	struct iwl_umac_alive umac_data;
105 	struct iwl_sku_id sku_id;
106 	struct iwl_imr_alive_info imr;
107 	__le64 platform_id;
108 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_8 */
109 
110 /**
111  * enum iwl_extended_cfg_flags - commands driver may send before
112  *	finishing init flow
113  * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
114  * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
115  * @IWL_INIT_PHY: driver is going to send the PHY_CONFIGURATION_CMD
116  */
117 enum iwl_extended_cfg_flags {
118 	IWL_INIT_DEBUG_CFG,
119 	IWL_INIT_NVM,
120 	IWL_INIT_PHY,
121 };
122 
123 /**
124  * struct iwl_init_extended_cfg_cmd - mark what commands ucode should wait for
125  * before finishing init flows
126  * @init_flags: values from iwl_extended_cfg_flags
127  */
128 struct iwl_init_extended_cfg_cmd {
129 	__le32 init_flags;
130 } __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
131 
132 /**
133  * struct iwl_radio_version_notif - information on the radio version
134  * ( RADIO_VERSION_NOTIFICATION = 0x68 )
135  * @radio_flavor: radio flavor
136  * @radio_step: radio version step
137  * @radio_dash: radio version dash
138  */
139 struct iwl_radio_version_notif {
140 	__le32 radio_flavor;
141 	__le32 radio_step;
142 	__le32 radio_dash;
143 } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
144 
145 enum iwl_card_state_flags {
146 	CARD_ENABLED		= 0x00,
147 	HW_CARD_DISABLED	= 0x01,
148 	SW_CARD_DISABLED	= 0x02,
149 	CT_KILL_CARD_DISABLED	= 0x04,
150 	HALT_CARD_DISABLED	= 0x08,
151 	CARD_DISABLED_MSK	= 0x0f,
152 	CARD_IS_RX_ON		= 0x10,
153 };
154 
155 /**
156  * enum iwl_error_recovery_flags - flags for error recovery cmd
157  * @ERROR_RECOVERY_UPDATE_DB: update db from blob sent
158  * @ERROR_RECOVERY_END_OF_RECOVERY: end of recovery
159  */
160 enum iwl_error_recovery_flags {
161 	ERROR_RECOVERY_UPDATE_DB = BIT(0),
162 	ERROR_RECOVERY_END_OF_RECOVERY = BIT(1),
163 };
164 
165 /**
166  * struct iwl_fw_error_recovery_cmd - recovery cmd sent upon assert
167  * @flags: &enum iwl_error_recovery_flags
168  * @buf_size: db buffer size in bytes
169  */
170 struct iwl_fw_error_recovery_cmd {
171 	__le32 flags;
172 	__le32 buf_size;
173 } __packed; /* ERROR_RECOVERY_CMD_HDR_API_S_VER_1 */
174 
175 #endif /* __iwl_fw_api_alive_h__ */
176