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