1 /*
2  * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com>
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef _HAL_H_
18 #define _HAL_H_
19 
20 /*---------------------------------------------------------------------------
21   API VERSIONING INFORMATION
22 
23   The RIVA API is versioned as MAJOR.MINOR.VERSION.REVISION
24   The MAJOR is incremented for major product/architecture changes
25       (and then MINOR/VERSION/REVISION are zeroed)
26   The MINOR is incremented for minor product/architecture changes
27       (and then VERSION/REVISION are zeroed)
28   The VERSION is incremented if a significant API change occurs
29       (and then REVISION is zeroed)
30   The REVISION is incremented if an insignificant API change occurs
31       or if a new API is added
32   All values are in the range 0..255 (ie they are 8-bit values)
33  ---------------------------------------------------------------------------*/
34 #define WCN36XX_HAL_VER_MAJOR 1
35 #define WCN36XX_HAL_VER_MINOR 4
36 #define WCN36XX_HAL_VER_VERSION 1
37 #define WCN36XX_HAL_VER_REVISION 2
38 
39 /* This is to force compiler to use the maximum of an int ( 4 bytes ) */
40 #define WCN36XX_HAL_MAX_ENUM_SIZE    0x7FFFFFFF
41 #define WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE    0x7FFF
42 
43 /* Max no. of transmit categories */
44 #define STACFG_MAX_TC    8
45 
46 /* The maximum value of access category */
47 #define WCN36XX_HAL_MAX_AC  4
48 
49 #define WCN36XX_HAL_IPV4_ADDR_LEN       4
50 
51 #define WCN36XX_HAL_STA_INVALID_IDX 0xFF
52 #define WCN36XX_HAL_BSS_INVALID_IDX 0xFF
53 
54 /* Default Beacon template size */
55 #define BEACON_TEMPLATE_SIZE 0x180
56 
57 /* Minimum PVM size that the FW expects. See comment in smd.c for details. */
58 #define TIM_MIN_PVM_SIZE 6
59 
60 /* Param Change Bitmap sent to HAL */
61 #define PARAM_BCN_INTERVAL_CHANGED                      (1 << 0)
62 #define PARAM_SHORT_PREAMBLE_CHANGED                 (1 << 1)
63 #define PARAM_SHORT_SLOT_TIME_CHANGED                 (1 << 2)
64 #define PARAM_llACOEXIST_CHANGED                            (1 << 3)
65 #define PARAM_llBCOEXIST_CHANGED                            (1 << 4)
66 #define PARAM_llGCOEXIST_CHANGED                            (1 << 5)
67 #define PARAM_HT20MHZCOEXIST_CHANGED                  (1<<6)
68 #define PARAM_NON_GF_DEVICES_PRESENT_CHANGED (1<<7)
69 #define PARAM_RIFS_MODE_CHANGED                            (1<<8)
70 #define PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED   (1<<9)
71 #define PARAM_OBSS_MODE_CHANGED                               (1<<10)
72 #define PARAM_BEACON_UPDATE_MASK \
73 	(PARAM_BCN_INTERVAL_CHANGED |					\
74 	 PARAM_SHORT_PREAMBLE_CHANGED |					\
75 	 PARAM_SHORT_SLOT_TIME_CHANGED |				\
76 	 PARAM_llACOEXIST_CHANGED |					\
77 	 PARAM_llBCOEXIST_CHANGED |					\
78 	 PARAM_llGCOEXIST_CHANGED |					\
79 	 PARAM_HT20MHZCOEXIST_CHANGED |					\
80 	 PARAM_NON_GF_DEVICES_PRESENT_CHANGED |				\
81 	 PARAM_RIFS_MODE_CHANGED |					\
82 	 PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED |				\
83 	 PARAM_OBSS_MODE_CHANGED)
84 
85 /* dump command response Buffer size */
86 #define DUMPCMD_RSP_BUFFER 100
87 
88 /* version string max length (including NULL) */
89 #define WCN36XX_HAL_VERSION_LENGTH  64
90 
91 /* How many frames until we start a-mpdu TX session */
92 #define WCN36XX_AMPDU_START_THRESH	20
93 
94 #define WCN36XX_MAX_SCAN_SSIDS		9
95 #define WCN36XX_MAX_SCAN_IE_LEN		500
96 
97 /* message types for messages exchanged between WDI and HAL */
98 enum wcn36xx_hal_host_msg_type {
99 	/* Init/De-Init */
100 	WCN36XX_HAL_START_REQ = 0,
101 	WCN36XX_HAL_START_RSP = 1,
102 	WCN36XX_HAL_STOP_REQ = 2,
103 	WCN36XX_HAL_STOP_RSP = 3,
104 
105 	/* Scan */
106 	WCN36XX_HAL_INIT_SCAN_REQ = 4,
107 	WCN36XX_HAL_INIT_SCAN_RSP = 5,
108 	WCN36XX_HAL_START_SCAN_REQ = 6,
109 	WCN36XX_HAL_START_SCAN_RSP = 7,
110 	WCN36XX_HAL_END_SCAN_REQ = 8,
111 	WCN36XX_HAL_END_SCAN_RSP = 9,
112 	WCN36XX_HAL_FINISH_SCAN_REQ = 10,
113 	WCN36XX_HAL_FINISH_SCAN_RSP = 11,
114 
115 	/* HW STA configuration/deconfiguration */
116 	WCN36XX_HAL_CONFIG_STA_REQ = 12,
117 	WCN36XX_HAL_CONFIG_STA_RSP = 13,
118 	WCN36XX_HAL_DELETE_STA_REQ = 14,
119 	WCN36XX_HAL_DELETE_STA_RSP = 15,
120 	WCN36XX_HAL_CONFIG_BSS_REQ = 16,
121 	WCN36XX_HAL_CONFIG_BSS_RSP = 17,
122 	WCN36XX_HAL_DELETE_BSS_REQ = 18,
123 	WCN36XX_HAL_DELETE_BSS_RSP = 19,
124 
125 	/* Infra STA asscoiation */
126 	WCN36XX_HAL_JOIN_REQ = 20,
127 	WCN36XX_HAL_JOIN_RSP = 21,
128 	WCN36XX_HAL_POST_ASSOC_REQ = 22,
129 	WCN36XX_HAL_POST_ASSOC_RSP = 23,
130 
131 	/* Security */
132 	WCN36XX_HAL_SET_BSSKEY_REQ = 24,
133 	WCN36XX_HAL_SET_BSSKEY_RSP = 25,
134 	WCN36XX_HAL_SET_STAKEY_REQ = 26,
135 	WCN36XX_HAL_SET_STAKEY_RSP = 27,
136 	WCN36XX_HAL_RMV_BSSKEY_REQ = 28,
137 	WCN36XX_HAL_RMV_BSSKEY_RSP = 29,
138 	WCN36XX_HAL_RMV_STAKEY_REQ = 30,
139 	WCN36XX_HAL_RMV_STAKEY_RSP = 31,
140 
141 	/* Qos Related */
142 	WCN36XX_HAL_ADD_TS_REQ = 32,
143 	WCN36XX_HAL_ADD_TS_RSP = 33,
144 	WCN36XX_HAL_DEL_TS_REQ = 34,
145 	WCN36XX_HAL_DEL_TS_RSP = 35,
146 	WCN36XX_HAL_UPD_EDCA_PARAMS_REQ = 36,
147 	WCN36XX_HAL_UPD_EDCA_PARAMS_RSP = 37,
148 	WCN36XX_HAL_ADD_BA_REQ = 38,
149 	WCN36XX_HAL_ADD_BA_RSP = 39,
150 	WCN36XX_HAL_DEL_BA_REQ = 40,
151 	WCN36XX_HAL_DEL_BA_RSP = 41,
152 
153 	WCN36XX_HAL_CH_SWITCH_REQ = 42,
154 	WCN36XX_HAL_CH_SWITCH_RSP = 43,
155 	WCN36XX_HAL_SET_LINK_ST_REQ = 44,
156 	WCN36XX_HAL_SET_LINK_ST_RSP = 45,
157 	WCN36XX_HAL_GET_STATS_REQ = 46,
158 	WCN36XX_HAL_GET_STATS_RSP = 47,
159 	WCN36XX_HAL_UPDATE_CFG_REQ = 48,
160 	WCN36XX_HAL_UPDATE_CFG_RSP = 49,
161 
162 	WCN36XX_HAL_MISSED_BEACON_IND = 50,
163 	WCN36XX_HAL_UNKNOWN_ADDR2_FRAME_RX_IND = 51,
164 	WCN36XX_HAL_MIC_FAILURE_IND = 52,
165 	WCN36XX_HAL_FATAL_ERROR_IND = 53,
166 	WCN36XX_HAL_SET_KEYDONE_MSG = 54,
167 
168 	/* NV Interface */
169 	WCN36XX_HAL_DOWNLOAD_NV_REQ = 55,
170 	WCN36XX_HAL_DOWNLOAD_NV_RSP = 56,
171 
172 	WCN36XX_HAL_ADD_BA_SESSION_REQ = 57,
173 	WCN36XX_HAL_ADD_BA_SESSION_RSP = 58,
174 	WCN36XX_HAL_TRIGGER_BA_REQ = 59,
175 	WCN36XX_HAL_TRIGGER_BA_RSP = 60,
176 	WCN36XX_HAL_UPDATE_BEACON_REQ = 61,
177 	WCN36XX_HAL_UPDATE_BEACON_RSP = 62,
178 	WCN36XX_HAL_SEND_BEACON_REQ = 63,
179 	WCN36XX_HAL_SEND_BEACON_RSP = 64,
180 
181 	WCN36XX_HAL_SET_BCASTKEY_REQ = 65,
182 	WCN36XX_HAL_SET_BCASTKEY_RSP = 66,
183 	WCN36XX_HAL_DELETE_STA_CONTEXT_IND = 67,
184 	WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ = 68,
185 	WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP = 69,
186 
187 	/* PTT interface support */
188 	WCN36XX_HAL_PROCESS_PTT_REQ = 70,
189 	WCN36XX_HAL_PROCESS_PTT_RSP = 71,
190 
191 	/* BTAMP related events */
192 	WCN36XX_HAL_SIGNAL_BTAMP_EVENT_REQ = 72,
193 	WCN36XX_HAL_SIGNAL_BTAMP_EVENT_RSP = 73,
194 	WCN36XX_HAL_TL_HAL_FLUSH_AC_REQ = 74,
195 	WCN36XX_HAL_TL_HAL_FLUSH_AC_RSP = 75,
196 
197 	WCN36XX_HAL_ENTER_IMPS_REQ = 76,
198 	WCN36XX_HAL_EXIT_IMPS_REQ = 77,
199 	WCN36XX_HAL_ENTER_BMPS_REQ = 78,
200 	WCN36XX_HAL_EXIT_BMPS_REQ = 79,
201 	WCN36XX_HAL_ENTER_UAPSD_REQ = 80,
202 	WCN36XX_HAL_EXIT_UAPSD_REQ = 81,
203 	WCN36XX_HAL_UPDATE_UAPSD_PARAM_REQ = 82,
204 	WCN36XX_HAL_CONFIGURE_RXP_FILTER_REQ = 83,
205 	WCN36XX_HAL_ADD_BCN_FILTER_REQ = 84,
206 	WCN36XX_HAL_REM_BCN_FILTER_REQ = 85,
207 	WCN36XX_HAL_ADD_WOWL_BCAST_PTRN = 86,
208 	WCN36XX_HAL_DEL_WOWL_BCAST_PTRN = 87,
209 	WCN36XX_HAL_ENTER_WOWL_REQ = 88,
210 	WCN36XX_HAL_EXIT_WOWL_REQ = 89,
211 	WCN36XX_HAL_HOST_OFFLOAD_REQ = 90,
212 	WCN36XX_HAL_SET_RSSI_THRESH_REQ = 91,
213 	WCN36XX_HAL_GET_RSSI_REQ = 92,
214 	WCN36XX_HAL_SET_UAPSD_AC_PARAMS_REQ = 93,
215 	WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ = 94,
216 
217 	WCN36XX_HAL_ENTER_IMPS_RSP = 95,
218 	WCN36XX_HAL_EXIT_IMPS_RSP = 96,
219 	WCN36XX_HAL_ENTER_BMPS_RSP = 97,
220 	WCN36XX_HAL_EXIT_BMPS_RSP = 98,
221 	WCN36XX_HAL_ENTER_UAPSD_RSP = 99,
222 	WCN36XX_HAL_EXIT_UAPSD_RSP = 100,
223 	WCN36XX_HAL_SET_UAPSD_AC_PARAMS_RSP = 101,
224 	WCN36XX_HAL_UPDATE_UAPSD_PARAM_RSP = 102,
225 	WCN36XX_HAL_CONFIGURE_RXP_FILTER_RSP = 103,
226 	WCN36XX_HAL_ADD_BCN_FILTER_RSP = 104,
227 	WCN36XX_HAL_REM_BCN_FILTER_RSP = 105,
228 	WCN36XX_HAL_SET_RSSI_THRESH_RSP = 106,
229 	WCN36XX_HAL_HOST_OFFLOAD_RSP = 107,
230 	WCN36XX_HAL_ADD_WOWL_BCAST_PTRN_RSP = 108,
231 	WCN36XX_HAL_DEL_WOWL_BCAST_PTRN_RSP = 109,
232 	WCN36XX_HAL_ENTER_WOWL_RSP = 110,
233 	WCN36XX_HAL_EXIT_WOWL_RSP = 111,
234 	WCN36XX_HAL_RSSI_NOTIFICATION_IND = 112,
235 	WCN36XX_HAL_GET_RSSI_RSP = 113,
236 	WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP = 114,
237 
238 	/* 11k related events */
239 	WCN36XX_HAL_SET_MAX_TX_POWER_REQ = 115,
240 	WCN36XX_HAL_SET_MAX_TX_POWER_RSP = 116,
241 
242 	/* 11R related msgs */
243 	WCN36XX_HAL_AGGR_ADD_TS_REQ = 117,
244 	WCN36XX_HAL_AGGR_ADD_TS_RSP = 118,
245 
246 	/* P2P  WLAN_FEATURE_P2P */
247 	WCN36XX_HAL_SET_P2P_GONOA_REQ = 119,
248 	WCN36XX_HAL_SET_P2P_GONOA_RSP = 120,
249 
250 	/* WLAN Dump commands */
251 	WCN36XX_HAL_DUMP_COMMAND_REQ = 121,
252 	WCN36XX_HAL_DUMP_COMMAND_RSP = 122,
253 
254 	/* OEM_DATA FEATURE SUPPORT */
255 	WCN36XX_HAL_START_OEM_DATA_REQ = 123,
256 	WCN36XX_HAL_START_OEM_DATA_RSP = 124,
257 
258 	/* ADD SELF STA REQ and RSP */
259 	WCN36XX_HAL_ADD_STA_SELF_REQ = 125,
260 	WCN36XX_HAL_ADD_STA_SELF_RSP = 126,
261 
262 	/* DEL SELF STA SUPPORT */
263 	WCN36XX_HAL_DEL_STA_SELF_REQ = 127,
264 	WCN36XX_HAL_DEL_STA_SELF_RSP = 128,
265 
266 	/* Coex Indication */
267 	WCN36XX_HAL_COEX_IND = 129,
268 
269 	/* Tx Complete Indication */
270 	WCN36XX_HAL_OTA_TX_COMPL_IND = 130,
271 
272 	/* Host Suspend/resume messages */
273 	WCN36XX_HAL_HOST_SUSPEND_IND = 131,
274 	WCN36XX_HAL_HOST_RESUME_REQ = 132,
275 	WCN36XX_HAL_HOST_RESUME_RSP = 133,
276 
277 	WCN36XX_HAL_SET_TX_POWER_REQ = 134,
278 	WCN36XX_HAL_SET_TX_POWER_RSP = 135,
279 	WCN36XX_HAL_GET_TX_POWER_REQ = 136,
280 	WCN36XX_HAL_GET_TX_POWER_RSP = 137,
281 
282 	WCN36XX_HAL_P2P_NOA_ATTR_IND = 138,
283 
284 	WCN36XX_HAL_ENABLE_RADAR_DETECT_REQ = 139,
285 	WCN36XX_HAL_ENABLE_RADAR_DETECT_RSP = 140,
286 	WCN36XX_HAL_GET_TPC_REPORT_REQ = 141,
287 	WCN36XX_HAL_GET_TPC_REPORT_RSP = 142,
288 	WCN36XX_HAL_RADAR_DETECT_IND = 143,
289 	WCN36XX_HAL_RADAR_DETECT_INTR_IND = 144,
290 	WCN36XX_HAL_KEEP_ALIVE_REQ = 145,
291 	WCN36XX_HAL_KEEP_ALIVE_RSP = 146,
292 
293 	/* PNO messages */
294 	WCN36XX_HAL_SET_PREF_NETWORK_REQ = 147,
295 	WCN36XX_HAL_SET_PREF_NETWORK_RSP = 148,
296 	WCN36XX_HAL_SET_RSSI_FILTER_REQ = 149,
297 	WCN36XX_HAL_SET_RSSI_FILTER_RSP = 150,
298 	WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ = 151,
299 	WCN36XX_HAL_UPDATE_SCAN_PARAM_RSP = 152,
300 	WCN36XX_HAL_PREF_NETW_FOUND_IND = 153,
301 
302 	WCN36XX_HAL_SET_TX_PER_TRACKING_REQ = 154,
303 	WCN36XX_HAL_SET_TX_PER_TRACKING_RSP = 155,
304 	WCN36XX_HAL_TX_PER_HIT_IND = 156,
305 
306 	WCN36XX_HAL_8023_MULTICAST_LIST_REQ = 157,
307 	WCN36XX_HAL_8023_MULTICAST_LIST_RSP = 158,
308 
309 	WCN36XX_HAL_SET_PACKET_FILTER_REQ = 159,
310 	WCN36XX_HAL_SET_PACKET_FILTER_RSP = 160,
311 	WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_REQ = 161,
312 	WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_RSP = 162,
313 	WCN36XX_HAL_CLEAR_PACKET_FILTER_REQ = 163,
314 	WCN36XX_HAL_CLEAR_PACKET_FILTER_RSP = 164,
315 
316 	/*
317 	 * This is temp fix. Should be removed once Host and Riva code is
318 	 * in sync.
319 	 */
320 	WCN36XX_HAL_INIT_SCAN_CON_REQ = 165,
321 
322 	WCN36XX_HAL_SET_POWER_PARAMS_REQ = 166,
323 	WCN36XX_HAL_SET_POWER_PARAMS_RSP = 167,
324 
325 	WCN36XX_HAL_TSM_STATS_REQ = 168,
326 	WCN36XX_HAL_TSM_STATS_RSP = 169,
327 
328 	/* wake reason indication (WOW) */
329 	WCN36XX_HAL_WAKE_REASON_IND = 170,
330 
331 	/* GTK offload support */
332 	WCN36XX_HAL_GTK_OFFLOAD_REQ = 171,
333 	WCN36XX_HAL_GTK_OFFLOAD_RSP = 172,
334 	WCN36XX_HAL_GTK_OFFLOAD_GETINFO_REQ = 173,
335 	WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP = 174,
336 
337 	WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ = 175,
338 	WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_RSP = 176,
339 	WCN36XX_HAL_EXCLUDE_UNENCRYPTED_IND = 177,
340 
341 	WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ = 178,
342 	WCN36XX_HAL_SET_THERMAL_MITIGATION_RSP = 179,
343 
344 	WCN36XX_HAL_UPDATE_VHT_OP_MODE_REQ = 182,
345 	WCN36XX_HAL_UPDATE_VHT_OP_MODE_RSP = 183,
346 
347 	WCN36XX_HAL_P2P_NOA_START_IND = 184,
348 
349 	WCN36XX_HAL_GET_ROAM_RSSI_REQ = 185,
350 	WCN36XX_HAL_GET_ROAM_RSSI_RSP = 186,
351 
352 	WCN36XX_HAL_CLASS_B_STATS_IND = 187,
353 	WCN36XX_HAL_DEL_BA_IND = 188,
354 	WCN36XX_HAL_DHCP_START_IND = 189,
355 	WCN36XX_HAL_DHCP_STOP_IND = 190,
356 
357 	/* Scan Offload(hw) APIs */
358 	WCN36XX_HAL_START_SCAN_OFFLOAD_REQ = 204,
359 	WCN36XX_HAL_START_SCAN_OFFLOAD_RSP = 205,
360 	WCN36XX_HAL_STOP_SCAN_OFFLOAD_REQ = 206,
361 	WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP = 207,
362 	WCN36XX_HAL_UPDATE_CHANNEL_LIST_REQ = 208,
363 	WCN36XX_HAL_UPDATE_CHANNEL_LIST_RSP = 209,
364 	WCN36XX_HAL_SCAN_OFFLOAD_IND = 210,
365 
366 	WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233,
367 
368 	WCN36XX_HAL_PRINT_REG_INFO_IND = 259,
369 
370 	WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE
371 };
372 
373 /* Enumeration for Version */
374 enum wcn36xx_hal_host_msg_version {
375 	WCN36XX_HAL_MSG_VERSION0 = 0,
376 	WCN36XX_HAL_MSG_VERSION1 = 1,
377 	/* define as 2 bytes data */
378 	WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF,
379 	WCN36XX_HAL_MSG_VERSION_MAX_FIELD = WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION
380 };
381 
382 enum driver_type {
383 	DRIVER_TYPE_PRODUCTION = 0,
384 	DRIVER_TYPE_MFG = 1,
385 	DRIVER_TYPE_DVT = 2,
386 	DRIVER_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
387 };
388 
389 enum wcn36xx_hal_stop_type {
390 	HAL_STOP_TYPE_SYS_RESET,
391 	HAL_STOP_TYPE_SYS_DEEP_SLEEP,
392 	HAL_STOP_TYPE_RF_KILL,
393 	HAL_STOP_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
394 };
395 
396 enum wcn36xx_hal_sys_mode {
397 	HAL_SYS_MODE_NORMAL,
398 	HAL_SYS_MODE_LEARN,
399 	HAL_SYS_MODE_SCAN,
400 	HAL_SYS_MODE_PROMISC,
401 	HAL_SYS_MODE_SUSPEND_LINK,
402 	HAL_SYS_MODE_ROAM_SCAN,
403 	HAL_SYS_MODE_ROAM_SUSPEND_LINK,
404 	HAL_SYS_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
405 };
406 
407 enum phy_chan_bond_state {
408 	/* 20MHz IF bandwidth centered on IF carrier */
409 	PHY_SINGLE_CHANNEL_CENTERED = 0,
410 
411 	/* 40MHz IF bandwidth with lower 20MHz supporting the primary channel */
412 	PHY_DOUBLE_CHANNEL_LOW_PRIMARY = 1,
413 
414 	/* 40MHz IF bandwidth centered on IF carrier */
415 	PHY_DOUBLE_CHANNEL_CENTERED = 2,
416 
417 	/* 40MHz IF bandwidth with higher 20MHz supporting the primary ch */
418 	PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3,
419 
420 	/* 20/40MHZ offset LOW 40/80MHZ offset CENTERED */
421 	PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED = 4,
422 
423 	/* 20/40MHZ offset CENTERED 40/80MHZ offset CENTERED */
424 	PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED = 5,
425 
426 	/* 20/40MHZ offset HIGH 40/80MHZ offset CENTERED */
427 	PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED = 6,
428 
429 	/* 20/40MHZ offset LOW 40/80MHZ offset LOW */
430 	PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW = 7,
431 
432 	/* 20/40MHZ offset HIGH 40/80MHZ offset LOW */
433 	PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW = 8,
434 
435 	/* 20/40MHZ offset LOW 40/80MHZ offset HIGH */
436 	PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH = 9,
437 
438 	/* 20/40MHZ offset-HIGH 40/80MHZ offset HIGH */
439 	PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH = 10,
440 
441 	PHY_CHANNEL_BONDING_STATE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
442 };
443 
444 /* Spatial Multiplexing(SM) Power Save mode */
445 enum wcn36xx_hal_ht_mimo_state {
446 	/* Static SM Power Save mode */
447 	WCN36XX_HAL_HT_MIMO_PS_STATIC = 0,
448 
449 	/* Dynamic SM Power Save mode */
450 	WCN36XX_HAL_HT_MIMO_PS_DYNAMIC = 1,
451 
452 	/* reserved */
453 	WCN36XX_HAL_HT_MIMO_PS_NA = 2,
454 
455 	/* SM Power Save disabled */
456 	WCN36XX_HAL_HT_MIMO_PS_NO_LIMIT = 3,
457 
458 	WCN36XX_HAL_HT_MIMO_PS_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
459 };
460 
461 /* each station added has a rate mode which specifies the sta attributes */
462 enum sta_rate_mode {
463 	STA_TAURUS = 0,
464 	STA_TITAN,
465 	STA_POLARIS,
466 	STA_11b,
467 	STA_11bg,
468 	STA_11a,
469 	STA_11n,
470 	STA_11ac,
471 	STA_INVALID_RATE_MODE = WCN36XX_HAL_MAX_ENUM_SIZE
472 };
473 
474 /* 1,2,5.5,11 */
475 #define WCN36XX_HAL_NUM_DSSS_RATES           4
476 
477 /* 6,9,12,18,24,36,48,54 */
478 #define WCN36XX_HAL_NUM_OFDM_RATES           8
479 
480 /* 72,96,108 */
481 #define WCN36XX_HAL_NUM_POLARIS_RATES       3
482 
483 #define WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET    16
484 
485 enum wcn36xx_hal_bss_type {
486 	WCN36XX_HAL_INFRASTRUCTURE_MODE,
487 
488 	/* Added for softAP support */
489 	WCN36XX_HAL_INFRA_AP_MODE,
490 
491 	WCN36XX_HAL_IBSS_MODE,
492 
493 	/* Added for BT-AMP support */
494 	WCN36XX_HAL_BTAMP_STA_MODE,
495 
496 	/* Added for BT-AMP support */
497 	WCN36XX_HAL_BTAMP_AP_MODE,
498 
499 	WCN36XX_HAL_AUTO_MODE,
500 
501 	WCN36XX_HAL_DONOT_USE_BSS_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE
502 };
503 
504 enum wcn36xx_hal_nw_type {
505 	WCN36XX_HAL_11A_NW_TYPE,
506 	WCN36XX_HAL_11B_NW_TYPE,
507 	WCN36XX_HAL_11G_NW_TYPE,
508 	WCN36XX_HAL_11N_NW_TYPE,
509 	WCN36XX_HAL_DONOT_USE_NW_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE
510 };
511 
512 #define WCN36XX_HAL_MAC_RATESET_EID_MAX            12
513 
514 enum wcn36xx_hal_ht_operating_mode {
515 	/* No Protection */
516 	WCN36XX_HAL_HT_OP_MODE_PURE,
517 
518 	/* Overlap Legacy device present, protection is optional */
519 	WCN36XX_HAL_HT_OP_MODE_OVERLAP_LEGACY,
520 
521 	/* No legacy device, but 20 MHz HT present */
522 	WCN36XX_HAL_HT_OP_MODE_NO_LEGACY_20MHZ_HT,
523 
524 	/* Protection is required */
525 	WCN36XX_HAL_HT_OP_MODE_MIXED,
526 
527 	WCN36XX_HAL_HT_OP_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
528 };
529 
530 /* Encryption type enum used with peer */
531 enum ani_ed_type {
532 	WCN36XX_HAL_ED_NONE,
533 	WCN36XX_HAL_ED_WEP40,
534 	WCN36XX_HAL_ED_WEP104,
535 	WCN36XX_HAL_ED_TKIP,
536 	WCN36XX_HAL_ED_CCMP,
537 	WCN36XX_HAL_ED_WPI,
538 	WCN36XX_HAL_ED_AES_128_CMAC,
539 	WCN36XX_HAL_ED_NOT_IMPLEMENTED = WCN36XX_HAL_MAX_ENUM_SIZE
540 };
541 
542 #define WLAN_MAX_KEY_RSC_LEN                16
543 #define WLAN_WAPI_KEY_RSC_LEN               16
544 
545 /* MAX key length when ULA is used */
546 #define WCN36XX_HAL_MAC_MAX_KEY_LENGTH              32
547 #define WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS     4
548 
549 /*
550  * Enum to specify whether key is used for TX only, RX only or both.
551  */
552 enum ani_key_direction {
553 	WCN36XX_HAL_TX_ONLY,
554 	WCN36XX_HAL_RX_ONLY,
555 	WCN36XX_HAL_TX_RX,
556 	WCN36XX_HAL_TX_DEFAULT,
557 	WCN36XX_HAL_DONOT_USE_KEY_DIRECTION = WCN36XX_HAL_MAX_ENUM_SIZE
558 };
559 
560 enum ani_wep_type {
561 	WCN36XX_HAL_WEP_STATIC,
562 	WCN36XX_HAL_WEP_DYNAMIC,
563 	WCN36XX_HAL_WEP_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
564 };
565 
566 enum wcn36xx_hal_link_state {
567 
568 	WCN36XX_HAL_LINK_IDLE_STATE = 0,
569 	WCN36XX_HAL_LINK_PREASSOC_STATE = 1,
570 	WCN36XX_HAL_LINK_POSTASSOC_STATE = 2,
571 	WCN36XX_HAL_LINK_AP_STATE = 3,
572 	WCN36XX_HAL_LINK_IBSS_STATE = 4,
573 
574 	/* BT-AMP Case */
575 	WCN36XX_HAL_LINK_BTAMP_PREASSOC_STATE = 5,
576 	WCN36XX_HAL_LINK_BTAMP_POSTASSOC_STATE = 6,
577 	WCN36XX_HAL_LINK_BTAMP_AP_STATE = 7,
578 	WCN36XX_HAL_LINK_BTAMP_STA_STATE = 8,
579 
580 	/* Reserved for HAL Internal Use */
581 	WCN36XX_HAL_LINK_LEARN_STATE = 9,
582 	WCN36XX_HAL_LINK_SCAN_STATE = 10,
583 	WCN36XX_HAL_LINK_FINISH_SCAN_STATE = 11,
584 	WCN36XX_HAL_LINK_INIT_CAL_STATE = 12,
585 	WCN36XX_HAL_LINK_FINISH_CAL_STATE = 13,
586 	WCN36XX_HAL_LINK_LISTEN_STATE = 14,
587 
588 	WCN36XX_HAL_LINK_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
589 };
590 
591 enum wcn36xx_hal_stats_mask {
592 	HAL_SUMMARY_STATS_INFO = 0x00000001,
593 	HAL_GLOBAL_CLASS_A_STATS_INFO = 0x00000002,
594 	HAL_GLOBAL_CLASS_B_STATS_INFO = 0x00000004,
595 	HAL_GLOBAL_CLASS_C_STATS_INFO = 0x00000008,
596 	HAL_GLOBAL_CLASS_D_STATS_INFO = 0x00000010,
597 	HAL_PER_STA_STATS_INFO = 0x00000020
598 };
599 
600 /* BT-AMP events type */
601 enum bt_amp_event_type {
602 	BTAMP_EVENT_CONNECTION_START,
603 	BTAMP_EVENT_CONNECTION_STOP,
604 	BTAMP_EVENT_CONNECTION_TERMINATED,
605 
606 	/* This and beyond are invalid values */
607 	BTAMP_EVENT_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
608 };
609 
610 /* PE Statistics */
611 enum pe_stats_mask {
612 	PE_SUMMARY_STATS_INFO = 0x00000001,
613 	PE_GLOBAL_CLASS_A_STATS_INFO = 0x00000002,
614 	PE_GLOBAL_CLASS_B_STATS_INFO = 0x00000004,
615 	PE_GLOBAL_CLASS_C_STATS_INFO = 0x00000008,
616 	PE_GLOBAL_CLASS_D_STATS_INFO = 0x00000010,
617 	PE_PER_STA_STATS_INFO = 0x00000020,
618 
619 	/* This and beyond are invalid values */
620 	PE_STATS_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
621 };
622 
623 /*
624  * Configuration Parameter IDs
625  */
626 #define WCN36XX_HAL_CFG_STA_ID				0
627 #define WCN36XX_HAL_CFG_CURRENT_TX_ANTENNA		1
628 #define WCN36XX_HAL_CFG_CURRENT_RX_ANTENNA		2
629 #define WCN36XX_HAL_CFG_LOW_GAIN_OVERRIDE		3
630 #define WCN36XX_HAL_CFG_POWER_STATE_PER_CHAIN		4
631 #define WCN36XX_HAL_CFG_CAL_PERIOD			5
632 #define WCN36XX_HAL_CFG_CAL_CONTROL			6
633 #define WCN36XX_HAL_CFG_PROXIMITY			7
634 #define WCN36XX_HAL_CFG_NETWORK_DENSITY			8
635 #define WCN36XX_HAL_CFG_MAX_MEDIUM_TIME			9
636 #define WCN36XX_HAL_CFG_MAX_MPDUS_IN_AMPDU		10
637 #define WCN36XX_HAL_CFG_RTS_THRESHOLD			11
638 #define WCN36XX_HAL_CFG_SHORT_RETRY_LIMIT		12
639 #define WCN36XX_HAL_CFG_LONG_RETRY_LIMIT		13
640 #define WCN36XX_HAL_CFG_FRAGMENTATION_THRESHOLD		14
641 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ZERO		15
642 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ONE		16
643 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_TWO		17
644 #define WCN36XX_HAL_CFG_FIXED_RATE			18
645 #define WCN36XX_HAL_CFG_RETRYRATE_POLICY		19
646 #define WCN36XX_HAL_CFG_RETRYRATE_SECONDARY		20
647 #define WCN36XX_HAL_CFG_RETRYRATE_TERTIARY		21
648 #define WCN36XX_HAL_CFG_FORCE_POLICY_PROTECTION		22
649 #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ	23
650 #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ	24
651 #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ	25
652 #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ		26
653 #define WCN36XX_HAL_CFG_MAX_BA_SESSIONS			27
654 #define WCN36XX_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT	28
655 #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_FILTER		29
656 #define WCN36XX_HAL_CFG_PS_ENABLE_RSSI_MONITOR		30
657 #define WCN36XX_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE	31
658 #define WCN36XX_HAL_CFG_STATS_PERIOD			32
659 #define WCN36XX_HAL_CFG_CFP_MAX_DURATION		33
660 #define WCN36XX_HAL_CFG_FRAME_TRANS_ENABLED		34
661 #define WCN36XX_HAL_CFG_DTIM_PERIOD			35
662 #define WCN36XX_HAL_CFG_EDCA_WMM_ACBK			36
663 #define WCN36XX_HAL_CFG_EDCA_WMM_ACBE			37
664 #define WCN36XX_HAL_CFG_EDCA_WMM_ACVO			38
665 #define WCN36XX_HAL_CFG_EDCA_WMM_ACVI			39
666 #define WCN36XX_HAL_CFG_BA_THRESHOLD_HIGH		40
667 #define WCN36XX_HAL_CFG_MAX_BA_BUFFERS			41
668 #define WCN36XX_HAL_CFG_RPE_POLLING_THRESHOLD		42
669 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG	43
670 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG	44
671 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG	45
672 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG	46
673 #define WCN36XX_HAL_CFG_NO_OF_ONCHIP_REORDER_SESSIONS	47
674 #define WCN36XX_HAL_CFG_PS_LISTEN_INTERVAL		48
675 #define WCN36XX_HAL_CFG_PS_HEART_BEAT_THRESHOLD		49
676 #define WCN36XX_HAL_CFG_PS_NTH_BEACON_FILTER		50
677 #define WCN36XX_HAL_CFG_PS_MAX_PS_POLL			51
678 #define WCN36XX_HAL_CFG_PS_MIN_RSSI_THRESHOLD		52
679 #define WCN36XX_HAL_CFG_PS_RSSI_FILTER_PERIOD		53
680 #define WCN36XX_HAL_CFG_PS_BROADCAST_FRAME_FILTER_ENABLE 54
681 #define WCN36XX_HAL_CFG_PS_IGNORE_DTIM			55
682 #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_EARLY_TERM	56
683 #define WCN36XX_HAL_CFG_DYNAMIC_PS_POLL_VALUE		57
684 #define WCN36XX_HAL_CFG_PS_NULLDATA_AP_RESP_TIMEOUT	58
685 #define WCN36XX_HAL_CFG_TELE_BCN_WAKEUP_EN		59
686 #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI		60
687 #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS	61
688 #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI			62
689 #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS	63
690 #define WCN36XX_HAL_CFG_TX_PWR_CTRL_ENABLE		64
691 #define WCN36XX_HAL_CFG_VALID_RADAR_CHANNEL_LIST	65
692 #define WCN36XX_HAL_CFG_TX_POWER_24_20			66
693 #define WCN36XX_HAL_CFG_TX_POWER_24_40			67
694 #define WCN36XX_HAL_CFG_TX_POWER_50_20			68
695 #define WCN36XX_HAL_CFG_TX_POWER_50_40			69
696 #define WCN36XX_HAL_CFG_MCAST_BCAST_FILTER_SETTING	70
697 #define WCN36XX_HAL_CFG_BCN_EARLY_TERM_WAKEUP_INTERVAL	71
698 #define WCN36XX_HAL_CFG_MAX_TX_POWER_2_4		72
699 #define WCN36XX_HAL_CFG_MAX_TX_POWER_5			73
700 #define WCN36XX_HAL_CFG_INFRA_STA_KEEP_ALIVE_PERIOD	74
701 #define WCN36XX_HAL_CFG_ENABLE_CLOSE_LOOP		75
702 #define WCN36XX_HAL_CFG_BTC_EXECUTION_MODE		76
703 #define WCN36XX_HAL_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK	77
704 #define WCN36XX_HAL_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS	78
705 #define WCN36XX_HAL_CFG_PS_TX_INACTIVITY_TIMEOUT	79
706 #define WCN36XX_HAL_CFG_WCNSS_API_VERSION		80
707 #define WCN36XX_HAL_CFG_AP_KEEPALIVE_TIMEOUT		81
708 #define WCN36XX_HAL_CFG_GO_KEEPALIVE_TIMEOUT		82
709 #define WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST		83
710 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_BT		84
711 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_BT		85
712 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_BT		86
713 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_BT		87
714 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_WLAN		88
715 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_WLAN	89
716 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_WLAN	90
717 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_WLAN		91
718 #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_BT		92
719 #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_WLAN		93
720 #define WCN36XX_HAL_CFG_BTC_MAX_SCO_BLOCK_PERC		94
721 #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_A2DP		95
722 #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_SCO		96
723 #define WCN36XX_HAL_CFG_ENABLE_UNICAST_FILTER		97
724 #define WCN36XX_HAL_CFG_MAX_ASSOC_LIMIT			98
725 #define WCN36XX_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION	99
726 #define WCN36XX_HAL_CFG_ENABLE_MCC_ADAPTIVE_SCHEDULER	100
727 #define WCN36XX_HAL_CFG_ENABLE_DETECT_PS_SUPPORT	101
728 #define WCN36XX_HAL_CFG_AP_LINK_MONITOR_TIMEOUT		102
729 #define WCN36XX_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER	103
730 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE		104
731 #define WCN36XX_HAL_CFG_ENABLE_NAT_KEEP_ALIVE_FILTER	105
732 #define WCN36XX_HAL_CFG_ENABLE_SAP_OBSS_PROT		106
733 #define WCN36XX_HAL_CFG_PSPOLL_DATA_RECEP_TIMEOUT	107
734 #define WCN36XX_HAL_CFG_TDLS_PUAPSD_BUFFER_STA_CAPABLE	108
735 #define WCN36XX_HAL_CFG_TDLS_PUAPSD_MASK		109
736 #define WCN36XX_HAL_CFG_TDLS_PUAPSD_INACTIVITY_TIME	110
737 #define WCN36XX_HAL_CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD	111
738 #define WCN36XX_HAL_CFG_ANTENNA_DIVERSITY		112
739 #define WCN36XX_HAL_CFG_ATH_DISABLE			113
740 #define WCN36XX_HAL_CFG_FLEXCONNECT_POWER_FACTOR	114
741 #define WCN36XX_HAL_CFG_ENABLE_ADAPTIVE_RX_DRAIN	115
742 #define WCN36XX_HAL_CFG_TDLS_OFF_CHANNEL_CAPABLE	116
743 #define WCN36XX_HAL_CFG_MWS_COEX_V1_WAN_FREQ		117
744 #define WCN36XX_HAL_CFG_MWS_COEX_V1_WLAN_FREQ		118
745 #define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG		119
746 #define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG2		120
747 #define WCN36XX_HAL_CFG_MWS_COEX_V2_WAN_FREQ		121
748 #define WCN36XX_HAL_CFG_MWS_COEX_V2_WLAN_FREQ		122
749 #define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG		123
750 #define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG2		124
751 #define WCN36XX_HAL_CFG_MWS_COEX_V3_WAN_FREQ		125
752 #define WCN36XX_HAL_CFG_MWS_COEX_V3_WLAN_FREQ		126
753 #define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG		127
754 #define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG2		128
755 #define WCN36XX_HAL_CFG_MWS_COEX_V4_WAN_FREQ		129
756 #define WCN36XX_HAL_CFG_MWS_COEX_V4_WLAN_FREQ		130
757 #define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG		131
758 #define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG2		132
759 #define WCN36XX_HAL_CFG_MWS_COEX_V5_WAN_FREQ		133
760 #define WCN36XX_HAL_CFG_MWS_COEX_V5_WLAN_FREQ		134
761 #define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG		135
762 #define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG2		136
763 #define WCN36XX_HAL_CFG_MWS_COEX_V6_WAN_FREQ		137
764 #define WCN36XX_HAL_CFG_MWS_COEX_V6_WLAN_FREQ		138
765 #define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG		139
766 #define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG2		140
767 #define WCN36XX_HAL_CFG_MWS_COEX_V7_WAN_FREQ		141
768 #define WCN36XX_HAL_CFG_MWS_COEX_V7_WLAN_FREQ		142
769 #define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG		143
770 #define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG2		144
771 #define WCN36XX_HAL_CFG_MWS_COEX_V8_WAN_FREQ		145
772 #define WCN36XX_HAL_CFG_MWS_COEX_V8_WLAN_FREQ		146
773 #define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG		147
774 #define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG2		148
775 #define WCN36XX_HAL_CFG_MWS_COEX_V9_WAN_FREQ		149
776 #define WCN36XX_HAL_CFG_MWS_COEX_V9_WLAN_FREQ		150
777 #define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG		151
778 #define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG2		152
779 #define WCN36XX_HAL_CFG_MWS_COEX_V10_WAN_FREQ		153
780 #define WCN36XX_HAL_CFG_MWS_COEX_V10_WLAN_FREQ		154
781 #define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG		155
782 #define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG2		156
783 #define WCN36XX_HAL_CFG_MWS_COEX_MODEM_BACKOFF		157
784 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG1		158
785 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG2		159
786 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG3		160
787 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG4		161
788 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG5		162
789 #define WCN36XX_HAL_CFG_MWS_COEX_CONFIG6		163
790 #define WCN36XX_HAL_CFG_SAR_POWER_BACKOFF		164
791 #define WCN36XX_HAL_CFG_GO_LINK_MONITOR_TIMEOUT		165
792 #define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN	166
793 #define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN	167
794 #define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN	168
795 #define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN	169
796 #define WCN36XX_HAL_CFG_RMC_FIXED_RATE			170
797 #define WCN36XX_HAL_CFG_ASD_PROBE_INTERVAL		171
798 #define WCN36XX_HAL_CFG_ASD_TRIGGER_THRESHOLD		172
799 #define WCN36XX_HAL_CFG_ASD_RTT_RSSI_HYST_THRESHOLD	173
800 #define WCN36XX_HAL_CFG_BTC_CTS2S_ON_STA_DURING_SCO	174
801 #define WCN36XX_HAL_CFG_SHORT_PREAMBLE			175
802 #define WCN36XX_HAL_CFG_SHORT_SLOT_TIME			176
803 #define WCN36XX_HAL_CFG_DELAYED_BA			177
804 #define WCN36XX_HAL_CFG_IMMEDIATE_BA			178
805 #define WCN36XX_HAL_CFG_DOT11_MODE			179
806 #define WCN36XX_HAL_CFG_HT_CAPS				180
807 #define WCN36XX_HAL_CFG_AMPDU_PARAMS			181
808 #define WCN36XX_HAL_CFG_TX_BF_INFO			182
809 #define WCN36XX_HAL_CFG_ASC_CAP_INFO			183
810 #define WCN36XX_HAL_CFG_EXT_HT_CAPS			184
811 #define WCN36XX_HAL_CFG_QOS_ENABLED			185
812 #define WCN36XX_HAL_CFG_WME_ENABLED			186
813 #define WCN36XX_HAL_CFG_WSM_ENABLED			187
814 #define WCN36XX_HAL_CFG_WMM_ENABLED			188
815 #define WCN36XX_HAL_CFG_UAPSD_PER_AC_BITMASK		189
816 #define WCN36XX_HAL_CFG_MCS_RATES			190
817 #define WCN36XX_HAL_CFG_VHT_CAPS			191
818 #define WCN36XX_HAL_CFG_VHT_RX_SUPP_MCS			192
819 #define WCN36XX_HAL_CFG_VHT_TX_SUPP_MCS			193
820 #define WCN36XX_HAL_CFG_RA_FILTER_ENABLE		194
821 #define WCN36XX_HAL_CFG_RA_RATE_LIMIT_INTERVAL		195
822 #define WCN36XX_HAL_CFG_BTC_FATAL_HID_NSNIFF_BLK	196
823 #define WCN36XX_HAL_CFG_BTC_CRITICAL_HID_NSNIFF_BLK	197
824 #define WCN36XX_HAL_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD	198
825 #define WCN36XX_HAL_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD	199
826 #define WCN36XX_HAL_CFG_LINK_FAIL_TIMEOUT		200
827 #define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_SP		201
828 #define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT		202
829 #define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT		203
830 #define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW	204
831 #define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW	205
832 #define WCN36XX_HAL_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE	206
833 #define WCN36XX_HAL_CFG_MAX_UAPSD_INACTIVITY_INTERVALS	207
834 #define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_WMMPS		208
835 #define WCN36XX_HAL_CFG_BURST_MODE_BE_TXOP_VALUE	209
836 #define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE	210
837 #define WCN36XX_HAL_CFG_BTC_FAST_WLAN_CONN_PREF		211
838 #define WCN36XX_HAL_CFG_ENABLE_RTSCTS_HTVHT		212
839 #define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN	213
840 #define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN	214
841 #define WCN36XX_HAL_CFG_LINK_FAIL_TX_CNT		215
842 #define WCN36XX_HAL_CFG_TOGGLE_ARP_BDRATES		216
843 #define WCN36XX_HAL_CFG_OPTIMIZE_CA_EVENT		217
844 #define WCN36XX_HAL_CFG_EXT_SCAN_CONC_MODE		218
845 #define WCN36XX_HAL_CFG_BAR_WAKEUP_HOST_DISABLE		219
846 #define WCN36XX_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE	220
847 #define WCN36XX_HAL_CFG_UNITS_OF_BCN_WAIT_TIME		221
848 #define WCN36XX_HAL_CFG_CONS_BCNMISS_COUNT		222
849 #define WCN36XX_HAL_CFG_BTC_DISABLE_WLAN_LINK_CRITICAL	223
850 #define WCN36XX_HAL_CFG_DISABLE_SCAN_DURING_SCO		224
851 #define WCN36XX_HAL_CFG_TRIGGER_NULLFRAME_BEFORE_HB	225
852 #define WCN36XX_HAL_CFG_ENABLE_POWERSAVE_OFFLOAD	226
853 #define WCN36XX_HAL_CFG_MAX_PARAMS			227
854 
855 /* Specify the starting bitrate, 11B and 11A/G rates can be specified in
856  * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should
857  * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130.
858  * Any invalid non-zero value or unsupported rate will set the start rate
859  * to 6 mbps.
860  */
861 #define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE	210
862 
863 /* Message definitons - All the messages below need to be packed */
864 
865 /* Definition for HAL API Version. */
866 struct wcnss_wlan_version {
867 	u8 revision;
868 	u8 version;
869 	u8 minor;
870 	u8 major;
871 } __packed;
872 
873 /* Definition for Encryption Keys */
874 struct wcn36xx_hal_keys {
875 	u8 id;
876 
877 	/* 0 for multicast */
878 	u8 unicast;
879 
880 	enum ani_key_direction direction;
881 
882 	/* Usage is unknown */
883 	u8 rsc[WLAN_MAX_KEY_RSC_LEN];
884 
885 	/* =1 for authenticator,=0 for supplicant */
886 	u8 pae_role;
887 
888 	u16 length;
889 	u8 key[WCN36XX_HAL_MAC_MAX_KEY_LENGTH];
890 } __packed;
891 
892 /*
893  * set_sta_key_params Moving here since it is shared by
894  * configbss/setstakey msgs
895  */
896 struct wcn36xx_hal_set_sta_key_params {
897 	/* STA Index */
898 	u16 sta_index;
899 
900 	/* Encryption Type used with peer */
901 	enum ani_ed_type enc_type;
902 
903 	/* STATIC/DYNAMIC - valid only for WEP */
904 	enum ani_wep_type wep_type;
905 
906 	/* Default WEP key, valid only for static WEP, must between 0 and 3. */
907 	u8 def_wep_idx;
908 
909 	/* valid only for non-static WEP encyrptions */
910 	struct wcn36xx_hal_keys key[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS];
911 
912 	/*
913 	 * Control for Replay Count, 1= Single TID based replay count on Tx
914 	 * 0 = Per TID based replay count on TX
915 	 */
916 	u8 single_tid_rc;
917 
918 } __packed;
919 
920 /* 4-byte control message header used by HAL*/
921 struct wcn36xx_hal_msg_header {
922 	enum wcn36xx_hal_host_msg_type msg_type:16;
923 	enum wcn36xx_hal_host_msg_version msg_version:16;
924 	u32 len;
925 } __packed;
926 
927 /* Config format required by HAL for each CFG item*/
928 struct wcn36xx_hal_cfg {
929 	/* Cfg Id. The Id required by HAL is exported by HAL
930 	 * in shared header file between UMAC and HAL.*/
931 	u16 id;
932 
933 	/* Length of the Cfg. This parameter is used to go to next cfg
934 	 * in the TLV format.*/
935 	u16 len;
936 
937 	/* Padding bytes for unaligned address's */
938 	u16 pad_bytes;
939 
940 	/* Reserve bytes for making cfgVal to align address */
941 	u16 reserve;
942 
943 	/* Following the uCfgLen field there should be a 'uCfgLen' bytes
944 	 * containing the uCfgValue ; u8 uCfgValue[uCfgLen] */
945 } __packed;
946 
947 struct wcn36xx_hal_mac_start_parameters {
948 	/* Drive Type - Production or FTM etc */
949 	enum driver_type type;
950 
951 	/* Length of the config buffer */
952 	u32 len;
953 
954 	/* Following this there is a TLV formatted buffer of length
955 	 * "len" bytes containing all config values.
956 	 * The TLV is expected to be formatted like this:
957 	 * 0           15            31           31+CFG_LEN-1        length-1
958 	 * |   CFG_ID   |   CFG_LEN   |   CFG_BODY    |  CFG_ID  |......|
959 	 */
960 } __packed;
961 
962 struct wcn36xx_hal_mac_start_req_msg {
963 	/* config buffer must start in TLV format just here */
964 	struct wcn36xx_hal_msg_header header;
965 	struct wcn36xx_hal_mac_start_parameters params;
966 } __packed;
967 
968 struct wcn36xx_hal_mac_start_rsp_params {
969 	/* success or failure */
970 	u16 status;
971 
972 	/* Max number of STA supported by the device */
973 	u8 stations;
974 
975 	/* Max number of BSS supported by the device */
976 	u8 bssids;
977 
978 	/* API Version */
979 	struct wcnss_wlan_version version;
980 
981 	/* CRM build information */
982 	u8 crm_version[WCN36XX_HAL_VERSION_LENGTH];
983 
984 	/* hardware/chipset/misc version information */
985 	u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH];
986 
987 } __packed;
988 
989 struct wcn36xx_hal_mac_start_rsp_msg {
990 	struct wcn36xx_hal_msg_header header;
991 	struct wcn36xx_hal_mac_start_rsp_params start_rsp_params;
992 } __packed;
993 
994 struct wcn36xx_hal_mac_stop_req_params {
995 	/* The reason for which the device is being stopped */
996 	enum wcn36xx_hal_stop_type reason;
997 
998 } __packed;
999 
1000 struct wcn36xx_hal_mac_stop_req_msg {
1001 	struct wcn36xx_hal_msg_header header;
1002 	struct wcn36xx_hal_mac_stop_req_params stop_req_params;
1003 } __packed;
1004 
1005 struct wcn36xx_hal_mac_stop_rsp_msg {
1006 	struct wcn36xx_hal_msg_header header;
1007 
1008 	/* success or failure */
1009 	u32 status;
1010 } __packed;
1011 
1012 struct wcn36xx_hal_update_cfg_req_msg {
1013 	/*
1014 	 * Note: The length specified in tHalUpdateCfgReqMsg messages should be
1015 	 * header.msgLen = sizeof(tHalUpdateCfgReqMsg) + uConfigBufferLen
1016 	 */
1017 	struct wcn36xx_hal_msg_header header;
1018 
1019 	/* Length of the config buffer. Allows UMAC to update multiple CFGs */
1020 	u32 len;
1021 
1022 	/*
1023 	 * Following this there is a TLV formatted buffer of length
1024 	 * "uConfigBufferLen" bytes containing all config values.
1025 	 * The TLV is expected to be formatted like this:
1026 	 * 0           15            31           31+CFG_LEN-1        length-1
1027 	 * |   CFG_ID   |   CFG_LEN   |   CFG_BODY    |  CFG_ID  |......|
1028 	 */
1029 
1030 } __packed;
1031 
1032 struct wcn36xx_hal_update_cfg_rsp_msg {
1033 	struct wcn36xx_hal_msg_header header;
1034 
1035 	/* success or failure */
1036 	u32 status;
1037 
1038 } __packed;
1039 
1040 /* Frame control field format (2 bytes) */
1041 struct wcn36xx_hal_mac_frame_ctl {
1042 
1043 #ifndef ANI_LITTLE_BIT_ENDIAN
1044 
1045 	u8 subType:4;
1046 	u8 type:2;
1047 	u8 protVer:2;
1048 
1049 	u8 order:1;
1050 	u8 wep:1;
1051 	u8 moreData:1;
1052 	u8 powerMgmt:1;
1053 	u8 retry:1;
1054 	u8 moreFrag:1;
1055 	u8 fromDS:1;
1056 	u8 toDS:1;
1057 
1058 #else
1059 
1060 	u8 protVer:2;
1061 	u8 type:2;
1062 	u8 subType:4;
1063 
1064 	u8 toDS:1;
1065 	u8 fromDS:1;
1066 	u8 moreFrag:1;
1067 	u8 retry:1;
1068 	u8 powerMgmt:1;
1069 	u8 moreData:1;
1070 	u8 wep:1;
1071 	u8 order:1;
1072 
1073 #endif
1074 
1075 };
1076 
1077 /* Sequence control field */
1078 struct wcn36xx_hal_mac_seq_ctl {
1079 	u8 fragNum:4;
1080 	u8 seqNumLo:4;
1081 	u8 seqNumHi:8;
1082 };
1083 
1084 /* Management header format */
1085 struct wcn36xx_hal_mac_mgmt_hdr {
1086 	struct wcn36xx_hal_mac_frame_ctl fc;
1087 	u8 durationLo;
1088 	u8 durationHi;
1089 	u8 da[6];
1090 	u8 sa[6];
1091 	u8 bssId[6];
1092 	struct wcn36xx_hal_mac_seq_ctl seqControl;
1093 };
1094 
1095 /* FIXME: pronto v1 apparently has 4 */
1096 #define WCN36XX_HAL_NUM_BSSID               2
1097 
1098 /* Scan Entry to hold active BSS idx's */
1099 struct wcn36xx_hal_scan_entry {
1100 	u8 bss_index[WCN36XX_HAL_NUM_BSSID];
1101 	u8 active_bss_count;
1102 };
1103 
1104 struct wcn36xx_hal_init_scan_req_msg {
1105 	struct wcn36xx_hal_msg_header header;
1106 
1107 	/* LEARN - AP Role
1108 	   SCAN - STA Role */
1109 	enum wcn36xx_hal_sys_mode mode;
1110 
1111 	/* BSSID of the BSS */
1112 	u8 bssid[ETH_ALEN];
1113 
1114 	/* Whether BSS needs to be notified */
1115 	u8 notify;
1116 
1117 	/* Kind of frame to be used for notifying the BSS (Data Null, QoS
1118 	 * Null, or CTS to Self). Must always be a valid frame type. */
1119 	u8 frame_type;
1120 
1121 	/* UMAC has the option of passing the MAC frame to be used for
1122 	 * notifying the BSS. If non-zero, HAL will use the MAC frame
1123 	 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
1124 	 * appropriate MAC frame based on frameType. */
1125 	u8 frame_len;
1126 
1127 	/* Following the framelength there is a MAC frame buffer if
1128 	 * frameLength is non-zero. */
1129 	struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
1130 
1131 	/* Entry to hold number of active BSS idx's */
1132 	struct wcn36xx_hal_scan_entry scan_entry;
1133 };
1134 
1135 struct wcn36xx_hal_init_scan_con_req_msg {
1136 	struct wcn36xx_hal_msg_header header;
1137 
1138 	/* LEARN - AP Role
1139 	   SCAN - STA Role */
1140 	enum wcn36xx_hal_sys_mode mode;
1141 
1142 	/* BSSID of the BSS */
1143 	u8 bssid[ETH_ALEN];
1144 
1145 	/* Whether BSS needs to be notified */
1146 	u8 notify;
1147 
1148 	/* Kind of frame to be used for notifying the BSS (Data Null, QoS
1149 	 * Null, or CTS to Self). Must always be a valid frame type. */
1150 	u8 frame_type;
1151 
1152 	/* UMAC has the option of passing the MAC frame to be used for
1153 	 * notifying the BSS. If non-zero, HAL will use the MAC frame
1154 	 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
1155 	 * appropriate MAC frame based on frameType. */
1156 	u8 frame_length;
1157 
1158 	/* Following the framelength there is a MAC frame buffer if
1159 	 * frameLength is non-zero. */
1160 	struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
1161 
1162 	/* Entry to hold number of active BSS idx's */
1163 	struct wcn36xx_hal_scan_entry scan_entry;
1164 
1165 	/* Single NoA usage in Scanning */
1166 	u8 use_noa;
1167 
1168 	/* Indicates the scan duration (in ms) */
1169 	u16 scan_duration;
1170 
1171 };
1172 
1173 struct wcn36xx_hal_init_scan_rsp_msg {
1174 	struct wcn36xx_hal_msg_header header;
1175 
1176 	/* success or failure */
1177 	u32 status;
1178 
1179 } __packed;
1180 
1181 struct wcn36xx_hal_start_scan_req_msg {
1182 	struct wcn36xx_hal_msg_header header;
1183 
1184 	/* Indicates the channel to scan */
1185 	u8 scan_channel;
1186 } __packed;
1187 
1188 struct wcn36xx_hal_start_rsp_msg {
1189 	struct wcn36xx_hal_msg_header header;
1190 
1191 	/* success or failure */
1192 	u32 status;
1193 
1194 	u32 start_tsf[2];
1195 	u8 tx_mgmt_power;
1196 
1197 } __packed;
1198 
1199 struct wcn36xx_hal_end_scan_req_msg {
1200 	struct wcn36xx_hal_msg_header header;
1201 
1202 	/* Indicates the channel to stop scanning. Not used really. But
1203 	 * retained for symmetry with "start Scan" message. It can also
1204 	 * help in error check if needed. */
1205 	u8 scan_channel;
1206 } __packed;
1207 
1208 struct wcn36xx_hal_end_scan_rsp_msg {
1209 	struct wcn36xx_hal_msg_header header;
1210 
1211 	/* success or failure */
1212 	u32 status;
1213 } __packed;
1214 
1215 struct wcn36xx_hal_finish_scan_req_msg {
1216 	struct wcn36xx_hal_msg_header header;
1217 
1218 	/* Identifies the operational state of the AP/STA
1219 	 * LEARN - AP Role SCAN - STA Role */
1220 	enum wcn36xx_hal_sys_mode mode;
1221 
1222 	/* Operating channel to tune to. */
1223 	u8 oper_channel;
1224 
1225 	/* Channel Bonding state If 20/40 MHz is operational, this will
1226 	 * indicate the 40 MHz extension channel in combination with the
1227 	 * control channel */
1228 	enum phy_chan_bond_state cb_state;
1229 
1230 	/* BSSID of the BSS */
1231 	u8 bssid[ETH_ALEN];
1232 
1233 	/* Whether BSS needs to be notified */
1234 	u8 notify;
1235 
1236 	/* Kind of frame to be used for notifying the BSS (Data Null, QoS
1237 	 * Null, or CTS to Self). Must always be a valid frame type. */
1238 	u8 frame_type;
1239 
1240 	/* UMAC has the option of passing the MAC frame to be used for
1241 	 * notifying the BSS. If non-zero, HAL will use the MAC frame
1242 	 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
1243 	 * appropriate MAC frame based on frameType. */
1244 	u8 frame_length;
1245 
1246 	/* Following the framelength there is a MAC frame buffer if
1247 	 * frameLength is non-zero. */
1248 	struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
1249 
1250 	/* Entry to hold number of active BSS idx's */
1251 	struct wcn36xx_hal_scan_entry scan_entry;
1252 
1253 } __packed;
1254 
1255 struct wcn36xx_hal_finish_scan_rsp_msg {
1256 	struct wcn36xx_hal_msg_header header;
1257 
1258 	/* success or failure */
1259 	u32 status;
1260 
1261 } __packed;
1262 
1263 enum wcn36xx_hal_scan_type {
1264 	WCN36XX_HAL_SCAN_TYPE_PASSIVE = 0x00,
1265 	WCN36XX_HAL_SCAN_TYPE_ACTIVE = WCN36XX_HAL_MAX_ENUM_SIZE
1266 };
1267 
1268 struct wcn36xx_hal_mac_ssid {
1269 	u8 length;
1270 	u8 ssid[32];
1271 } __packed;
1272 
1273 struct wcn36xx_hal_start_scan_offload_req_msg {
1274 	struct wcn36xx_hal_msg_header header;
1275 
1276 	/* BSSIDs hot list */
1277 	u8 num_bssid;
1278 	u8 bssids[4][ETH_ALEN];
1279 
1280 	/* Directed probe-requests will be sent for listed SSIDs (max 10)*/
1281 	u8 num_ssid;
1282 	struct wcn36xx_hal_mac_ssid ssids[10];
1283 
1284 	/* Report AP with hidden ssid */
1285 	u8 scan_hidden;
1286 
1287 	/* Self MAC address */
1288 	u8 mac[ETH_ALEN];
1289 
1290 	/* BSS type */
1291 	enum wcn36xx_hal_bss_type bss_type;
1292 
1293 	/* Scan type */
1294 	enum wcn36xx_hal_scan_type scan_type;
1295 
1296 	/* Minimum scanning time on each channel (ms) */
1297 	u32 min_ch_time;
1298 
1299 	/* Maximum scanning time on each channel */
1300 	u32 max_ch_time;
1301 
1302 	/* Is a p2p search */
1303 	u8 p2p_search;
1304 
1305 	/* Channels to scan */
1306 	u8 num_channel;
1307 	u8 channels[80];
1308 
1309 	/* IE field */
1310 	u16 ie_len;
1311 	u8 ie[WCN36XX_MAX_SCAN_IE_LEN];
1312 } __packed;
1313 
1314 struct wcn36xx_hal_start_scan_offload_rsp_msg {
1315 	struct wcn36xx_hal_msg_header header;
1316 
1317 	/* success or failure */
1318 	u32 status;
1319 } __packed;
1320 
1321 enum wcn36xx_hal_scan_offload_ind_type {
1322 	/* Scan has been started */
1323 	WCN36XX_HAL_SCAN_IND_STARTED = 0x01,
1324 	/* Scan has been completed */
1325 	WCN36XX_HAL_SCAN_IND_COMPLETED = 0x02,
1326 	/* Moved to foreign channel */
1327 	WCN36XX_HAL_SCAN_IND_FOREIGN_CHANNEL = 0x08,
1328 	/* scan request has been dequeued */
1329 	WCN36XX_HAL_SCAN_IND_DEQUEUED = 0x10,
1330 	/* preempted by other high priority scan */
1331 	WCN36XX_HAL_SCAN_IND_PREEMPTED = 0x20,
1332 	/* scan start failed */
1333 	WCN36XX_HAL_SCAN_IND_FAILED = 0x40,
1334 	 /*scan restarted */
1335 	WCN36XX_HAL_SCAN_IND_RESTARTED = 0x80,
1336 	WCN36XX_HAL_SCAN_IND_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
1337 };
1338 
1339 struct wcn36xx_hal_scan_offload_ind {
1340 	struct wcn36xx_hal_msg_header header;
1341 
1342 	u32 type;
1343 	u32 channel_mhz;
1344 	u32 scan_id;
1345 } __packed;
1346 
1347 struct wcn36xx_hal_stop_scan_offload_req_msg {
1348 	struct wcn36xx_hal_msg_header header;
1349 } __packed;
1350 
1351 struct wcn36xx_hal_stop_scan_offload_rsp_msg {
1352 	struct wcn36xx_hal_msg_header header;
1353 
1354 	/* success or failure */
1355 	u32 status;
1356 } __packed;
1357 
1358 #define WCN36XX_HAL_CHAN_REG1_MIN_PWR_MASK  0x000000ff
1359 #define WCN36XX_HAL_CHAN_REG1_MAX_PWR_MASK  0x0000ff00
1360 #define WCN36XX_HAL_CHAN_REG1_REG_PWR_MASK  0x00ff0000
1361 #define WCN36XX_HAL_CHAN_REG1_CLASS_ID_MASK 0xff000000
1362 #define WCN36XX_HAL_CHAN_REG2_ANT_GAIN_MASK 0x000000ff
1363 #define WCN36XX_HAL_CHAN_INFO_FLAG_PASSIVE  BIT(7)
1364 #define WCN36XX_HAL_CHAN_INFO_FLAG_DFS      BIT(10)
1365 #define WCN36XX_HAL_CHAN_INFO_FLAG_HT       BIT(11)
1366 #define WCN36XX_HAL_CHAN_INFO_FLAG_VHT      BIT(12)
1367 #define WCN36XX_HAL_CHAN_INFO_PHY_11A       0
1368 #define WCN36XX_HAL_CHAN_INFO_PHY_11BG      1
1369 #define WCN36XX_HAL_DEFAULT_ANT_GAIN        6
1370 #define WCN36XX_HAL_DEFAULT_MIN_POWER       6
1371 
1372 struct wcn36xx_hal_channel_param {
1373 	u32 mhz;
1374 	u32 band_center_freq1;
1375 	u32 band_center_freq2;
1376 	u32 channel_info;
1377 	u32 reg_info_1;
1378 	u32 reg_info_2;
1379 } __packed;
1380 
1381 struct wcn36xx_hal_update_channel_list_req_msg {
1382 	struct wcn36xx_hal_msg_header header;
1383 
1384 	u8 num_channel;
1385 	struct wcn36xx_hal_channel_param channels[80];
1386 } __packed;
1387 
1388 enum wcn36xx_hal_rate_index {
1389 	HW_RATE_INDEX_1MBPS	= 0x82,
1390 	HW_RATE_INDEX_2MBPS	= 0x84,
1391 	HW_RATE_INDEX_5_5MBPS	= 0x8B,
1392 	HW_RATE_INDEX_6MBPS	= 0x0C,
1393 	HW_RATE_INDEX_9MBPS	= 0x12,
1394 	HW_RATE_INDEX_11MBPS	= 0x96,
1395 	HW_RATE_INDEX_12MBPS	= 0x18,
1396 	HW_RATE_INDEX_18MBPS	= 0x24,
1397 	HW_RATE_INDEX_24MBPS	= 0x30,
1398 	HW_RATE_INDEX_36MBPS	= 0x48,
1399 	HW_RATE_INDEX_48MBPS	= 0x60,
1400 	HW_RATE_INDEX_54MBPS	= 0x6C
1401 };
1402 
1403 struct wcn36xx_hal_supported_rates {
1404 	/*
1405 	 * For Self STA Entry: this represents Self Mode.
1406 	 * For Peer Stations, this represents the mode of the peer.
1407 	 * On Station:
1408 	 *
1409 	 * --this mode is updated when PE adds the Self Entry.
1410 	 *
1411 	 * -- OR when PE sends 'ADD_BSS' message and station context in BSS
1412 	 *    is used to indicate the mode of the AP.
1413 	 *
1414 	 * ON AP:
1415 	 *
1416 	 * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry
1417 	 *     for that BSS is used to indicate the self mode of the AP.
1418 	 *
1419 	 * -- OR when a station is associated, PE sends 'ADD_STA' message
1420 	 *    with this mode updated.
1421 	 */
1422 
1423 	enum sta_rate_mode op_rate_mode;
1424 
1425 	/* 11b, 11a and aniLegacyRates are IE rates which gives rate in
1426 	 * unit of 500Kbps */
1427 	u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
1428 	u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
1429 	u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
1430 	u16 reserved;
1431 
1432 	/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be
1433 	 * supported) First 26 bits are reserved for those Titan rates and
1434 	 * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
1435 	 * reserved. */
1436 	/* Titan and Taurus Rates */
1437 	u32 enhanced_rate_bitmap;
1438 
1439 	/*
1440 	 * 0-76 bits used, remaining reserved
1441 	 * bits 0-15 and 32 should be set.
1442 	 */
1443 	u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
1444 
1445 	/*
1446 	 * RX Highest Supported Data Rate defines the highest data
1447 	 * rate that the STA is able to receive, in unites of 1Mbps.
1448 	 * This value is derived from "Supported MCS Set field" inside
1449 	 * the HT capability element.
1450 	 */
1451 	u16 rx_highest_data_rate;
1452 
1453 } __packed;
1454 
1455 struct wcn36xx_hal_config_sta_params {
1456 	/* BSSID of STA */
1457 	u8 bssid[ETH_ALEN];
1458 
1459 	/* ASSOC ID, as assigned by UMAC */
1460 	u16 aid;
1461 
1462 	/* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */
1463 	u8 type;
1464 
1465 	/* Short Preamble Supported. */
1466 	u8 short_preamble_supported;
1467 
1468 	/* MAC Address of STA */
1469 	u8 mac[ETH_ALEN];
1470 
1471 	/* Listen interval of the STA */
1472 	u16 listen_interval;
1473 
1474 	/* Support for 11e/WMM */
1475 	u8 wmm_enabled;
1476 
1477 	/* 11n HT capable STA */
1478 	u8 ht_capable;
1479 
1480 	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
1481 	u8 tx_channel_width_set;
1482 
1483 	/* RIFS mode 0 - NA, 1 - Allowed */
1484 	u8 rifs_mode;
1485 
1486 	/* L-SIG TXOP Protection mechanism
1487 	   0 - No Support, 1 - Supported
1488 	   SG - there is global field */
1489 	u8 lsig_txop_protection;
1490 
1491 	/* Max Ampdu Size supported by STA. TPE programming.
1492 	   0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */
1493 	u8 max_ampdu_size;
1494 
1495 	/* Max Ampdu density. Used by RA.  3 : 0~7 : 2^(11nAMPDUdensity -4) */
1496 	u8 max_ampdu_density;
1497 
1498 	/* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */
1499 	u8 max_amsdu_size;
1500 
1501 	/* Short GI support for 40Mhz packets */
1502 	u8 sgi_40mhz;
1503 
1504 	/* Short GI support for 20Mhz packets */
1505 	u8 sgi_20Mhz;
1506 
1507 	/* TODO move this parameter to the end for 3680 */
1508 	/* These rates are the intersection of peer and self capabilities. */
1509 	struct wcn36xx_hal_supported_rates supported_rates;
1510 
1511 	/* Robust Management Frame (RMF) enabled/disabled */
1512 	u8 rmf;
1513 
1514 	/* The unicast encryption type in the association */
1515 	u32 encrypt_type;
1516 
1517 	/* HAL should update the existing STA entry, if this flag is set. UMAC
1518 	   will set this flag in case of RE-ASSOC, where we want to reuse the
1519 	   old STA ID. 0 = Add, 1 = Update */
1520 	u8 action;
1521 
1522 	/* U-APSD Flags: 1b per AC.  Encoded as follows:
1523 	   b7 b6 b5 b4 b3 b2 b1 b0 =
1524 	   X  X  X  X  BE BK VI VO */
1525 	u8 uapsd;
1526 
1527 	/* Max SP Length */
1528 	u8 max_sp_len;
1529 
1530 	/* 11n Green Field preamble support
1531 	   0 - Not supported, 1 - Supported */
1532 	u8 green_field_capable;
1533 
1534 	/* MIMO Power Save mode */
1535 	enum wcn36xx_hal_ht_mimo_state mimo_ps;
1536 
1537 	/* Delayed BA Support */
1538 	u8 delayed_ba_support;
1539 
1540 	/* Max AMPDU duration in 32us */
1541 	u8 max_ampdu_duration;
1542 
1543 	/* HT STA should set it to 1 if it is enabled in BSS. HT STA should
1544 	 * set it to 0 if AP does not support it. This indication is sent
1545 	 * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
1546 	 * rates. */
1547 	u8 dsss_cck_mode_40mhz;
1548 
1549 	/* Valid STA Idx when action=Update. Set to 0xFF when invalid!
1550 	 * Retained for backward compalibity with existing HAL code */
1551 	u8 sta_index;
1552 
1553 	/* BSSID of BSS to which station is associated. Set to 0xFF when
1554 	 * invalid. Retained for backward compalibity with existing HAL
1555 	 * code */
1556 	u8 bssid_index;
1557 
1558 	u8 p2p;
1559 
1560 	/* TODO add this parameter for 3680. */
1561 	/* Reserved to align next field on a dword boundary */
1562 	/* u8 reserved; */
1563 } __packed;
1564 
1565 struct wcn36xx_hal_config_sta_req_msg {
1566 	struct wcn36xx_hal_msg_header header;
1567 	struct wcn36xx_hal_config_sta_params sta_params;
1568 } __packed;
1569 
1570 struct wcn36xx_hal_supported_rates_v1 {
1571 	/* For Self STA Entry: this represents Self Mode.
1572 	 * For Peer Stations, this represents the mode of the peer.
1573 	 * On Station:
1574 	 *
1575 	 * --this mode is updated when PE adds the Self Entry.
1576 	 *
1577 	 * -- OR when PE sends 'ADD_BSS' message and station context in BSS
1578 	 *    is used to indicate the mode of the AP.
1579 	 *
1580 	 * ON AP:
1581 	 *
1582 	 * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry
1583 	 *     for that BSS is used to indicate the self mode of the AP.
1584 	 *
1585 	 * -- OR when a station is associated, PE sends 'ADD_STA' message
1586 	 *    with this mode updated.
1587 	 */
1588 
1589 	enum sta_rate_mode op_rate_mode;
1590 
1591 	/* 11b, 11a and aniLegacyRates are IE rates which gives rate in
1592 	 * unit of 500Kbps
1593 	 */
1594 	u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
1595 	u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
1596 	u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
1597 	u16 reserved;
1598 
1599 	/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be
1600 	 * supported) First 26 bits are reserved for those Titan rates and
1601 	 * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
1602 	 * reserved
1603 	 * Titan and Taurus Rates
1604 	 */
1605 	u32 enhanced_rate_bitmap;
1606 
1607 	/* 0-76 bits used, remaining reserved
1608 	 * bits 0-15 and 32 should be set.
1609 	 */
1610 	u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
1611 
1612 	/* RX Highest Supported Data Rate defines the highest data
1613 	 * rate that the STA is able to receive, in unites of 1Mbps.
1614 	 * This value is derived from "Supported MCS Set field" inside
1615 	 * the HT capability element.
1616 	 */
1617 	u16 rx_highest_data_rate;
1618 
1619 	/* Indicates the Maximum MCS that can be received for each spatial
1620 	 * stream.
1621 	 */
1622 	u16 vht_rx_mcs_map;
1623 
1624 	/* Indicates the highest VHT data rate that the STA is able to
1625 	 * receive.
1626 	 */
1627 	u16 vht_rx_highest_data_rate;
1628 
1629 	/* Indicates the Maximum MCS that can be transmitted for each spatial
1630 	 * stream.
1631 	 */
1632 	u16 vht_tx_mcs_map;
1633 
1634 	/* Indicates the highest VHT data rate that the STA is able to
1635 	 * transmit.
1636 	 */
1637 	u16 vht_tx_highest_data_rate;
1638 } __packed;
1639 
1640 struct wcn36xx_hal_config_sta_params_v1 {
1641 	/* BSSID of STA */
1642 	u8 bssid[ETH_ALEN];
1643 
1644 	/* ASSOC ID, as assigned by UMAC */
1645 	u16 aid;
1646 
1647 	/* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */
1648 	u8 type;
1649 
1650 	/* Short Preamble Supported. */
1651 	u8 short_preamble_supported;
1652 
1653 	/* MAC Address of STA */
1654 	u8 mac[ETH_ALEN];
1655 
1656 	/* Listen interval of the STA */
1657 	u16 listen_interval;
1658 
1659 	/* Support for 11e/WMM */
1660 	u8 wmm_enabled;
1661 
1662 	/* 11n HT capable STA */
1663 	u8 ht_capable;
1664 
1665 	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
1666 	u8 tx_channel_width_set;
1667 
1668 	/* RIFS mode 0 - NA, 1 - Allowed */
1669 	u8 rifs_mode;
1670 
1671 	/* L-SIG TXOP Protection mechanism
1672 	   0 - No Support, 1 - Supported
1673 	   SG - there is global field */
1674 	u8 lsig_txop_protection;
1675 
1676 	/* Max Ampdu Size supported by STA. TPE programming.
1677 	   0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */
1678 	u8 max_ampdu_size;
1679 
1680 	/* Max Ampdu density. Used by RA.  3 : 0~7 : 2^(11nAMPDUdensity -4) */
1681 	u8 max_ampdu_density;
1682 
1683 	/* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */
1684 	u8 max_amsdu_size;
1685 
1686 	/* Short GI support for 40Mhz packets */
1687 	u8 sgi_40mhz;
1688 
1689 	/* Short GI support for 20Mhz packets */
1690 	u8 sgi_20Mhz;
1691 
1692 	/* Robust Management Frame (RMF) enabled/disabled */
1693 	u8 rmf;
1694 
1695 	/* The unicast encryption type in the association */
1696 	u32 encrypt_type;
1697 
1698 	/* HAL should update the existing STA entry, if this flag is set. UMAC
1699 	   will set this flag in case of RE-ASSOC, where we want to reuse the
1700 	   old STA ID. 0 = Add, 1 = Update */
1701 	u8 action;
1702 
1703 	/* U-APSD Flags: 1b per AC.  Encoded as follows:
1704 	   b7 b6 b5 b4 b3 b2 b1 b0 =
1705 	   X  X  X  X  BE BK VI VO */
1706 	u8 uapsd;
1707 
1708 	/* Max SP Length */
1709 	u8 max_sp_len;
1710 
1711 	/* 11n Green Field preamble support
1712 	   0 - Not supported, 1 - Supported */
1713 	u8 green_field_capable;
1714 
1715 	/* MIMO Power Save mode */
1716 	enum wcn36xx_hal_ht_mimo_state mimo_ps;
1717 
1718 	/* Delayed BA Support */
1719 	u8 delayed_ba_support;
1720 
1721 	/* Max AMPDU duration in 32us */
1722 	u8 max_ampdu_duration;
1723 
1724 	/* HT STA should set it to 1 if it is enabled in BSS. HT STA should
1725 	 * set it to 0 if AP does not support it. This indication is sent
1726 	 * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
1727 	 * rates. */
1728 	u8 dsss_cck_mode_40mhz;
1729 
1730 	/* Valid STA Idx when action=Update. Set to 0xFF when invalid!
1731 	 * Retained for backward compalibity with existing HAL code */
1732 	u8 sta_index;
1733 
1734 	/* BSSID of BSS to which station is associated. Set to 0xFF when
1735 	 * invalid. Retained for backward compalibity with existing HAL
1736 	 * code */
1737 	u8 bssid_index;
1738 
1739 	u8 p2p;
1740 
1741 	/* Reserved to align next field on a dword boundary */
1742 	u8 ht_ldpc_enabled:1;
1743 	u8 vht_ldpc_enabled:1;
1744 	u8 vht_tx_bf_enabled:1;
1745 	u8 vht_tx_mu_beamformee_capable:1;
1746 	u8 reserved:4;
1747 
1748 	/* These rates are the intersection of peer and self capabilities. */
1749 	struct wcn36xx_hal_supported_rates_v1 supported_rates;
1750 
1751 	u8 vht_capable;
1752 	u8 vht_tx_channel_width_set;
1753 
1754 } __packed;
1755 
1756 #define WCN36XX_DIFF_STA_PARAMS_V1_NOVHT 10
1757 
1758 struct wcn36xx_hal_config_sta_req_msg_v1 {
1759 	struct wcn36xx_hal_msg_header header;
1760 	struct wcn36xx_hal_config_sta_params_v1 sta_params;
1761 } __packed;
1762 
1763 struct config_sta_rsp_params {
1764 	/* success or failure */
1765 	u32 status;
1766 
1767 	/* Station index; valid only when 'status' field value SUCCESS */
1768 	u8 sta_index;
1769 
1770 	/* BSSID Index of BSS to which the station is associated */
1771 	u8 bssid_index;
1772 
1773 	/* DPU Index for PTK */
1774 	u8 dpu_index;
1775 
1776 	/* DPU Index for GTK */
1777 	u8 bcast_dpu_index;
1778 
1779 	/* DPU Index for IGTK  */
1780 	u8 bcast_mgmt_dpu_idx;
1781 
1782 	/* PTK DPU signature */
1783 	u8 uc_ucast_sig;
1784 
1785 	/* GTK DPU isignature */
1786 	u8 uc_bcast_sig;
1787 
1788 	/* IGTK DPU signature */
1789 	u8 uc_mgmt_sig;
1790 
1791 	u8 p2p;
1792 
1793 } __packed;
1794 
1795 struct wcn36xx_hal_config_sta_rsp_msg {
1796 	struct wcn36xx_hal_msg_header header;
1797 
1798 	struct config_sta_rsp_params params;
1799 } __packed;
1800 
1801 /* Delete STA Request message */
1802 struct wcn36xx_hal_delete_sta_req_msg {
1803 	struct wcn36xx_hal_msg_header header;
1804 
1805 	/* Index of STA to delete */
1806 	u8 sta_index;
1807 
1808 } __packed;
1809 
1810 /* Delete STA Response message */
1811 struct wcn36xx_hal_delete_sta_rsp_msg {
1812 	struct wcn36xx_hal_msg_header header;
1813 
1814 	/* success or failure */
1815 	u32 status;
1816 
1817 	/* Index of STA deleted */
1818 	u8 sta_id;
1819 } __packed;
1820 
1821 /* 12 Bytes long because this structure can be used to represent rate and
1822  * extended rate set IEs. The parser assume this to be at least 12 */
1823 struct wcn36xx_hal_rate_set {
1824 	u8 num_rates;
1825 	u8 rate[WCN36XX_HAL_MAC_RATESET_EID_MAX];
1826 } __packed;
1827 
1828 /* access category record */
1829 struct wcn36xx_hal_aci_aifsn {
1830 #ifndef ANI_LITTLE_BIT_ENDIAN
1831 	u8 rsvd:1;
1832 	u8 aci:2;
1833 	u8 acm:1;
1834 	u8 aifsn:4;
1835 #else
1836 	u8 aifsn:4;
1837 	u8 acm:1;
1838 	u8 aci:2;
1839 	u8 rsvd:1;
1840 #endif
1841 } __packed;
1842 
1843 /* contention window size */
1844 struct wcn36xx_hal_mac_cw {
1845 #ifndef ANI_LITTLE_BIT_ENDIAN
1846 	u8 max:4;
1847 	u8 min:4;
1848 #else
1849 	u8 min:4;
1850 	u8 max:4;
1851 #endif
1852 } __packed;
1853 
1854 struct wcn36xx_hal_edca_param_record {
1855 	struct wcn36xx_hal_aci_aifsn aci;
1856 	struct wcn36xx_hal_mac_cw cw;
1857 	u16 txop_limit;
1858 } __packed;
1859 
1860 /* Concurrency role. These are generic IDs that identify the various roles
1861  *  in the software system. */
1862 enum wcn36xx_hal_con_mode {
1863 	WCN36XX_HAL_STA_MODE = 0,
1864 
1865 	/* to support softAp mode . This is misleading.
1866 	   It means AP MODE only. */
1867 	WCN36XX_HAL_STA_SAP_MODE = 1,
1868 
1869 	WCN36XX_HAL_P2P_CLIENT_MODE,
1870 	WCN36XX_HAL_P2P_GO_MODE,
1871 	WCN36XX_HAL_MONITOR_MODE,
1872 };
1873 
1874 /* This is a bit pattern to be set for each mode
1875  * bit 0 - sta mode
1876  * bit 1 - ap mode
1877  * bit 2 - p2p client mode
1878  * bit 3 - p2p go mode */
1879 enum wcn36xx_hal_concurrency_mode {
1880 	HAL_STA = 1,
1881 	HAL_SAP = 2,
1882 
1883 	/* to support sta, softAp  mode . This means STA+AP mode */
1884 	HAL_STA_SAP = 3,
1885 
1886 	HAL_P2P_CLIENT = 4,
1887 	HAL_P2P_GO = 8,
1888 	HAL_MAX_CONCURRENCY_PERSONA = 4
1889 };
1890 
1891 struct wcn36xx_hal_config_bss_params {
1892 	/* BSSID */
1893 	u8 bssid[ETH_ALEN];
1894 
1895 	/* Self Mac Address */
1896 	u8 self_mac_addr[ETH_ALEN];
1897 
1898 	/* BSS type */
1899 	enum wcn36xx_hal_bss_type bss_type;
1900 
1901 	/* Operational Mode: AP =0, STA = 1 */
1902 	u8 oper_mode;
1903 
1904 	/* Network Type */
1905 	enum wcn36xx_hal_nw_type nw_type;
1906 
1907 	/* Used to classify PURE_11G/11G_MIXED to program MTU */
1908 	u8 short_slot_time_supported;
1909 
1910 	/* Co-exist with 11a STA */
1911 	u8 lla_coexist;
1912 
1913 	/* Co-exist with 11b STA */
1914 	u8 llb_coexist;
1915 
1916 	/* Co-exist with 11g STA */
1917 	u8 llg_coexist;
1918 
1919 	/* Coexistence with 11n STA */
1920 	u8 ht20_coexist;
1921 
1922 	/* Non GF coexist flag */
1923 	u8 lln_non_gf_coexist;
1924 
1925 	/* TXOP protection support */
1926 	u8 lsig_tx_op_protection_full_support;
1927 
1928 	/* RIFS mode */
1929 	u8 rifs_mode;
1930 
1931 	/* Beacon Interval in TU */
1932 	u16 beacon_interval;
1933 
1934 	/* DTIM period */
1935 	u8 dtim_period;
1936 
1937 	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
1938 	u8 tx_channel_width_set;
1939 
1940 	/* Operating channel */
1941 	u8 oper_channel;
1942 
1943 	/* Extension channel for channel bonding */
1944 	u8 ext_channel;
1945 
1946 	/* Reserved to align next field on a dword boundary */
1947 	u8 reserved;
1948 
1949 	/* TODO move sta to the end for 3680 */
1950 	/* Context of the station being added in HW
1951 	 *  Add a STA entry for "itself" -
1952 	 *
1953 	 *  On AP  - Add the AP itself in an "STA context"
1954 	 *
1955 	 *  On STA - Add the AP to which this STA is joining in an
1956 	 *  "STA context"
1957 	 */
1958 	struct wcn36xx_hal_config_sta_params sta;
1959 	/* SSID of the BSS */
1960 	struct wcn36xx_hal_mac_ssid ssid;
1961 
1962 	/* HAL should update the existing BSS entry, if this flag is set.
1963 	 * UMAC will set this flag in case of reassoc, where we want to
1964 	 * resue the the old BSSID and still return success 0 = Add, 1 =
1965 	 * Update */
1966 	u8 action;
1967 
1968 	/* MAC Rate Set */
1969 	struct wcn36xx_hal_rate_set rateset;
1970 
1971 	/* Enable/Disable HT capabilities of the BSS */
1972 	u8 ht;
1973 
1974 	/* Enable/Disable OBSS protection */
1975 	u8 obss_prot_enabled;
1976 
1977 	/* RMF enabled/disabled */
1978 	u8 rmf;
1979 
1980 	/* HT Operating Mode operating mode of the 802.11n STA */
1981 	enum wcn36xx_hal_ht_operating_mode ht_oper_mode;
1982 
1983 	/* Dual CTS Protection: 0 - Unused, 1 - Used */
1984 	u8 dual_cts_protection;
1985 
1986 	/* Probe Response Max retries */
1987 	u8 max_probe_resp_retry_limit;
1988 
1989 	/* To Enable Hidden ssid */
1990 	u8 hidden_ssid;
1991 
1992 	/* To Enable Disable FW Proxy Probe Resp */
1993 	u8 proxy_probe_resp;
1994 
1995 	/* Boolean to indicate if EDCA params are valid. UMAC might not
1996 	 * have valid EDCA params or might not desire to apply EDCA params
1997 	 * during config BSS. 0 implies Not Valid ; Non-Zero implies
1998 	 * valid */
1999 	u8 edca_params_valid;
2000 
2001 	/* EDCA Parameters for Best Effort Access Category */
2002 	struct wcn36xx_hal_edca_param_record acbe;
2003 
2004 	/* EDCA Parameters forBackground Access Category */
2005 	struct wcn36xx_hal_edca_param_record acbk;
2006 
2007 	/* EDCA Parameters for Video Access Category */
2008 	struct wcn36xx_hal_edca_param_record acvi;
2009 
2010 	/* EDCA Parameters for Voice Access Category */
2011 	struct wcn36xx_hal_edca_param_record acvo;
2012 
2013 	/* Ext Bss Config Msg if set */
2014 	u8 ext_set_sta_key_param_valid;
2015 
2016 	/* SetStaKeyParams for ext bss msg */
2017 	struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
2018 
2019 	/* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum
2020 	 * wcn36xx_hal_con_mode */
2021 	u8 wcn36xx_hal_persona;
2022 
2023 	u8 spectrum_mgt_enable;
2024 
2025 	/* HAL fills in the tx power used for mgmt frames in txMgmtPower */
2026 	s8 tx_mgmt_power;
2027 
2028 	/* maxTxPower has max power to be used after applying the power
2029 	 * constraint if any */
2030 	s8 max_tx_power;
2031 } __packed;
2032 
2033 struct wcn36xx_hal_config_bss_req_msg {
2034 	struct wcn36xx_hal_msg_header header;
2035 	struct wcn36xx_hal_config_bss_params bss_params;
2036 } __packed;
2037 
2038 struct wcn36xx_hal_config_bss_params_v1 {
2039 	/* BSSID */
2040 	u8 bssid[ETH_ALEN];
2041 
2042 	/* Self Mac Address */
2043 	u8 self_mac_addr[ETH_ALEN];
2044 
2045 	/* BSS type */
2046 	enum wcn36xx_hal_bss_type bss_type;
2047 
2048 	/* Operational Mode: AP =0, STA = 1 */
2049 	u8 oper_mode;
2050 
2051 	/* Network Type */
2052 	enum wcn36xx_hal_nw_type nw_type;
2053 
2054 	/* Used to classify PURE_11G/11G_MIXED to program MTU */
2055 	u8 short_slot_time_supported;
2056 
2057 	/* Co-exist with 11a STA */
2058 	u8 lla_coexist;
2059 
2060 	/* Co-exist with 11b STA */
2061 	u8 llb_coexist;
2062 
2063 	/* Co-exist with 11g STA */
2064 	u8 llg_coexist;
2065 
2066 	/* Coexistence with 11n STA */
2067 	u8 ht20_coexist;
2068 
2069 	/* Non GF coexist flag */
2070 	u8 lln_non_gf_coexist;
2071 
2072 	/* TXOP protection support */
2073 	u8 lsig_tx_op_protection_full_support;
2074 
2075 	/* RIFS mode */
2076 	u8 rifs_mode;
2077 
2078 	/* Beacon Interval in TU */
2079 	u16 beacon_interval;
2080 
2081 	/* DTIM period */
2082 	u8 dtim_period;
2083 
2084 	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
2085 	u8 tx_channel_width_set;
2086 
2087 	/* Operating channel */
2088 	u8 oper_channel;
2089 
2090 	/* Extension channel for channel bonding */
2091 	u8 ext_channel;
2092 
2093 	/* Reserved to align next field on a dword boundary */
2094 	u8 reserved;
2095 
2096 	/* SSID of the BSS */
2097 	struct wcn36xx_hal_mac_ssid ssid;
2098 
2099 	/* HAL should update the existing BSS entry, if this flag is set.
2100 	 * UMAC will set this flag in case of reassoc, where we want to
2101 	 * resue the the old BSSID and still return success 0 = Add, 1 =
2102 	 * Update */
2103 	u8 action;
2104 
2105 	/* MAC Rate Set */
2106 	struct wcn36xx_hal_rate_set rateset;
2107 
2108 	/* Enable/Disable HT capabilities of the BSS */
2109 	u8 ht;
2110 
2111 	/* Enable/Disable OBSS protection */
2112 	u8 obss_prot_enabled;
2113 
2114 	/* RMF enabled/disabled */
2115 	u8 rmf;
2116 
2117 	/* HT Operating Mode operating mode of the 802.11n STA */
2118 	enum wcn36xx_hal_ht_operating_mode ht_oper_mode;
2119 
2120 	/* Dual CTS Protection: 0 - Unused, 1 - Used */
2121 	u8 dual_cts_protection;
2122 
2123 	/* Probe Response Max retries */
2124 	u8 max_probe_resp_retry_limit;
2125 
2126 	/* To Enable Hidden ssid */
2127 	u8 hidden_ssid;
2128 
2129 	/* To Enable Disable FW Proxy Probe Resp */
2130 	u8 proxy_probe_resp;
2131 
2132 	/* Boolean to indicate if EDCA params are valid. UMAC might not
2133 	 * have valid EDCA params or might not desire to apply EDCA params
2134 	 * during config BSS. 0 implies Not Valid ; Non-Zero implies
2135 	 * valid */
2136 	u8 edca_params_valid;
2137 
2138 	/* EDCA Parameters for Best Effort Access Category */
2139 	struct wcn36xx_hal_edca_param_record acbe;
2140 
2141 	/* EDCA Parameters forBackground Access Category */
2142 	struct wcn36xx_hal_edca_param_record acbk;
2143 
2144 	/* EDCA Parameters for Video Access Category */
2145 	struct wcn36xx_hal_edca_param_record acvi;
2146 
2147 	/* EDCA Parameters for Voice Access Category */
2148 	struct wcn36xx_hal_edca_param_record acvo;
2149 
2150 	/* Ext Bss Config Msg if set */
2151 	u8 ext_set_sta_key_param_valid;
2152 
2153 	/* SetStaKeyParams for ext bss msg */
2154 	struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
2155 
2156 	/* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum
2157 	 * wcn36xx_hal_con_mode */
2158 	u8 wcn36xx_hal_persona;
2159 
2160 	u8 spectrum_mgt_enable;
2161 
2162 	/* HAL fills in the tx power used for mgmt frames in txMgmtPower */
2163 	s8 tx_mgmt_power;
2164 
2165 	/* maxTxPower has max power to be used after applying the power
2166 	 * constraint if any */
2167 	s8 max_tx_power;
2168 
2169 	/* Context of the station being added in HW
2170 	 *  Add a STA entry for "itself" -
2171 	 *
2172 	 *  On AP  - Add the AP itself in an "STA context"
2173 	 *
2174 	 *  On STA - Add the AP to which this STA is joining in an
2175 	 *  "STA context"
2176 	 */
2177 	struct wcn36xx_hal_config_sta_params_v1 sta;
2178 
2179 	u8 vht_capable;
2180 	u8 vht_tx_channel_width_set;
2181 
2182 } __packed;
2183 
2184 #define WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT (WCN36XX_DIFF_STA_PARAMS_V1_NOVHT + 2)
2185 
2186 struct wcn36xx_hal_config_bss_req_msg_v1 {
2187 	struct wcn36xx_hal_msg_header header;
2188 	struct wcn36xx_hal_config_bss_params_v1 bss_params;
2189 } __packed;
2190 
2191 struct wcn36xx_hal_config_bss_rsp_params {
2192 	/* Success or Failure */
2193 	u32 status;
2194 
2195 	/* BSS index allocated by HAL */
2196 	u8 bss_index;
2197 
2198 	/* DPU descriptor index for PTK */
2199 	u8 dpu_desc_index;
2200 
2201 	/* PTK DPU signature */
2202 	u8 ucast_dpu_signature;
2203 
2204 	/* DPU descriptor index for GTK */
2205 	u8 bcast_dpu_desc_indx;
2206 
2207 	/* GTK DPU signature */
2208 	u8 bcast_dpu_signature;
2209 
2210 	/* DPU descriptor for IGTK */
2211 	u8 mgmt_dpu_desc_index;
2212 
2213 	/* IGTK DPU signature */
2214 	u8 mgmt_dpu_signature;
2215 
2216 	/* Station Index for BSS entry */
2217 	u8 bss_sta_index;
2218 
2219 	/* Self station index for this BSS */
2220 	u8 bss_self_sta_index;
2221 
2222 	/* Bcast station for buffering bcast frames in AP role */
2223 	u8 bss_bcast_sta_idx;
2224 
2225 	/* MAC Address of STA(PEER/SELF) in staContext of configBSSReq */
2226 	u8 mac[ETH_ALEN];
2227 
2228 	/* HAL fills in the tx power used for mgmt frames in this field. */
2229 	s8 tx_mgmt_power;
2230 
2231 } __packed;
2232 
2233 struct wcn36xx_hal_config_bss_rsp_msg {
2234 	struct wcn36xx_hal_msg_header header;
2235 	struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
2236 } __packed;
2237 
2238 struct wcn36xx_hal_delete_bss_req_msg {
2239 	struct wcn36xx_hal_msg_header header;
2240 
2241 	/* BSS index to be deleted */
2242 	u8 bss_index;
2243 
2244 } __packed;
2245 
2246 struct wcn36xx_hal_delete_bss_rsp_msg {
2247 	struct wcn36xx_hal_msg_header header;
2248 
2249 	/* Success or Failure */
2250 	u32 status;
2251 
2252 	/* BSS index that has been deleted */
2253 	u8 bss_index;
2254 
2255 } __packed;
2256 
2257 struct wcn36xx_hal_join_req_msg {
2258 	struct wcn36xx_hal_msg_header header;
2259 
2260 	/* Indicates the BSSID to which STA is going to associate */
2261 	u8 bssid[ETH_ALEN];
2262 
2263 	/* Indicates the channel to switch to. */
2264 	u8 channel;
2265 
2266 	/* Self STA MAC */
2267 	u8 self_sta_mac_addr[ETH_ALEN];
2268 
2269 	/* Local power constraint */
2270 	u8 local_power_constraint;
2271 
2272 	/* Secondary channel offset */
2273 	enum phy_chan_bond_state secondary_channel_offset;
2274 
2275 	/* link State */
2276 	enum wcn36xx_hal_link_state link_state;
2277 
2278 	/* Max TX power */
2279 	s8 max_tx_power;
2280 } __packed;
2281 
2282 struct wcn36xx_hal_join_rsp_msg {
2283 	struct wcn36xx_hal_msg_header header;
2284 
2285 	/* success or failure */
2286 	u32 status;
2287 
2288 	/* HAL fills in the tx power used for mgmt frames in this field */
2289 	u8 tx_mgmt_power;
2290 } __packed;
2291 
2292 struct post_assoc_req_msg {
2293 	struct wcn36xx_hal_msg_header header;
2294 
2295 	struct wcn36xx_hal_config_sta_params sta_params;
2296 	struct wcn36xx_hal_config_bss_params bss_params;
2297 };
2298 
2299 struct post_assoc_rsp_msg {
2300 	struct wcn36xx_hal_msg_header header;
2301 	struct config_sta_rsp_params sta_rsp_params;
2302 	struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
2303 };
2304 
2305 /* This is used to create a set of WEP keys for a given BSS. */
2306 struct wcn36xx_hal_set_bss_key_req_msg {
2307 	struct wcn36xx_hal_msg_header header;
2308 
2309 	/* BSS Index of the BSS */
2310 	u8 bss_idx;
2311 
2312 	/* Encryption Type used with peer */
2313 	enum ani_ed_type enc_type;
2314 
2315 	/* Number of keys */
2316 	u8 num_keys;
2317 
2318 	/* Array of keys. */
2319 	struct wcn36xx_hal_keys keys[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS];
2320 
2321 	/* Control for Replay Count, 1= Single TID based replay count on Tx
2322 	 * 0 = Per TID based replay count on TX */
2323 	u8 single_tid_rc;
2324 } __packed;
2325 
2326 /* tagged version of set bss key */
2327 struct wcn36xx_hal_set_bss_key_req_msg_tagged {
2328 	struct wcn36xx_hal_set_bss_key_req_msg Msg;
2329 	u32 tag;
2330 } __packed;
2331 
2332 struct wcn36xx_hal_set_bss_key_rsp_msg {
2333 	struct wcn36xx_hal_msg_header header;
2334 
2335 	/* success or failure */
2336 	u32 status;
2337 } __packed;
2338 
2339 /*
2340  * This is used  configure the key information on a given station.
2341  * When the sec_type is WEP40 or WEP104, the def_wep_idx is used to locate
2342  * a preconfigured key from a BSS the station associated with; otherwise
2343  * a new key descriptor is created based on the key field.
2344  */
2345 struct wcn36xx_hal_set_sta_key_req_msg {
2346 	struct wcn36xx_hal_msg_header header;
2347 	struct wcn36xx_hal_set_sta_key_params set_sta_key_params;
2348 } __packed;
2349 
2350 struct wcn36xx_hal_set_sta_key_rsp_msg {
2351 	struct wcn36xx_hal_msg_header header;
2352 
2353 	/* success or failure */
2354 	u32 status;
2355 } __packed;
2356 
2357 struct wcn36xx_hal_remove_bss_key_req_msg {
2358 	struct wcn36xx_hal_msg_header header;
2359 
2360 	/* BSS Index of the BSS */
2361 	u8 bss_idx;
2362 
2363 	/* Encryption Type used with peer */
2364 	enum ani_ed_type enc_type;
2365 
2366 	/* Key Id */
2367 	u8 key_id;
2368 
2369 	/* STATIC/DYNAMIC. Used in Nullifying in Key Descriptors for
2370 	 * Static/Dynamic keys */
2371 	enum ani_wep_type wep_type;
2372 } __packed;
2373 
2374 struct wcn36xx_hal_remove_bss_key_rsp_msg {
2375 	struct wcn36xx_hal_msg_header header;
2376 
2377 	/* success or failure */
2378 	u32 status;
2379 } __packed;
2380 
2381 /*
2382  * This is used by PE to Remove the key information on a given station.
2383  */
2384 struct wcn36xx_hal_remove_sta_key_req_msg {
2385 	struct wcn36xx_hal_msg_header header;
2386 
2387 	/* STA Index */
2388 	u16 sta_idx;
2389 
2390 	/* Encryption Type used with peer */
2391 	enum ani_ed_type enc_type;
2392 
2393 	/* Key Id */
2394 	u8 key_id;
2395 
2396 	/* Whether to invalidate the Broadcast key or Unicast key. In case
2397 	 * of WEP, the same key is used for both broadcast and unicast. */
2398 	u8 unicast;
2399 
2400 } __packed;
2401 
2402 struct wcn36xx_hal_remove_sta_key_rsp_msg {
2403 	struct wcn36xx_hal_msg_header header;
2404 
2405 	/*success or failure */
2406 	u32 status;
2407 
2408 } __packed;
2409 
2410 #ifdef FEATURE_OEM_DATA_SUPPORT
2411 
2412 #ifndef OEM_DATA_REQ_SIZE
2413 #define OEM_DATA_REQ_SIZE 134
2414 #endif
2415 
2416 #ifndef OEM_DATA_RSP_SIZE
2417 #define OEM_DATA_RSP_SIZE 1968
2418 #endif
2419 
2420 struct start_oem_data_req_msg {
2421 	struct wcn36xx_hal_msg_header header;
2422 
2423 	u32 status;
2424 	tSirMacAddr self_mac_addr;
2425 	u8 oem_data_req[OEM_DATA_REQ_SIZE];
2426 
2427 };
2428 
2429 struct start_oem_data_rsp_msg {
2430 	struct wcn36xx_hal_msg_header header;
2431 
2432 	u8 oem_data_rsp[OEM_DATA_RSP_SIZE];
2433 };
2434 
2435 #endif
2436 
2437 struct wcn36xx_hal_switch_channel_req_msg {
2438 	struct wcn36xx_hal_msg_header header;
2439 
2440 	/* Channel number */
2441 	u8 channel_number;
2442 
2443 	/* Local power constraint */
2444 	u8 local_power_constraint;
2445 
2446 	/* Secondary channel offset */
2447 	enum phy_chan_bond_state secondary_channel_offset;
2448 
2449 	/* HAL fills in the tx power used for mgmt frames in this field. */
2450 	u8 tx_mgmt_power;
2451 
2452 	/* Max TX power */
2453 	u8 max_tx_power;
2454 
2455 	/* Self STA MAC */
2456 	u8 self_sta_mac_addr[ETH_ALEN];
2457 
2458 	/* VO WIFI comment: BSSID needed to identify session. As the
2459 	 * request has power constraints, this should be applied only to
2460 	 * that session Since MTU timing and EDCA are sessionized, this
2461 	 * struct needs to be sessionized and bssid needs to be out of the
2462 	 * VOWifi feature flag V IMP: Keep bssId field at the end of this
2463 	 * msg. It is used to mantain backward compatbility by way of
2464 	 * ignoring if using new host/old FW or old host/new FW since it is
2465 	 * at the end of this struct
2466 	 */
2467 	u8 bssid[ETH_ALEN];
2468 } __packed;
2469 
2470 struct wcn36xx_hal_switch_channel_rsp_msg {
2471 	struct wcn36xx_hal_msg_header header;
2472 
2473 	/* Status */
2474 	u32 status;
2475 
2476 	/* Channel number - same as in request */
2477 	u8 channel_number;
2478 
2479 	/* HAL fills in the tx power used for mgmt frames in this field */
2480 	u8 tx_mgmt_power;
2481 
2482 	/* BSSID needed to identify session - same as in request */
2483 	u8 bssid[ETH_ALEN];
2484 
2485 } __packed;
2486 
2487 struct wcn36xx_hal_process_ptt_msg_req_msg {
2488 	struct wcn36xx_hal_msg_header header;
2489 
2490 	/* Actual FTM Command body */
2491 	u8 ptt_msg[];
2492 } __packed;
2493 
2494 struct wcn36xx_hal_process_ptt_msg_rsp_msg {
2495 	struct wcn36xx_hal_msg_header header;
2496 
2497 	/* FTM Command response status */
2498 	u32 ptt_msg_resp_status;
2499 	/* Actual FTM Command body */
2500 	u8 ptt_msg[];
2501 } __packed;
2502 
2503 struct update_edca_params_req_msg {
2504 	struct wcn36xx_hal_msg_header header;
2505 
2506 	/*BSS Index */
2507 	u16 bss_index;
2508 
2509 	/* Best Effort */
2510 	struct wcn36xx_hal_edca_param_record acbe;
2511 
2512 	/* Background */
2513 	struct wcn36xx_hal_edca_param_record acbk;
2514 
2515 	/* Video */
2516 	struct wcn36xx_hal_edca_param_record acvi;
2517 
2518 	/* Voice */
2519 	struct wcn36xx_hal_edca_param_record acvo;
2520 };
2521 
2522 struct update_edca_params_rsp_msg {
2523 	struct wcn36xx_hal_msg_header header;
2524 
2525 	/* success or failure */
2526 	u32 status;
2527 };
2528 
2529 struct dpu_stats_params {
2530 	/* Index of STA to which the statistics */
2531 	u16 sta_index;
2532 
2533 	/* Encryption mode */
2534 	u8 enc_mode;
2535 
2536 	/* status */
2537 	u32 status;
2538 
2539 	/* Statistics */
2540 	u32 send_blocks;
2541 	u32 recv_blocks;
2542 	u32 replays;
2543 	u8 mic_error_cnt;
2544 	u32 prot_excl_cnt;
2545 	u16 format_err_cnt;
2546 	u16 un_decryptable_cnt;
2547 	u32 decrypt_err_cnt;
2548 	u32 decrypt_ok_cnt;
2549 };
2550 
2551 struct wcn36xx_hal_stats_req_msg {
2552 	struct wcn36xx_hal_msg_header header;
2553 
2554 	/* Valid STA Idx for per STA stats request */
2555 	u32 sta_id;
2556 
2557 	/* Categories of stats requested as specified in eHalStatsMask */
2558 	u32 stats_mask;
2559 };
2560 
2561 struct ani_summary_stats_info {
2562 	/* Total number of packets(per AC) that were successfully
2563 	 * transmitted with retries */
2564 	u32 retry_cnt[4];
2565 
2566 	/* The number of MSDU packets and MMPDU frames per AC that the
2567 	 * 802.11 station successfully transmitted after more than one
2568 	 * retransmission attempt */
2569 	u32 multiple_retry_cnt[4];
2570 
2571 	/* Total number of packets(per AC) that were successfully
2572 	 * transmitted (with and without retries, including multi-cast,
2573 	 * broadcast) */
2574 	u32 tx_frm_cnt[4];
2575 
2576 	/* Total number of packets that were successfully received (after
2577 	 * appropriate filter rules including multi-cast, broadcast) */
2578 	u32 rx_frm_cnt;
2579 
2580 	/* Total number of duplicate frames received successfully */
2581 	u32 frm_dup_cnt;
2582 
2583 	/* Total number packets(per AC) failed to transmit */
2584 	u32 fail_cnt[4];
2585 
2586 	/* Total number of RTS/CTS sequence failures for transmission of a
2587 	 * packet */
2588 	u32 rts_fail_cnt;
2589 
2590 	/* Total number packets failed transmit because of no ACK from the
2591 	 * remote entity */
2592 	u32 ack_fail_cnt;
2593 
2594 	/* Total number of RTS/CTS sequence success for transmission of a
2595 	 * packet */
2596 	u32 rts_succ_cnt;
2597 
2598 	/* The sum of the receive error count and dropped-receive-buffer
2599 	 * error count. HAL will provide this as a sum of (FCS error) +
2600 	 * (Fail get BD/PDU in HW) */
2601 	u32 rx_discard_cnt;
2602 
2603 	/*
2604 	 * The receive error count. HAL will provide the RxP FCS error
2605 	 * global counter. */
2606 	u32 rx_error_cnt;
2607 
2608 	/* The sum of the transmit-directed byte count, transmit-multicast
2609 	 * byte count and transmit-broadcast byte count. HAL will sum TPE
2610 	 * UC/MC/BCAST global counters to provide this. */
2611 	u32 tx_byte_cnt;
2612 };
2613 
2614 /* defines tx_rate_flags */
2615 enum tx_rate_info {
2616 	/* Legacy rates */
2617 	HAL_TX_RATE_LEGACY = 0x1,
2618 
2619 	/* HT20 rates */
2620 	HAL_TX_RATE_HT20 = 0x2,
2621 
2622 	/* HT40 rates */
2623 	HAL_TX_RATE_HT40 = 0x4,
2624 
2625 	/* Rate with Short guard interval */
2626 	HAL_TX_RATE_SGI = 0x8,
2627 
2628 	/* Rate with Long guard interval */
2629 	HAL_TX_RATE_LGI = 0x10
2630 };
2631 
2632 struct ani_global_class_a_stats_info {
2633 	/* The number of MPDU frames received by the 802.11 station for
2634 	 * MSDU packets or MMPDU frames */
2635 	u32 rx_frag_cnt;
2636 
2637 	/* The number of MPDU frames received by the 802.11 station for
2638 	 * MSDU packets or MMPDU frames when a promiscuous packet filter
2639 	 * was enabled */
2640 	u32 promiscuous_rx_frag_cnt;
2641 
2642 	/* The receiver input sensitivity referenced to a FER of 8% at an
2643 	 * MPDU length of 1024 bytes at the antenna connector. Each element
2644 	 * of the array shall correspond to a supported rate and the order
2645 	 * shall be the same as the supporteRates parameter. */
2646 	u32 rx_input_sensitivity;
2647 
2648 	/* The maximum transmit power in dBm upto one decimal. for eg: if
2649 	 * it is 10.5dBm, the value would be 105 */
2650 	u32 max_pwr;
2651 
2652 	/* Number of times the receiver failed to synchronize with the
2653 	 * incoming signal after detecting the sync in the preamble of the
2654 	 * transmitted PLCP protocol data unit. */
2655 	u32 sync_fail_cnt;
2656 
2657 	/* Legacy transmit rate, in units of 500 kbit/sec, for the most
2658 	 * recently transmitted frame */
2659 	u32 tx_rate;
2660 
2661 	/* mcs index for HT20 and HT40 rates */
2662 	u32 mcs_index;
2663 
2664 	/* to differentiate between HT20 and HT40 rates; short and long
2665 	 * guard interval */
2666 	u32 tx_rate_flags;
2667 };
2668 
2669 struct ani_global_security_stats {
2670 	/* The number of unencrypted received MPDU frames that the MAC
2671 	 * layer discarded when the IEEE 802.11 dot11ExcludeUnencrypted
2672 	 * management information base (MIB) object is enabled */
2673 	u32 rx_wep_unencrypted_frm_cnt;
2674 
2675 	/* The number of received MSDU packets that that the 802.11 station
2676 	 * discarded because of MIC failures */
2677 	u32 rx_mic_fail_cnt;
2678 
2679 	/* The number of encrypted MPDU frames that the 802.11 station
2680 	 * failed to decrypt because of a TKIP ICV error */
2681 	u32 tkip_icv_err;
2682 
2683 	/* The number of received MPDU frames that the 802.11 discarded
2684 	 * because of an invalid AES-CCMP format */
2685 	u32 aes_ccmp_format_err;
2686 
2687 	/* The number of received MPDU frames that the 802.11 station
2688 	 * discarded because of the AES-CCMP replay protection procedure */
2689 	u32 aes_ccmp_replay_cnt;
2690 
2691 	/* The number of received MPDU frames that the 802.11 station
2692 	 * discarded because of errors detected by the AES-CCMP decryption
2693 	 * algorithm */
2694 	u32 aes_ccmp_decrpt_err;
2695 
2696 	/* The number of encrypted MPDU frames received for which a WEP
2697 	 * decryption key was not available on the 802.11 station */
2698 	u32 wep_undecryptable_cnt;
2699 
2700 	/* The number of encrypted MPDU frames that the 802.11 station
2701 	 * failed to decrypt because of a WEP ICV error */
2702 	u32 wep_icv_err;
2703 
2704 	/* The number of received encrypted packets that the 802.11 station
2705 	 * successfully decrypted */
2706 	u32 rx_decrypt_succ_cnt;
2707 
2708 	/* The number of encrypted packets that the 802.11 station failed
2709 	 * to decrypt */
2710 	u32 rx_decrypt_fail_cnt;
2711 };
2712 
2713 struct ani_global_class_b_stats_info {
2714 	struct ani_global_security_stats uc_stats;
2715 	struct ani_global_security_stats mc_bc_stats;
2716 };
2717 
2718 struct ani_global_class_c_stats_info {
2719 	/* This counter shall be incremented for a received A-MSDU frame
2720 	 * with the stations MAC address in the address 1 field or an
2721 	 * A-MSDU frame with a group address in the address 1 field */
2722 	u32 rx_amsdu_cnt;
2723 
2724 	/* This counter shall be incremented when the MAC receives an AMPDU
2725 	 * from the PHY */
2726 	u32 rx_ampdu_cnt;
2727 
2728 	/* This counter shall be incremented when a Frame is transmitted
2729 	 * only on the primary channel */
2730 	u32 tx_20_frm_cnt;
2731 
2732 	/* This counter shall be incremented when a Frame is received only
2733 	 * on the primary channel */
2734 	u32 rx_20_frm_cnt;
2735 
2736 	/* This counter shall be incremented by the number of MPDUs
2737 	 * received in the A-MPDU when an A-MPDU is received */
2738 	u32 rx_mpdu_in_ampdu_cnt;
2739 
2740 	/* This counter shall be incremented when an MPDU delimiter has a
2741 	 * CRC error when this is the first CRC error in the received AMPDU
2742 	 * or when the previous delimiter has been decoded correctly */
2743 	u32 ampdu_delimiter_crc_err;
2744 };
2745 
2746 struct ani_per_sta_stats_info {
2747 	/* The number of MPDU frames that the 802.11 station transmitted
2748 	 * and acknowledged through a received 802.11 ACK frame */
2749 	u32 tx_frag_cnt[4];
2750 
2751 	/* This counter shall be incremented when an A-MPDU is transmitted */
2752 	u32 tx_ampdu_cnt;
2753 
2754 	/* This counter shall increment by the number of MPDUs in the AMPDU
2755 	 * when an A-MPDU is transmitted */
2756 	u32 tx_mpdu_in_ampdu_cnt;
2757 };
2758 
2759 struct wcn36xx_hal_stats_rsp_msg {
2760 	struct wcn36xx_hal_msg_header header;
2761 
2762 	/* Success or Failure */
2763 	u32 status;
2764 
2765 	/* STA Idx */
2766 	u32 sta_index;
2767 
2768 	/* Categories of STATS being returned as per eHalStatsMask */
2769 	u32 stats_mask;
2770 
2771 	/* message type is same as the request type */
2772 	u16 msg_type;
2773 
2774 	/* length of the entire request, includes the pStatsBuf length too */
2775 	u16 msg_len;
2776 };
2777 
2778 struct wcn36xx_hal_set_link_state_req_msg {
2779 	struct wcn36xx_hal_msg_header header;
2780 
2781 	u8 bssid[ETH_ALEN];
2782 	enum wcn36xx_hal_link_state state;
2783 	u8 self_mac_addr[ETH_ALEN];
2784 
2785 } __packed;
2786 
2787 struct set_link_state_rsp_msg {
2788 	struct wcn36xx_hal_msg_header header;
2789 
2790 	/* success or failure */
2791 	u32 status;
2792 };
2793 
2794 /* TSPEC Params */
2795 struct wcn36xx_hal_ts_info_tfc {
2796 #ifndef ANI_LITTLE_BIT_ENDIAN
2797 	u16 ackPolicy:2;
2798 	u16 userPrio:3;
2799 	u16 psb:1;
2800 	u16 aggregation:1;
2801 	u16 accessPolicy:2;
2802 	u16 direction:2;
2803 	u16 tsid:4;
2804 	u16 trafficType:1;
2805 #else
2806 	u16 trafficType:1;
2807 	u16 tsid:4;
2808 	u16 direction:2;
2809 	u16 accessPolicy:2;
2810 	u16 aggregation:1;
2811 	u16 psb:1;
2812 	u16 userPrio:3;
2813 	u16 ackPolicy:2;
2814 #endif
2815 };
2816 
2817 /* Flag to schedule the traffic type */
2818 struct wcn36xx_hal_ts_info_sch {
2819 #ifndef ANI_LITTLE_BIT_ENDIAN
2820 	u8 rsvd:7;
2821 	u8 schedule:1;
2822 #else
2823 	u8 schedule:1;
2824 	u8 rsvd:7;
2825 #endif
2826 };
2827 
2828 /* Traffic and scheduling info */
2829 struct wcn36xx_hal_ts_info {
2830 	struct wcn36xx_hal_ts_info_tfc traffic;
2831 	struct wcn36xx_hal_ts_info_sch schedule;
2832 };
2833 
2834 /* Information elements */
2835 struct wcn36xx_hal_tspec_ie {
2836 	u8 type;
2837 	u8 length;
2838 	struct wcn36xx_hal_ts_info ts_info;
2839 	u16 nom_msdu_size;
2840 	u16 max_msdu_size;
2841 	u32 min_svc_interval;
2842 	u32 max_svc_interval;
2843 	u32 inact_interval;
2844 	u32 suspend_interval;
2845 	u32 svc_start_time;
2846 	u32 min_data_rate;
2847 	u32 mean_data_rate;
2848 	u32 peak_data_rate;
2849 	u32 max_burst_sz;
2850 	u32 delay_bound;
2851 	u32 min_phy_rate;
2852 	u16 surplus_bw;
2853 	u16 medium_time;
2854 };
2855 
2856 struct add_ts_req_msg {
2857 	struct wcn36xx_hal_msg_header header;
2858 
2859 	/* Station Index */
2860 	u16 sta_index;
2861 
2862 	/* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS */
2863 	u16 tspec_index;
2864 
2865 	/* To program TPE with required parameters */
2866 	struct wcn36xx_hal_tspec_ie tspec;
2867 
2868 	/* U-APSD Flags: 1b per AC.  Encoded as follows:
2869 	   b7 b6 b5 b4 b3 b2 b1 b0 =
2870 	   X  X  X  X  BE BK VI VO */
2871 	u8 uapsd;
2872 
2873 	/* These parameters are for all the access categories */
2874 
2875 	/* Service Interval */
2876 	u32 service_interval[WCN36XX_HAL_MAX_AC];
2877 
2878 	/* Suspend Interval */
2879 	u32 suspend_interval[WCN36XX_HAL_MAX_AC];
2880 
2881 	/* Delay Interval */
2882 	u32 delay_interval[WCN36XX_HAL_MAX_AC];
2883 };
2884 
2885 struct add_rs_rsp_msg {
2886 	struct wcn36xx_hal_msg_header header;
2887 
2888 	/* success or failure */
2889 	u32 status;
2890 };
2891 
2892 struct del_ts_req_msg {
2893 	struct wcn36xx_hal_msg_header header;
2894 
2895 	/* Station Index */
2896 	u16 sta_index;
2897 
2898 	/* TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS */
2899 	u16 tspec_index;
2900 
2901 	/* To lookup station id using the mac address */
2902 	u8 bssid[ETH_ALEN];
2903 };
2904 
2905 struct del_ts_rsp_msg {
2906 	struct wcn36xx_hal_msg_header header;
2907 
2908 	/* success or failure */
2909 	u32 status;
2910 };
2911 
2912 /* End of TSpec Parameters */
2913 
2914 /* Start of BLOCK ACK related Parameters */
2915 
2916 struct wcn36xx_hal_add_ba_session_req_msg {
2917 	struct wcn36xx_hal_msg_header header;
2918 
2919 	/* Station Index */
2920 	u16 sta_index;
2921 
2922 	/* Peer MAC Address */
2923 	u8 mac_addr[ETH_ALEN];
2924 
2925 	/* ADDBA Action Frame dialog token
2926 	   HAL will not interpret this object */
2927 	u8 dialog_token;
2928 
2929 	/* TID for which the BA is being setup
2930 	   This identifies the TC or TS of interest */
2931 	u8 tid;
2932 
2933 	/* 0 - Delayed BA (Not supported)
2934 	   1 - Immediate BA */
2935 	u8 policy;
2936 
2937 	/* Indicates the number of buffers for this TID (baTID)
2938 	   NOTE - This is the requested buffer size. When this
2939 	   is processed by HAL and subsequently by HDD, it is
2940 	   possible that HDD may change this buffer size. Any
2941 	   change in the buffer size should be noted by PE and
2942 	   advertized appropriately in the ADDBA response */
2943 	u16 buffer_size;
2944 
2945 	/* BA timeout in TU's 0 means no timeout will occur */
2946 	u16 timeout;
2947 
2948 	/* b0..b3 - Fragment Number - Always set to 0
2949 	   b4..b15 - Starting Sequence Number of first MSDU
2950 	   for which this BA is setup */
2951 	u16 ssn;
2952 
2953 	/* ADDBA direction
2954 	   1 - Originator
2955 	   0 - Recipient */
2956 	u8 direction;
2957 } __packed;
2958 
2959 struct wcn36xx_hal_add_ba_session_rsp_msg {
2960 	struct wcn36xx_hal_msg_header header;
2961 
2962 	/* success or failure */
2963 	u32 status;
2964 
2965 	/* Dialog token */
2966 	u8 dialog_token;
2967 
2968 	/* TID for which the BA session has been setup */
2969 	u8 ba_tid;
2970 
2971 	/* BA Buffer Size allocated for the current BA session */
2972 	u8 ba_buffer_size;
2973 
2974 	u8 ba_session_id;
2975 
2976 	/* Reordering Window buffer */
2977 	u8 win_size;
2978 
2979 	/* Station Index to id the sta */
2980 	u8 sta_index;
2981 
2982 	/* Starting Sequence Number */
2983 	u16 ssn;
2984 } __packed;
2985 
2986 struct wcn36xx_hal_add_ba_req_msg {
2987 	struct wcn36xx_hal_msg_header header;
2988 
2989 	/* Session Id */
2990 	u8 session_id;
2991 
2992 	/* Reorder Window Size */
2993 	u8 win_size;
2994 /* Old FW 1.2.2.4 does not support this*/
2995 #ifdef FEATURE_ON_CHIP_REORDERING
2996 	u8 reordering_done_on_chip;
2997 #endif
2998 } __packed;
2999 
3000 struct wcn36xx_hal_add_ba_rsp_msg {
3001 	struct wcn36xx_hal_msg_header header;
3002 
3003 	/* success or failure */
3004 	u32 status;
3005 
3006 	/* Dialog token */
3007 	u8 dialog_token;
3008 } __packed;
3009 
3010 struct add_ba_info {
3011 	u16 ba_enable:1;
3012 	u16 starting_seq_num:12;
3013 	u16 reserved:3;
3014 };
3015 
3016 struct wcn36xx_hal_trigger_ba_rsp_candidate {
3017 	u8 sta_addr[ETH_ALEN];
3018 	struct add_ba_info ba_info[STACFG_MAX_TC];
3019 } __packed;
3020 
3021 struct wcn36xx_hal_trigger_ba_req_candidate {
3022 	u8 sta_index;
3023 	u8 tid_bitmap;
3024 } __packed;
3025 
3026 struct wcn36xx_hal_trigger_ba_req_msg {
3027 	struct wcn36xx_hal_msg_header header;
3028 
3029 	/* Session Id */
3030 	u8 session_id;
3031 
3032 	/* baCandidateCnt is followed by trigger BA
3033 	 * Candidate List(tTriggerBaCandidate)
3034 	 */
3035 	u16 candidate_cnt;
3036 
3037 } __packed;
3038 
3039 struct wcn36xx_hal_trigger_ba_rsp_msg {
3040 	struct wcn36xx_hal_msg_header header;
3041 
3042 	/* TO SUPPORT BT-AMP */
3043 	u8 bssid[ETH_ALEN];
3044 
3045 	/* success or failure */
3046 	u32 status;
3047 
3048 	/* baCandidateCnt is followed by trigger BA
3049 	 * Rsp Candidate List(tTriggerRspBaCandidate)
3050 	 */
3051 	u16 candidate_cnt;
3052 } __packed;
3053 
3054 struct wcn36xx_hal_del_ba_req_msg {
3055 	struct wcn36xx_hal_msg_header header;
3056 
3057 	/* Station Index */
3058 	u16 sta_index;
3059 
3060 	/* TID for which the BA session is being deleted */
3061 	u8 tid;
3062 
3063 	/* DELBA direction
3064 	   1 - Originator
3065 	   0 - Recipient */
3066 	u8 direction;
3067 } __packed;
3068 
3069 struct wcn36xx_hal_del_ba_rsp_msg {
3070 	struct wcn36xx_hal_msg_header header;
3071 
3072 	/* success or failure */
3073 	u32 status;
3074 } __packed;
3075 
3076 struct tsm_stats_req_msg {
3077 	struct wcn36xx_hal_msg_header header;
3078 
3079 	/* Traffic Id */
3080 	u8 tid;
3081 
3082 	u8 bssid[ETH_ALEN];
3083 };
3084 
3085 struct tsm_stats_rsp_msg {
3086 	struct wcn36xx_hal_msg_header header;
3087 
3088 	/*success or failure */
3089 	u32 status;
3090 
3091 	/* Uplink Packet Queue delay */
3092 	u16 uplink_pkt_queue_delay;
3093 
3094 	/* Uplink Packet Queue delay histogram */
3095 	u16 uplink_pkt_queue_delay_hist[4];
3096 
3097 	/* Uplink Packet Transmit delay */
3098 	u32 uplink_pkt_tx_delay;
3099 
3100 	/* Uplink Packet loss */
3101 	u16 uplink_pkt_loss;
3102 
3103 	/* Uplink Packet count */
3104 	u16 uplink_pkt_count;
3105 
3106 	/* Roaming count */
3107 	u8 roaming_count;
3108 
3109 	/* Roaming Delay */
3110 	u16 roaming_delay;
3111 };
3112 
3113 struct set_key_done_msg {
3114 	struct wcn36xx_hal_msg_header header;
3115 
3116 	/*bssid of the keys */
3117 	u8 bssidx;
3118 	u8 enc_type;
3119 };
3120 
3121 struct wcn36xx_hal_nv_img_download_req_msg {
3122 	/* Note: The length specified in wcn36xx_hal_nv_img_download_req_msg
3123 	 * messages should be
3124 	 * header.len = sizeof(wcn36xx_hal_nv_img_download_req_msg) +
3125 	 * nv_img_buffer_size */
3126 	struct wcn36xx_hal_msg_header header;
3127 
3128 	/* Fragment sequence number of the NV Image. Note that NV Image
3129 	 * might not fit into one message due to size limitation of the SMD
3130 	 * channel FIFO. UMAC can hence choose to chop the NV blob into
3131 	 * multiple fragments starting with seqeunce number 0, 1, 2 etc.
3132 	 * The last fragment MUST be indicated by marking the
3133 	 * isLastFragment field to 1. Note that all the NV blobs would be
3134 	 * concatenated together by HAL without any padding bytes in
3135 	 * between.*/
3136 	u16 frag_number;
3137 
3138 	/* Is this the last fragment? When set to 1 it indicates that no
3139 	 * more fragments will be sent by UMAC and HAL can concatenate all
3140 	 * the NV blobs rcvd & proceed with the parsing. HAL would generate
3141 	 * a WCN36XX_HAL_DOWNLOAD_NV_RSP to the WCN36XX_HAL_DOWNLOAD_NV_REQ
3142 	 * after it receives each fragment */
3143 	u16 last_fragment;
3144 
3145 	/* NV Image size (number of bytes) */
3146 	u32 nv_img_buffer_size;
3147 
3148 	/* Following the 'nv_img_buffer_size', there should be
3149 	 * nv_img_buffer_size bytes of NV Image i.e.
3150 	 * u8[nv_img_buffer_size] */
3151 } __packed;
3152 
3153 struct wcn36xx_hal_nv_img_download_rsp_msg {
3154 	struct wcn36xx_hal_msg_header header;
3155 
3156 	/* Success or Failure. HAL would generate a
3157 	 * WCN36XX_HAL_DOWNLOAD_NV_RSP after each fragment */
3158 	u32 status;
3159 } __packed;
3160 
3161 struct wcn36xx_hal_nv_store_ind {
3162 	/* Note: The length specified in tHalNvStoreInd messages should be
3163 	 * header.msgLen = sizeof(tHalNvStoreInd) + nvBlobSize */
3164 	struct wcn36xx_hal_msg_header header;
3165 
3166 	/* NV Item */
3167 	u32 table_id;
3168 
3169 	/* Size of NV Blob */
3170 	u32 nv_blob_size;
3171 
3172 	/* Following the 'nvBlobSize', there should be nvBlobSize bytes of
3173 	 * NV blob i.e. u8[nvBlobSize] */
3174 };
3175 
3176 /* End of Block Ack Related Parameters */
3177 
3178 #define WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE 6
3179 
3180 /* Definition for MIC failure indication MAC reports this each time a MIC
3181  * failure occures on Rx TKIP packet
3182  */
3183 struct mic_failure_ind_msg {
3184 	struct wcn36xx_hal_msg_header header;
3185 
3186 	u8 bssid[ETH_ALEN];
3187 
3188 	/* address used to compute MIC */
3189 	u8 src_addr[ETH_ALEN];
3190 
3191 	/* transmitter address */
3192 	u8 ta_addr[ETH_ALEN];
3193 
3194 	u8 dst_addr[ETH_ALEN];
3195 
3196 	u8 multicast;
3197 
3198 	/* first byte of IV */
3199 	u8 iv1;
3200 
3201 	/* second byte of IV */
3202 	u8 key_id;
3203 
3204 	/* sequence number */
3205 	u8 tsc[WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE];
3206 
3207 	/* receive address */
3208 	u8 rx_addr[ETH_ALEN];
3209 };
3210 
3211 struct update_vht_op_mode_req_msg {
3212 	struct wcn36xx_hal_msg_header header;
3213 
3214 	u16 op_mode;
3215 	u16 sta_id;
3216 };
3217 
3218 struct update_vht_op_mode_params_rsp_msg {
3219 	struct wcn36xx_hal_msg_header header;
3220 
3221 	u32 status;
3222 };
3223 
3224 struct update_beacon_req_msg {
3225 	struct wcn36xx_hal_msg_header header;
3226 
3227 	u8 bss_index;
3228 
3229 	/* shortPreamble mode. HAL should update all the STA rates when it
3230 	 * receives this message */
3231 	u8 short_preamble;
3232 
3233 	/* short Slot time. */
3234 	u8 short_slot_time;
3235 
3236 	/* Beacon Interval */
3237 	u16 beacon_interval;
3238 
3239 	/* Protection related */
3240 	u8 lla_coexist;
3241 	u8 llb_coexist;
3242 	u8 llg_coexist;
3243 	u8 ht20_coexist;
3244 	u8 lln_non_gf_coexist;
3245 	u8 lsig_tx_op_protection_full_support;
3246 	u8 rifs_mode;
3247 
3248 	u16 param_change_bitmap;
3249 };
3250 
3251 struct update_beacon_rsp_msg {
3252 	struct wcn36xx_hal_msg_header header;
3253 	u32 status;
3254 };
3255 
3256 struct wcn36xx_hal_send_beacon_req_msg {
3257 	struct wcn36xx_hal_msg_header header;
3258 
3259 	/* length of the template + 6. Only qcom knows why */
3260 	u32 beacon_length6;
3261 
3262 	/* length of the template. */
3263 	u32 beacon_length;
3264 
3265 	/* Beacon data. */
3266 	u8 beacon[BEACON_TEMPLATE_SIZE - sizeof(u32)];
3267 
3268 	u8 bssid[ETH_ALEN];
3269 
3270 	/* TIM IE offset from the beginning of the template. */
3271 	u32 tim_ie_offset;
3272 
3273 	/* P2P IE offset from the begining of the template */
3274 	u16 p2p_ie_offset;
3275 } __packed;
3276 
3277 struct send_beacon_rsp_msg {
3278 	struct wcn36xx_hal_msg_header header;
3279 	u32 status;
3280 } __packed;
3281 
3282 struct enable_radar_req_msg {
3283 	struct wcn36xx_hal_msg_header header;
3284 
3285 	u8 bssid[ETH_ALEN];
3286 	u8 channel;
3287 };
3288 
3289 struct enable_radar_rsp_msg {
3290 	struct wcn36xx_hal_msg_header header;
3291 
3292 	/* Link Parameters */
3293 	u8 bssid[ETH_ALEN];
3294 
3295 	/* success or failure */
3296 	u32 status;
3297 };
3298 
3299 struct radar_detect_intr_ind_msg {
3300 	struct wcn36xx_hal_msg_header header;
3301 
3302 	u8 radar_det_channel;
3303 };
3304 
3305 struct radar_detect_ind_msg {
3306 	struct wcn36xx_hal_msg_header header;
3307 
3308 	/* channel number in which the RADAR detected */
3309 	u8 channel_number;
3310 
3311 	/* RADAR pulse width in usecond */
3312 	u16 radar_pulse_width;
3313 
3314 	/* Number of RADAR pulses */
3315 	u16 num_radar_pulse;
3316 };
3317 
3318 struct wcn36xx_hal_get_tpc_report_req_msg {
3319 	struct wcn36xx_hal_msg_header header;
3320 
3321 	u8 sta[ETH_ALEN];
3322 	u8 dialog_token;
3323 	u8 txpower;
3324 };
3325 
3326 struct wcn36xx_hal_get_tpc_report_rsp_msg {
3327 	struct wcn36xx_hal_msg_header header;
3328 
3329 	/* success or failure */
3330 	u32 status;
3331 };
3332 
3333 struct wcn36xx_hal_send_probe_resp_req_msg {
3334 	struct wcn36xx_hal_msg_header header;
3335 
3336 	u8 probe_resp_template[BEACON_TEMPLATE_SIZE];
3337 	u32 probe_resp_template_len;
3338 	u32 proxy_probe_req_valid_ie_bmap[8];
3339 	u8 bssid[ETH_ALEN];
3340 };
3341 
3342 struct send_probe_resp_rsp_msg {
3343 	struct wcn36xx_hal_msg_header header;
3344 
3345 	/* success or failure */
3346 	u32 status;
3347 };
3348 
3349 struct send_unknown_frame_rx_ind_msg {
3350 	struct wcn36xx_hal_msg_header header;
3351 
3352 	/* success or failure */
3353 	u32 status;
3354 };
3355 
3356 struct wcn36xx_hal_delete_sta_context_ind_msg {
3357 	struct wcn36xx_hal_msg_header header;
3358 
3359 	u16 aid;
3360 	u16 sta_id;
3361 
3362 	/* TO SUPPORT BT-AMP */
3363 	u8 bssid[ETH_ALEN];
3364 
3365 	/* HAL copies bssid from the sta table. */
3366 	u8 addr2[ETH_ALEN];
3367 
3368 	/* To unify the keepalive / unknown A2 / tim-based disa */
3369 	u16 reason_code;
3370 } __packed;
3371 
3372 struct indicate_del_sta {
3373 	struct wcn36xx_hal_msg_header header;
3374 	u8 aid;
3375 	u8 sta_index;
3376 	u8 bss_index;
3377 	u8 reason_code;
3378 	u32 status;
3379 };
3380 
3381 struct bt_amp_event_msg {
3382 	struct wcn36xx_hal_msg_header header;
3383 
3384 	enum bt_amp_event_type btAmpEventType;
3385 };
3386 
3387 struct bt_amp_event_rsp {
3388 	struct wcn36xx_hal_msg_header header;
3389 
3390 	/* success or failure */
3391 	u32 status;
3392 };
3393 
3394 struct tl_hal_flush_ac_req_msg {
3395 	struct wcn36xx_hal_msg_header header;
3396 
3397 	/* Station Index. originates from HAL */
3398 	u8 sta_id;
3399 
3400 	/* TID for which the transmit queue is being flushed */
3401 	u8 tid;
3402 };
3403 
3404 struct tl_hal_flush_ac_rsp_msg {
3405 	struct wcn36xx_hal_msg_header header;
3406 
3407 	/* Station Index. originates from HAL */
3408 	u8 sta_id;
3409 
3410 	/* TID for which the transmit queue is being flushed */
3411 	u8 tid;
3412 
3413 	/* success or failure */
3414 	u32 status;
3415 };
3416 
3417 struct wcn36xx_hal_enter_imps_req_msg {
3418 	struct wcn36xx_hal_msg_header header;
3419 } __packed;
3420 
3421 struct wcn36xx_hal_exit_imps_req_msg {
3422 	struct wcn36xx_hal_msg_header header;
3423 } __packed;
3424 
3425 struct wcn36xx_hal_enter_bmps_req_msg {
3426 	struct wcn36xx_hal_msg_header header;
3427 
3428 	u8 bss_index;
3429 
3430 	/* TBTT value derived from the last beacon */
3431 #ifndef BUILD_QWPTTSTATIC
3432 	u64 tbtt;
3433 #endif
3434 	u8 dtim_count;
3435 
3436 	/* DTIM period given to HAL during association may not be valid, if
3437 	 * association is based on ProbeRsp instead of beacon. */
3438 	u8 dtim_period;
3439 
3440 	/* For CCX and 11R Roaming */
3441 	u32 rssi_filter_period;
3442 
3443 	u32 num_beacon_per_rssi_average;
3444 	u8 rssi_filter_enable;
3445 } __packed;
3446 
3447 struct wcn36xx_hal_exit_bmps_req_msg {
3448 	struct wcn36xx_hal_msg_header header;
3449 
3450 	u8 send_data_null;
3451 	u8 bss_index;
3452 } __packed;
3453 
3454 struct wcn36xx_hal_missed_beacon_ind_msg {
3455 	struct wcn36xx_hal_msg_header header;
3456 
3457 	u8 bss_index;
3458 } __packed;
3459 
3460 /* Beacon Filtering data structures */
3461 
3462 struct beacon_filter_ie {
3463 	u8 element_id;
3464 	u8 check_ie_presence;
3465 	u8 offset;
3466 	u8 value;
3467 	u8 bitmask;
3468 	u8 ref;
3469 } __packed;
3470 
3471 #define WCN36XX_FILTER_CAPABILITY_MASK		0x73cf
3472 #define WCN36XX_FILTER_IE_DS_CHANNEL_MASK	0x00
3473 #define WCN36XX_FILTER_IE_ERP_FILTER_MASK	0xF8
3474 #define WCN36XX_FILTER_IE_EDCA_FILTER_MASK	0xF0
3475 #define WCN36XX_FILTER_IE_QOS_FILTER_MASK	0xF0
3476 #define WCN36XX_FILTER_IE_CHANNEL_SWITCH_MASK	0x00
3477 #define WCN36XX_FILTER_IE_HT_BYTE0_FILTER_MASK	0x00
3478 #define WCN36XX_FILTER_IE_HT_BYTE1_FILTER_MASK	0xF8
3479 #define WCN36XX_FILTER_IE_HT_BYTE2_FILTER_MASK	0xEB
3480 #define WCN36XX_FILTER_IE_HT_BYTE5_FILTER_MASK	0xFD
3481 #define WCN36XX_FILTER_IE_PWR_CONSTRAINT_MASK	0x00
3482 #define WCN36XX_FILTER_IE_OPMODE_NOTIF_MASK	0x00
3483 #define WCN36XX_FILTER_IE_VHTOP_CHWIDTH_MASK	0xFC
3484 #define WCN36XX_FILTER_IE_RSN_MASK		0x00
3485 #define WCN36XX_FILTER_IE_VENDOR_MASK		0x00
3486 
3487 /* The above structure would be followed by multiple of below mentioned
3488  * structure
3489  */
3490 
3491 struct wcn36xx_hal_add_bcn_filter_req_msg {
3492 	struct wcn36xx_hal_msg_header header;
3493 
3494 	u16 capability_info;
3495 	u16 capability_mask;
3496 	u16 beacon_interval;
3497 	u16 ie_num;
3498 	u8 bss_index;
3499 	u8 reserved;
3500 } __packed;
3501 
3502 struct wcn36xx_hal_rem_bcn_filter_req {
3503 	struct wcn36xx_hal_msg_header header;
3504 
3505 	u8 ie_Count;
3506 	u8 rem_ie_id[1];
3507 } __packed;
3508 
3509 #define WCN36XX_HAL_IPV4_ARP_REPLY_OFFLOAD                  0
3510 #define WCN36XX_HAL_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD         1
3511 #define WCN36XX_HAL_IPV6_NS_OFFLOAD                         2
3512 #define WCN36XX_HAL_IPV6_ADDR_LEN                           16
3513 #define WCN36XX_HAL_OFFLOAD_DISABLE                         0
3514 #define WCN36XX_HAL_OFFLOAD_ENABLE                          1
3515 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE             0x2
3516 #define WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE             0x4
3517 #define WCN36XX_HAL_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE	\
3518 	(WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE)
3519 #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE	\
3520 	(WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE)
3521 #define WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX		0x02
3522 
3523 struct wcn36xx_hal_ns_offload_params {
3524 	u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
3525 	u8 self_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
3526 
3527 	/* Only support 2 possible Network Advertisement IPv6 address */
3528 	u8 target_ipv6_addr1[WCN36XX_HAL_IPV6_ADDR_LEN];
3529 	u8 target_ipv6_addr2[WCN36XX_HAL_IPV6_ADDR_LEN];
3530 
3531 	u8 self_addr[ETH_ALEN];
3532 	u8 src_ipv6_addr_valid:1;
3533 	u8 target_ipv6_addr1_valid:1;
3534 	u8 target_ipv6_addr2_valid:1;
3535 	u8 reserved1:5;
3536 
3537 	/* make it DWORD aligned */
3538 	u8 reserved2;
3539 
3540 	/* slot index for this offload */
3541 	u32 slot_index;
3542 	u8 bss_index;
3543 } __packed;
3544 
3545 struct wcn36xx_hal_host_offload_req {
3546 	u8 offload_type;
3547 
3548 	/* enable or disable */
3549 	u8 enable;
3550 
3551 	union {
3552 		u8 host_ipv4_addr[4];
3553 		u8 host_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
3554 	} u;
3555 } __packed;
3556 
3557 struct wcn36xx_hal_host_offload_req_msg {
3558 	struct wcn36xx_hal_msg_header header;
3559 	struct wcn36xx_hal_host_offload_req host_offload_params;
3560 	struct wcn36xx_hal_ns_offload_params ns_offload_params;
3561 } __packed;
3562 
3563 /* Packet Types. */
3564 #define WCN36XX_HAL_KEEP_ALIVE_NULL_PKT              1
3565 #define WCN36XX_HAL_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
3566 
3567 /* Enable or disable keep alive */
3568 #define WCN36XX_HAL_KEEP_ALIVE_DISABLE   0
3569 #define WCN36XX_HAL_KEEP_ALIVE_ENABLE    1
3570 #define WCN36XX_KEEP_ALIVE_TIME_PERIOD	 30 /* unit: s */
3571 
3572 /* Keep Alive request. */
3573 struct wcn36xx_hal_keep_alive_req_msg {
3574 	struct wcn36xx_hal_msg_header header;
3575 
3576 	u8 packet_type;
3577 	u32 time_period;
3578 	u8 host_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN];
3579 	u8 dest_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN];
3580 	u8 dest_addr[ETH_ALEN];
3581 	u8 bss_index;
3582 } __packed;
3583 
3584 struct wcn36xx_hal_rssi_threshold_req_msg {
3585 	struct wcn36xx_hal_msg_header header;
3586 
3587 	s8 threshold1:8;
3588 	s8 threshold2:8;
3589 	s8 threshold3:8;
3590 	u8 thres1_pos_notify:1;
3591 	u8 thres1_neg_notify:1;
3592 	u8 thres2_pos_notify:1;
3593 	u8 thres2_neg_notify:1;
3594 	u8 thres3_pos_notify:1;
3595 	u8 thres3_neg_notify:1;
3596 	u8 reserved10:2;
3597 };
3598 
3599 struct wcn36xx_hal_enter_uapsd_req_msg {
3600 	struct wcn36xx_hal_msg_header header;
3601 
3602 	u8 bk_delivery:1;
3603 	u8 be_delivery:1;
3604 	u8 vi_delivery:1;
3605 	u8 vo_delivery:1;
3606 	u8 bk_trigger:1;
3607 	u8 be_trigger:1;
3608 	u8 vi_trigger:1;
3609 	u8 vo_trigger:1;
3610 	u8 bss_index;
3611 };
3612 
3613 struct wcn36xx_hal_exit_uapsd_req_msg {
3614 	struct wcn36xx_hal_msg_header header;
3615 	u8 bss_index;
3616 };
3617 
3618 #define WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE 128
3619 #define WCN36XX_HAL_WOWL_BCAST_MAX_NUM_PATTERNS 16
3620 
3621 struct wcn36xx_hal_wowl_add_bcast_ptrn_req_msg {
3622 	struct wcn36xx_hal_msg_header header;
3623 
3624 	/* Pattern ID */
3625 	u8 id;
3626 
3627 	/* Pattern byte offset from beginning of the 802.11 packet to start
3628 	 * of the wake-up pattern */
3629 	u8 byte_Offset;
3630 
3631 	/* Non-Zero Pattern size */
3632 	u8 size;
3633 
3634 	/* Pattern */
3635 	u8 pattern[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
3636 
3637 	/* Non-zero pattern mask size */
3638 	u8 mask_size;
3639 
3640 	/* Pattern mask */
3641 	u8 mask[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
3642 
3643 	/* Extra pattern */
3644 	u8 extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
3645 
3646 	/* Extra pattern mask */
3647 	u8 mask_extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
3648 
3649 	u8 bss_index;
3650 };
3651 
3652 struct wcn36xx_hal_wow_del_bcast_ptrn_req_msg {
3653 	struct wcn36xx_hal_msg_header header;
3654 
3655 	/* Pattern ID of the wakeup pattern to be deleted */
3656 	u8 id;
3657 	u8 bss_index;
3658 };
3659 
3660 struct wcn36xx_hal_wowl_enter_req_msg {
3661 	struct wcn36xx_hal_msg_header header;
3662 
3663 	/* Enables/disables magic packet filtering */
3664 	u8 magic_packet_enable;
3665 
3666 	/* Magic pattern */
3667 	u8 magic_pattern[ETH_ALEN];
3668 
3669 	/* Enables/disables packet pattern filtering in firmware. Enabling
3670 	 * this flag enables broadcast pattern matching in Firmware. If
3671 	 * unicast pattern matching is also desired,
3672 	 * ucUcastPatternFilteringEnable flag must be set tot true as well
3673 	 */
3674 	u8 pattern_filtering_enable;
3675 
3676 	/* Enables/disables unicast packet pattern filtering. This flag
3677 	 * specifies whether we want to do pattern match on unicast packets
3678 	 * as well and not just broadcast packets. This flag has no effect
3679 	 * if the ucPatternFilteringEnable (main controlling flag) is set
3680 	 * to false
3681 	 */
3682 	u8 ucast_pattern_filtering_enable;
3683 
3684 	/* This configuration is valid only when magicPktEnable=1. It
3685 	 * requests hardware to wake up when it receives the Channel Switch
3686 	 * Action Frame.
3687 	 */
3688 	u8 wow_channel_switch_receive;
3689 
3690 	/* This configuration is valid only when magicPktEnable=1. It
3691 	 * requests hardware to wake up when it receives the
3692 	 * Deauthentication Frame.
3693 	 */
3694 	u8 wow_deauth_receive;
3695 
3696 	/* This configuration is valid only when magicPktEnable=1. It
3697 	 * requests hardware to wake up when it receives the Disassociation
3698 	 * Frame.
3699 	 */
3700 	u8 wow_disassoc_receive;
3701 
3702 	/* This configuration is valid only when magicPktEnable=1. It
3703 	 * requests hardware to wake up when it has missed consecutive
3704 	 * beacons. This is a hardware register configuration (NOT a
3705 	 * firmware configuration).
3706 	 */
3707 	u8 wow_max_missed_beacons;
3708 
3709 	/* This configuration is valid only when magicPktEnable=1. This is
3710 	 * a timeout value in units of microsec. It requests hardware to
3711 	 * unconditionally wake up after it has stayed in WoWLAN mode for
3712 	 * some time. Set 0 to disable this feature.
3713 	 */
3714 	u8 wow_max_sleep;
3715 
3716 	/* This configuration directs the WoW packet filtering to look for
3717 	 * EAP-ID requests embedded in EAPOL frames and use this as a wake
3718 	 * source.
3719 	 */
3720 	u8 wow_eap_id_request_enable;
3721 
3722 	/* This configuration directs the WoW packet filtering to look for
3723 	 * EAPOL-4WAY requests and use this as a wake source.
3724 	 */
3725 	u8 wow_eapol_4way_enable;
3726 
3727 	/* This configuration allows a host wakeup on an network scan
3728 	 * offload match.
3729 	 */
3730 	u8 wow_net_scan_offload_match;
3731 
3732 	/* This configuration allows a host wakeup on any GTK rekeying
3733 	 * error.
3734 	 */
3735 	u8 wow_gtk_rekey_error;
3736 
3737 	/* This configuration allows a host wakeup on BSS connection loss.
3738 	 */
3739 	u8 wow_bss_connection_loss;
3740 
3741 	u8 bss_index;
3742 };
3743 
3744 struct wcn36xx_hal_wowl_exit_req_msg {
3745 	struct wcn36xx_hal_msg_header header;
3746 
3747 	u8 bss_index;
3748 };
3749 
3750 struct wcn36xx_hal_get_rssi_req_msg {
3751 	struct wcn36xx_hal_msg_header header;
3752 };
3753 
3754 struct wcn36xx_hal_get_roam_rssi_req_msg {
3755 	struct wcn36xx_hal_msg_header header;
3756 
3757 	/* Valid STA Idx for per STA stats request */
3758 	u32 sta_id;
3759 };
3760 
3761 struct wcn36xx_hal_set_uapsd_ac_params_req_msg {
3762 	struct wcn36xx_hal_msg_header header;
3763 
3764 	/* STA index */
3765 	u8 sta_idx;
3766 
3767 	/* Access Category */
3768 	u8 ac;
3769 
3770 	/* User Priority */
3771 	u8 up;
3772 
3773 	/* Service Interval */
3774 	u32 service_interval;
3775 
3776 	/* Suspend Interval */
3777 	u32 suspend_interval;
3778 
3779 	/* Delay Interval */
3780 	u32 delay_interval;
3781 };
3782 
3783 struct wcn36xx_hal_configure_rxp_filter_req_msg {
3784 	struct wcn36xx_hal_msg_header header;
3785 
3786 	u8 set_mcst_bcst_filter_setting;
3787 	u8 set_mcst_bcst_filter;
3788 };
3789 
3790 struct wcn36xx_hal_enter_imps_rsp_msg {
3791 	struct wcn36xx_hal_msg_header header;
3792 
3793 	/* success or failure */
3794 	u32 status;
3795 };
3796 
3797 struct wcn36xx_hal_exit_imps_rsp_msg {
3798 	struct wcn36xx_hal_msg_header header;
3799 
3800 	/* success or failure */
3801 	u32 status;
3802 };
3803 
3804 struct wcn36xx_hal_enter_bmps_rsp_msg {
3805 	struct wcn36xx_hal_msg_header header;
3806 
3807 	/* success or failure */
3808 	u32 status;
3809 
3810 	u8 bss_index;
3811 } __packed;
3812 
3813 struct wcn36xx_hal_exit_bmps_rsp_msg {
3814 	struct wcn36xx_hal_msg_header header;
3815 
3816 	/* success or failure */
3817 	u32 status;
3818 
3819 	u8 bss_index;
3820 } __packed;
3821 
3822 struct wcn36xx_hal_enter_uapsd_rsp_msg {
3823 	struct wcn36xx_hal_msg_header header;
3824 
3825 	/* success or failure */
3826 	u32 status;
3827 
3828 	u8 bss_index;
3829 };
3830 
3831 struct wcn36xx_hal_exit_uapsd_rsp_msg {
3832 	struct wcn36xx_hal_msg_header header;
3833 
3834 	/* success or failure */
3835 	u32 status;
3836 
3837 	u8 bss_index;
3838 };
3839 
3840 struct wcn36xx_hal_rssi_notification_ind_msg {
3841 	struct wcn36xx_hal_msg_header header;
3842 
3843 	u32 rssi_thres1_pos_cross:1;
3844 	u32 rssi_thres1_neg_cross:1;
3845 	u32 rssi_thres2_pos_cross:1;
3846 	u32 rssi_thres2_neg_cross:1;
3847 	u32 rssi_thres3_pos_cross:1;
3848 	u32 rssi_thres3_neg_cross:1;
3849 	u32 avg_rssi:8;
3850 	u32 reserved:18;
3851 
3852 };
3853 
3854 struct wcn36xx_hal_get_rssio_rsp_msg {
3855 	struct wcn36xx_hal_msg_header header;
3856 
3857 	/* success or failure */
3858 	u32 status;
3859 	s8 rssi;
3860 
3861 };
3862 
3863 struct wcn36xx_hal_get_roam_rssi_rsp_msg {
3864 	struct wcn36xx_hal_msg_header header;
3865 
3866 	/* success or failure */
3867 	u32 status;
3868 
3869 	u8 sta_id;
3870 	s8 rssi;
3871 };
3872 
3873 struct wcn36xx_hal_wowl_enter_rsp_msg {
3874 	struct wcn36xx_hal_msg_header header;
3875 
3876 	/* success or failure */
3877 	u32 status;
3878 	u8 bss_index;
3879 };
3880 
3881 struct wcn36xx_hal_wowl_exit_rsp_msg {
3882 	struct wcn36xx_hal_msg_header header;
3883 
3884 	/* success or failure */
3885 	u32 status;
3886 	u8 bss_index;
3887 };
3888 
3889 struct wcn36xx_hal_add_bcn_filter_rsp_msg {
3890 	struct wcn36xx_hal_msg_header header;
3891 
3892 	/* success or failure */
3893 	u32 status;
3894 };
3895 
3896 struct wcn36xx_hal_rem_bcn_filter_rsp_msg {
3897 	struct wcn36xx_hal_msg_header header;
3898 
3899 	/* success or failure */
3900 	u32 status;
3901 };
3902 
3903 struct wcn36xx_hal_add_wowl_bcast_ptrn_rsp_msg {
3904 	struct wcn36xx_hal_msg_header header;
3905 
3906 	/* success or failure */
3907 	u32 status;
3908 	u8 bss_index;
3909 };
3910 
3911 struct wcn36xx_hal_del_wowl_bcast_ptrn_rsp_msg {
3912 	struct wcn36xx_hal_msg_header header;
3913 
3914 	/* success or failure */
3915 	u32 status;
3916 	u8 bss_index;
3917 };
3918 
3919 struct wcn36xx_hal_host_offload_rsp_msg {
3920 	struct wcn36xx_hal_msg_header header;
3921 
3922 	/* success or failure */
3923 	u32 status;
3924 };
3925 
3926 struct wcn36xx_hal_keep_alive_rsp_msg {
3927 	struct wcn36xx_hal_msg_header header;
3928 
3929 	/* success or failure */
3930 	u32 status;
3931 };
3932 
3933 struct wcn36xx_hal_set_rssi_thresh_rsp_msg {
3934 	struct wcn36xx_hal_msg_header header;
3935 
3936 	/* success or failure */
3937 	u32 status;
3938 };
3939 
3940 struct wcn36xx_hal_set_uapsd_ac_params_rsp_msg {
3941 	struct wcn36xx_hal_msg_header header;
3942 
3943 	/* success or failure */
3944 	u32 status;
3945 };
3946 
3947 struct wcn36xx_hal_configure_rxp_filter_rsp_msg {
3948 	struct wcn36xx_hal_msg_header header;
3949 
3950 	/* success or failure */
3951 	u32 status;
3952 };
3953 
3954 struct set_max_tx_pwr_req {
3955 	struct wcn36xx_hal_msg_header header;
3956 
3957 	/* BSSID is needed to identify which session issued this request.
3958 	 * As the request has power constraints, this should be applied
3959 	 * only to that session */
3960 	u8 bssid[ETH_ALEN];
3961 
3962 	u8 self_addr[ETH_ALEN];
3963 
3964 	/* In request, power == MaxTx power to be used. */
3965 	u8 power;
3966 };
3967 
3968 struct set_max_tx_pwr_rsp_msg {
3969 	struct wcn36xx_hal_msg_header header;
3970 
3971 	/* power == tx power used for management frames */
3972 	u8 power;
3973 
3974 	/* success or failure */
3975 	u32 status;
3976 };
3977 
3978 struct set_tx_pwr_req_msg {
3979 	struct wcn36xx_hal_msg_header header;
3980 
3981 	/* TX Power in milli watts */
3982 	u32 tx_power;
3983 
3984 	u8 bss_index;
3985 };
3986 
3987 struct set_tx_pwr_rsp_msg {
3988 	struct wcn36xx_hal_msg_header header;
3989 
3990 	/* success or failure */
3991 	u32 status;
3992 };
3993 
3994 struct get_tx_pwr_req_msg {
3995 	struct wcn36xx_hal_msg_header header;
3996 
3997 	u8 sta_id;
3998 };
3999 
4000 struct get_tx_pwr_rsp_msg {
4001 	struct wcn36xx_hal_msg_header header;
4002 
4003 	/* success or failure */
4004 	u32 status;
4005 
4006 	/* TX Power in milli watts */
4007 	u32 tx_power;
4008 };
4009 
4010 struct set_p2p_gonoa_req_msg {
4011 	struct wcn36xx_hal_msg_header header;
4012 
4013 	u8 opp_ps;
4014 	u32 ct_window;
4015 	u8 count;
4016 	u32 duration;
4017 	u32 interval;
4018 	u32 single_noa_duration;
4019 	u8 ps_selection;
4020 };
4021 
4022 struct set_p2p_gonoa_rsp_msg {
4023 	struct wcn36xx_hal_msg_header header;
4024 
4025 	/* success or failure */
4026 	u32 status;
4027 };
4028 
4029 struct wcn36xx_hal_add_sta_self_req {
4030 	struct wcn36xx_hal_msg_header header;
4031 
4032 	u8 self_addr[ETH_ALEN];
4033 	u32 status;
4034 } __packed;
4035 
4036 struct wcn36xx_hal_add_sta_self_rsp_msg {
4037 	struct wcn36xx_hal_msg_header header;
4038 
4039 	/* success or failure */
4040 	u32 status;
4041 
4042 	/* Self STA Index */
4043 	u8 self_sta_index;
4044 
4045 	/* DPU Index (IGTK, PTK, GTK all same) */
4046 	u8 dpu_index;
4047 
4048 	/* DPU Signature */
4049 	u8 dpu_signature;
4050 } __packed;
4051 
4052 struct wcn36xx_hal_del_sta_self_req_msg {
4053 	struct wcn36xx_hal_msg_header header;
4054 
4055 	u8 self_addr[ETH_ALEN];
4056 } __packed;
4057 
4058 struct wcn36xx_hal_del_sta_self_rsp_msg {
4059 	struct wcn36xx_hal_msg_header header;
4060 
4061 	/*success or failure */
4062 	u32 status;
4063 
4064 	u8 self_addr[ETH_ALEN];
4065 } __packed;
4066 
4067 struct aggr_add_ts_req {
4068 	struct wcn36xx_hal_msg_header header;
4069 
4070 	/* Station Index */
4071 	u16 sta_idx;
4072 
4073 	/* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS.
4074 	 * This will carry the bitmap with the bit positions representing
4075 	 * different AC.s */
4076 	u16 tspec_index;
4077 
4078 	/* Tspec info per AC To program TPE with required parameters */
4079 	struct wcn36xx_hal_tspec_ie tspec[WCN36XX_HAL_MAX_AC];
4080 
4081 	/* U-APSD Flags: 1b per AC.  Encoded as follows:
4082 	   b7 b6 b5 b4 b3 b2 b1 b0 =
4083 	   X  X  X  X  BE BK VI VO */
4084 	u8 uapsd;
4085 
4086 	/* These parameters are for all the access categories */
4087 
4088 	/* Service Interval */
4089 	u32 service_interval[WCN36XX_HAL_MAX_AC];
4090 
4091 	/* Suspend Interval */
4092 	u32 suspend_interval[WCN36XX_HAL_MAX_AC];
4093 
4094 	/* Delay Interval */
4095 	u32 delay_interval[WCN36XX_HAL_MAX_AC];
4096 };
4097 
4098 struct aggr_add_ts_rsp_msg {
4099 	struct wcn36xx_hal_msg_header header;
4100 
4101 	/* success or failure */
4102 	u32 status0;
4103 
4104 	/* FIXME PRIMA for future use for 11R */
4105 	u32 status1;
4106 };
4107 
4108 struct wcn36xx_hal_configure_apps_cpu_wakeup_state_req_msg {
4109 	struct wcn36xx_hal_msg_header header;
4110 
4111 	u8 is_apps_cpu_awake;
4112 };
4113 
4114 struct wcn36xx_hal_configure_apps_cpu_wakeup_state_rsp_msg {
4115 	struct wcn36xx_hal_msg_header header;
4116 
4117 	/* success or failure */
4118 	u32 status;
4119 };
4120 
4121 struct wcn36xx_hal_dump_cmd_req_msg {
4122 	struct wcn36xx_hal_msg_header header;
4123 
4124 	u32 arg1;
4125 	u32 arg2;
4126 	u32 arg3;
4127 	u32 arg4;
4128 	u32 arg5;
4129 } __packed;
4130 
4131 struct wcn36xx_hal_dump_cmd_rsp_msg {
4132 	struct wcn36xx_hal_msg_header header;
4133 
4134 	/* success or failure */
4135 	u32 status;
4136 
4137 	/* Length of the responce message */
4138 	u32 rsp_length;
4139 
4140 	/* FIXME: Currently considering the the responce will be less than
4141 	 * 100bytes */
4142 	u8 rsp_buffer[DUMPCMD_RSP_BUFFER];
4143 } __packed;
4144 
4145 #define WLAN_COEX_IND_DATA_SIZE (4)
4146 #define WLAN_COEX_IND_TYPE_DISABLE_HB_MONITOR (0)
4147 #define WLAN_COEX_IND_TYPE_ENABLE_HB_MONITOR (1)
4148 
4149 struct coex_ind_msg {
4150 	struct wcn36xx_hal_msg_header header;
4151 
4152 	/* Coex Indication Type */
4153 	u32 type;
4154 
4155 	/* Coex Indication Data */
4156 	u32 data[WLAN_COEX_IND_DATA_SIZE];
4157 };
4158 
4159 struct wcn36xx_hal_tx_compl_ind_msg {
4160 	struct wcn36xx_hal_msg_header header;
4161 
4162 	/* Tx Complete Indication Success or Failure */
4163 	u32 status;
4164 };
4165 
4166 struct wcn36xx_hal_wlan_host_suspend_ind_msg {
4167 	struct wcn36xx_hal_msg_header header;
4168 
4169 	u32 configured_mcst_bcst_filter_setting;
4170 	u32 active_session_count;
4171 };
4172 
4173 struct wcn36xx_hal_wlan_exclude_unencrpted_ind_msg {
4174 	struct wcn36xx_hal_msg_header header;
4175 
4176 	u8 dot11_exclude_unencrypted;
4177 	u8 bssid[ETH_ALEN];
4178 };
4179 
4180 struct noa_attr_ind_msg {
4181 	struct wcn36xx_hal_msg_header header;
4182 
4183 	u8 index;
4184 	u8 opp_ps_flag;
4185 	u16 ctwin;
4186 
4187 	u16 noa1_interval_count;
4188 	u16 bss_index;
4189 	u32 noa1_duration;
4190 	u32 noa1_interval;
4191 	u32 noa1_starttime;
4192 
4193 	u16 noa2_interval_count;
4194 	u16 reserved2;
4195 	u32 noa2_duration;
4196 	u32 noa2_interval;
4197 	u32 noa2_start_time;
4198 
4199 	u32 status;
4200 };
4201 
4202 struct noa_start_ind_msg {
4203 	struct wcn36xx_hal_msg_header header;
4204 
4205 	u32 status;
4206 	u32 bss_index;
4207 };
4208 
4209 struct wcn36xx_hal_wlan_host_resume_req_msg {
4210 	struct wcn36xx_hal_msg_header header;
4211 
4212 	u8 configured_mcst_bcst_filter_setting;
4213 };
4214 
4215 struct wcn36xx_hal_host_resume_rsp_msg {
4216 	struct wcn36xx_hal_msg_header header;
4217 
4218 	/* success or failure */
4219 	u32 status;
4220 };
4221 
4222 struct wcn36xx_hal_del_ba_ind_msg {
4223 	struct wcn36xx_hal_msg_header header;
4224 
4225 	u16 sta_idx;
4226 
4227 	/* Peer MAC Address, whose BA session has timed out */
4228 	u8 peer_addr[ETH_ALEN];
4229 
4230 	/* TID for which a BA session timeout is being triggered */
4231 	u8 ba_tid;
4232 
4233 	/* DELBA direction
4234 	 * 1 - Originator
4235 	 * 0 - Recipient
4236 	 */
4237 	u8 direction;
4238 
4239 	u32 reason_code;
4240 
4241 	/* TO SUPPORT BT-AMP */
4242 	u8 bssid[ETH_ALEN];
4243 };
4244 
4245 /* PNO Messages */
4246 
4247 /* Max number of channels that a network can be found on */
4248 #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS  26
4249 
4250 /* Max number of channels that a network can be found on */
4251 #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX  60
4252 
4253 /* Maximum numbers of networks supported by PNO */
4254 #define WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS  16
4255 
4256 /* The number of scan time intervals that can be programmed into PNO */
4257 #define WCN36XX_HAL_PNO_MAX_SCAN_TIMERS    10
4258 
4259 /* Maximum size of the probe template */
4260 #define WCN36XX_HAL_PNO_MAX_PROBE_SIZE     450
4261 
4262 /* Type of PNO enabling:
4263  *
4264  * Immediate - scanning will start immediately and PNO procedure will be
4265  * repeated based on timer
4266  *
4267  * Suspend - scanning will start at suspend
4268  *
4269  * Resume - scanning will start on system resume
4270  */
4271 enum pno_mode {
4272 	PNO_MODE_IMMEDIATE,
4273 	PNO_MODE_ON_SUSPEND,
4274 	PNO_MODE_ON_RESUME,
4275 	PNO_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
4276 };
4277 
4278 /* Authentication type */
4279 enum auth_type {
4280 	AUTH_TYPE_ANY = 0,
4281 	AUTH_TYPE_OPEN_SYSTEM = 1,
4282 
4283 	/* Upper layer authentication types */
4284 	AUTH_TYPE_WPA = 2,
4285 	AUTH_TYPE_WPA_PSK = 3,
4286 
4287 	AUTH_TYPE_RSN = 4,
4288 	AUTH_TYPE_RSN_PSK = 5,
4289 	AUTH_TYPE_FT_RSN = 6,
4290 	AUTH_TYPE_FT_RSN_PSK = 7,
4291 	AUTH_TYPE_WAPI_WAI_CERTIFICATE = 8,
4292 	AUTH_TYPE_WAPI_WAI_PSK = 9,
4293 
4294 	AUTH_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
4295 };
4296 
4297 /* Encryption type */
4298 enum ed_type {
4299 	ED_ANY = 0,
4300 	ED_NONE = 1,
4301 	ED_WEP = 2,
4302 	ED_TKIP = 3,
4303 	ED_CCMP = 4,
4304 	ED_WPI = 5,
4305 
4306 	ED_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
4307 };
4308 
4309 /* SSID broadcast  type */
4310 enum ssid_bcast_type {
4311 	BCAST_UNKNOWN = 0,
4312 	BCAST_NORMAL = 1,
4313 	BCAST_HIDDEN = 2,
4314 
4315 	BCAST_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
4316 };
4317 
4318 /* The network description for which PNO will have to look for */
4319 struct network_type {
4320 	/* SSID of the BSS */
4321 	struct wcn36xx_hal_mac_ssid ssid;
4322 
4323 	/* Authentication type for the network */
4324 	enum auth_type authentication;
4325 
4326 	/* Encryption type for the network */
4327 	enum ed_type encryption;
4328 
4329 	/* Indicate the channel on which the Network can be found 0 - if
4330 	 * all channels */
4331 	u8 channel_count;
4332 	u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
4333 
4334 	/* Indicates the RSSI threshold for the network to be considered */
4335 	u8 rssi_threshold;
4336 };
4337 
4338 struct scan_timer {
4339 	/* How much it should wait */
4340 	u32 value;
4341 
4342 	/* How many times it should repeat that wait value 0 - keep using
4343 	 * this timer until PNO is disabled */
4344 	u32 repeat;
4345 
4346 	/* e.g: 2 3 4 0 - it will wait 2s between consecutive scans for 3
4347 	 * times - after that it will wait 4s between consecutive scans
4348 	 * until disabled */
4349 };
4350 
4351 /* The network parameters to be sent to the PNO algorithm */
4352 struct scan_timers_type {
4353 	/* set to 0 if you wish for PNO to use its default telescopic timer */
4354 	u8 count;
4355 
4356 	/* A set value represents the amount of time that PNO will wait
4357 	 * between two consecutive scan procedures If the desired is for a
4358 	 * uniform timer that fires always at the exact same interval - one
4359 	 * single value is to be set If there is a desire for a more
4360 	 * complex - telescopic like timer multiple values can be set -
4361 	 * once PNO reaches the end of the array it will continue scanning
4362 	 * at intervals presented by the last value */
4363 	struct scan_timer values[WCN36XX_HAL_PNO_MAX_SCAN_TIMERS];
4364 };
4365 
4366 /* Preferred network list request */
4367 struct set_pref_netw_list_req {
4368 	struct wcn36xx_hal_msg_header header;
4369 
4370 	/* Enable PNO */
4371 	u32 enable;
4372 
4373 	/* Immediate,  On Suspend,   On Resume */
4374 	enum pno_mode mode;
4375 
4376 	/* Number of networks sent for PNO */
4377 	u32 networks_count;
4378 
4379 	/* The networks that PNO needs to look for */
4380 	struct network_type networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS];
4381 
4382 	/* The scan timers required for PNO */
4383 	struct scan_timers_type scan_timers;
4384 
4385 	/* Probe template for 2.4GHz band */
4386 	u16 band_24g_probe_size;
4387 	u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
4388 
4389 	/* Probe template for 5GHz band */
4390 	u16 band_5g_probe_size;
4391 	u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
4392 };
4393 
4394 /* The network description for which PNO will have to look for */
4395 struct network_type_new {
4396 	/* SSID of the BSS */
4397 	struct wcn36xx_hal_mac_ssid ssid;
4398 
4399 	/* Authentication type for the network */
4400 	enum auth_type authentication;
4401 
4402 	/* Encryption type for the network */
4403 	enum ed_type encryption;
4404 
4405 	/* SSID broadcast type, normal, hidden or unknown */
4406 	enum ssid_bcast_type bcast_network_type;
4407 
4408 	/* Indicate the channel on which the Network can be found 0 - if
4409 	 * all channels */
4410 	u8 channel_count;
4411 	u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
4412 
4413 	/* Indicates the RSSI threshold for the network to be considered */
4414 	u8 rssi_threshold;
4415 };
4416 
4417 /* Preferred network list request new */
4418 struct set_pref_netw_list_req_new {
4419 	struct wcn36xx_hal_msg_header header;
4420 
4421 	/* Enable PNO */
4422 	u32 enable;
4423 
4424 	/* Immediate,  On Suspend,   On Resume */
4425 	enum pno_mode mode;
4426 
4427 	/* Number of networks sent for PNO */
4428 	u32 networks_count;
4429 
4430 	/* The networks that PNO needs to look for */
4431 	struct network_type_new networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS];
4432 
4433 	/* The scan timers required for PNO */
4434 	struct scan_timers_type scan_timers;
4435 
4436 	/* Probe template for 2.4GHz band */
4437 	u16 band_24g_probe_size;
4438 	u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
4439 
4440 	/* Probe template for 5GHz band */
4441 	u16 band_5g_probe_size;
4442 	u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
4443 };
4444 
4445 /* Preferred network list response */
4446 struct set_pref_netw_list_resp {
4447 	struct wcn36xx_hal_msg_header header;
4448 
4449 	/* status of the request - just to indicate that PNO has
4450 	 * acknowledged the request and will start scanning */
4451 	u32 status;
4452 };
4453 
4454 /* Preferred network found indication */
4455 struct pref_netw_found_ind {
4456 
4457 	struct wcn36xx_hal_msg_header header;
4458 
4459 	/* Network that was found with the highest RSSI */
4460 	struct wcn36xx_hal_mac_ssid ssid;
4461 
4462 	/* Indicates the RSSI */
4463 	u8 rssi;
4464 };
4465 
4466 /* RSSI Filter request */
4467 struct set_rssi_filter_req {
4468 	struct wcn36xx_hal_msg_header header;
4469 
4470 	/* RSSI Threshold */
4471 	u8 rssi_threshold;
4472 };
4473 
4474 /* Set RSSI filter resp */
4475 struct set_rssi_filter_resp {
4476 	struct wcn36xx_hal_msg_header header;
4477 
4478 	/* status of the request */
4479 	u32 status;
4480 };
4481 
4482 /* Update scan params - sent from host to PNO to be used during PNO
4483  * scanningx */
4484 struct wcn36xx_hal_update_scan_params_req {
4485 
4486 	struct wcn36xx_hal_msg_header header;
4487 
4488 	/* Host setting for 11d */
4489 	u8 dot11d_enabled;
4490 
4491 	/* Lets PNO know that host has determined the regulatory domain */
4492 	u8 dot11d_resolved;
4493 
4494 	/* Channels on which PNO is allowed to scan */
4495 	u8 channel_count;
4496 	u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
4497 
4498 	/* Minimum channel time */
4499 	u16 active_min_ch_time;
4500 
4501 	/* Maximum channel time */
4502 	u16 active_max_ch_time;
4503 
4504 	/* Minimum channel time */
4505 	u16 passive_min_ch_time;
4506 
4507 	/* Maximum channel time */
4508 	u16 passive_max_ch_time;
4509 
4510 	/* Cb State */
4511 	enum phy_chan_bond_state state;
4512 } __packed;
4513 
4514 /* Update scan params - sent from host to PNO to be used during PNO
4515  * scanningx */
4516 struct wcn36xx_hal_update_scan_params_req_ex {
4517 
4518 	struct wcn36xx_hal_msg_header header;
4519 
4520 	/* Host setting for 11d */
4521 	u8 dot11d_enabled;
4522 
4523 	/* Lets PNO know that host has determined the regulatory domain */
4524 	u8 dot11d_resolved;
4525 
4526 	/* Channels on which PNO is allowed to scan */
4527 	u8 channel_count;
4528 	u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX];
4529 
4530 	/* Minimum channel time */
4531 	u16 active_min_ch_time;
4532 
4533 	/* Maximum channel time */
4534 	u16 active_max_ch_time;
4535 
4536 	/* Minimum channel time */
4537 	u16 passive_min_ch_time;
4538 
4539 	/* Maximum channel time */
4540 	u16 passive_max_ch_time;
4541 
4542 	/* Cb State */
4543 	enum phy_chan_bond_state state;
4544 } __packed;
4545 
4546 /* Update scan params - sent from host to PNO to be used during PNO
4547  * scanningx */
4548 struct wcn36xx_hal_update_scan_params_resp {
4549 
4550 	struct wcn36xx_hal_msg_header header;
4551 
4552 	/* status of the request */
4553 	u32 status;
4554 } __packed;
4555 
4556 struct wcn36xx_hal_set_tx_per_tracking_req_msg {
4557 	struct wcn36xx_hal_msg_header header;
4558 
4559 	/* 0: disable, 1:enable */
4560 	u8 tx_per_tracking_enable;
4561 
4562 	/* Check period, unit is sec. */
4563 	u8 tx_per_tracking_period;
4564 
4565 	/* (Fail TX packet)/(Total TX packet) ratio, the unit is 10%. */
4566 	u8 tx_per_tracking_ratio;
4567 
4568 	/* A watermark of check number, once the tx packet exceed this
4569 	 * number, we do the check, default is 5 */
4570 	u32 tx_per_tracking_watermark;
4571 };
4572 
4573 struct wcn36xx_hal_set_tx_per_tracking_rsp_msg {
4574 	struct wcn36xx_hal_msg_header header;
4575 
4576 	/* success or failure */
4577 	u32 status;
4578 
4579 };
4580 
4581 struct tx_per_hit_ind_msg {
4582 	struct wcn36xx_hal_msg_header header;
4583 };
4584 
4585 /* Packet Filtering Definitions Begin */
4586 #define    WCN36XX_HAL_PROTOCOL_DATA_LEN                  8
4587 #define    WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS        240
4588 #define    WCN36XX_HAL_MAX_NUM_FILTERS                   20
4589 #define    WCN36XX_HAL_MAX_CMP_PER_FILTER                10
4590 
4591 enum wcn36xx_hal_receive_packet_filter_type {
4592 	HAL_RCV_FILTER_TYPE_INVALID,
4593 	HAL_RCV_FILTER_TYPE_FILTER_PKT,
4594 	HAL_RCV_FILTER_TYPE_BUFFER_PKT,
4595 	HAL_RCV_FILTER_TYPE_MAX_ENUM_SIZE
4596 };
4597 
4598 enum wcn36xx_hal_rcv_pkt_flt_protocol_type {
4599 	HAL_FILTER_PROTO_TYPE_INVALID,
4600 	HAL_FILTER_PROTO_TYPE_MAC,
4601 	HAL_FILTER_PROTO_TYPE_ARP,
4602 	HAL_FILTER_PROTO_TYPE_IPV4,
4603 	HAL_FILTER_PROTO_TYPE_IPV6,
4604 	HAL_FILTER_PROTO_TYPE_UDP,
4605 	HAL_FILTER_PROTO_TYPE_MAX
4606 };
4607 
4608 enum wcn36xx_hal_rcv_pkt_flt_cmp_flag_type {
4609 	HAL_FILTER_CMP_TYPE_INVALID,
4610 	HAL_FILTER_CMP_TYPE_EQUAL,
4611 	HAL_FILTER_CMP_TYPE_MASK_EQUAL,
4612 	HAL_FILTER_CMP_TYPE_NOT_EQUAL,
4613 	HAL_FILTER_CMP_TYPE_MAX
4614 };
4615 
4616 struct wcn36xx_hal_rcv_pkt_filter_params {
4617 	u8 protocol_layer;
4618 	u8 cmp_flag;
4619 
4620 	/* Length of the data to compare */
4621 	u16 data_length;
4622 
4623 	/* from start of the respective frame header */
4624 	u8 data_offset;
4625 
4626 	/* Reserved field */
4627 	u8 reserved;
4628 
4629 	/* Data to compare */
4630 	u8 compare_data[WCN36XX_HAL_PROTOCOL_DATA_LEN];
4631 
4632 	/* Mask to be applied on the received packet data before compare */
4633 	u8 data_mask[WCN36XX_HAL_PROTOCOL_DATA_LEN];
4634 };
4635 
4636 struct wcn36xx_hal_sessionized_rcv_pkt_filter_cfg_type {
4637 	u8 id;
4638 	u8 type;
4639 	u8 params_count;
4640 	u32 coleasce_time;
4641 	u8 bss_index;
4642 	struct wcn36xx_hal_rcv_pkt_filter_params params[1];
4643 };
4644 
4645 struct wcn36xx_hal_set_rcv_pkt_filter_req_msg {
4646 	struct wcn36xx_hal_msg_header header;
4647 
4648 	u8 id;
4649 	u8 type;
4650 	u8 params_count;
4651 	u32 coalesce_time;
4652 	struct wcn36xx_hal_rcv_pkt_filter_params params[1];
4653 };
4654 
4655 struct wcn36xx_hal_rcv_flt_mc_addr_list_type {
4656 	/* from start of the respective frame header */
4657 	u8 data_offset;
4658 
4659 	u32 mc_addr_count;
4660 	u8 mc_addr[WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS][ETH_ALEN];
4661 	u8 bss_index;
4662 } __packed;
4663 
4664 struct wcn36xx_hal_set_pkt_filter_rsp_msg {
4665 	struct wcn36xx_hal_msg_header header;
4666 
4667 	/* success or failure */
4668 	u32 status;
4669 
4670 	u8 bss_index;
4671 };
4672 
4673 struct wcn36xx_hal_rcv_flt_pkt_match_cnt_req_msg {
4674 	struct wcn36xx_hal_msg_header header;
4675 
4676 	u8 bss_index;
4677 };
4678 
4679 struct wcn36xx_hal_rcv_flt_pkt_match_cnt {
4680 	u8 id;
4681 	u32 match_cnt;
4682 };
4683 
4684 struct wcn36xx_hal_rcv_flt_pkt_match_cnt_rsp_msg {
4685 	struct wcn36xx_hal_msg_header header;
4686 
4687 	/* Success or Failure */
4688 	u32 status;
4689 
4690 	u32 match_count;
4691 	struct wcn36xx_hal_rcv_flt_pkt_match_cnt
4692 		matches[WCN36XX_HAL_MAX_NUM_FILTERS];
4693 	u8 bss_index;
4694 };
4695 
4696 struct wcn36xx_hal_rcv_flt_pkt_clear_param {
4697 	/* only valid for response message */
4698 	u32 status;
4699 	u8 id;
4700 	u8 bss_index;
4701 };
4702 
4703 struct wcn36xx_hal_rcv_flt_pkt_clear_req_msg {
4704 	struct wcn36xx_hal_msg_header header;
4705 	struct wcn36xx_hal_rcv_flt_pkt_clear_param param;
4706 };
4707 
4708 struct wcn36xx_hal_rcv_flt_pkt_clear_rsp_msg {
4709 	struct wcn36xx_hal_msg_header header;
4710 	struct wcn36xx_hal_rcv_flt_pkt_clear_param param;
4711 };
4712 
4713 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_req_msg {
4714 	struct wcn36xx_hal_msg_header header;
4715 	struct wcn36xx_hal_rcv_flt_mc_addr_list_type mc_addr_list;
4716 } __packed;
4717 
4718 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_rsp_msg {
4719 	struct wcn36xx_hal_msg_header header;
4720 	u32 status;
4721 	u8 bss_index;
4722 };
4723 
4724 /* Packet Filtering Definitions End */
4725 
4726 struct wcn36xx_hal_set_power_params_req_msg {
4727 	struct wcn36xx_hal_msg_header header;
4728 
4729 	/*  Ignore DTIM */
4730 	u32 ignore_dtim;
4731 
4732 	/* DTIM Period */
4733 	u32 dtim_period;
4734 
4735 	/* Listen Interval */
4736 	u32 listen_interval;
4737 
4738 	/* Broadcast Multicast Filter  */
4739 	u32 bcast_mcast_filter;
4740 
4741 	/* Beacon Early Termination */
4742 	u32 enable_bet;
4743 
4744 	/* Beacon Early Termination Interval */
4745 	u32 bet_interval;
4746 } __packed;
4747 
4748 struct wcn36xx_hal_set_power_params_resp {
4749 
4750 	struct wcn36xx_hal_msg_header header;
4751 
4752 	/* status of the request */
4753 	u32 status;
4754 } __packed;
4755 
4756 /* Capability bitmap exchange definitions and macros starts */
4757 
4758 enum place_holder_in_cap_bitmap {
4759 	MCC = 0,
4760 	P2P = 1,
4761 	DOT11AC = 2,
4762 	SLM_SESSIONIZATION = 3,
4763 	DOT11AC_OPMODE = 4,
4764 	SAP32STA = 5,
4765 	TDLS = 6,
4766 	P2P_GO_NOA_DECOUPLE_INIT_SCAN = 7,
4767 	WLANACTIVE_OFFLOAD = 8,
4768 	BEACON_OFFLOAD = 9,
4769 	SCAN_OFFLOAD = 10,
4770 	ROAM_OFFLOAD = 11,
4771 	BCN_MISS_OFFLOAD = 12,
4772 	STA_POWERSAVE = 13,
4773 	STA_ADVANCED_PWRSAVE = 14,
4774 	AP_UAPSD = 15,
4775 	AP_DFS = 16,
4776 	BLOCKACK = 17,
4777 	PHY_ERR = 18,
4778 	BCN_FILTER = 19,
4779 	RTT = 20,
4780 	RATECTRL = 21,
4781 	WOW = 22,
4782 	WLAN_ROAM_SCAN_OFFLOAD = 23,
4783 	SPECULATIVE_PS_POLL = 24,
4784 	SCAN_SCH = 25,
4785 	IBSS_HEARTBEAT_OFFLOAD = 26,
4786 	WLAN_SCAN_OFFLOAD = 27,
4787 	WLAN_PERIODIC_TX_PTRN = 28,
4788 	ADVANCE_TDLS = 29,
4789 	BATCH_SCAN = 30,
4790 	FW_IN_TX_PATH = 31,
4791 	EXTENDED_NSOFFLOAD_SLOT = 32,
4792 	CH_SWITCH_V1 = 33,
4793 	HT40_OBSS_SCAN = 34,
4794 	UPDATE_CHANNEL_LIST = 35,
4795 	WLAN_MCADDR_FLT = 36,
4796 	WLAN_CH144 = 37,
4797 	NAN = 38,
4798 	TDLS_SCAN_COEXISTENCE = 39,
4799 	LINK_LAYER_STATS_MEAS = 40,
4800 	MU_MIMO = 41,
4801 	EXTENDED_SCAN = 42,
4802 	DYNAMIC_WMM_PS = 43,
4803 	MAC_SPOOFED_SCAN = 44,
4804 	BMU_ERROR_GENERIC_RECOVERY = 45,
4805 	DISA = 46,
4806 	FW_STATS = 47,
4807 	WPS_PRBRSP_TMPL = 48,
4808 	BCN_IE_FLT_DELTA = 49,
4809 	TDLS_OFF_CHANNEL = 51,
4810 	RTT3 = 52,
4811 	MGMT_FRAME_LOGGING = 53,
4812 	ENHANCED_TXBD_COMPLETION = 54,
4813 	LOGGING_ENHANCEMENT = 55,
4814 	EXT_SCAN_ENHANCED = 56,
4815 	MEMORY_DUMP_SUPPORTED = 57,
4816 	PER_PKT_STATS_SUPPORTED = 58,
4817 	EXT_LL_STAT = 60,
4818 	WIFI_CONFIG = 61,
4819 	ANTENNA_DIVERSITY_SELECTION = 62,
4820 
4821 	MAX_FEATURE_SUPPORTED = 128,
4822 };
4823 
4824 #define WCN36XX_HAL_CAPS_SIZE 4
4825 
4826 struct wcn36xx_hal_feat_caps_msg {
4827 
4828 	struct wcn36xx_hal_msg_header header;
4829 
4830 	u32 feat_caps[WCN36XX_HAL_CAPS_SIZE];
4831 } __packed;
4832 
4833 /* status codes to help debug rekey failures */
4834 enum gtk_rekey_status {
4835 	WCN36XX_HAL_GTK_REKEY_STATUS_SUCCESS = 0,
4836 
4837 	/* rekey detected, but not handled */
4838 	WCN36XX_HAL_GTK_REKEY_STATUS_NOT_HANDLED = 1,
4839 
4840 	/* MIC check error on M1 */
4841 	WCN36XX_HAL_GTK_REKEY_STATUS_MIC_ERROR = 2,
4842 
4843 	/* decryption error on M1  */
4844 	WCN36XX_HAL_GTK_REKEY_STATUS_DECRYPT_ERROR = 3,
4845 
4846 	/* M1 replay detected */
4847 	WCN36XX_HAL_GTK_REKEY_STATUS_REPLAY_ERROR = 4,
4848 
4849 	/* missing GTK key descriptor in M1 */
4850 	WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_KDE = 5,
4851 
4852 	/* missing iGTK key descriptor in M1 */
4853 	WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_IGTK_KDE = 6,
4854 
4855 	/* key installation error */
4856 	WCN36XX_HAL_GTK_REKEY_STATUS_INSTALL_ERROR = 7,
4857 
4858 	/* iGTK key installation error */
4859 	WCN36XX_HAL_GTK_REKEY_STATUS_IGTK_INSTALL_ERROR = 8,
4860 
4861 	/* GTK rekey M2 response TX error */
4862 	WCN36XX_HAL_GTK_REKEY_STATUS_RESP_TX_ERROR = 9,
4863 
4864 	/* non-specific general error */
4865 	WCN36XX_HAL_GTK_REKEY_STATUS_GEN_ERROR = 255
4866 };
4867 
4868 /* wake reason types */
4869 enum wake_reason_type {
4870 	WCN36XX_HAL_WAKE_REASON_NONE = 0,
4871 
4872 	/* magic packet match */
4873 	WCN36XX_HAL_WAKE_REASON_MAGIC_PACKET = 1,
4874 
4875 	/* host defined pattern match */
4876 	WCN36XX_HAL_WAKE_REASON_PATTERN_MATCH = 2,
4877 
4878 	/* EAP-ID frame detected */
4879 	WCN36XX_HAL_WAKE_REASON_EAPID_PACKET = 3,
4880 
4881 	/* start of EAPOL 4-way handshake detected */
4882 	WCN36XX_HAL_WAKE_REASON_EAPOL4WAY_PACKET = 4,
4883 
4884 	/* network scan offload match */
4885 	WCN36XX_HAL_WAKE_REASON_NETSCAN_OFFL_MATCH = 5,
4886 
4887 	/* GTK rekey status wakeup (see status) */
4888 	WCN36XX_HAL_WAKE_REASON_GTK_REKEY_STATUS = 6,
4889 
4890 	/* BSS connection lost */
4891 	WCN36XX_HAL_WAKE_REASON_BSS_CONN_LOST = 7,
4892 };
4893 
4894 /*
4895   Wake Packet which is saved at tWakeReasonParams.DataStart
4896   This data is sent for any wake reasons that involve a packet-based wakeup :
4897 
4898   WCN36XX_HAL_WAKE_REASON_TYPE_MAGIC_PACKET
4899   WCN36XX_HAL_WAKE_REASON_TYPE_PATTERN_MATCH
4900   WCN36XX_HAL_WAKE_REASON_TYPE_EAPID_PACKET
4901   WCN36XX_HAL_WAKE_REASON_TYPE_EAPOL4WAY_PACKET
4902   WCN36XX_HAL_WAKE_REASON_TYPE_GTK_REKEY_STATUS
4903 
4904   The information is provided to the host for auditing and debug purposes
4905 
4906 */
4907 
4908 /* Wake reason indication */
4909 struct wcn36xx_hal_wake_reason_ind {
4910 	struct wcn36xx_hal_msg_header header;
4911 
4912 	/* see tWakeReasonType */
4913 	u32 reason;
4914 
4915 	/* argument specific to the reason type */
4916 	u32 reason_arg;
4917 
4918 	/* length of optional data stored in this message, in case HAL
4919 	 * truncates the data (i.e. data packets) this length will be less
4920 	 * than the actual length */
4921 	u32 stored_data_len;
4922 
4923 	/* actual length of data */
4924 	u32 actual_data_len;
4925 
4926 	/* variable length start of data (length == storedDataLen) see
4927 	 * specific wake type */
4928 	u8 data_start[1];
4929 
4930 	u32 bss_index:8;
4931 	u32 reserved:24;
4932 };
4933 
4934 #define WCN36XX_HAL_GTK_KEK_BYTES 16
4935 #define WCN36XX_HAL_GTK_KCK_BYTES 16
4936 
4937 #define WCN36XX_HAL_GTK_OFFLOAD_FLAGS_DISABLE (1 << 0)
4938 
4939 #define GTK_SET_BSS_KEY_TAG  0x1234AA55
4940 
4941 struct wcn36xx_hal_gtk_offload_req_msg {
4942 	struct wcn36xx_hal_msg_header header;
4943 
4944 	/* optional flags */
4945 	u32 flags;
4946 
4947 	/* Key confirmation key */
4948 	u8 kck[WCN36XX_HAL_GTK_KCK_BYTES];
4949 
4950 	/* key encryption key */
4951 	u8 kek[WCN36XX_HAL_GTK_KEK_BYTES];
4952 
4953 	/* replay counter */
4954 	u64 key_replay_counter;
4955 
4956 	u8 bss_index;
4957 } __packed;
4958 
4959 struct wcn36xx_hal_gtk_offload_rsp_msg {
4960 	struct wcn36xx_hal_msg_header header;
4961 
4962 	/* success or failure */
4963 	u32 status;
4964 
4965 	u8 bss_index;
4966 };
4967 
4968 struct wcn36xx_hal_gtk_offload_get_info_req_msg {
4969 	struct wcn36xx_hal_msg_header header;
4970 	u8 bss_index;
4971 } __packed;
4972 
4973 struct wcn36xx_hal_gtk_offload_get_info_rsp_msg {
4974 	struct wcn36xx_hal_msg_header header;
4975 
4976 	/* success or failure */
4977 	u32 status;
4978 
4979 	/* last rekey status when the rekey was offloaded */
4980 	u32 last_rekey_status;
4981 
4982 	/* current replay counter value */
4983 	u64 key_replay_counter;
4984 
4985 	/* total rekey attempts */
4986 	u32 total_rekey_count;
4987 
4988 	/* successful GTK rekeys */
4989 	u32 gtk_rekey_count;
4990 
4991 	/* successful iGTK rekeys */
4992 	u32 igtk_rekey_count;
4993 
4994 	u8 bss_index;
4995 } __packed;
4996 
4997 struct dhcp_info {
4998 	/* Indicates the device mode which indicates about the DHCP activity */
4999 	u8 device_mode;
5000 
5001 	u8 addr[ETH_ALEN];
5002 };
5003 
5004 struct dhcp_ind_status {
5005 	struct wcn36xx_hal_msg_header header;
5006 
5007 	/* success or failure */
5008 	u32 status;
5009 };
5010 
5011 /*
5012  *   Thermal Mitigation mode of operation.
5013  *
5014  *  WCN36XX_HAL_THERMAL_MITIGATION_MODE_0 - Based on AMPDU disabling aggregation
5015  *
5016  *  WCN36XX_HAL_THERMAL_MITIGATION_MODE_1 - Based on AMPDU disabling aggregation
5017  *  and reducing transmit power
5018  *
5019  *  WCN36XX_HAL_THERMAL_MITIGATION_MODE_2 - Not supported */
5020 enum wcn36xx_hal_thermal_mitigation_mode_type {
5021 	HAL_THERMAL_MITIGATION_MODE_INVALID = -1,
5022 	HAL_THERMAL_MITIGATION_MODE_0,
5023 	HAL_THERMAL_MITIGATION_MODE_1,
5024 	HAL_THERMAL_MITIGATION_MODE_2,
5025 	HAL_THERMAL_MITIGATION_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
5026 };
5027 
5028 
5029 /*
5030  *   Thermal Mitigation level.
5031  * Note the levels are incremental i.e WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 =
5032  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 +
5033  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1
5034  *
5035  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 - lowest level of thermal mitigation.
5036  * This level indicates normal mode of operation
5037  *
5038  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1 - 1st level of thermal mitigation
5039  *
5040  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 - 2nd level of thermal mitigation
5041  *
5042  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_3 - 3rd level of thermal mitigation
5043  *
5044  * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_4 - 4th level of thermal mitigation
5045  */
5046 enum wcn36xx_hal_thermal_mitigation_level_type {
5047 	HAL_THERMAL_MITIGATION_LEVEL_INVALID = -1,
5048 	HAL_THERMAL_MITIGATION_LEVEL_0,
5049 	HAL_THERMAL_MITIGATION_LEVEL_1,
5050 	HAL_THERMAL_MITIGATION_LEVEL_2,
5051 	HAL_THERMAL_MITIGATION_LEVEL_3,
5052 	HAL_THERMAL_MITIGATION_LEVEL_4,
5053 	HAL_THERMAL_MITIGATION_LEVEL_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
5054 };
5055 
5056 
5057 /* WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ */
5058 struct set_thermal_mitigation_req_msg {
5059 	struct wcn36xx_hal_msg_header header;
5060 
5061 	/* Thermal Mitigation Operation Mode */
5062 	enum wcn36xx_hal_thermal_mitigation_mode_type mode;
5063 
5064 	/* Thermal Mitigation Level */
5065 	enum wcn36xx_hal_thermal_mitigation_level_type level;
5066 };
5067 
5068 struct set_thermal_mitigation_resp {
5069 
5070 	struct wcn36xx_hal_msg_header header;
5071 
5072 	/* status of the request */
5073 	u32 status;
5074 };
5075 
5076 /* Per STA Class B Statistics. Class B statistics are STA TX/RX stats
5077  * provided to FW from Host via periodic messages */
5078 struct stats_class_b_ind {
5079 	struct wcn36xx_hal_msg_header header;
5080 
5081 	/* Duration over which this stats was collected */
5082 	u32 duration;
5083 
5084 	/* Per STA Stats */
5085 
5086 	/* TX stats */
5087 	u32 tx_bytes_pushed;
5088 	u32 tx_packets_pushed;
5089 
5090 	/* RX stats */
5091 	u32 rx_bytes_rcvd;
5092 	u32 rx_packets_rcvd;
5093 	u32 rx_time_total;
5094 };
5095 
5096 /* WCN36XX_HAL_PRINT_REG_INFO_IND */
5097 struct wcn36xx_hal_print_reg_info_ind {
5098 	struct wcn36xx_hal_msg_header header;
5099 
5100 	u32 count;
5101 	u32 scenario;
5102 	u32 reason;
5103 
5104 	struct {
5105 		u32 addr;
5106 		u32 value;
5107 	} regs[];
5108 } __packed;
5109 
5110 #endif /* _HAL_H_ */
5111