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