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