xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/nxp/mlan/mlan_ioctl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file mlan_ioctl.h
2  *
3  *  @brief This file declares the IOCTL data structures and APIs.
4  *
5  *
6  *  Copyright 2008-2022 NXP
7  *
8  *  This software file (the File) is distributed by NXP
9  *  under the terms of the GNU General Public License Version 2, June 1991
10  *  (the License).  You may use, redistribute and/or modify the File in
11  *  accordance with the terms and conditions of the License, a copy of which
12  *  is available by writing to the Free Software Foundation, Inc.,
13  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
14  *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15  *
16  *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
17  *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
18  *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
19  *  this warranty disclaimer.
20  *
21  */
22 
23 /******************************************************
24 Change log:
25     11/07/2008: initial version
26 ******************************************************/
27 
28 #ifndef _MLAN_IOCTL_H_
29 #define _MLAN_IOCTL_H_
30 
31 /** Enumeration for IOCTL request ID */
32 enum _mlan_ioctl_req_id {
33 	/* Scan Group */
34 	MLAN_IOCTL_SCAN = 0x00010000,
35 	MLAN_OID_SCAN_NORMAL = 0x00010001,
36 	MLAN_OID_SCAN_SPECIFIC_SSID = 0x00010002,
37 	MLAN_OID_SCAN_USER_CONFIG = 0x00010003,
38 	MLAN_OID_SCAN_CONFIG = 0x00010004,
39 	MLAN_OID_SCAN_GET_CURRENT_BSS = 0x00010005,
40 	MLAN_OID_SCAN_CANCEL = 0x00010006,
41 	MLAN_OID_SCAN_TABLE_FLUSH = 0x0001000A,
42 	MLAN_OID_SCAN_BGSCAN_CONFIG = 0x0001000B,
43 	/* BSS Configuration Group */
44 	MLAN_IOCTL_BSS = 0x00020000,
45 	MLAN_OID_BSS_START = 0x00020001,
46 	MLAN_OID_BSS_STOP = 0x00020002,
47 	MLAN_OID_BSS_MODE = 0x00020003,
48 	MLAN_OID_BSS_CHANNEL = 0x00020004,
49 	MLAN_OID_BSS_CHANNEL_LIST = 0x00020005,
50 	MLAN_OID_BSS_MAC_ADDR = 0x00020006,
51 	MLAN_OID_BSS_MULTICAST_LIST = 0x00020007,
52 	MLAN_OID_BSS_FIND_BSS = 0x00020008,
53 	MLAN_OID_IBSS_BCN_INTERVAL = 0x00020009,
54 	MLAN_OID_IBSS_ATIM_WINDOW = 0x0002000A,
55 	MLAN_OID_IBSS_CHANNEL = 0x0002000B,
56 #ifdef UAP_SUPPORT
57 	MLAN_OID_UAP_BSS_CONFIG = 0x0002000C,
58 	MLAN_OID_UAP_DEAUTH_STA = 0x0002000D,
59 	MLAN_OID_UAP_BSS_RESET = 0x0002000E,
60 #endif
61 #if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
62 	MLAN_OID_BSS_ROLE = 0x0002000F,
63 #endif
64 #ifdef WIFI_DIRECT_SUPPORT
65 	MLAN_OID_WIFI_DIRECT_MODE = 0x00020010,
66 #endif
67 #ifdef STA_SUPPORT
68 	MLAN_OID_BSS_LISTEN_INTERVAL = 0x00020011,
69 #endif
70 	MLAN_OID_BSS_REMOVE = 0x00020014,
71 #ifdef UAP_SUPPORT
72 	MLAN_OID_UAP_CFG_WMM_PARAM = 0x00020015,
73 #endif
74 	MLAN_OID_BSS_11D_CHECK_CHANNEL = 0x00020016,
75 #ifdef UAP_SUPPORT
76 	MLAN_OID_UAP_ACS_SCAN = 0x00020017,
77 	MLAN_OID_UAP_SCAN_CHANNELS = 0x00020018,
78 	MLAN_OID_UAP_CHANNEL = 0x00020019,
79 	MLAN_OID_UAP_OPER_CTRL = 0x0002001A,
80 #endif
81 #ifdef STA_SUPPORT
82 	MLAN_OID_BSS_CHAN_INFO = 0x0002001B,
83 #endif
84 #ifdef UAP_SUPPORT
85 	MLAN_OID_UAP_ADD_STATION = 0x0002001C,
86 #endif
87 
88 	MLAN_OID_BSS_FIND_BSSID = 0x0002001D,
89 #ifdef UAP_SUPPORT
90 	MLAN_OID_ACTION_CHAN_SWITCH = 0x0002001E,
91 #endif
92 
93 	/* Radio Configuration Group */
94 	MLAN_IOCTL_RADIO_CFG = 0x00030000,
95 	MLAN_OID_RADIO_CTRL = 0x00030001,
96 	MLAN_OID_BAND_CFG = 0x00030002,
97 	MLAN_OID_ANT_CFG = 0x00030003,
98 	MLAN_OID_REMAIN_CHAN_CFG = 0x00030004,
99 	MLAN_OID_MIMO_SWITCH = 0x00030005,
100 
101 	/* SNMP MIB Group */
102 	MLAN_IOCTL_SNMP_MIB = 0x00040000,
103 	MLAN_OID_SNMP_MIB_RTS_THRESHOLD = 0x00040001,
104 	MLAN_OID_SNMP_MIB_FRAG_THRESHOLD = 0x00040002,
105 	MLAN_OID_SNMP_MIB_RETRY_COUNT = 0x00040003,
106 	MLAN_OID_SNMP_MIB_DOT11D = 0x00040004,
107 #if defined(UAP_SUPPORT)
108 	MLAN_OID_SNMP_MIB_DOT11H = 0x00040005,
109 #endif
110 	MLAN_OID_SNMP_MIB_DTIM_PERIOD = 0x00040006,
111 	MLAN_OID_SNMP_MIB_SIGNALEXT_ENABLE = 0x00040007,
112 	MLAN_OID_SNMP_MIB_CTRL_DEAUTH = 0x00040008,
113 	MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR = 0x00040009,
114 	MLAN_OID_SNMP_MIB_CHAN_TRACK = 0x0004000A,
115 
116 	/* Status Information Group */
117 	MLAN_IOCTL_GET_INFO = 0x00050000,
118 	MLAN_OID_GET_STATS = 0x00050001,
119 	MLAN_OID_GET_SIGNAL = 0x00050002,
120 	MLAN_OID_GET_FW_INFO = 0x00050003,
121 	MLAN_OID_GET_VER_EXT = 0x00050004,
122 	MLAN_OID_GET_BSS_INFO = 0x00050005,
123 	MLAN_OID_GET_DEBUG_INFO = 0x00050006,
124 #ifdef UAP_SUPPORT
125 	MLAN_OID_UAP_STA_LIST = 0x00050007,
126 #endif
127 	MLAN_OID_GET_SIGNAL_EXT = 0x00050008,
128 	MLAN_OID_LINK_STATS = 0x00050009,
129 	MLAN_OID_GET_UAP_STATS_LOG = 0x0005000A,
130 	/* Security Configuration Group */
131 	MLAN_IOCTL_SEC_CFG = 0x00060000,
132 	MLAN_OID_SEC_CFG_AUTH_MODE = 0x00060001,
133 	MLAN_OID_SEC_CFG_ENCRYPT_MODE = 0x00060002,
134 	MLAN_OID_SEC_CFG_WPA_ENABLED = 0x00060003,
135 	MLAN_OID_SEC_CFG_ENCRYPT_KEY = 0x00060004,
136 	MLAN_OID_SEC_CFG_PASSPHRASE = 0x00060005,
137 	MLAN_OID_SEC_CFG_EWPA_ENABLED = 0x00060006,
138 	MLAN_OID_SEC_CFG_ESUPP_MODE = 0x00060007,
139 	MLAN_OID_SEC_CFG_WAPI_ENABLED = 0x00060009,
140 	MLAN_OID_SEC_CFG_PORT_CTRL_ENABLED = 0x0006000A,
141 #ifdef UAP_SUPPORT
142 	MLAN_OID_SEC_CFG_REPORT_MIC_ERR = 0x0006000B,
143 #endif
144 	MLAN_OID_SEC_QUERY_KEY = 0x0006000C,
145 
146 	/* Rate Group */
147 	MLAN_IOCTL_RATE = 0x00070000,
148 	MLAN_OID_RATE_CFG = 0x00070001,
149 	MLAN_OID_GET_DATA_RATE = 0x00070002,
150 	MLAN_OID_SUPPORTED_RATES = 0x00070003,
151 
152 	/* Power Configuration Group */
153 	MLAN_IOCTL_POWER_CFG = 0x00080000,
154 	MLAN_OID_POWER_CFG = 0x00080001,
155 	MLAN_OID_POWER_CFG_EXT = 0x00080002,
156 	MLAN_OID_POWER_LOW_POWER_MODE = 0x00080003,
157 
158 	/* Power Management Configuration Group */
159 	MLAN_IOCTL_PM_CFG = 0x00090000,
160 	MLAN_OID_PM_CFG_IEEE_PS = 0x00090001,
161 	MLAN_OID_PM_CFG_HS_CFG = 0x00090002,
162 	MLAN_OID_PM_CFG_INACTIVITY_TO = 0x00090003,
163 	MLAN_OID_PM_CFG_DEEP_SLEEP = 0x00090004,
164 	MLAN_OID_PM_CFG_SLEEP_PD = 0x00090005,
165 	MLAN_OID_PM_CFG_PS_CFG = 0x00090006,
166 	MLAN_OID_PM_CFG_SLEEP_PARAMS = 0x00090008,
167 #ifdef UAP_SUPPORT
168 	MLAN_OID_PM_CFG_PS_MODE = 0x00090009,
169 #endif /* UAP_SUPPORT */
170 	MLAN_OID_PM_INFO = 0x0009000A,
171 	MLAN_OID_PM_HS_WAKEUP_REASON = 0x0009000B,
172 	MLAN_OID_PM_MGMT_FILTER = 0x0009000C,
173 	MLAN_OID_PM_CFG_BCN_TIMEOUT = 0x0009000D,
174 
175 	/* WMM Configuration Group */
176 	MLAN_IOCTL_WMM_CFG = 0x000A0000,
177 	MLAN_OID_WMM_CFG_ENABLE = 0x000A0001,
178 	MLAN_OID_WMM_CFG_QOS = 0x000A0002,
179 	MLAN_OID_WMM_CFG_ADDTS = 0x000A0003,
180 	MLAN_OID_WMM_CFG_DELTS = 0x000A0004,
181 	MLAN_OID_WMM_CFG_QUEUE_CONFIG = 0x000A0005,
182 	MLAN_OID_WMM_CFG_QUEUE_STATS = 0x000A0006,
183 	MLAN_OID_WMM_CFG_QUEUE_STATUS = 0x000A0007,
184 	MLAN_OID_WMM_CFG_TS_STATUS = 0x000A0008,
185 
186 	/* WPS Configuration Group */
187 	MLAN_IOCTL_WPS_CFG = 0x000B0000,
188 	MLAN_OID_WPS_CFG_SESSION = 0x000B0001,
189 
190 	/* 802.11n Configuration Group */
191 	MLAN_IOCTL_11N_CFG = 0x000C0000,
192 	MLAN_OID_11N_CFG_TX = 0x000C0001,
193 	MLAN_OID_11N_HTCAP_CFG = 0x000C0002,
194 	MLAN_OID_11N_CFG_ADDBA_REJECT = 0x000C0003,
195 	MLAN_OID_11N_CFG_AGGR_PRIO_TBL = 0x000C0004,
196 	MLAN_OID_11N_CFG_ADDBA_PARAM = 0x000C0005,
197 	MLAN_OID_11N_CFG_MAX_TX_BUF_SIZE = 0x000C0006,
198 	MLAN_OID_11N_CFG_AMSDU_AGGR_CTRL = 0x000C0007,
199 	MLAN_OID_11N_CFG_SUPPORTED_MCS_SET = 0x000C0008,
200 	MLAN_OID_11N_CFG_TX_BF_CAP = 0x000C0009,
201 	MLAN_OID_11N_CFG_TX_BF_CFG = 0x000C000A,
202 	MLAN_OID_11N_CFG_STREAM_CFG = 0x000C000B,
203 	MLAN_OID_11N_CFG_DELBA = 0x000C000C,
204 	MLAN_OID_11N_CFG_REJECT_ADDBA_REQ = 0x000C000D,
205 	MLAN_OID_11N_CFG_COEX_RX_WINSIZE = 0x000C000E,
206 	MLAN_OID_11N_CFG_TX_AGGR_CTRL = 0x000C000F,
207 	MLAN_OID_11N_CFG_IBSS_AMPDU_PARAM = 0x000C0010,
208 	MLAN_OID_11N_CFG_MIN_BA_THRESHOLD = 0x000C0011,
209 
210 	/* 802.11d Configuration Group */
211 	MLAN_IOCTL_11D_CFG = 0x000D0000,
212 #ifdef STA_SUPPORT
213 	MLAN_OID_11D_CFG_ENABLE = 0x000D0001,
214 	MLAN_OID_11D_CLR_CHAN_TABLE = 0x000D0002,
215 #endif /* STA_SUPPORT */
216 #ifdef UAP_SUPPORT
217 	MLAN_OID_11D_DOMAIN_INFO = 0x000D0003,
218 #endif
219 	MLAN_OID_11D_DOMAIN_INFO_EXT = 0x000D0004,
220 
221 	/* Register Memory Access Group */
222 	MLAN_IOCTL_REG_MEM = 0x000E0000,
223 	MLAN_OID_REG_RW = 0x000E0001,
224 	MLAN_OID_EEPROM_RD = 0x000E0002,
225 	MLAN_OID_MEM_RW = 0x000E0003,
226 
227 	/* Multi-Radio Configuration Group */
228 	MLAN_IOCTL_MFR_CFG = 0x00100000,
229 	/* 802.11h Configuration Group */
230 	MLAN_IOCTL_11H_CFG = 0x00110000,
231 	MLAN_OID_11H_CHANNEL_CHECK = 0x00110001,
232 	MLAN_OID_11H_LOCAL_POWER_CONSTRAINT = 0x00110002,
233 	MLAN_OID_11H_DFS_TESTING = 0x00110003,
234 	MLAN_OID_11H_CHAN_REPORT_REQUEST = 0x00110004,
235 	MLAN_OID_11H_CHAN_SWITCH_COUNT = 0x00110005,
236 	MLAN_OID_11H_CHAN_NOP_INFO = 0x00110006,
237 	MLAN_OID_11H_CHAN_DFS_STATE = 0x00110007,
238 	MLAN_OID_11H_DFS_W53_CFG = 0x00110008,
239 	MLAN_OID_11H_DFS_MODE = 0x00110009,
240 	MLAN_OID_11H_NOP_CHAN_LIST = 0x0011000A,
241 
242 	/* 802.11n Configuration Group RANDYTODO for value assign */
243 	MLAN_IOCTL_11AC_CFG = 0x00120000,
244 	MLAN_OID_11AC_VHT_CFG = 0x00120001,
245 	MLAN_OID_11AC_CFG_SUPPORTED_MCS_SET = 0x00120002,
246 	MLAN_OID_11AC_OPERMODE_CFG = 0x00120003,
247 
248 	/* 802.11ax Configuration Group  */
249 	MLAN_IOCTL_11AX_CFG = 0x00170000,
250 	MLAN_OID_11AX_HE_CFG = 0x00170001,
251 	MLAN_OID_11AX_CMD_CFG = 0x00170002,
252 	MLAN_OID_11AX_TWT_CFG = 0x00170003,
253 
254 	/* Miscellaneous Configuration Group */
255 	MLAN_IOCTL_MISC_CFG = 0x00200000,
256 	MLAN_OID_MISC_GEN_IE = 0x00200001,
257 	MLAN_OID_MISC_REGION = 0x00200002,
258 	MLAN_OID_MISC_WARM_RESET = 0x00200003,
259 #ifdef SDIO
260 	MLAN_OID_MISC_SDIO_MPA_CTRL = 0x00200006,
261 #endif
262 	MLAN_OID_MISC_HOST_CMD = 0x00200007,
263 	MLAN_OID_MISC_SYS_CLOCK = 0x00200009,
264 	MLAN_OID_MISC_SOFT_RESET = 0x0020000A,
265 	MLAN_OID_MISC_WWS = 0x0020000B,
266 	MLAN_OID_MISC_ASSOC_RSP = 0x0020000C,
267 	MLAN_OID_MISC_INIT_SHUTDOWN = 0x0020000D,
268 	MLAN_OID_MISC_CUSTOM_IE = 0x0020000F,
269 	MLAN_OID_MISC_TDLS_CONFIG = 0x00200010,
270 	MLAN_OID_MISC_NET_MONITOR = 0x00200011,
271 	MLAN_OID_MISC_TX_DATAPAUSE = 0x00200012,
272 	MLAN_OID_MISC_IP_ADDR = 0x00200013,
273 	MLAN_OID_MISC_MAC_CONTROL = 0x00200014,
274 	MLAN_OID_MISC_MEF_CFG = 0x00200015,
275 	MLAN_OID_MISC_CFP_CODE = 0x00200016,
276 	MLAN_OID_MISC_COUNTRY_CODE = 0x00200017,
277 	MLAN_OID_MISC_THERMAL = 0x00200018,
278 	MLAN_OID_MISC_RX_MGMT_IND = 0x00200019,
279 	MLAN_OID_MISC_SUBSCRIBE_EVENT = 0x0020001A,
280 #ifdef DEBUG_LEVEL1
281 	MLAN_OID_MISC_DRVDBG = 0x0020001B,
282 #endif
283 	MLAN_OID_MISC_HOTSPOT_CFG = 0x0020001C,
284 	MLAN_OID_MISC_OTP_USER_DATA = 0x0020001D,
285 	MLAN_OID_MISC_AUTO_ASSOC = 0x0020001E,
286 #ifdef USB
287 	MLAN_OID_MISC_USB_AGGR_CTRL = 0x0020001F,
288 #endif
289 	MLAN_OID_MISC_TXCONTROL = 0x00200020,
290 #ifdef STA_SUPPORT
291 	MLAN_OID_MISC_EXT_CAP_CFG = 0x00200021,
292 #endif
293 #if defined(STA_SUPPORT)
294 	MLAN_OID_MISC_PMFCFG = 0x00200022,
295 #endif
296 #ifdef WIFI_DIRECT_SUPPORT
297 	MLAN_OID_MISC_WIFI_DIRECT_CONFIG = 0x00200025,
298 #endif
299 	MLAN_OID_MISC_TDLS_OPER = 0x00200026,
300 	MLAN_OID_MISC_GET_TDLS_IES = 0x00200027,
301 	MLAN_OID_MISC_LOW_PWR_MODE = 0x00200029,
302 	MLAN_OID_MISC_MEF_FLT_CFG = 0x0020002A,
303 	MLAN_OID_MISC_DFS_REAPTER_MODE = 0x0020002B,
304 #ifdef RX_PACKET_COALESCE
305 	MLAN_OID_MISC_RX_PACKET_COALESCE = 0x0020002C,
306 #endif
307 	MLAN_OID_MISC_TDLS_CS_CHANNEL = 0x0020002D,
308 	MLAN_OID_MISC_COALESCE_CFG = 0x0020002E,
309 	MLAN_OID_MISC_TDLS_IDLE_TIME = 0x0020002F,
310 	MLAN_OID_MISC_GET_SENSOR_TEMP = 0x00200030,
311 	MLAN_OID_MISC_IPV6_RA_OFFLOAD = 0x00200036,
312 	MLAN_OID_MISC_GTK_REKEY_OFFLOAD = 0x00200037,
313 	MLAN_OID_MISC_OPER_CLASS = 0x00200038,
314 	MLAN_OID_MISC_PMIC_CFG = 0x00200039,
315 	MLAN_OID_MISC_IND_RST_CFG = 0x00200040,
316 	MLAN_OID_MISC_ROAM_OFFLOAD = 0x00200042,
317 	MLAN_OID_MISC_ROAM_OFFLOAD_APLIST = 0x00200043,
318 	MLAN_OID_MISC_GET_TSF = 0x00200045,
319 	MLAN_OID_MISC_GET_CHAN_REGION_CFG = 0x00200046,
320 	MLAN_OID_MISC_CLOUD_KEEP_ALIVE = 0x00200048,
321 	MLAN_OID_MISC_OPER_CLASS_CHECK = 0x00200049,
322 
323 	MLAN_OID_MISC_CWMODE_CTRL = 0x00200051,
324 	MLAN_OID_MISC_AGGR_CTRL = 0x00200052,
325 	MLAN_OID_MISC_DYN_BW = 0x00200053,
326 	MLAN_OID_MISC_FW_DUMP_EVENT = 0x00200054,
327 	MLAN_OID_MISC_PER_PKT_CFG = 0x00200055,
328 
329 	MLAN_OID_MISC_ROBUSTCOEX = 0x00200056,
330 	MLAN_OID_MISC_GET_TX_RX_HISTOGRAM = 0x00200057,
331 	MLAN_OID_MISC_CFP_INFO = 0x00200060,
332 	MLAN_OID_MISC_BOOT_SLEEP = 0x00200061,
333 #if defined(PCIE)
334 	MLAN_OID_MISC_SSU = 0x00200062,
335 #endif
336 	MLAN_OID_MISC_CSI = 0x00200064,
337 	MLAN_OID_MISC_DMCS_CONFIG = 0x00200065,
338 	MLAN_OID_MISC_RX_ABORT_CFG = 0x00200066,
339 	MLAN_OID_MISC_RX_ABORT_CFG_EXT = 0x00200067,
340 	MLAN_OID_MISC_TX_AMPDU_PROT_MODE = 0x00200068,
341 	MLAN_OID_MISC_RATE_ADAPT_CFG = 0x00200069,
342 	MLAN_OID_MISC_CCK_DESENSE_CFG = 0x00200070,
343 	MLAN_OID_MISC_GET_CHAN_TRPC_CFG = 0x00200072,
344 	MLAN_OID_MISC_BAND_STEERING = 0x00200073,
345 	MLAN_OID_MISC_GET_REGIONPWR_CFG = 0x00200074,
346 	MLAN_OID_MISC_RF_TEST_GENERIC = 0x00200075,
347 	MLAN_OID_MISC_RF_TEST_TX_CONT = 0x00200076,
348 	MLAN_OID_MISC_RF_TEST_TX_FRAME = 0x00200077,
349 	MLAN_OID_MISC_ARB_CONFIG = 0x00200078,
350 	MLAN_OID_MISC_BEACON_STUCK = 0x00200079,
351 	MLAN_OID_MISC_CFP_TABLE = 0x0020007A,
352 	MLAN_OID_MISC_RANGE_EXT = 0x0020007B,
353 	MLAN_OID_MISC_DOT11MC_UNASSOC_FTM_CFG = 0x0020007C,
354 	MLAN_OID_MISC_TP_STATE = 0x0020007D,
355 	MLAN_OID_MISC_HAL_PHY_CFG = 0x0020007E,
356 	MLAN_OID_MISC_RF_TEST_HE_POWER = 0X0020007F,
357 #ifdef UAP_SUPPORT
358 	MLAN_OID_MISC_WACP_MODE = 0x00200081,
359 #endif
360 	MLAN_OID_MISC_GPIO_TSF_LATCH = 0x00200082,
361 	MLAN_OID_MISC_GET_TSF_INFO = 0x00200083,
362 	MLAN_OID_MISC_ASSOC_REQ = 0x00200084,
363 	MLAN_OID_MISC_IPS_CFG = 0x00200085,
364 	MLAN_OID_MISC_MC_AGGR_CFG = 0x00200086,
365 	MLAN_OID_MISC_CH_LOAD = 0x00200087,
366 	MLAN_OID_MISC_STATS = 0x00200088,
367 	MLAN_OID_MISC_CH_LOAD_RESULTS = 0x00200089,
368 };
369 
370 /** Sub command size */
371 #define MLAN_SUB_COMMAND_SIZE 4
372 
373 /** Enumeration for the action of IOCTL request */
374 enum _mlan_act_ioctl {
375 	MLAN_ACT_SET = 1,
376 	MLAN_ACT_GET,
377 	MLAN_ACT_CANCEL,
378 	MLAN_ACT_CLEAR,
379 	MLAN_ACT_RESET,
380 	MLAN_ACT_DEFAULT
381 };
382 
383 /** Enumeration for generic enable/disable */
384 enum _mlan_act_generic { MLAN_ACT_DISABLE = 0, MLAN_ACT_ENABLE = 1 };
385 
386 /** Enumeration for scan mode */
387 enum _mlan_scan_mode {
388 	MLAN_SCAN_MODE_UNCHANGED = 0,
389 	MLAN_SCAN_MODE_BSS,
390 	MLAN_SCAN_MODE_IBSS,
391 	MLAN_SCAN_MODE_ANY
392 };
393 
394 /** Enumeration for scan type */
395 enum _mlan_scan_type {
396 	MLAN_SCAN_TYPE_UNCHANGED = 0,
397 	MLAN_SCAN_TYPE_ACTIVE,
398 	MLAN_SCAN_TYPE_PASSIVE,
399 	MLAN_SCAN_TYPE_PASSIVE_TO_ACTIVE
400 };
401 
402 /** Enumeration for passive to active scan */
403 enum _mlan_pass_to_act_scan {
404 	MLAN_PASS_TO_ACT_SCAN_UNCHANGED = 0,
405 	MLAN_PASS_TO_ACT_SCAN_EN,
406 	MLAN_PASS_TO_ACT_SCAN_DIS
407 };
408 
409 /** Enumeration for passive to active scan */
410 enum _mlan_ext_scan {
411 	MLAN_EXTENDED_SCAN_UNCHANGED = 0,
412 	MLAN_LEGACY_SCAN,
413 	MLAN_EXT_SCAN,
414 	MLAN_EXT_SCAN_ENH
415 };
416 
417 /** Max number of supported rates */
418 #define MLAN_SUPPORTED_RATES 32
419 
420 /** Mrvl Proprietary Tlv base */
421 #define PROPRIETARY_TLV_BASE_ID 0x100
422 
423 /** RSSI scan */
424 #define SCAN_RSSI(RSSI) (0x100 - ((t_u8)(RSSI)))
425 
426 /** Max passive scan time for each channel in milliseconds */
427 #define MRVDRV_MAX_PASSIVE_SCAN_CHAN_TIME 2000
428 
429 /** Max active scan time for each channel in milliseconds  */
430 #define MRVDRV_MAX_ACTIVE_SCAN_CHAN_TIME 500
431 /** Max gap time between 2 scan in milliseconds  */
432 #define MRVDRV_MAX_SCAN_CHAN_GAP_TIME 500
433 
434 /** Maximum number of probes to send on each channel */
435 #define MAX_PROBES 5
436 
437 /** Default number of probes to send on each channel */
438 #define DEFAULT_PROBES 4
439 
440 /**
441  *  @brief Sub-structure passed in wlan_ioctl_get_scan_table_entry for each BSS
442  *
443  *  Fixed field information returned for the scan response in the IOCTL
444  *    response.
445  */
446 typedef struct _wlan_get_scan_table_fixed {
447 	/** BSSID of this network */
448 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
449 	/** Channel this beacon/probe response was detected */
450 	t_u8 channel;
451 	/** RSSI for the received packet */
452 	t_u8 rssi;
453 	/** channel load */
454 	t_u8 chan_load;
455 	/** TSF value in microseconds from the firmware at packet reception */
456 	t_u64 network_tsf;
457 } wlan_get_scan_table_fixed;
458 
459 /** mlan_802_11_ssid data structure */
460 typedef struct _mlan_802_11_ssid {
461 	/** SSID Length */
462 	t_u32 ssid_len;
463 	/** SSID information field */
464 	t_u8 ssid[MLAN_MAX_SSID_LENGTH];
465 } mlan_802_11_ssid, *pmlan_802_11_ssid;
466 
467 typedef MLAN_PACK_START struct _tx_status_event {
468 	/** packet type */
469 	t_u8 packet_type;
470 	/** tx_token_id */
471 	t_u8 tx_token_id;
472 	/** 0--success, 1--fail, 2--watchdogtimeout */
473 	t_u8 status;
474 } MLAN_PACK_END tx_status_event;
475 
476 /**
477  *  Sructure to retrieve the scan table
478  */
479 typedef struct {
480 	/**
481 	 *  - Zero based scan entry to start retrieval in command request
482 	 *  - Number of scans entries returned in command response
483 	 */
484 	t_u32 scan_number;
485 	/**
486 	 * Buffer marker for multiple wlan_ioctl_get_scan_table_entry
487 	 * structures. Each struct is padded to the nearest 32 bit boundary.
488 	 */
489 	t_u8 scan_table_entry_buf[1];
490 } wlan_ioctl_get_scan_table_info;
491 
492 /**
493  *  Structure passed in the wlan_ioctl_get_scan_table_info for each
494  *    BSS returned in the WLAN_GET_SCAN_RESP IOCTL
495  */
496 typedef struct _wlan_ioctl_get_scan_table_entry {
497 	/**
498 	 *  Fixed field length included in the response.
499 	 *
500 	 *  Length value is included so future fixed fields can be added to the
501 	 *   response without breaking backwards compatibility.  Use the length
502 	 *   to find the offset for the bssInfoLength field, not a sizeof()
503 	 * calc.
504 	 */
505 	t_u32 fixed_field_length;
506 
507 	/**
508 	 *  Length of the BSS Information (probe resp or beacon) that
509 	 *    follows after the fixed_field_length
510 	 */
511 	t_u32 bss_info_length;
512 
513 	/**
514 	 *  Always present, fixed length data fields for the BSS
515 	 */
516 	wlan_get_scan_table_fixed fixed_fields;
517 
518 	/*
519 	 * Probe response or beacon scanned for the BSS.
520 	 *
521 	 * Field layout:
522 	 *  - TSF              8 octets
523 	 *  - Beacon Interval  2 octets
524 	 *  - Capability Info  2 octets
525 	 *
526 	 *  - IEEE Infomation Elements; variable number & length per 802.11 spec
527 	 */
528 	/* t_u8  bss_info_buffer[]; */
529 } wlan_ioctl_get_scan_table_entry;
530 
531 /** Type definition of mlan_scan_time_params */
532 typedef struct _mlan_scan_time_params {
533 	/** Scan channel time for specific scan in milliseconds */
534 	t_u32 specific_scan_time;
535 	/** Scan channel time for active scan in milliseconds */
536 	t_u32 active_scan_time;
537 	/** Scan channel time for passive scan in milliseconds */
538 	t_u32 passive_scan_time;
539 } mlan_scan_time_params, *pmlan_scan_time_params;
540 
541 /** Type definition of mlan_user_scan */
542 typedef struct _mlan_user_scan {
543 	/** Length of scan_cfg_buf */
544 	t_u32 scan_cfg_len;
545 	/** Buffer of scan config */
546 	t_u8 scan_cfg_buf[1];
547 } mlan_user_scan, *pmlan_user_scan;
548 
549 /** Type definition of mlan_scan_req */
550 typedef struct _mlan_scan_req {
551 	/** BSS mode for scanning */
552 	t_u32 scan_mode;
553 	/** Scan type */
554 	t_u32 scan_type;
555 	/** SSID */
556 	mlan_802_11_ssid scan_ssid;
557 	/** Scan time parameters */
558 	mlan_scan_time_params scan_time;
559 	/** Scan config parameters in user scan */
560 	mlan_user_scan user_scan;
561 } mlan_scan_req, *pmlan_scan_req;
562 
563 /** Type defnition of mlan_scan_resp */
564 typedef struct _mlan_scan_resp {
565 	/** Number of scan result */
566 	t_u32 num_in_scan_table;
567 	/** Scan table */
568 	t_u8 *pscan_table;
569 	/* Age in seconds */
570 	t_u32 age_in_secs;
571 	/** channel statstics */
572 	t_u8 *pchan_stats;
573 	/** Number of records in the chan_stats */
574 	t_u32 num_in_chan_stats;
575 } mlan_scan_resp, *pmlan_scan_resp;
576 
577 #define EXT_SCAN_TYPE_ENH 2
578 /** Type definition of mlan_scan_cfg */
579 typedef struct _mlan_scan_cfg {
580 	/** Scan type */
581 	t_u32 scan_type;
582 	/** BSS mode for scanning */
583 	t_u32 scan_mode;
584 	/** Scan probe */
585 	t_u32 scan_probe;
586 	/** Scan time parameters */
587 	mlan_scan_time_params scan_time;
588 	/** First passive scan then active scan */
589 	t_u8 passive_to_active_scan;
590 	/** Ext_scan:  0 disable, 1: enable, 2: enhance scan*/
591 	t_u32 ext_scan;
592 	/** scan channel gap */
593 	t_u32 scan_chan_gap;
594 } mlan_scan_cfg, *pmlan_scan_cfg;
595 
596 /** Type defnition of mlan_ds_scan for MLAN_IOCTL_SCAN */
597 typedef struct _mlan_ds_scan {
598 	/** Sub-command */
599 	t_u32 sub_command;
600 	/** Scan request/response */
601 	union {
602 		/** Scan request */
603 		mlan_scan_req scan_req;
604 		/** Scan response */
605 		mlan_scan_resp scan_resp;
606 		/** Scan config parameters in user scan */
607 		mlan_user_scan user_scan;
608 		/** Scan config parameters */
609 		mlan_scan_cfg scan_cfg;
610 	} param;
611 } mlan_ds_scan, *pmlan_ds_scan;
612 
613 /*-----------------------------------------------------------------*/
614 /** BSS Configuration Group */
615 /*-----------------------------------------------------------------*/
616 /** Enumeration for BSS mode */
617 enum _mlan_bss_mode {
618 	MLAN_BSS_MODE_INFRA = 1,
619 	MLAN_BSS_MODE_IBSS,
620 	MLAN_BSS_MODE_AUTO
621 };
622 
623 /** Maximum key length */
624 #define MLAN_MAX_KEY_LENGTH 32
625 /** Maximum PMK R0 NAME key length */
626 #define MLAN_MAX_PMKR0_NAME_LENGTH 16
627 
628 /** Maximum atim window in milliseconds */
629 #define MLAN_MAX_ATIM_WINDOW 50
630 
631 /** Minimum beacon interval */
632 #define MLAN_MIN_BEACON_INTERVAL 20
633 /** Maximum beacon interval */
634 #define MLAN_MAX_BEACON_INTERVAL 1000
635 /** Default beacon interval */
636 #define MLAN_BEACON_INTERVAL 100
637 
638 /** Receive all packets */
639 #define MLAN_PROMISC_MODE 1
640 /** Receive multicast packets in multicast list */
641 #define MLAN_MULTICAST_MODE 2
642 /** Receive all multicast packets */
643 #define MLAN_ALL_MULTI_MODE 4
644 
645 /** Maximum size of multicast list */
646 #define MLAN_MAX_MULTICAST_LIST_SIZE 32
647 
648 /** mlan_multicast_list data structure for MLAN_OID_BSS_MULTICAST_LIST */
649 typedef struct _mlan_multicast_list {
650 	/** Multicast mode */
651 	t_u32 mode;
652 	/** Number of multicast addresses in the list */
653 	t_u32 num_multicast_addr;
654 	/** Multicast address list */
655 	mlan_802_11_mac_addr mac_list[MLAN_MAX_MULTICAST_LIST_SIZE];
656 } mlan_multicast_list, *pmlan_multicast_list;
657 
658 /** Max channel */
659 #define MLAN_MAX_CHANNEL 177
660 /** Maximum number of channels in table */
661 #define MLAN_MAX_CHANNEL_NUM 128
662 
663 /** Channel/frequence for MLAN_OID_BSS_CHANNEL */
664 typedef struct _chan_freq {
665 	/** Channel Number */
666 	t_u32 channel;
667 	/** Frequency of this Channel */
668 	t_u32 freq;
669 } chan_freq;
670 
671 /** mlan_chan_list data structure for MLAN_OID_BSS_CHANNEL_LIST */
672 typedef struct _mlan_chan_list {
673 	/** Number of channel */
674 	t_u32 num_of_chan;
675 	/** Channel-Frequency table */
676 	chan_freq cf[MLAN_MAX_CHANNEL_NUM];
677 } mlan_chan_list;
678 
679 /* This channel is disabled.*/
680 #define CHAN_FLAGS_DISABLED MBIT(0)
681 /* do not initiate radiation, this includes sending probe requests or beaconing
682  */
683 #define CHAN_FLAGS_NO_IR MBIT(1)
684 /* Radar detection is required on this channel */
685 #define CHAN_FLAGS_RADAR MBIT(3)
686 /* extension channel above this channel is not permitted */
687 #define CHAN_FLAGS_NO_HT40PLUS MBIT(4)
688 /* extension channel below this channel is not permitted */
689 #define CHAN_FLAGS_NO_HT40MINUS MBIT(5)
690 /* OFDM is not allowed on this channel */
691 #define CHAN_FLAGS_NO_OFDM MBIT(6)
692 /** 80Mhz can not used on this channel */
693 #define CHAN_FLAGS_NO_80MHZ MBIT(7)
694 /** 180Mhz can not used on this channel */
695 #define CHAN_FLAGS_NO_160MHZ MBIT(8)
696 /* Only indoor use is permitted on this channel */
697 #define CHAN_FLAGS_INDOOR_ONLY MBIT(9)
698 /* IR operation is allowed on this channel if it's
699  * connected concurrently to a BSS on the same channel on
700  * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
701  * band), and IEEE80211_CHAN_RADAR is not set */
702 #define CHAN_FLAGS_IR_CONCURRENT MBIT(10)
703 /* 20 MHz operation is not allowed on this channel */
704 #define CHAN_FLAGS_20MHZ MBIT(11)
705 /* 10 MHz operation is not allowed on this channel */
706 #define CHAN_FLAGS_NO_10MHZ MBIT(12)
707 /** This channel's flag is valid */
708 #define CHAN_FLAGS_MAX MBIT(31)
709 
710 /** Maximum response buffer length */
711 #define ASSOC_RSP_BUF_SIZE 500
712 
713 /** Type definition of mlan_ds_misc_assoc_rsp for MLAN_OID_MISC_ASSOC_RSP */
714 typedef struct _mlan_ds_misc_assoc_rsp {
715 	/** Associate response buffer */
716 	t_u8 assoc_resp_buf[ASSOC_RSP_BUF_SIZE];
717 	/** Response buffer length */
718 	t_u32 assoc_resp_len;
719 } mlan_ds_misc_assoc_rsp, *pmlan_ds_misc_assoc_rsp;
720 
721 /** Type definition of mlan_ds_misc_assoc_req for MLAN_OID_MISC_ASSOC_REQ */
722 typedef struct _mlan_ds_misc_assoc_req {
723 	/** Associate req buffer */
724 	t_u8 assoc_req_buf[ASSOC_RSP_BUF_SIZE];
725 	/** Response buffer length */
726 	t_u32 assoc_req_len;
727 } mlan_ds_misc_assoc_req, *pmlan_ds_misc_assoc_req;
728 
729 /** mlan_ds_assoc_info */
730 typedef struct _mlan_ds_assoc_info {
731 	/** Associate req buffer */
732 	t_u8 assoc_resp_buf[ASSOC_RSP_BUF_SIZE];
733 	/** Response buffer length */
734 	t_u32 assoc_resp_len;
735 	/** Associate req buffer */
736 	t_u8 assoc_req_buf[ASSOC_RSP_BUF_SIZE];
737 	/** Response buffer length */
738 	t_u32 assoc_req_len;
739 } mlan_ds_assoc_info, *pmlan_ds_assoc_info;
740 
741 /** mlan_ssid_bssid  data structure for
742  *  MLAN_OID_BSS_START and MLAN_OID_BSS_FIND_BSS
743  */
744 typedef struct _mlan_ssid_bssid {
745 	/** SSID */
746 	mlan_802_11_ssid ssid;
747 	/** BSSID */
748 	mlan_802_11_mac_addr bssid;
749 	/** index in BSSID list, start from 1 */
750 	t_u32 idx;
751 	/** Receive signal strength in dBm */
752 	t_s32 rssi;
753 	/* previous bssid */
754 	mlan_802_11_mac_addr prev_bssid;
755 	/**channel*/
756 	t_u16 channel;
757 	/**mobility domain value*/
758 	t_u16 ft_md;
759 	/**ft capability*/
760 	t_u8 ft_cap;
761 	/**band*/
762 	t_u16 bss_band;
763 	/** channel flag */
764 	t_u32 channel_flags;
765 	/** host mlme flag*/
766 	t_u8 host_mlme;
767 	/** assoicate resp frame/ie from firmware */
768 	mlan_ds_misc_assoc_rsp assoc_rsp;
769 } mlan_ssid_bssid, *pmlan_ssid_bssid;
770 
771 /** Data structure of WMM ECW */
772 typedef struct _wmm_ecw_t {
773 #ifdef BIG_ENDIAN_SUPPORT
774 	/** Maximum Ecw */
775 	t_u8 ecw_max : 4;
776 	/** Minimum Ecw */
777 	t_u8 ecw_min : 4;
778 #else
779 	/** Minimum Ecw */
780 	t_u8 ecw_min : 4;
781 	/** Maximum Ecw */
782 	t_u8 ecw_max : 4;
783 #endif /* BIG_ENDIAN_SUPPORT */
784 } wmm_ecw_t, *pwmm_ecw_t;
785 
786 /** Data structure of WMM Aci/Aifsn */
787 typedef struct _wmm_aci_aifsn_t {
788 #ifdef BIG_ENDIAN_SUPPORT
789 	/** Reserved */
790 	t_u8 reserved : 1;
791 	/** Aci */
792 	t_u8 aci : 2;
793 	/** Acm */
794 	t_u8 acm : 1;
795 	/** Aifsn */
796 	t_u8 aifsn : 4;
797 #else
798 	/** Aifsn */
799 	t_u8 aifsn : 4;
800 	/** Acm */
801 	t_u8 acm : 1;
802 	/** Aci */
803 	t_u8 aci : 2;
804 	/** Reserved */
805 	t_u8 reserved : 1;
806 #endif /* BIG_ENDIAN_SUPPORT */
807 } wmm_aci_aifsn_t, *pwmm_aci_aifsn_t;
808 
809 /** Data structure of WMM AC parameters  */
810 typedef struct _wmm_ac_parameters_t {
811 	wmm_aci_aifsn_t aci_aifsn; /**< AciAifSn */
812 	wmm_ecw_t ecw; /**< Ecw */
813 	t_u16 tx_op_limit; /**< Tx op limit */
814 } wmm_ac_parameters_t, *pwmm_ac_parameters_t;
815 
816 /** mlan_deauth_param */
817 typedef struct _mlan_deauth_param {
818 	/** STA mac addr */
819 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
820 	/** deauth reason */
821 	t_u16 reason_code;
822 } mlan_deauth_param;
823 
824 #ifdef UAP_SUPPORT
825 /** UAP FLAG: Host based */
826 #define UAP_FLAG_HOST_BASED MBIT(0)
827 /** UAP FLAG: Host mlme */
828 #define UAP_FLAG_HOST_MLME MBIT(1)
829 
830 /** Maximum packet forward control value */
831 #define MAX_PKT_FWD_CTRL 15
832 /** Maximum BEACON period */
833 #define MAX_BEACON_PERIOD 4000
834 /** Minimum BEACON period */
835 #define MIN_BEACON_PERIOD 50
836 /** Maximum DTIM period */
837 #define MAX_DTIM_PERIOD 100
838 /** Minimum DTIM period */
839 #define MIN_DTIM_PERIOD 1
840 /** Maximum TX Power Limit */
841 #define MAX_TX_POWER 20
842 /** Minimum TX Power Limit */
843 #define MIN_TX_POWER 0
844 /** MAX station count */
845 #define MAX_STA_COUNT 64
846 /** Maximum RTS threshold */
847 #define MAX_RTS_THRESHOLD 2347
848 /** Maximum fragmentation threshold */
849 #define MAX_FRAG_THRESHOLD 2346
850 /** Minimum fragmentation threshold */
851 #define MIN_FRAG_THRESHOLD 256
852 /** data rate 54 M */
853 #define DATA_RATE_54M 108
854 /** Maximum value of bcast_ssid_ctl */
855 #define MAX_BCAST_SSID_CTL 2
856 /** antenna A */
857 #define ANTENNA_MODE_A 0
858 /** antenna B */
859 #define ANTENNA_MODE_B 1
860 /** transmit antenna */
861 #define TX_ANTENNA 1
862 /** receive antenna */
863 #define RX_ANTENNA 0
864 /** Maximum stage out time */
865 #define MAX_STAGE_OUT_TIME 864000
866 /** Minimum stage out time */
867 #define MIN_STAGE_OUT_TIME 50
868 /** Maximum Retry Limit */
869 #define MAX_RETRY_LIMIT 14
870 
871 /** Maximum group key timer in seconds */
872 #define MAX_GRP_TIMER 86400
873 
874 /** Maximum value of 4 byte configuration */
875 #define MAX_VALID_DWORD 0x7FFFFFFF /*  (1 << 31) - 1 */
876 
877 /** default UAP BAND 2.4G */
878 #define DEFAULT_UAP_BAND 0
879 /** default UAP channel 6 */
880 #define DEFAULT_UAP_CHANNEL 6
881 
882 /** Maximum data rates */
883 #define MAX_DATA_RATES 14
884 
885 /** auto data rate */
886 #define DATA_RATE_AUTO 0
887 
888 /**filter mode: disable */
889 #define MAC_FILTER_MODE_DISABLE 0
890 /**filter mode: block mac address */
891 #define MAC_FILTER_MODE_ALLOW_MAC 1
892 /**filter mode: block mac address */
893 #define MAC_FILTER_MODE_BLOCK_MAC 2
894 /** Maximum mac filter num */
895 #define MAX_MAC_FILTER_NUM 64
896 
897 /* Bitmap for protocol to use */
898 /** No security */
899 #define PROTOCOL_NO_SECURITY 0x01
900 /** Static WEP */
901 #define PROTOCOL_STATIC_WEP 0x02
902 /** WPA */
903 #define PROTOCOL_WPA 0x08
904 /** WPA2 */
905 #define PROTOCOL_WPA2 0x20
906 /** WP2 Mixed */
907 #define PROTOCOL_WPA2_MIXED 0x28
908 /** EAP */
909 #define PROTOCOL_EAP 0x40
910 /** WAPI */
911 #define PROTOCOL_WAPI 0x80
912 /** WPA3 SAE */
913 #define PROTOCOL_WPA3_SAE 0x100
914 
915 /** Key_mgmt_psk */
916 #define KEY_MGMT_NONE 0x04
917 /** Key_mgmt_none */
918 #define KEY_MGMT_PSK 0x02
919 /** Key_mgmt_eap  */
920 #define KEY_MGMT_EAP 0x01
921 /** Key_mgmt_psk_sha256 */
922 #define KEY_MGMT_PSK_SHA256 0x100
923 /** Key_mgmt_sae */
924 #define KEY_MGMT_SAE 0x400
925 /** Key_mgmt_owe */
926 #define KEY_MGMT_OWE 0x200
927 
928 /** TKIP */
929 #define CIPHER_TKIP 0x04
930 /** AES CCMP */
931 #define CIPHER_AES_CCMP 0x08
932 
933 /** Valid cipher bitmap */
934 #define VALID_CIPHER_BITMAP 0x0c
935 
936 /** Packet forwarding to be done by FW or host */
937 #define PKT_FWD_FW_BIT 0x01
938 /** Intra-BSS broadcast packet forwarding allow bit */
939 #define PKT_FWD_INTRA_BCAST 0x02
940 /** Intra-BSS unicast packet forwarding allow bit */
941 #define PKT_FWD_INTRA_UCAST 0x04
942 /** Inter-BSS unicast packet forwarding allow bit */
943 #define PKT_FWD_INTER_UCAST 0x08
944 /** Intra-BSS unicast packet */
945 #define PKT_INTRA_UCAST 0x01
946 /** Inter-BSS unicast packet */
947 #define PKT_INTER_UCAST 0x02
948 /** Enable Host PKT forwarding */
949 #define PKT_FWD_ENABLE_BIT 0x01
950 
951 /** Channel List Entry */
952 typedef struct _channel_list {
953 	/** Channel Number */
954 	t_u8 chan_number;
955 	/** Band Config */
956 	Band_Config_t bandcfg;
957 } scan_chan_list;
958 
959 /** mac_filter data structure */
960 typedef struct _mac_filter {
961 	/** mac filter mode */
962 	t_u16 filter_mode;
963 	/** mac adress count */
964 	t_u16 mac_count;
965 	/** mac address list */
966 	mlan_802_11_mac_addr mac_list[MAX_MAC_FILTER_NUM];
967 } mac_filter;
968 
969 /** wpa parameter */
970 typedef struct _wpa_param {
971 	/** Pairwise cipher WPA */
972 	t_u8 pairwise_cipher_wpa;
973 	/** Pairwise cipher WPA2 */
974 	t_u8 pairwise_cipher_wpa2;
975 	/** group cipher */
976 	t_u8 group_cipher;
977 	/** RSN replay protection */
978 	t_u8 rsn_protection;
979 	/** passphrase length */
980 	t_u32 length;
981 	/** passphrase */
982 	t_u8 passphrase[64];
983 	/**group key rekey time in seconds */
984 	t_u32 gk_rekey_time;
985 } wpa_param;
986 
987 /** wep key */
988 typedef struct _wep_key {
989 	/** key index 0-3 */
990 	t_u8 key_index;
991 	/** is default */
992 	t_u8 is_default;
993 	/** length */
994 	t_u16 length;
995 	/** key data */
996 	t_u8 key[26];
997 } wep_key;
998 
999 /** wep param */
1000 typedef struct _wep_param {
1001 	/** key 0 */
1002 	wep_key key0;
1003 	/** key 1 */
1004 	wep_key key1;
1005 	/** key 2 */
1006 	wep_key key2;
1007 	/** key 3 */
1008 	wep_key key3;
1009 } wep_param;
1010 
1011 /** Data structure of WMM QoS information */
1012 typedef struct _wmm_qos_info_t {
1013 #ifdef BIG_ENDIAN_SUPPORT
1014 	/** QoS UAPSD */
1015 	t_u8 qos_uapsd : 1;
1016 	/** Reserved */
1017 	t_u8 reserved : 3;
1018 	/** Parameter set count */
1019 	t_u8 para_set_count : 4;
1020 #else
1021 	/** Parameter set count */
1022 	t_u8 para_set_count : 4;
1023 	/** Reserved */
1024 	t_u8 reserved : 3;
1025 	/** QoS UAPSD */
1026 	t_u8 qos_uapsd : 1;
1027 #endif /* BIG_ENDIAN_SUPPORT */
1028 } wmm_qos_info_t, *pwmm_qos_info_t;
1029 
1030 /** Data structure of WMM parameter IE  */
1031 typedef struct _wmm_parameter_t {
1032 	/** OuiType:  00:50:f2:02 */
1033 	t_u8 ouitype[4];
1034 	/** Oui subtype: 01 */
1035 	t_u8 ouisubtype;
1036 	/** version: 01 */
1037 	t_u8 version;
1038 	/** QoS information */
1039 	t_u8 qos_info;
1040 	/** Reserved */
1041 	t_u8 reserved;
1042 	/** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
1043 	wmm_ac_parameters_t ac_params[MAX_AC_QUEUES];
1044 } wmm_parameter_t, *pwmm_parameter_t;
1045 
1046 /** MAX BG channel */
1047 #define MAX_BG_CHANNEL 14
1048 /** mlan_bss_param
1049  * Note: For each entry you must enter an invalid value
1050  * in the MOAL function woal_set_sys_config_invalid_data().
1051  * Otherwise for a valid data an unwanted TLV will be
1052  * added to that command.
1053  */
1054 typedef struct _mlan_uap_bss_param {
1055 	/** AP mac addr */
1056 	mlan_802_11_mac_addr mac_addr;
1057 	/** SSID */
1058 	mlan_802_11_ssid ssid;
1059 	/** Broadcast ssid control */
1060 	t_u8 bcast_ssid_ctl;
1061 	/** Radio control: on/off */
1062 	t_u8 radio_ctl;
1063 	/** dtim period */
1064 	t_u8 dtim_period;
1065 	/** beacon period */
1066 	t_u16 beacon_period;
1067 	/** rates */
1068 	t_u8 rates[MAX_DATA_RATES];
1069 	/** Tx data rate */
1070 	t_u16 tx_data_rate;
1071 	/** Tx beacon rate */
1072 	t_u16 tx_beacon_rate;
1073 	/** multicast/broadcast data rate */
1074 	t_u16 mcbc_data_rate;
1075 	/** Tx power level in dBm */
1076 	t_u8 tx_power_level;
1077 	/** Tx antenna */
1078 	t_u8 tx_antenna;
1079 	/** Rx antenna */
1080 	t_u8 rx_antenna;
1081 	/** packet forward control */
1082 	t_u8 pkt_forward_ctl;
1083 	/** max station count */
1084 	t_u16 max_sta_count;
1085 	/** mac filter */
1086 	mac_filter filter;
1087 	/** station ageout timer in unit of 100ms  */
1088 	t_u32 sta_ageout_timer;
1089 	/** PS station ageout timer in unit of 100ms  */
1090 	t_u32 ps_sta_ageout_timer;
1091 	/** RTS threshold */
1092 	t_u16 rts_threshold;
1093 	/** fragmentation threshold */
1094 	t_u16 frag_threshold;
1095 	/**  retry_limit */
1096 	t_u16 retry_limit;
1097 	/**  pairwise update timeout in milliseconds */
1098 	t_u32 pairwise_update_timeout;
1099 	/** pairwise handshake retries */
1100 	t_u32 pwk_retries;
1101 	/**  groupwise update timeout in milliseconds */
1102 	t_u32 groupwise_update_timeout;
1103 	/** groupwise handshake retries */
1104 	t_u32 gwk_retries;
1105 	/** preamble type */
1106 	t_u8 preamble_type;
1107 	/** band cfg */
1108 	Band_Config_t bandcfg;
1109 	/** channel */
1110 	t_u8 channel;
1111 	/** auth mode */
1112 	t_u16 auth_mode;
1113 	/** PWE derivation */
1114 	t_u8 pwe_derivation;
1115 	/** transition disable */
1116 	t_u8 transition_disable;
1117 	/** encryption protocol */
1118 	t_u16 protocol;
1119 	/** key managment type */
1120 	t_u16 key_mgmt;
1121 	/** wep param */
1122 	wep_param wep_cfg;
1123 	/** wpa param */
1124 	wpa_param wpa_cfg;
1125 	/** Mgmt IE passthru mask */
1126 	t_u32 mgmt_ie_passthru_mask;
1127 	/*
1128 	 * 11n HT Cap  HTCap_t  ht_cap
1129 	 */
1130 	/** HT Capabilities Info field */
1131 	t_u16 ht_cap_info;
1132 	/** A-MPDU Parameters field */
1133 	t_u8 ampdu_param;
1134 	/** Supported MCS Set field */
1135 	t_u8 supported_mcs_set[16];
1136 	/** HT Extended Capabilities field */
1137 	t_u16 ht_ext_cap;
1138 	/** Transmit Beamforming Capabilities field */
1139 	t_u32 tx_bf_cap;
1140 	/** Antenna Selection Capability field */
1141 	t_u8 asel;
1142 	/** Enable 2040 Coex */
1143 	t_u8 enable_2040coex;
1144 	/** key management operation */
1145 	t_u16 key_mgmt_operation;
1146 	/** BSS status */
1147 	t_u16 bss_status;
1148 #ifdef WIFI_DIRECT_SUPPORT
1149 	/* pre shared key */
1150 	t_u8 psk[MLAN_MAX_KEY_LENGTH];
1151 #endif /* WIFI_DIRECT_SUPPORT */
1152 	/** Number of channels in scan_channel_list */
1153 	t_u32 num_of_chan;
1154 	/** scan channel list in ACS mode */
1155 	scan_chan_list chan_list[MLAN_MAX_CHANNEL];
1156 	/** Wmm parameters */
1157 	wmm_parameter_t wmm_para;
1158 
1159 	/** uap host based config */
1160 	t_u32 uap_host_based_config;
1161 } mlan_uap_bss_param, *pmlan_uap_bss_param;
1162 
1163 /** mlan_uap_scan_channels */
1164 typedef struct _mlan_uap_scan_channels {
1165 	/** flag for remove nop channel*/
1166 	t_u8 remove_nop_channel;
1167 	/** num of removed channel */
1168 	t_u8 num_remvoed_channel;
1169 	/** Number of channels in scan_channel_list */
1170 	t_u32 num_of_chan;
1171 	/** scan channel list in ACS mode */
1172 	scan_chan_list chan_list[MLAN_MAX_CHANNEL];
1173 } mlan_uap_scan_channels;
1174 
1175 #define MAX_NUM_PKTS 9
1176 #define DEF_NUM_PKTS 3
1177 /** mlan_chan_switch_param */
1178 typedef struct _mlan_action_chan_switch {
1179 	/** mode*/
1180 	t_u8 mode;
1181 	/** switch mode*/
1182 	t_u8 chan_switch_mode;
1183 	/** oper class*/
1184 	t_u8 new_oper_class;
1185 	/** new channel */
1186 	t_u8 new_channel_num;
1187 	/** chan_switch_count */
1188 	t_u8 chan_switch_count;
1189 } mlan_action_chan_switch;
1190 
1191 /** mlan_uap_oper_ctrl */
1192 typedef struct _mlan_uap_oper_ctrl {
1193 	/** control value
1194 	 *  0: do nothing,
1195 	 *  2: uap stops and restarts automaticaly
1196 	 */
1197 	t_u16 ctrl_value;
1198 	/** channel opt
1199 	 *  1: uap restart on default 2.4G/channel 6
1200 	 *  2: uap restart on the band/channel configured by driver previously
1201 	 *  3: uap restart on the band/channel specified by band_cfg and channel
1202 	 */
1203 	t_u16 chan_opt;
1204 	/** band cfg   0
1205 	 *  0: 20Mhz  2: 40 Mhz  3: 80Mhz
1206 	 */
1207 	t_u8 band_cfg;
1208 	/** channel */
1209 	t_u8 channel;
1210 } mlan_uap_oper_ctrl;
1211 
1212 /** mlan_uap_acs_scan */
1213 typedef struct _mlan_uap_acs_scan {
1214 	/** band */
1215 	Band_Config_t bandcfg;
1216 	/** channel */
1217 	t_u8 chan;
1218 } mlan_uap_acs_scan;
1219 
1220 /** station is authorized (802.1X) */
1221 #define STA_FLAG_AUTHORIZED MBIT(1)
1222 /** Station is capable of receiving frames with short barker preamble */
1223 #define STA_FLAG_SHORT_PREAMBLE MBIT(2)
1224 /** station is WME/QoS capable */
1225 #define STA_FLAG_WME MBIT(3)
1226 /** station uses management frame protection */
1227 #define STA_FLAG_MFP MBIT(4)
1228 /** station is authenticated */
1229 #define STA_FLAG_AUTHENTICATED MBIT(5)
1230 /** station is a TDLS peer */
1231 #define STA_FLAG_TDLS_PEER MBIT(6)
1232 /** station is associated */
1233 #define STA_FLAG_ASSOCIATED MBIT(7)
1234 /** mlan_ds_sta_info */
1235 typedef struct _mlan_ds_sta_info {
1236 	/** aid */
1237 	t_u16 aid;
1238 	/** peer_mac */
1239 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
1240 	/** Listen Interval */
1241 	int listen_interval;
1242 	/** Capability Info */
1243 	t_u16 cap_info;
1244 	/** station flag */
1245 	t_u32 sta_flags;
1246 	/** tlv len */
1247 	t_u16 tlv_len;
1248 	/** tlv start */
1249 	t_u8 tlv[];
1250 } mlan_ds_sta_info;
1251 #endif
1252 
1253 #ifdef WIFI_DIRECT_SUPPORT
1254 /** mode: disable wifi direct */
1255 #define WIFI_DIRECT_MODE_DISABLE 0
1256 /** mode: listen */
1257 #define WIFI_DIRECT_MODE_LISTEN 1
1258 /** mode: GO */
1259 #define WIFI_DIRECT_MODE_GO 2
1260 /** mode: client */
1261 #define WIFI_DIRECT_MODE_CLIENT 3
1262 /** mode: find */
1263 #define WIFI_DIRECT_MODE_FIND 4
1264 /** mode: stop find */
1265 #define WIFI_DIRECT_MODE_STOP_FIND 5
1266 #endif
1267 
1268 /** Type definition of mlan_ds_bss for MLAN_IOCTL_BSS */
1269 typedef struct _mlan_ds_bss {
1270 	/** Sub-command */
1271 	t_u32 sub_command;
1272 	/** BSS parameter */
1273 	union {
1274 		/** SSID-BSSID for MLAN_OID_BSS_START */
1275 		mlan_ssid_bssid ssid_bssid;
1276 		/** BSSID for MLAN_OID_BSS_STOP */
1277 		mlan_802_11_mac_addr bssid;
1278 		/** BSS mode for MLAN_OID_BSS_MODE */
1279 		t_u32 bss_mode;
1280 		/** BSS channel/frequency for MLAN_OID_BSS_CHANNEL */
1281 		chan_freq bss_chan;
1282 		/** BSS channel list for MLAN_OID_BSS_CHANNEL_LIST */
1283 		mlan_chan_list chanlist;
1284 		/** MAC address for MLAN_OID_BSS_MAC_ADDR */
1285 		mlan_802_11_mac_addr mac_addr;
1286 		/** Multicast list for MLAN_OID_BSS_MULTICAST_LIST */
1287 		mlan_multicast_list multicast_list;
1288 		/** Beacon interval for MLAN_OID_IBSS_BCN_INTERVAL */
1289 		t_u32 bcn_interval;
1290 		/** ATIM window for MLAN_OID_IBSS_ATIM_WINDOW */
1291 		t_u32 atim_window;
1292 		/** deauth param for MLAN_OID_BSS_STOP & MLAN_OID_UAP_DEAUTH_STA
1293 		 */
1294 		mlan_deauth_param deauth_param;
1295 #ifdef UAP_SUPPORT
1296 		/** host based flag for MLAN_OID_BSS_START */
1297 		t_u8 host_based;
1298 		/** BSS param for AP mode for MLAN_OID_UAP_BSS_CONFIG */
1299 		mlan_uap_bss_param bss_config;
1300 		/** AP Wmm parameters for MLAN_OID_UAP_CFG_WMM_PARAM */
1301 		wmm_parameter_t ap_wmm_para;
1302 		/** ap scan channels for MLAN_OID_UAP_SCAN_CHANNELS*/
1303 		mlan_uap_scan_channels ap_scan_channels;
1304 		/** channel switch for MLAN_OID_UAP_CHAN_SWITCH */
1305 		mlan_action_chan_switch chanswitch;
1306 		/** ap channel for MLAN_OID_UAP_CHANNEL*/
1307 		chan_band_info ap_channel;
1308 		/** ap operation control for MLAN_OID_UAP_OPER_CTRL*/
1309 		mlan_uap_oper_ctrl ap_oper_ctrl;
1310 		/** AP acs scan 	    MLAN_OID_UAP_ACS_SCAN */
1311 		mlan_uap_acs_scan ap_acs_scan;
1312 #endif
1313 #if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
1314 		/** BSS role for MLAN_OID_BSS_ROLE */
1315 		t_u8 bss_role;
1316 #endif
1317 #ifdef WIFI_DIRECT_SUPPORT
1318 		/** wifi direct mode for MLAN_OID_WIFI_DIRECT_MODE */
1319 		t_u16 wfd_mode;
1320 #endif
1321 #ifdef STA_SUPPORT
1322 		/** Listen interval for MLAN_OID_BSS_LISTEN_INTERVAL */
1323 		t_u16 listen_interval;
1324 		/** STA channel info for MLAN_OID_BSS_CHAN_INFO */
1325 		chan_band_info sta_channel;
1326 #endif
1327 #ifdef UAP_SUPPORT
1328 		/** STA info for MLAN_OID_UAP_ADD_STATION */
1329 		mlan_ds_sta_info sta_info;
1330 #endif
1331 	} param;
1332 } mlan_ds_bss, *pmlan_ds_bss;
1333 
1334 /* OTP Region info */
1335 typedef MLAN_PACK_START struct _otp_region_info {
1336 	t_u8 country_code[2];
1337 	t_u8 region_code;
1338 	t_u8 environment;
1339 	t_u8 force_reg : 1;
1340 	t_u8 reserved : 7;
1341 	t_u8 dfs_region;
1342 } MLAN_PACK_END otp_region_info_t;
1343 
1344 /** Type definition of mlan_ds_custom_reg_domain */
1345 typedef struct _mlan_ds_custom_reg_domain {
1346 	otp_region_info_t region;
1347 	/** num of 2g channels in custom_reg_domain */
1348 	t_u8 num_bg_chan;
1349 	/** num of 5g channels in custom_reg_domain */
1350 	t_u8 num_a_chan;
1351 	/** cfp table */
1352 	chan_freq_power_t cfp_tbl[];
1353 } mlan_ds_custom_reg_domain;
1354 /*-----------------------------------------------------------------*/
1355 /** Radio Control Group */
1356 /*-----------------------------------------------------------------*/
1357 /** Enumeration for band */
1358 enum _mlan_band_def {
1359 	BAND_B = 1,
1360 	BAND_G = 2,
1361 	BAND_A = 4,
1362 	BAND_GN = 8,
1363 	BAND_AN = 16,
1364 	BAND_GAC = 32,
1365 	BAND_AAC = 64,
1366 	BAND_GAX = 256,
1367 	BAND_AAX = 512,
1368 };
1369 
1370 /** Channel bandwidth */
1371 #define CHANNEL_BW_20MHZ 0
1372 #define CHANNEL_BW_40MHZ_ABOVE 1
1373 #define CHANNEL_BW_40MHZ_BELOW 3
1374 /** secondary channel is 80Mhz bandwidth for 11ac */
1375 #define CHANNEL_BW_80MHZ 4
1376 #define CHANNEL_BW_160MHZ 5
1377 
1378 /** RF antenna selection */
1379 #define RF_ANTENNA_MASK(n) ((1 << (n)) - 1)
1380 /** RF antenna auto select */
1381 #define RF_ANTENNA_AUTO 0xFFFF
1382 
1383 /** Type definition of mlan_ds_band_cfg for MLAN_OID_BAND_CFG */
1384 typedef struct _mlan_ds_band_cfg {
1385 	/** Infra band */
1386 	t_u32 config_bands;
1387 	/** Ad-hoc start band */
1388 	t_u32 adhoc_start_band;
1389 	/** Ad-hoc start channel */
1390 	t_u32 adhoc_channel;
1391 	/** fw supported band */
1392 	t_u32 fw_bands;
1393 } mlan_ds_band_cfg;
1394 
1395 /** Type definition of mlan_ds_ant_cfg for MLAN_OID_ANT_CFG */
1396 typedef struct _mlan_ds_ant_cfg {
1397 	/** Tx antenna mode */
1398 	t_u32 tx_antenna;
1399 	/** Rx antenna mode */
1400 	t_u32 rx_antenna;
1401 } mlan_ds_ant_cfg, *pmlan_ds_ant_cfg;
1402 /** Type definition of mlan_ds_mimo_switch for MLAN_OID_MIMO_SWITCH */
1403 typedef struct _mlan_ds_mimo_switch {
1404 	/** Tx antenna mode */
1405 	t_u8 txpath_antmode;
1406 	/** Rx antenna mode */
1407 	t_u8 rxpath_antmode;
1408 } mlan_ds_mimo_switch, *pmlan_ds_mimo_switch;
1409 /** Type definition of mlan_ds_ant_cfg_1x1 for MLAN_OID_ANT_CFG */
1410 typedef struct _mlan_ds_ant_cfg_1x1 {
1411 	/** Antenna mode */
1412 	t_u32 antenna;
1413 	/** Evaluate time */
1414 	t_u16 evaluate_time;
1415 	/** Current antenna */
1416 	t_u16 current_antenna;
1417 } mlan_ds_ant_cfg_1x1, *pmlan_ds_ant_cfg_1x1;
1418 
1419 /** Type definition of mlan_ds_remain_chan for MLAN_OID_REMAIN_CHAN_CFG */
1420 typedef struct _mlan_ds_remain_chan {
1421 	/** remove flag */
1422 	t_u16 remove;
1423 	/** status */
1424 	t_u8 status;
1425 	/** Band cfg */
1426 	Band_Config_t bandcfg;
1427 	/** channel */
1428 	t_u8 channel;
1429 	/** remain time: Unit ms*/
1430 	t_u32 remain_period;
1431 } mlan_ds_remain_chan, *pmlan_ds_remain_chan;
1432 
1433 /** Type definition of mlan_ds_radio_cfg for MLAN_IOCTL_RADIO_CFG */
1434 typedef struct _mlan_ds_radio_cfg {
1435 	/** Sub-command */
1436 	t_u32 sub_command;
1437 	/** Radio control parameter */
1438 	union {
1439 		/** Radio on/off for MLAN_OID_RADIO_CTRL */
1440 		t_u32 radio_on_off;
1441 		/** Band info for MLAN_OID_BAND_CFG */
1442 		mlan_ds_band_cfg band_cfg;
1443 		/** Antenna info for MLAN_OID_ANT_CFG */
1444 		mlan_ds_ant_cfg ant_cfg;
1445 		/** Antenna mode for MLAN_OID_MIMO_SWITCH */
1446 		mlan_ds_mimo_switch mimo_switch_cfg;
1447 		/** Antenna info for MLAN_OID_ANT_CFG */
1448 		mlan_ds_ant_cfg_1x1 ant_cfg_1x1;
1449 		/** remain on channel for MLAN_OID_REMAIN_CHAN_CFG */
1450 		mlan_ds_remain_chan remain_chan;
1451 	} param;
1452 } mlan_ds_radio_cfg, *pmlan_ds_radio_cfg;
1453 
1454 enum COALESCE_OPERATION {
1455 	RECV_FILTER_MATCH_TYPE_EQ = 0x80,
1456 	RECV_FILTER_MATCH_TYPE_NE,
1457 };
1458 
1459 enum COALESCE_PACKET_TYPE {
1460 	PACKET_TYPE_UNICAST = 1,
1461 	PACKET_TYPE_MULTICAST = 2,
1462 	PACKET_TYPE_BROADCAST = 3
1463 };
1464 
1465 #define COALESCE_MAX_RULES 8
1466 #define COALESCE_MAX_BYTESEQ 4 /* non-adjustable */
1467 #define COALESCE_MAX_FILTERS 4
1468 #define MAX_COALESCING_DELAY 100 /* in msecs */
1469 #define MAX_PATTERN_LEN 20
1470 #define MAX_OFFSET_LEN 100
1471 
1472 struct filt_field_param {
1473 	t_u8 operation;
1474 	t_u8 operand_len;
1475 	t_u16 offset;
1476 	t_u8 operand_byte_stream[COALESCE_MAX_BYTESEQ];
1477 };
1478 
1479 struct coalesce_rule {
1480 	t_u16 max_coalescing_delay;
1481 	t_u8 num_of_fields;
1482 	t_u8 pkt_type;
1483 	struct filt_field_param params[COALESCE_MAX_FILTERS];
1484 };
1485 
1486 typedef struct _mlan_ds_coalesce_cfg {
1487 	t_u16 num_of_rules;
1488 	struct coalesce_rule rule[COALESCE_MAX_RULES];
1489 } mlan_ds_coalesce_cfg;
1490 
1491 /*-----------------------------------------------------------------*/
1492 /** SNMP MIB Group */
1493 /*-----------------------------------------------------------------*/
1494 /** Type definition of mlan_ds_snmp_mib for MLAN_IOCTL_SNMP_MIB */
1495 typedef struct _mlan_ds_snmp_mib {
1496 	/** Sub-command */
1497 	t_u32 sub_command;
1498 	/** SNMP MIB parameter */
1499 	union {
1500 		/** RTS threshold for MLAN_OID_SNMP_MIB_RTS_THRESHOLD */
1501 		t_u32 rts_threshold;
1502 		/** Fragment threshold for MLAN_OID_SNMP_MIB_FRAG_THRESHOLD */
1503 		t_u32 frag_threshold;
1504 		/** Retry count for MLAN_OID_SNMP_MIB_RETRY_COUNT */
1505 		t_u32 retry_count;
1506 		/** OID value for MLAN_OID_SNMP_MIB_DOT11D/H */
1507 		t_u32 oid_value;
1508 		/** DTIM period for MLAN_OID_SNMP_MIB_DTIM_PERIOD */
1509 		t_u32 dtim_period;
1510 		/** Singal_ext Enable for MLAN_OID_SNMP_MIB_SIGNALEXT_ENABLE */
1511 		t_u8 signalext_enable;
1512 		/** Control deauth when uap switch channel */
1513 		t_u8 deauthctrl;
1514 		t_u8 chan_track;
1515 	} param;
1516 } mlan_ds_snmp_mib, *pmlan_ds_snmp_mib;
1517 
1518 /*-----------------------------------------------------------------*/
1519 /** Status Information Group */
1520 /*-----------------------------------------------------------------*/
1521 /** Enumeration for ad-hoc status */
1522 enum _mlan_adhoc_status {
1523 	ADHOC_IDLE,
1524 	ADHOC_STARTED,
1525 	ADHOC_JOINED,
1526 	ADHOC_COALESCED,
1527 	ADHOC_STARTING
1528 };
1529 
1530 typedef struct _mlan_ds_get_stats_org {
1531 	/** Statistics counter */
1532 	/** Multicast transmitted frame count */
1533 	t_u32 mcast_tx_frame;
1534 	/** Failure count */
1535 	t_u32 failed;
1536 	/** Retry count */
1537 	t_u32 retry;
1538 	/** Multi entry count */
1539 	t_u32 multi_retry;
1540 	/** Duplicate frame count */
1541 	t_u32 frame_dup;
1542 	/** RTS success count */
1543 	t_u32 rts_success;
1544 	/** RTS failure count */
1545 	t_u32 rts_failure;
1546 	/** Ack failure count */
1547 	t_u32 ack_failure;
1548 	/** Rx fragmentation count */
1549 	t_u32 rx_frag;
1550 	/** Multicast Tx frame count */
1551 	t_u32 mcast_rx_frame;
1552 	/** FCS error count */
1553 	t_u32 fcs_error;
1554 	/** Tx frame count */
1555 	t_u32 tx_frame;
1556 	/** WEP ICV error count */
1557 	t_u32 wep_icv_error[4];
1558 	/** beacon recv count */
1559 	t_u32 bcn_rcv_cnt;
1560 	/** beacon miss count */
1561 	t_u32 bcn_miss_cnt;
1562 	/** received amsdu count*/
1563 	t_u32 amsdu_rx_cnt;
1564 	/** received msdu count in amsdu*/
1565 	t_u32 msdu_in_rx_amsdu_cnt;
1566 	/** tx amsdu count*/
1567 	t_u32 amsdu_tx_cnt;
1568 	/** tx msdu count in amsdu*/
1569 	t_u32 msdu_in_tx_amsdu_cnt;
1570 } mlan_ds_get_stats_org;
1571 
1572 /** Type definition of mlan_ds_get_stats for MLAN_OID_GET_STATS */
1573 typedef struct _mlan_ds_get_stats {
1574 	/** Statistics counter */
1575 	/** Multicast transmitted frame count */
1576 	t_u32 mcast_tx_frame;
1577 	/** Failure count */
1578 	t_u32 failed;
1579 	/** Retry count */
1580 	t_u32 retry;
1581 	/** Multi entry count */
1582 	t_u32 multi_retry;
1583 	/** Duplicate frame count */
1584 	t_u32 frame_dup;
1585 	/** RTS success count */
1586 	t_u32 rts_success;
1587 	/** RTS failure count */
1588 	t_u32 rts_failure;
1589 	/** Ack failure count */
1590 	t_u32 ack_failure;
1591 	/** Rx fragmentation count */
1592 	t_u32 rx_frag;
1593 	/** Multicast Tx frame count */
1594 	t_u32 mcast_rx_frame;
1595 	/** FCS error count */
1596 	t_u32 fcs_error;
1597 	/** Tx frame count */
1598 	t_u32 tx_frame;
1599 	/** WEP ICV error count */
1600 	t_u32 wep_icv_error[4];
1601 	/** beacon recv count */
1602 	t_u32 bcn_rcv_cnt;
1603 	/** beacon miss count */
1604 	t_u32 bcn_miss_cnt;
1605 	/** received amsdu count*/
1606 	t_u32 amsdu_rx_cnt;
1607 	/** received msdu count in amsdu*/
1608 	t_u32 msdu_in_rx_amsdu_cnt;
1609 	/** tx amsdu count*/
1610 	t_u32 amsdu_tx_cnt;
1611 	/** tx msdu count in amsdu*/
1612 	t_u32 msdu_in_tx_amsdu_cnt;
1613 
1614 	/** Tx frag count */
1615 	t_u32 tx_frag_cnt;
1616 	/** Qos Tx frag count */
1617 	t_u32 qos_tx_frag_cnt[8];
1618 	/** Qos failed count */
1619 	t_u32 qos_failed_cnt[8];
1620 	/** Qos retry count */
1621 	t_u32 qos_retry_cnt[8];
1622 	/** Qos multi retry count */
1623 	t_u32 qos_multi_retry_cnt[8];
1624 	/** Qos frame dup count */
1625 	t_u32 qos_frm_dup_cnt[8];
1626 	/** Qos rts success count */
1627 	t_u32 qos_rts_suc_cnt[8];
1628 	/** Qos rts failure count */
1629 	t_u32 qos_rts_failure_cnt[8];
1630 	/** Qos ack failure count */
1631 	t_u32 qos_ack_failure_cnt[8];
1632 	/** Qos Rx frag count */
1633 	t_u32 qos_rx_frag_cnt[8];
1634 	/** Qos Tx frame count */
1635 	t_u32 qos_tx_frm_cnt[8];
1636 	/** Qos discarded frame count */
1637 	t_u32 qos_discarded_frm_cnt[8];
1638 	/** Qos mpdus Rx count */
1639 	t_u32 qos_mpdus_rx_cnt[8];
1640 	/** Qos retry rx count */
1641 	t_u32 qos_retries_rx_cnt[8];
1642 	/** CMAC ICV errors count */
1643 	t_u32 cmacicv_errors;
1644 	/** CMAC replays count */
1645 	t_u32 cmac_replays;
1646 	/** mgmt CCMP replays count */
1647 	t_u32 mgmt_ccmp_replays;
1648 	/** TKIP ICV errors count */
1649 	t_u32 tkipicv_errors;
1650 	/** TKIP replays count */
1651 	t_u32 tkip_replays;
1652 	/** CCMP decrypt errors count */
1653 	t_u32 ccmp_decrypt_errors;
1654 	/** CCMP replays count */
1655 	t_u32 ccmp_replays;
1656 	/** Tx amsdu count */
1657 	t_u32 tx_amsdu_cnt;
1658 	/** failed amsdu count */
1659 	t_u32 failed_amsdu_cnt;
1660 	/** retry amsdu count */
1661 	t_u32 retry_amsdu_cnt;
1662 	/** multi-retry amsdu count */
1663 	t_u32 multi_retry_amsdu_cnt;
1664 	/** Tx octets in amsdu count */
1665 	t_u64 tx_octets_in_amsdu_cnt;
1666 	/** amsdu ack failure count */
1667 	t_u32 amsdu_ack_failure_cnt;
1668 	/** Rx amsdu count */
1669 	t_u32 rx_amsdu_cnt;
1670 	/** Rx octets in amsdu count */
1671 	t_u64 rx_octets_in_amsdu_cnt;
1672 	/** Tx ampdu count */
1673 	t_u32 tx_ampdu_cnt;
1674 	/** tx mpdus in ampdu count */
1675 	t_u32 tx_mpdus_in_ampdu_cnt;
1676 	/** tx octets in ampdu count */
1677 	t_u64 tx_octets_in_ampdu_cnt;
1678 	/** ampdu Rx count */
1679 	t_u32 ampdu_rx_cnt;
1680 	/** mpdu in Rx ampdu count */
1681 	t_u32 mpdu_in_rx_ampdu_cnt;
1682 	/** Rx octets ampdu count */
1683 	t_u64 rx_octets_in_ampdu_cnt;
1684 	/** ampdu delimiter CRC error count */
1685 	t_u32 ampdu_delimiter_crc_error_cnt;
1686 	/** Rx Stuck Related Info*/
1687 	/** Rx Stuck Issue count */
1688 	t_u32 rx_stuck_issue_cnt[2];
1689 	/** Rx Stuck Recovery count */
1690 	t_u32 rx_stuck_recovery_cnt;
1691 	/** Rx Stuck TSF */
1692 	t_u64 rx_stuck_tsf[2];
1693 	/** Tx Watchdog Recovery Related Info */
1694 	/** Tx Watchdog Recovery count */
1695 	t_u32 tx_watchdog_recovery_cnt;
1696 	/** Tx Watchdog TSF */
1697 	t_u64 tx_watchdog_tsf[2];
1698 	/** Channel Switch Related Info */
1699 	/** Channel Switch Announcement Sent */
1700 	t_u32 channel_switch_ann_sent;
1701 	/** Channel Switch State */
1702 	t_u32 channel_switch_state;
1703 	/** Register Class */
1704 	t_u32 reg_class;
1705 	/** Channel Number */
1706 	t_u32 channel_number;
1707 	/** Channel Switch Mode */
1708 	t_u32 channel_switch_mode;
1709 	/** Reset Rx Mac Count */
1710 	t_u32 rx_reset_mac_recovery_cnt;
1711 	/** ISR2 Not Done Count*/
1712 	t_u32 rx_Isr2_NotDone_Cnt;
1713 	/** GDMA Abort Count */
1714 	t_u32 gdma_abort_cnt;
1715 	/** Rx Reset MAC Count */
1716 	t_u32 g_reset_rx_mac_cnt;
1717 	// Ownership error counters
1718 	/*Error Ownership error count*/
1719 	t_u32 dwCtlErrCnt;
1720 	/*Control Ownership error count*/
1721 	t_u32 dwBcnErrCnt;
1722 	/*Control Ownership error count*/
1723 	t_u32 dwMgtErrCnt;
1724 	/*Control Ownership error count*/
1725 	t_u32 dwDatErrCnt;
1726 	/*BIGTK MME good count*/
1727 	t_u32 bigtk_mmeGoodCnt;
1728 	/*BIGTK Replay error count*/
1729 	t_u32 bigtk_replayErrCnt;
1730 	/*BIGTK MIC error count*/
1731 	t_u32 bigtk_micErrCnt;
1732 	/*BIGTK MME not included count*/
1733 	t_u32 bigtk_mmeNotFoundCnt;
1734 } mlan_ds_get_stats, *pmlan_ds_get_stats;
1735 
1736 /** Type definition of mlan_ds_uap_stats for MLAN_OID_GET_STATS */
1737 typedef struct _mlan_ds_uap_stats {
1738 	/** tkip mic failures */
1739 	t_u32 tkip_mic_failures;
1740 	/** ccmp decrypt errors */
1741 	t_u32 ccmp_decrypt_errors;
1742 	/** wep undecryptable count */
1743 	t_u32 wep_undecryptable_count;
1744 	/** wep icv error count */
1745 	t_u32 wep_icv_error_count;
1746 	/** decrypt failure count */
1747 	t_u32 decrypt_failure_count;
1748 	/** dot11 multicast tx count */
1749 	t_u32 mcast_tx_count;
1750 	/** dot11 failed count */
1751 	t_u32 failed_count;
1752 	/** dot11 retry count */
1753 	t_u32 retry_count;
1754 	/** dot11 multi retry count */
1755 	t_u32 multi_retry_count;
1756 	/** dot11 frame duplicate count */
1757 	t_u32 frame_dup_count;
1758 	/** dot11 rts success count */
1759 	t_u32 rts_success_count;
1760 	/** dot11 rts failure count */
1761 	t_u32 rts_failure_count;
1762 	/** dot11 ack failure count */
1763 	t_u32 ack_failure_count;
1764 	/** dot11 rx ragment count */
1765 	t_u32 rx_fragment_count;
1766 	/** dot11 mcast rx frame count */
1767 	t_u32 mcast_rx_frame_count;
1768 	/** dot11 fcs error count */
1769 	t_u32 fcs_error_count;
1770 	/** dot11 tx frame count */
1771 	t_u32 tx_frame_count;
1772 	/** dot11 rsna tkip cm invoked */
1773 	t_u32 rsna_tkip_cm_invoked;
1774 	/** dot11 rsna 4way handshake failures */
1775 	t_u32 rsna_4way_hshk_failures;
1776 } mlan_ds_uap_stats, *pmlan_ds_uap_stats;
1777 
1778 /** Mask of last beacon RSSI */
1779 #define BCN_RSSI_LAST_MASK 0x00000001
1780 /** Mask of average beacon RSSI */
1781 #define BCN_RSSI_AVG_MASK 0x00000002
1782 /** Mask of last data RSSI */
1783 #define DATA_RSSI_LAST_MASK 0x00000004
1784 /** Mask of average data RSSI */
1785 #define DATA_RSSI_AVG_MASK 0x00000008
1786 /** Mask of last beacon SNR */
1787 #define BCN_SNR_LAST_MASK 0x00000010
1788 /** Mask of average beacon SNR */
1789 #define BCN_SNR_AVG_MASK 0x00000020
1790 /** Mask of last data SNR */
1791 #define DATA_SNR_LAST_MASK 0x00000040
1792 /** Mask of average data SNR */
1793 #define DATA_SNR_AVG_MASK 0x00000080
1794 /** Mask of last beacon NF */
1795 #define BCN_NF_LAST_MASK 0x00000100
1796 /** Mask of average beacon NF */
1797 #define BCN_NF_AVG_MASK 0x00000200
1798 /** Mask of last data NF */
1799 #define DATA_NF_LAST_MASK 0x00000400
1800 /** Mask of average data NF */
1801 #define DATA_NF_AVG_MASK 0x00000800
1802 /** Mask of all RSSI_INFO */
1803 #define ALL_RSSI_INFO_MASK 0x00000fff
1804 #define MAX_PATH_NUM 3
1805 /** path A */
1806 #define PATH_A 0x01
1807 /** path B */
1808 #define PATH_B 0x02
1809 /** path AB */
1810 #define PATH_AB 0x03
1811 /** ALL the path */
1812 #define PATH_ALL 0
1813 /** Type definition of mlan_ds_get_signal for MLAN_OID_GET_SIGNAL */
1814 typedef struct _mlan_ds_get_signal {
1815 	/** Selector of get operation */
1816 	/*
1817 	 * Bit0:  Last Beacon RSSI,  Bit1:  Average Beacon RSSI,
1818 	 * Bit2:  Last Data RSSI,    Bit3:  Average Data RSSI,
1819 	 * Bit4:  Last Beacon SNR,   Bit5:  Average Beacon SNR,
1820 	 * Bit6:  Last Data SNR,     Bit7:  Average Data SNR,
1821 	 * Bit8:  Last Beacon NF,    Bit9:  Average Beacon NF,
1822 	 * Bit10: Last Data NF,      Bit11: Average Data NF
1823 	 *
1824 	 * Bit0: PATH A
1825 	 * Bit1: PATH B
1826 	 */
1827 	t_u16 selector;
1828 
1829 	/** RSSI */
1830 	/** RSSI of last beacon */
1831 	t_s16 bcn_rssi_last;
1832 	/** RSSI of beacon average */
1833 	t_s16 bcn_rssi_avg;
1834 	/** RSSI of last data packet */
1835 	t_s16 data_rssi_last;
1836 	/** RSSI of data packet average */
1837 	t_s16 data_rssi_avg;
1838 
1839 	/** SNR */
1840 	/** SNR of last beacon */
1841 	t_s16 bcn_snr_last;
1842 	/** SNR of beacon average */
1843 	t_s16 bcn_snr_avg;
1844 	/** SNR of last data packet */
1845 	t_s16 data_snr_last;
1846 	/** SNR of data packet average */
1847 	t_s16 data_snr_avg;
1848 
1849 	/** NF */
1850 	/** NF of last beacon */
1851 	t_s16 bcn_nf_last;
1852 	/** NF of beacon average */
1853 	t_s16 bcn_nf_avg;
1854 	/** NF of last data packet */
1855 	t_s16 data_nf_last;
1856 	/** NF of data packet average */
1857 	t_s16 data_nf_avg;
1858 } mlan_ds_get_signal, *pmlan_ds_get_signal;
1859 
1860 /** bit for 2.4 G antenna diversity */
1861 #define ANT_DIVERSITY_2G MBIT(3)
1862 /** bit for 5 G antenna diversity */
1863 #define ANT_DIVERSITY_5G MBIT(7)
1864 
1865 /** mlan_fw_info data structure for MLAN_OID_GET_FW_INFO */
1866 typedef struct _mlan_fw_info {
1867 	/** Firmware version */
1868 	t_u32 fw_ver;
1869 	/** Firmware Hotfix version */
1870 	t_u8 hotfix_version;
1871 	/** tx buf size */
1872 	t_u16 tx_buf_size;
1873 	/** MAC address */
1874 	mlan_802_11_mac_addr mac_addr;
1875 	/** 802.11n device capabilities */
1876 	t_u32 hw_dot_11n_dev_cap;
1877 	/** Device support for MIMO abstraction of MCSs */
1878 	t_u8 hw_dev_mcs_support;
1879 	/** user's MCS setting */
1880 	t_u8 usr_dev_mcs_support;
1881 	/** 802.11ac device capabilities */
1882 	t_u32 hw_dot_11ac_dev_cap;
1883 	/** 802.11ac device Capabilities for 2.4GHz */
1884 	t_u32 usr_dot_11ac_dev_cap_bg;
1885 	/** 802.11ac device Capabilities for 5GHz */
1886 	t_u32 usr_dot_11ac_dev_cap_a;
1887 	/** length of hw he capability */
1888 	t_u8 hw_hecap_len;
1889 	/** 802.11ax HE capability */
1890 	t_u8 hw_he_cap[54];
1891 	/** length of hw 2.4G he capability */
1892 	t_u8 hw_2g_hecap_len;
1893 	/** 802.11ax 2.4G HE capability */
1894 	t_u8 hw_2g_he_cap[54];
1895 	/** 802.11ac device support for MIMO abstraction of MCSs */
1896 	t_u32 hw_dot_11ac_mcs_support;
1897 	/** User conf 802.11ac device support for MIMO abstraction of MCSs */
1898 	t_u32 usr_dot_11ac_mcs_support;
1899 	/** fw supported band */
1900 	t_u16 fw_bands;
1901 	/** region code */
1902 	t_u16 region_code;
1903 	/** force_reg */
1904 	t_u8 force_reg;
1905 	/** ECSA support */
1906 	t_u8 ecsa_enable;
1907 	/** Get log support */
1908 	t_u8 getlog_enable;
1909 	/** FW support for embedded supplicant */
1910 	t_u8 fw_supplicant_support;
1911 	/** ant info */
1912 	t_u8 antinfo;
1913 	/** max AP associated sta count supported by fw */
1914 	t_u8 max_ap_assoc_sta;
1915 	/** FW support roaming offload */
1916 	t_u8 fw_roaming_support;
1917 	/** Bandwidth not support 80Mhz */
1918 	t_u8 prohibit_80mhz;
1919 	/** FW support beacon protection */
1920 	t_u8 fw_beacon_prot;
1921 
1922 	/* lower 8 bytes of uuid */
1923 	t_u64 uuid_lo;
1924 
1925 	/* higher 8 bytes of uuid */
1926 	t_u64 uuid_hi;
1927 } mlan_fw_info, *pmlan_fw_info;
1928 
1929 /** Version string buffer length */
1930 #define MLAN_MAX_VER_STR_LEN 128
1931 
1932 /** Maximum length of secure boot uuid */
1933 #define MLAN_MAX_UUID_LEN 32
1934 
1935 /** mlan_ver_ext data structure for MLAN_OID_GET_VER_EXT */
1936 typedef struct _mlan_ver_ext {
1937 	/** Selected version string */
1938 	t_u32 version_str_sel;
1939 	/** Version string */
1940 	char version_str[MLAN_MAX_VER_STR_LEN];
1941 } mlan_ver_ext, *pmlan_ver_ext;
1942 
1943 #ifdef BIG_ENDIAN_SUPPORT
1944 /** Extended Capabilities Data */
1945 typedef struct MLAN_PACK_START _ExtCap_t {
1946 	/** Extended Capabilities value */
1947 	t_u8 rsvdBit87 : 1; /* bit 87 */
1948 	t_u8 rsvdBit86 : 1; /* bit 86 */
1949 	t_u8 rsvdBit85 : 1; /* bit 85 */
1950 	t_u8 beacon_prot : 1; /* bit 84 */
1951 	t_u8 rsvdBit83 : 1; /* bit 83 */
1952 	t_u8 rsvdBit82 : 1; /* bit 82 */
1953 	t_u8 rsvdBit81 : 1; /* bit 81 */
1954 	t_u8 rsvdBit80 : 1; /* bit 80 */
1955 	t_u8 rsvdBit79 : 1; /* bit 79 */
1956 	t_u8 TWTResp : 1; /* bit 78 */
1957 	t_u8 TWTReq : 1; /* bit 77 */
1958 	t_u8 rsvdBit76 : 1; /* bit 76 */
1959 	t_u8 rsvdBit75 : 1; /* bit 75 */
1960 	t_u8 rsvdBit74 : 1; /* bit 74 */
1961 	t_u8 rsvdBit73 : 1; /* bit 73 */
1962 	t_u8 FILS : 1; /* bit 72 */
1963 	t_u8 FTMI : 1; /* bit 71 */
1964 	t_u8 FTMR : 1; /* bit 70 */
1965 	t_u8 CAQ : 1; /* bit 69 */
1966 	t_u8 rsvdBit68 : 1; /* bit 68 */
1967 	t_u8 NCC : 1; /* bit 67 */
1968 	t_u8 rsvdBit66 : 1; /* bit 66 */
1969 	t_u8 chanSchedMgnt : 1; /* bit 65 */
1970 	t_u8 MaxAMSDU1 : 1; /* bit 64 */
1971 	t_u8 MaxAMSDU0 : 1; /* bit 63 */
1972 	t_u8 OperModeNtf : 1; /* bit 62 */
1973 	t_u8 TDLSWildBandwidth : 1; /* bit 61 */
1974 	t_u8 rsvdBit60 : 1; /* bit 60 */
1975 	t_u8 rsvdBit59 : 1; /* bit 59 */
1976 	t_u8 rsvdBit58 : 1; /* bit 58 */
1977 	t_u8 rsvdBit57 : 1; /* bit 57 */
1978 	t_u8 rsvdBit56 : 1; /* bit 56 */
1979 	t_u8 rsvdBit55 : 1; /* bit 55 */
1980 	t_u8 rsvdBit54 : 1; /* bit 54 */
1981 	t_u8 rsvdBit53 : 1; /* bit 53 */
1982 	t_u8 rsvdBit52 : 1; /* bit 52 */
1983 	t_u8 rsvdBit51 : 1; /* bit 51 */
1984 	t_u8 rsvdBit50 : 1; /* bit 50 */
1985 	t_u8 rsvdBit49 : 1; /* bit 49 */
1986 	t_u8 rsvdBit48 : 1; /* bit 48 */
1987 	t_u8 rsvdBit47 : 1; /* bit 47 */
1988 	t_u8 rsvdBit46 : 1; /* bit 46 */
1989 	t_u8 rsvdBit45 : 1; /* bit 45 */
1990 	t_u8 rsvdBit44 : 1; /* bit 44 */
1991 	t_u8 rsvdBit43 : 1; /* bit 43 */
1992 	t_u8 rsvdBit42 : 1; /* bit 42 */
1993 	t_u8 rsvdBit41 : 1; /* bit 41 */
1994 	t_u8 rsvdBit40 : 1; /* bit 40 */
1995 	t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */
1996 	t_u8 TDLSProhibited : 1; /* bit 38 */
1997 	t_u8 TDLSSupport : 1; /* bit 37 */
1998 	t_u8 MSGCF_Capa : 1; /* bit 36 */
1999 	t_u8 Reserved35 : 1; /* bit 35 */
2000 	t_u8 SSPN_Interface : 1; /* bit 34 */
2001 	t_u8 EBR : 1; /* bit 33 */
2002 	t_u8 Qos_Map : 1; /* bit 32 */
2003 	t_u8 Interworking : 1; /* bit 31 */
2004 	t_u8 TDLSChannelSwitching : 1; /* bit 30 */
2005 	t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */
2006 	t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */
2007 	t_u8 UTC : 1; /* bit 27 */
2008 	t_u8 DMS : 1; /* bit 26 */
2009 	t_u8 SSID_List : 1; /* bit 25 */
2010 	t_u8 ChannelUsage : 1; /* bit 24 */
2011 	t_u8 TimingMeasurement : 1; /* bit 23 */
2012 	t_u8 MultipleBSSID : 1; /* bit 22 */
2013 	t_u8 AC_StationCount : 1; /* bit 21 */
2014 	t_u8 QoSTrafficCap : 1; /* bit 20 */
2015 	t_u8 BSS_Transition : 1; /* bit 19 */
2016 	t_u8 TIM_Broadcast : 1; /* bit 18 */
2017 	t_u8 WNM_Sleep : 1; /* bit 17 */
2018 	t_u8 TFS : 1; /* bit 16 */
2019 	t_u8 GeospatialLocation : 1; /* bit 15 */
2020 	t_u8 CivicLocation : 1; /* bit 14 */
2021 	t_u8 CollocatedIntf : 1; /* bit 13 */
2022 	t_u8 ProxyARPService : 1; /* bit 12 */
2023 	t_u8 FMS : 1; /* bit 11 */
2024 	t_u8 LocationTracking : 1; /* bit 10 */
2025 	t_u8 MulticastDiagnostics : 1; /* bit 9  */
2026 	t_u8 Diagnostics : 1; /* bit 8  */
2027 	t_u8 Event : 1; /* bit 7  */
2028 	t_u8 SPSMP_Support : 1; /* bit 6 */
2029 	t_u8 Reserved5 : 1; /* bit 5 */
2030 	t_u8 PSMP_Capable : 1; /* bit 4 */
2031 	t_u8 RejectUnadmFrame : 1; /* bit 3 */
2032 	t_u8 ExtChanSwitching : 1; /* bit 2 */
2033 	t_u8 Reserved1 : 1; /* bit 1 */
2034 	t_u8 BSS_CoexistSupport : 1; /* bit 0 */
2035 } MLAN_PACK_END ExtCap_t, *pExtCap_t;
2036 #else
2037 /** Extended Capabilities Data */
2038 typedef struct MLAN_PACK_START _ExtCap_t {
2039 	/** Extended Capabilities value */
2040 	t_u8 BSS_CoexistSupport : 1; /* bit 0 */
2041 	t_u8 Reserved1 : 1; /* bit 1 */
2042 	t_u8 ExtChanSwitching : 1; /* bit 2 */
2043 	t_u8 RejectUnadmFrame : 1; /* bit 3 */
2044 	t_u8 PSMP_Capable : 1; /* bit 4 */
2045 	t_u8 Reserved5 : 1; /* bit 5 */
2046 	t_u8 SPSMP_Support : 1; /* bit 6 */
2047 	t_u8 Event : 1; /* bit 7  */
2048 	t_u8 Diagnostics : 1; /* bit 8  */
2049 	t_u8 MulticastDiagnostics : 1; /* bit 9  */
2050 	t_u8 LocationTracking : 1; /* bit 10 */
2051 	t_u8 FMS : 1; /* bit 11 */
2052 	t_u8 ProxyARPService : 1; /* bit 12 */
2053 	t_u8 CollocatedIntf : 1; /* bit 13 */
2054 	t_u8 CivicLocation : 1; /* bit 14 */
2055 	t_u8 GeospatialLocation : 1; /* bit 15 */
2056 	t_u8 TFS : 1; /* bit 16 */
2057 	t_u8 WNM_Sleep : 1; /* bit 17 */
2058 	t_u8 TIM_Broadcast : 1; /* bit 18 */
2059 	t_u8 BSS_Transition : 1; /* bit 19 */
2060 	t_u8 QoSTrafficCap : 1; /* bit 20 */
2061 	t_u8 AC_StationCount : 1; /* bit 21 */
2062 	t_u8 MultipleBSSID : 1; /* bit 22 */
2063 	t_u8 TimingMeasurement : 1; /* bit 23 */
2064 	t_u8 ChannelUsage : 1; /* bit 24 */
2065 	t_u8 SSID_List : 1; /* bit 25 */
2066 	t_u8 DMS : 1; /* bit 26 */
2067 	t_u8 UTC : 1; /* bit 27 */
2068 	t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */
2069 	t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */
2070 	t_u8 TDLSChannelSwitching : 1; /* bit 30 */
2071 	t_u8 Interworking : 1; /* bit 31 */
2072 	t_u8 Qos_Map : 1; /* bit 32 */
2073 	t_u8 EBR : 1; /* bit 33 */
2074 	t_u8 SSPN_Interface : 1; /* bit 34 */
2075 	t_u8 Reserved35 : 1; /* bit 35 */
2076 	t_u8 MSGCF_Capa : 1; /* bit 36 */
2077 	t_u8 TDLSSupport : 1; /* bit 37 */
2078 	t_u8 TDLSProhibited : 1; /* bit 38 */
2079 	t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */
2080 	t_u8 rsvdBit40 : 1; /* bit 40 */
2081 	t_u8 rsvdBit41 : 1; /* bit 41 */
2082 	t_u8 rsvdBit42 : 1; /* bit 42 */
2083 	t_u8 rsvdBit43 : 1; /* bit 43 */
2084 	t_u8 rsvdBit44 : 1; /* bit 44 */
2085 	t_u8 rsvdBit45 : 1; /* bit 45 */
2086 	t_u8 rsvdBit46 : 1; /* bit 46 */
2087 	t_u8 rsvdBit47 : 1; /* bit 47 */
2088 	t_u8 rsvdBit48 : 1; /* bit 48 */
2089 	t_u8 rsvdBit49 : 1; /* bit 49 */
2090 	t_u8 rsvdBit50 : 1; /* bit 50 */
2091 	t_u8 rsvdBit51 : 1; /* bit 51 */
2092 	t_u8 rsvdBit52 : 1; /* bit 52 */
2093 	t_u8 rsvdBit53 : 1; /* bit 53 */
2094 	t_u8 rsvdBit54 : 1; /* bit 54 */
2095 	t_u8 rsvdBit55 : 1; /* bit 55 */
2096 	t_u8 rsvdBit56 : 1; /* bit 56 */
2097 	t_u8 rsvdBit57 : 1; /* bit 57 */
2098 	t_u8 rsvdBit58 : 1; /* bit 58 */
2099 	t_u8 rsvdBit59 : 1; /* bit 59 */
2100 	t_u8 rsvdBit60 : 1; /* bit 60 */
2101 	t_u8 TDLSWildBandwidth : 1; /* bit 61 */
2102 	t_u8 OperModeNtf : 1; /* bit 62 */
2103 	t_u8 MaxAMSDU0 : 1; /* bit 63 */
2104 	t_u8 MaxAMSDU1 : 1; /* bit 64 */
2105 	t_u8 chanSchedMgnt : 1; /* bit 65 */
2106 	t_u8 rsvdBit66 : 1; /* bit 66 */
2107 	t_u8 NCC : 1; /* bit 67 */
2108 	t_u8 rsvdBit68 : 1; /* bit 68 */
2109 	t_u8 CAQ : 1; /* bit 69 */
2110 	t_u8 FTMR : 1; /* bit 70 */
2111 	t_u8 FTMI : 1; /* bit 71 */
2112 	t_u8 FILS : 1; /* bit 72 */
2113 	t_u8 rsvdBit73 : 1; /* bit 73 */
2114 	t_u8 rsvdBit74 : 1; /* bit 74 */
2115 	t_u8 rsvdBit75 : 1; /* bit 75 */
2116 	t_u8 rsvdBit76 : 1; /* bit 76 */
2117 	t_u8 TWTReq : 1; /* bit 77 */
2118 	t_u8 TWTResp : 1; /* bit 78 */
2119 	t_u8 rsvdBit79 : 1; /* bit 79 */
2120 	t_u8 rsvdBit80 : 1; /* bit 80 */
2121 	t_u8 rsvdBit81 : 1; /* bit 81 */
2122 	t_u8 rsvdBit82 : 1; /* bit 82 */
2123 	t_u8 rsvdBit83 : 1; /* bit 83 */
2124 	t_u8 beacon_prot : 1; /* bit 84 */
2125 	t_u8 rsvdBit85 : 1; /* bit 85 */
2126 	t_u8 rsvdBit86 : 1; /* bit 86 */
2127 	t_u8 rsvdBit87 : 1; /* bit 87 */
2128 } MLAN_PACK_END ExtCap_t, *pExtCap_t;
2129 #endif
2130 
2131 /** ExtCap : TDLS prohibited */
2132 #define IS_EXTCAP_TDLS_PROHIBITED(ext_cap) (ext_cap.TDLSProhibited)
2133 /** ExtCap : TDLS channel switch prohibited */
2134 #define IS_EXTCAP_TDLS_CHLSWITCHPROHIB(ext_cap) (ext_cap.TDLSChlSwitchProhib)
2135 
2136 /** mlan_bss_info data structure for MLAN_OID_GET_BSS_INFO */
2137 typedef struct _mlan_bss_info {
2138 	/** BSS mode */
2139 	t_u32 bss_mode;
2140 	/** SSID */
2141 	mlan_802_11_ssid ssid;
2142 	/** Table index */
2143 	t_u32 scan_table_idx;
2144 	/** Channel */
2145 	t_u32 bss_chan;
2146 	/** Band */
2147 	t_u16 bss_band;
2148 	/** Region code */
2149 	t_u32 region_code;
2150 	/** Connection status */
2151 	t_u32 media_connected;
2152 	/** Radio on */
2153 	t_u32 radio_on;
2154 	/** Max power level in dBm */
2155 	t_s32 max_power_level;
2156 	/** Min power level in dBm */
2157 	t_s32 min_power_level;
2158 	/** Adhoc state */
2159 	t_u32 adhoc_state;
2160 	/** NF of last beacon */
2161 	t_s32 bcn_nf_last;
2162 	/** wep status */
2163 	t_u32 wep_status;
2164 	/** scan block status */
2165 	t_u8 scan_block;
2166 	/** Host Sleep configured flag */
2167 	t_u32 is_hs_configured;
2168 	/** Deep Sleep flag */
2169 	t_u32 is_deep_sleep;
2170 	/** BSSID */
2171 	mlan_802_11_mac_addr bssid;
2172 #ifdef STA_SUPPORT
2173 	/** Capability Info */
2174 	t_u16 capability_info;
2175 	/** Beacon Interval */
2176 	t_u16 beacon_interval;
2177 	/** Listen Interval */
2178 	t_u16 listen_interval;
2179 	/** Association Id  */
2180 	t_u16 assoc_id;
2181 	/** AP/Peer supported rates */
2182 	t_u8 peer_supp_rates[MLAN_SUPPORTED_RATES];
2183 	/** extend capability for AP */
2184 	ExtCap_t ext_cap;
2185 #endif /* STA_SUPPORT */
2186 	/** Mobility Domain ID */
2187 	t_u16 mdid;
2188 	/** FT Capability policy */
2189 	t_u8 ft_cap;
2190 	/** 11h active */
2191 	t_bool is_11h_active;
2192 	/** dfs check channel */
2193 	t_u8 dfs_check_channel;
2194 } mlan_bss_info, *pmlan_bss_info;
2195 
2196 /** MAXIMUM number of TID */
2197 #define MAX_NUM_TID 8
2198 
2199 /** Max RX Win size */
2200 #define MAX_RX_WINSIZE 64
2201 
2202 /** rx_reorder_tbl */
2203 typedef struct {
2204 	/** TID */
2205 	t_u16 tid;
2206 	/** TA */
2207 	t_u8 ta[MLAN_MAC_ADDR_LENGTH];
2208 	/** Start window */
2209 	t_u32 start_win;
2210 	/** Window size */
2211 	t_u32 win_size;
2212 	/** amsdu flag */
2213 	t_u8 amsdu;
2214 	/** buffer status */
2215 	t_u32 buffer[MAX_RX_WINSIZE];
2216 } rx_reorder_tbl;
2217 
2218 /** tx_ba_stream_tbl */
2219 typedef struct {
2220 	/** TID */
2221 	t_u16 tid;
2222 	/** RA */
2223 	t_u8 ra[MLAN_MAC_ADDR_LENGTH];
2224 	/** amsdu flag */
2225 	t_u8 amsdu;
2226 } tx_ba_stream_tbl;
2227 
2228 /** Debug command number */
2229 #define DBG_CMD_NUM 10
2230 
2231 #ifdef SDIO
2232 /** sdio mp debug number */
2233 #define SDIO_MP_DBG_NUM 10
2234 #endif
2235 
2236 /** Maximum size of IEEE Information Elements */
2237 #define IEEE_MAX_IE_SIZE 256
2238 
2239 /** support up to 8 TDLS peer */
2240 #define MLAN_MAX_TDLS_PEER_SUPPORTED 8
2241 /** TDLS peer info */
2242 typedef struct _tdls_peer_info {
2243 	/** station mac address */
2244 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
2245 	/** SNR */
2246 	t_s8 snr;
2247 	/** Noise Floor */
2248 	t_s8 nf;
2249 	/** Extended Capabilities IE */
2250 	t_u8 ext_cap[IEEE_MAX_IE_SIZE];
2251 	/** HT Capabilities IE */
2252 	t_u8 ht_cap[IEEE_MAX_IE_SIZE];
2253 	/** VHT Capabilities IE */
2254 	t_u8 vht_cap[IEEE_MAX_IE_SIZE];
2255 	/** HE Capabilities IE */
2256 	t_u8 he_cap[IEEE_MAX_IE_SIZE];
2257 } tdls_peer_info;
2258 
2259 /** max ralist num */
2260 #define MLAN_MAX_RALIST_NUM 8
2261 /** ralist info */
2262 typedef struct _ralist_info {
2263 	/** RA list buffer */
2264 	t_u8 ra[MLAN_MAC_ADDR_LENGTH];
2265 	/** total packets in RA list */
2266 	t_u16 total_pkts;
2267 	/** tid num */
2268 	t_u8 tid;
2269 	/** tx_pause flag */
2270 	t_u8 tx_pause;
2271 } ralist_info, *pralist_info;
2272 
2273 /** mlan_debug_info data structure for MLAN_OID_GET_DEBUG_INFO */
2274 typedef struct _mlan_debug_info {
2275 	/* WMM AC_BK count */
2276 	t_u32 wmm_ac_bk;
2277 	/* WMM AC_BE count */
2278 	t_u32 wmm_ac_be;
2279 	/* WMM AC_VI count */
2280 	t_u32 wmm_ac_vi;
2281 	/* WMM AC_VO count */
2282 	t_u32 wmm_ac_vo;
2283 	/** Corresponds to max_tx_buf_size member of mlan_adapter*/
2284 	t_u32 max_tx_buf_size;
2285 	/** Corresponds to tx_buf_size member of mlan_adapter*/
2286 	t_u32 tx_buf_size;
2287 	/** Corresponds to curr_tx_buf_size member of mlan_adapter*/
2288 	t_u32 curr_tx_buf_size;
2289 	/** Tx table num */
2290 	t_u32 tx_tbl_num;
2291 	/** Tx ba stream table */
2292 	tx_ba_stream_tbl tx_tbl[MLAN_MAX_TX_BASTREAM_SUPPORTED];
2293 	/** Rx table num */
2294 	t_u32 rx_tbl_num;
2295 	/** Rx reorder table*/
2296 	rx_reorder_tbl rx_tbl[MLAN_MAX_RX_BASTREAM_SUPPORTED];
2297 	/** TDLS peer number */
2298 	t_u32 tdls_peer_num;
2299 	/** TDLS peer list*/
2300 	tdls_peer_info tdls_peer_list[MLAN_MAX_TDLS_PEER_SUPPORTED];
2301 	/** ralist num */
2302 	t_u32 ralist_num;
2303 	/** ralist info */
2304 	ralist_info ralist[MLAN_MAX_RALIST_NUM];
2305 	/** Corresponds to ps_mode member of mlan_adapter */
2306 	t_u16 ps_mode;
2307 	/** Corresponds to ps_state member of mlan_adapter */
2308 	t_u32 ps_state;
2309 #ifdef STA_SUPPORT
2310 	/** Corresponds to is_deep_sleep member of mlan_adapter */
2311 	t_u8 is_deep_sleep;
2312 #endif /** STA_SUPPORT */
2313 	/** Corresponds to pm_wakeup_card_req member of mlan_adapter */
2314 	t_u8 pm_wakeup_card_req;
2315 	/** Corresponds to pm_wakeup_fw_try member of mlan_adapter */
2316 	t_u32 pm_wakeup_fw_try;
2317 	/** time stamp when host try to wake up firmware */
2318 	t_u32 pm_wakeup_in_secs;
2319 	/** wake up timeout happened */
2320 	t_u32 pm_wakeup_timeout;
2321 	/** Corresponds to is_hs_configured member of mlan_adapter */
2322 	t_u8 is_hs_configured;
2323 	/** Corresponds to hs_activated member of mlan_adapter */
2324 	t_u8 hs_activated;
2325 	/** Corresponds to pps_uapsd_mode member of mlan_adapter */
2326 	t_u16 pps_uapsd_mode;
2327 	/** Corresponds to sleep_period.period member of mlan_adapter */
2328 	t_u16 sleep_pd;
2329 	/** Corresponds to wmm_qosinfo member of mlan_private */
2330 	t_u8 qos_cfg;
2331 	/** Corresponds to tx_lock_flag member of mlan_adapter */
2332 	t_u8 tx_lock_flag;
2333 	/** Corresponds to port_open member of mlan_private */
2334 	t_u8 port_open;
2335 	/** bypass pkt count */
2336 	t_u32 bypass_pkt_count;
2337 	/** Corresponds to scan_processing member of mlan_adapter */
2338 	t_u32 scan_processing;
2339 	/** Corresponds to scan_state member of mlan_adapter */
2340 	t_u32 scan_state;
2341 	/** Corresponds to mlan_processing member of mlan_adapter */
2342 	t_u32 mlan_processing;
2343 	/** Corresponds to main_lock_flag member of mlan_adapter */
2344 	t_u32 main_lock_flag;
2345 	/** Corresponds to main_process_cnt member of mlan_adapter */
2346 	t_u32 main_process_cnt;
2347 	/** Corresponds to delay_task_flag member of mlan_adapter */
2348 	t_u32 delay_task_flag;
2349 	/** mlan_rx_processing */
2350 	t_u32 mlan_rx_processing;
2351 	/** rx pkts queued */
2352 	t_u32 rx_pkts_queued;
2353 	/** Number of host to card command failures */
2354 	t_u32 num_cmd_host_to_card_failure;
2355 	/** Number of host to card sleep confirm failures */
2356 	t_u32 num_cmd_sleep_cfm_host_to_card_failure;
2357 	/** Number of host to card Tx failures */
2358 	t_u32 num_tx_host_to_card_failure;
2359 	/** Number of allocate buffer failure */
2360 	t_u32 num_alloc_buffer_failure;
2361 	/** Number of pkt dropped */
2362 	t_u32 num_pkt_dropped;
2363 #ifdef SDIO
2364 	/** Number of card to host command/event failures */
2365 	t_u32 num_cmdevt_card_to_host_failure;
2366 	/** Number of card to host Rx failures */
2367 	t_u32 num_rx_card_to_host_failure;
2368 	/** Number of interrupt read failures */
2369 	t_u32 num_int_read_failure;
2370 	/** Last interrupt status */
2371 	t_u32 last_int_status;
2372 	/** number of interrupt receive */
2373 	t_u32 num_of_irq;
2374 	/** flag for sdio rx aggr */
2375 	t_u8 sdio_rx_aggr;
2376 	/** FW update port number */
2377 	t_u32 mp_update[SDIO_MP_AGGR_DEF_PKT_LIMIT_MAX * 2];
2378 	/** Invalid port update count */
2379 	t_u32 mp_invalid_update;
2380 	/** Number of packets tx aggr */
2381 	t_u32 mpa_tx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT_MAX];
2382 	/** no more packets count*/
2383 	t_u32 mpa_sent_last_pkt;
2384 	/** no write_ports count */
2385 	t_u32 mpa_sent_no_ports;
2386 	/** last recv wr_bitmap */
2387 	t_u32 last_recv_wr_bitmap;
2388 	/** last recv rd_bitmap */
2389 	t_u32 last_recv_rd_bitmap;
2390 	/** mp_data_port_mask */
2391 	t_u32 mp_data_port_mask;
2392 	/** last mp_wr_bitmap */
2393 	t_u32 last_mp_wr_bitmap[SDIO_MP_DBG_NUM];
2394 	/** last ports for cmd53 write data */
2395 	t_u32 last_mp_wr_ports[SDIO_MP_DBG_NUM];
2396 	/** last len for cmd53 write data */
2397 	t_u32 last_mp_wr_len[SDIO_MP_DBG_NUM];
2398 	/** last curr_wr_port */
2399 	t_u8 last_curr_wr_port[SDIO_MP_DBG_NUM];
2400 	/** length info for cmd53 write data */
2401 	t_u16 last_mp_wr_info[SDIO_MP_DBG_NUM * SDIO_MP_AGGR_DEF_PKT_LIMIT_MAX];
2402 	/** last mp_index */
2403 	t_u8 last_mp_index;
2404 	/** buffer for mp debug */
2405 	t_u8 *mpa_buf;
2406 	/** length info for mp buf size */
2407 	t_u32 mpa_buf_size;
2408 	/** Number of packets rx aggr */
2409 	t_u32 mpa_rx_count[SDIO_MP_AGGR_DEF_PKT_LIMIT_MAX];
2410 	/** mp aggr_pkt limit */
2411 	t_u8 mp_aggr_pkt_limit;
2412 #endif
2413 	/** Number of deauthentication events */
2414 	t_u32 num_event_deauth;
2415 	/** Number of disassosiation events */
2416 	t_u32 num_event_disassoc;
2417 	/** Number of link lost events */
2418 	t_u32 num_event_link_lost;
2419 	/** Number of deauthentication commands */
2420 	t_u32 num_cmd_deauth;
2421 	/** Number of association comamnd successes */
2422 	t_u32 num_cmd_assoc_success;
2423 	/** Number of association command failures */
2424 	t_u32 num_cmd_assoc_failure;
2425 	/** Number of consecutive association failures */
2426 	t_u32 num_cons_assoc_failure;
2427 
2428 	/** Number of command timeouts */
2429 	t_u32 num_cmd_timeout;
2430 	/** Timeout command ID */
2431 	t_u16 timeout_cmd_id;
2432 	/** Timeout command action */
2433 	t_u16 timeout_cmd_act;
2434 	/** List of last command IDs */
2435 	t_u16 last_cmd_id[DBG_CMD_NUM];
2436 	/** List of last command actions */
2437 	t_u16 last_cmd_act[DBG_CMD_NUM];
2438 	/** Last command index */
2439 	t_u16 last_cmd_index;
2440 	/** List of last command response IDs */
2441 	t_u16 last_cmd_resp_id[DBG_CMD_NUM];
2442 	/** Last command response index */
2443 	t_u16 last_cmd_resp_index;
2444 	/** List of last events */
2445 	t_u16 last_event[DBG_CMD_NUM];
2446 	/** Last event index */
2447 	t_u16 last_event_index;
2448 	/** Number of no free command node */
2449 	t_u16 num_no_cmd_node;
2450 	/** pending command id */
2451 	t_u16 pending_cmd;
2452 	/** time stamp for dnld last cmd */
2453 	t_u32 dnld_cmd_in_secs;
2454 	/** Corresponds to data_sent member of mlan_adapter */
2455 	t_u8 data_sent;
2456 	/** Corresponds to data_sent_cnt member of mlan_adapter */
2457 	t_u32 data_sent_cnt;
2458 	/** Corresponds to cmd_sent member of mlan_adapter */
2459 	t_u8 cmd_sent;
2460 	/** SDIO multiple port read bitmap */
2461 	t_u32 mp_rd_bitmap;
2462 	/** SDIO multiple port write bitmap */
2463 	t_u32 mp_wr_bitmap;
2464 	/** Current available port for read */
2465 	t_u8 curr_rd_port;
2466 	/** Current available port for write */
2467 	t_u8 curr_wr_port;
2468 #ifdef PCIE
2469 	/** PCIE txbd read pointer */
2470 	t_u32 txbd_rdptr;
2471 	/** PCIE txbd write pointer */
2472 	t_u32 txbd_wrptr;
2473 	/** PCIE rxbd read pointer */
2474 	t_u32 rxbd_rdptr;
2475 	/** PCIE rxbd write pointer */
2476 	t_u32 rxbd_wrptr;
2477 	/** PCIE eventbd read pointer */
2478 	t_u32 eventbd_rdptr;
2479 	/** PCIE eventbd write pointer */
2480 	t_u32 eventbd_wrptr;
2481 	/** txrx_bd_size */
2482 	t_u16 txrx_bd_size;
2483 	/** txbd ring vbase */
2484 	t_u8 *txbd_ring_vbase;
2485 	/** txbd ring size */
2486 	t_u32 txbd_ring_size;
2487 	/** rxbd ring vbase */
2488 	t_u8 *rxbd_ring_vbase;
2489 	/** rxbd ring size */
2490 	t_u32 rxbd_ring_size;
2491 	/** evtbd ring vbase */
2492 	t_u8 *evtbd_ring_vbase;
2493 	/** evtbd ring size */
2494 	t_u32 evtbd_ring_size;
2495 #endif
2496 	/** Corresponds to cmdresp_received member of mlan_adapter */
2497 	t_u8 cmd_resp_received;
2498 	/** Corresponds to event_received member of mlan_adapter */
2499 	t_u8 event_received;
2500 	/**  pendig tx pkts */
2501 	t_u32 tx_pkts_queued;
2502 #ifdef UAP_SUPPORT
2503 	/**  pending bridge pkts */
2504 	t_u16 num_bridge_pkts;
2505 	/**  dropped pkts */
2506 	t_u32 num_drop_pkts;
2507 #endif
2508 	/** FW hang report */
2509 	t_u8 fw_hang_report;
2510 	/** mlan_adapter pointer */
2511 	t_void *mlan_adapter;
2512 	/** mlan_adapter_size */
2513 	t_u32 mlan_adapter_size;
2514 	/** mlan_priv vector */
2515 	t_void *mlan_priv[MLAN_MAX_BSS_NUM];
2516 	/** mlan_priv_size */
2517 	t_u32 mlan_priv_size[MLAN_MAX_BSS_NUM];
2518 	/** mlan_priv_num */
2519 	t_u8 mlan_priv_num;
2520 } mlan_debug_info, *pmlan_debug_info;
2521 
2522 #ifdef UAP_SUPPORT
2523 /** Maximum number of clients supported by AP */
2524 #define MAX_NUM_CLIENTS MAX_STA_COUNT
2525 
2526 /** station info */
2527 typedef struct _sta_info_data {
2528 	/** STA MAC address */
2529 	t_u8 mac_address[MLAN_MAC_ADDR_LENGTH];
2530 	/** Power mgmt status */
2531 	t_u8 power_mgmt_status;
2532 	/** RSSI */
2533 	t_s8 rssi;
2534 	/** station bandmode */
2535 	t_u16 bandmode;
2536 	/** station stats */
2537 	sta_stats stats;
2538 	/** ie length */
2539 	t_u16 ie_len;
2540 } sta_info_data;
2541 
2542 /** mlan_ds_sta_list structure for MLAN_OID_UAP_STA_LIST */
2543 typedef struct _mlan_ds_sta_list {
2544 	/** station count */
2545 	t_u16 sta_count;
2546 	/** station list */
2547 	sta_info_data info[MAX_NUM_CLIENTS];
2548 	/* ie_buf will be append at the end */
2549 } mlan_ds_sta_list, *pmlan_ds_sta_list;
2550 #endif
2551 
2552 /** Type definition of mlan_ds_get_info for MLAN_IOCTL_GET_INFO */
2553 typedef struct _mlan_ds_get_info {
2554 	/** Sub-command */
2555 	t_u32 sub_command;
2556 
2557 	/** Status information parameter */
2558 	union {
2559 		/** Signal information for MLAN_OID_GET_SIGNAL */
2560 		mlan_ds_get_signal signal;
2561 		/** Signal path id for MLAN_OID_GET_SIGNAL_EXT */
2562 		t_u16 path_id;
2563 		/** Signal information for MLAN_OID_GET_SIGNAL_EXT */
2564 		mlan_ds_get_signal signal_ext[MAX_PATH_NUM];
2565 		/** Statistics information for MLAN_OID_GET_STATS */
2566 		mlan_ds_get_stats stats;
2567 		/** Statistics information for MLAN_OID_LINK_STATS*/
2568 		t_u8 link_statistic[1];
2569 		/** Firmware information for MLAN_OID_GET_FW_INFO */
2570 		mlan_fw_info fw_info;
2571 		/** Extended version information for MLAN_OID_GET_VER_EXT */
2572 		mlan_ver_ext ver_ext;
2573 		/** BSS information for MLAN_OID_GET_BSS_INFO */
2574 		mlan_bss_info bss_info;
2575 		/** Debug information for MLAN_OID_GET_DEBUG_INFO */
2576 		t_u8 debug_info[1];
2577 #ifdef UAP_SUPPORT
2578 		/** UAP Statistics information for MLAN_OID_GET_STATS */
2579 		mlan_ds_uap_stats ustats;
2580 		/** UAP station list for MLAN_OID_UAP_STA_LIST */
2581 		mlan_ds_sta_list sta_list;
2582 #endif
2583 	} param;
2584 } mlan_ds_get_info, *pmlan_ds_get_info;
2585 
2586 /*-----------------------------------------------------------------*/
2587 /** Security Configuration Group */
2588 /*-----------------------------------------------------------------*/
2589 /** Enumeration for authentication mode */
2590 enum _mlan_auth_mode {
2591 	MLAN_AUTH_MODE_OPEN = 0x00,
2592 	MLAN_AUTH_MODE_SHARED = 0x01,
2593 	MLAN_AUTH_MODE_FT = 0x02,
2594 	MLAN_AUTH_MODE_SAE = 0x03,
2595 	MLAN_AUTH_MODE_NETWORKEAP = 0x80,
2596 	MLAN_AUTH_MODE_AUTO = 0xFF,
2597 };
2598 
2599 /**Enumeration for AssocAgent authentication mode, sync from FW.*/
2600 typedef enum {
2601 	AssocAgentAuth_Open,
2602 	AssocAgentAuth_Shared,
2603 	AssocAgentAuth_FastBss,
2604 	AssocAgentAuth_FastBss_Skip,
2605 	AssocAgentAuth_Network_EAP,
2606 	AssocAgentAuth_Wpa3Sae = 6,
2607 	AssocAgentAuth_Auto,
2608 } AssocAgentAuthType_e;
2609 
2610 /** Enumeration for encryption mode */
2611 enum _mlan_encryption_mode {
2612 	MLAN_ENCRYPTION_MODE_NONE = 0,
2613 	MLAN_ENCRYPTION_MODE_WEP40 = 1,
2614 	MLAN_ENCRYPTION_MODE_TKIP = 2,
2615 	MLAN_ENCRYPTION_MODE_CCMP = 3,
2616 	MLAN_ENCRYPTION_MODE_WEP104 = 4,
2617 	MLAN_ENCRYPTION_MODE_GCMP = 5,
2618 	MLAN_ENCRYPTION_MODE_GCMP_256 = 6,
2619 	MLAN_ENCRYPTION_MODE_CCMP_256 = 7,
2620 };
2621 
2622 /** Enumeration for PSK */
2623 enum _mlan_psk_type {
2624 	MLAN_PSK_PASSPHRASE = 1,
2625 	MLAN_PSK_PMK,
2626 	MLAN_PSK_CLEAR,
2627 	MLAN_PSK_QUERY,
2628 	MLAN_PSK_SAE_PASSWORD,
2629 };
2630 
2631 /** The bit to indicate the key is for unicast */
2632 #define MLAN_KEY_INDEX_UNICAST 0x40000000
2633 /** The key index to indicate default key */
2634 #define MLAN_KEY_INDEX_DEFAULT 0x000000ff
2635 /** Maximum key length */
2636 /* #define MLAN_MAX_KEY_LENGTH        32 */
2637 /** Minimum passphrase length */
2638 #define MLAN_MIN_PASSPHRASE_LENGTH 8
2639 /** Maximum passphrase length */
2640 #define MLAN_MAX_PASSPHRASE_LENGTH 63
2641 /** Minimum sae_password length */
2642 #define MLAN_MIN_SAE_PASSWORD_LENGTH 8
2643 /** Maximum sae_password length */
2644 #define MLAN_MAX_SAE_PASSWORD_LENGTH 255
2645 /** PMK length */
2646 #define MLAN_PMK_HEXSTR_LENGTH 64
2647 /* A few details needed for WEP (Wireless Equivalent Privacy) */
2648 /** 104 bits */
2649 #define MAX_WEP_KEY_SIZE 13
2650 /** 40 bits RC4 - WEP */
2651 #define MIN_WEP_KEY_SIZE 5
2652 /** packet number size */
2653 #define PN_SIZE 16
2654 /** max seq size of wpa/wpa2 key */
2655 #define SEQ_MAX_SIZE 8
2656 
2657 /** key flag for tx_seq */
2658 #define KEY_FLAG_TX_SEQ_VALID 0x00000001
2659 /** key flag for rx_seq */
2660 #define KEY_FLAG_RX_SEQ_VALID 0x00000002
2661 /** key flag for group key */
2662 #define KEY_FLAG_GROUP_KEY 0x00000004
2663 /** key flag for tx */
2664 #define KEY_FLAG_SET_TX_KEY 0x00000008
2665 /** key flag for mcast IGTK */
2666 #define KEY_FLAG_AES_MCAST_IGTK 0x00000010
2667 /** key flag for remove key */
2668 #define KEY_FLAG_REMOVE_KEY 0x80000000
2669 /** key flag for GCMP */
2670 #define KEY_FLAG_GCMP 0x00000020
2671 /** key flag for GCMP_256 */
2672 #define KEY_FLAG_GCMP_256 0x00000040
2673 /** key flag for ccmp 256 */
2674 #define KEY_FLAG_CCMP_256 0x00000080
2675 /** key flag for GMAC_128 */
2676 #define KEY_FLAG_GMAC_128 0x00000100
2677 /** key flag for GMAC_256 */
2678 #define KEY_FLAG_GMAC_256 0x00000200
2679 
2680 /** Type definition of mlan_ds_encrypt_key for MLAN_OID_SEC_CFG_ENCRYPT_KEY */
2681 typedef struct _mlan_ds_encrypt_key {
2682 	/** Key disabled, all other fields will be
2683 	 *  ignore when this flag set to MTRUE
2684 	 */
2685 	t_u32 key_disable;
2686 	/** key removed flag, when this flag is set
2687 	 *  to MTRUE, only key_index will be check
2688 	 */
2689 	t_u32 key_remove;
2690 	/** Key index, used as current tx key index
2691 	 *  when is_current_wep_key is set to MTRUE
2692 	 */
2693 	t_u32 key_index;
2694 	/** Current Tx key flag */
2695 	t_u32 is_current_wep_key;
2696 	/** Key length */
2697 	t_u32 key_len;
2698 	/** Key */
2699 	t_u8 key_material[MLAN_MAX_KEY_LENGTH];
2700 	/** mac address */
2701 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
2702 	/** wapi key flag */
2703 	t_u32 is_wapi_key;
2704 	/** Initial packet number */
2705 	t_u8 pn[PN_SIZE];
2706 	/** key flags */
2707 	t_u32 key_flags;
2708 } mlan_ds_encrypt_key, *pmlan_ds_encrypt_key;
2709 
2710 /** Type definition of mlan_passphrase_t */
2711 typedef struct _mlan_passphrase_t {
2712 	/** Length of passphrase */
2713 	t_u32 passphrase_len;
2714 	/** Passphrase */
2715 	t_u8 passphrase[MLAN_MAX_PASSPHRASE_LENGTH];
2716 } mlan_passphrase_t;
2717 
2718 /** Type definition of mlan_sae_password_t */
2719 typedef struct _mlan_sae_password_t {
2720 	/** Length of SAE Password */
2721 	t_u32 sae_password_len;
2722 	/** SAE Password */
2723 	t_u8 sae_password[MLAN_MAX_SAE_PASSWORD_LENGTH];
2724 } mlan_sae_password_t;
2725 
2726 /** Type defnition of mlan_pmk_t */
2727 typedef struct _mlan_pmk_t {
2728 	/** PMK */
2729 	t_u8 pmk[MLAN_MAX_KEY_LENGTH];
2730 	t_u8 pmk_r0[MLAN_MAX_KEY_LENGTH];
2731 	t_u8 pmk_r0_name[MLAN_MAX_PMKR0_NAME_LENGTH];
2732 } mlan_pmk_t;
2733 
2734 /** Embedded supplicant RSN type: No RSN */
2735 #define RSN_TYPE_NO_RSN MBIT(0)
2736 /** Embedded supplicant RSN type: WPA */
2737 #define RSN_TYPE_WPA MBIT(3)
2738 /** Embedded supplicant RSN type: WPA-NONE */
2739 #define RSN_TYPE_WPANONE MBIT(4)
2740 /** Embedded supplicant RSN type: WPA2 */
2741 #define RSN_TYPE_WPA2 MBIT(5)
2742 /** Embedded supplicant RSN type: RFU */
2743 #define RSN_TYPE_VALID_BITS                                                    \
2744 	(RSN_TYPE_NO_RSN | RSN_TYPE_WPA | RSN_TYPE_WPANONE | RSN_TYPE_WPA2)
2745 
2746 /** Embedded supplicant cipher type: TKIP */
2747 #define EMBED_CIPHER_TKIP MBIT(2)
2748 /** Embedded supplicant cipher type: AES */
2749 #define EMBED_CIPHER_AES MBIT(3)
2750 /** Embedded supplicant cipher type: RFU */
2751 #define EMBED_CIPHER_VALID_BITS (EMBED_CIPHER_TKIP | EMBED_CIPHER_AES)
2752 
2753 /** Type definition of mlan_ds_passphrase for MLAN_OID_SEC_CFG_PASSPHRASE */
2754 typedef struct _mlan_ds_passphrase {
2755 	/** SSID may be used */
2756 	mlan_802_11_ssid ssid;
2757 	/** BSSID may be used */
2758 	mlan_802_11_mac_addr bssid;
2759 	/** Flag for passphrase or pmk used */
2760 	t_u16 psk_type;
2761 	/** Passphrase or PMK */
2762 	union {
2763 		/** Passphrase */
2764 		mlan_passphrase_t passphrase;
2765 		/** SAE Password */
2766 		mlan_sae_password_t sae_password;
2767 		/** PMK */
2768 		mlan_pmk_t pmk;
2769 	} psk;
2770 } mlan_ds_passphrase, *pmlan_ds_passphrase;
2771 
2772 /** Type definition of mlan_ds_esupp_mode for MLAN_OID_SEC_CFG_ESUPP_MODE */
2773 typedef struct _mlan_ds_ewpa_mode {
2774 	/** RSN mode */
2775 	t_u32 rsn_mode;
2776 	/** Active pairwise cipher */
2777 	t_u32 act_paircipher;
2778 	/** Active pairwise cipher */
2779 	t_u32 act_groupcipher;
2780 } mlan_ds_esupp_mode, *pmlan_ds_esupp_mode;
2781 
2782 /* Security SSID MAX number support by firmware*/
2783 #define MAX_SEC_SSID_NUM 6
2784 
2785 /** Type definition of mlan_ds_sec_cfg for MLAN_IOCTL_SEC_CFG */
2786 typedef struct _mlan_ds_sec_cfg {
2787 	/** Sub-command */
2788 	t_u32 sub_command;
2789 	/** Flag to extend some structures to support multiple values.
2790 	 ** For example, mlan_ds_passphrase can only contain one value,
2791 	 ** if need use mlan_ds_passphrase[N], just set this flag and
2792 	 ** use mlan_ds_passphrase[] instead to avoid modify
2793 	 ** more already exist code.
2794 	 */
2795 	t_u8 multi_passphrase;
2796 	/** Security configuration parameter */
2797 	union {
2798 		/** Authentication mode for MLAN_OID_SEC_CFG_AUTH_MODE */
2799 		t_u32 auth_mode;
2800 		/** Encryption mode for MLAN_OID_SEC_CFG_ENCRYPT_MODE */
2801 		t_u32 encrypt_mode;
2802 		/** WPA enabled flag for MLAN_OID_SEC_CFG_WPA_ENABLED */
2803 		t_u32 wpa_enabled;
2804 		/** WAPI enabled flag for MLAN_OID_SEC_CFG_WAPI_ENABLED */
2805 		t_u32 wapi_enabled;
2806 		/** Port Control enabled flag for MLAN_OID_SEC_CFG_PORT_CTRL */
2807 		t_u32 port_ctrl_enabled;
2808 		/** Encryption key for MLAN_OID_SEC_CFG_ENCRYPT_KEY */
2809 		mlan_ds_encrypt_key encrypt_key;
2810 		/** Passphrase for MLAN_OID_SEC_CFG_PASSPHRASE */
2811 		mlan_ds_passphrase passphrase;
2812 		/** Embedded supplicant WPA enabled flag for
2813 		 *  MLAN_OID_SEC_CFG_EWPA_ENABLED
2814 		 */
2815 		t_u32 ewpa_enabled;
2816 		/** Embedded supplicant mode for MLAN_OID_SEC_CFG_ESUPP_MODE */
2817 		mlan_ds_esupp_mode esupp_mode;
2818 #ifdef UAP_SUPPORT
2819 		t_u8 sta_mac[MLAN_MAC_ADDR_LENGTH];
2820 #endif
2821 		mlan_ds_passphrase roam_passphrase[MAX_SEC_SSID_NUM];
2822 	} param;
2823 } mlan_ds_sec_cfg, *pmlan_ds_sec_cfg;
2824 
2825 #if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
2826 #define BIT_TLV_TYPE_CRYPTO_KEY (1 << 0)
2827 #define BIT_TLV_TYPE_CRYPTO_KEY_IV (1 << 1)
2828 #define BIT_TLV_TYPE_CRYPTO_KEY_PREFIX (1 << 2)
2829 #define BIT_TLV_TYPE_CRYPTO_KEY_DATA_BLK (1 << 3)
2830 
2831 /** Type definition of mlan_ds_sup_cfg */
2832 typedef struct _mlan_ds_sup_cfg {
2833 	/** Sub-command */
2834 	t_u8 sub_command;
2835 	/** output length */
2836 	t_u16 output_len;
2837 	/** number of data blks */
2838 	t_u16 data_blks_nr;
2839 	/** sub action code */
2840 	t_u8 sub_action_code;
2841 	/** skip bytes */
2842 	t_u16 skip_bytes;
2843 	/** iteration */
2844 	t_u32 iteration;
2845 	/** count */
2846 	t_u32 count;
2847 	/** pointer to output */
2848 	t_u8 *output;
2849 	/** key length  */
2850 	t_u16 key_len;
2851 	/** pointer to key */
2852 	t_u8 *key;
2853 	/** key iv length  */
2854 	t_u16 key_iv_len;
2855 	/** pointer to key iv */
2856 	t_u8 *key_iv;
2857 	/** key prefix length */
2858 	t_u16 key_prefix_len;
2859 	/** pointer to key prefix */
2860 	t_u8 *key_prefix;
2861 	/** pointer to data blk length array */
2862 	t_u32 *key_data_blk_len;
2863 	/** pointer to key data blk pointer array */
2864 	t_u8 **key_data_blk;
2865 	/** callback */
2866 	t_u8 call_back;
2867 } mlan_ds_sup_cfg, *pmlan_ds_sup_cfg;
2868 #endif
2869 
2870 /*-----------------------------------------------------------------*/
2871 /** Rate Configuration Group */
2872 /*-----------------------------------------------------------------*/
2873 /** Enumeration for rate type */
2874 enum _mlan_rate_type { MLAN_RATE_INDEX, MLAN_RATE_VALUE, MLAN_RATE_BITMAP };
2875 
2876 /** Enumeration for rate format */
2877 enum _mlan_rate_format {
2878 	MLAN_RATE_FORMAT_LG = 0,
2879 	MLAN_RATE_FORMAT_HT,
2880 	MLAN_RATE_FORMAT_VHT,
2881 	MLAN_RATE_FORMAT_HE,
2882 	MLAN_RATE_FORMAT_AUTO = 0xFF,
2883 };
2884 
2885 /** Max bitmap rates size */
2886 #define MAX_BITMAP_RATES_SIZE 26
2887 
2888 /** Type definition of mlan_rate_cfg_t for MLAN_OID_RATE_CFG */
2889 typedef struct _mlan_rate_cfg_t {
2890 	/** Fixed rate: 0, auto rate: 1 */
2891 	t_u32 is_rate_auto;
2892 	/** Rate type. 0: index; 1: value; 2: bitmap */
2893 	t_u32 rate_type;
2894 	/** Rate/MCS index or rate value if fixed rate */
2895 	t_u32 rate;
2896 	/** Rate Bitmap */
2897 	t_u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
2898 	/** NSS */
2899 	t_u32 nss;
2900 	/* LG rate: 0, HT rate: 1, VHT rate: 2 */
2901 	t_u32 rate_format;
2902 	/** Rate Setting */
2903 	t_u16 rate_setting;
2904 } mlan_rate_cfg_t;
2905 
2906 /** HT channel bandwidth */
2907 typedef enum _mlan_ht_bw {
2908 	MLAN_HT_BW20,
2909 	MLAN_HT_BW40,
2910 	/** VHT channel bandwidth */
2911 	MLAN_VHT_BW80,
2912 	MLAN_VHT_BW160,
2913 } mlan_ht_bw;
2914 
2915 /** HT guard interval */
2916 typedef enum _mlan_ht_gi {
2917 	MLAN_HT_LGI,
2918 	MLAN_HT_SGI,
2919 } mlan_ht_gi;
2920 
2921 typedef enum _mlan_vht_stbc {
2922 	MLAN_VHT_STBC,
2923 	MLAN_VHT_NO_STBC,
2924 } mlan_vht_stbc;
2925 
2926 typedef enum _mlan_vht_ldpc {
2927 	MLAN_VHT_LDPC,
2928 	MLAN_VHT_NO_LDPC,
2929 } mlan_vht_ldpc;
2930 
2931 /** Band and BSS mode */
2932 typedef struct _mlan_band_data_rate {
2933 	/** Band configuration */
2934 	t_u8 config_bands;
2935 	/** BSS mode (Infra or IBSS) */
2936 	t_u8 bss_mode;
2937 } mlan_band_data_rate;
2938 
2939 /** Type definition of mlan_data_rate for MLAN_OID_GET_DATA_RATE */
2940 typedef struct _mlan_data_rate {
2941 	/** Tx data rate */
2942 	t_u32 tx_data_rate;
2943 	/** Rx data rate */
2944 	t_u32 rx_data_rate;
2945 
2946 	/** Tx channel bandwidth */
2947 	t_u32 tx_ht_bw;
2948 	/** Tx guard interval */
2949 	t_u32 tx_ht_gi;
2950 	/** Rx channel bandwidth */
2951 	t_u32 rx_ht_bw;
2952 	/** Rx guard interval */
2953 	t_u32 rx_ht_gi;
2954 	/** MCS index */
2955 	t_u32 tx_mcs_index;
2956 	t_u32 rx_mcs_index;
2957 	/** NSS */
2958 	t_u32 tx_nss;
2959 	t_u32 rx_nss;
2960 	/* LG rate: 0, HT rate: 1, VHT rate: 2 */
2961 	t_u32 tx_rate_format;
2962 	t_u32 rx_rate_format;
2963 } mlan_data_rate;
2964 
2965 /** Type definition of mlan_ds_rate for MLAN_IOCTL_RATE */
2966 typedef struct _mlan_ds_rate {
2967 	/** Sub-command */
2968 	t_u32 sub_command;
2969 	/** Rate configuration parameter */
2970 	union {
2971 		/** Rate configuration for MLAN_OID_RATE_CFG */
2972 		mlan_rate_cfg_t rate_cfg;
2973 		/** Data rate for MLAN_OID_GET_DATA_RATE */
2974 		mlan_data_rate data_rate;
2975 		/** Supported rates for MLAN_OID_SUPPORTED_RATES */
2976 		t_u8 rates[MLAN_SUPPORTED_RATES];
2977 		/** Band/BSS mode for getting supported rates */
2978 		mlan_band_data_rate rate_band_cfg;
2979 	} param;
2980 } mlan_ds_rate, *pmlan_ds_rate;
2981 
2982 /*-----------------------------------------------------------------*/
2983 /** Power Configuration Group */
2984 /*-----------------------------------------------------------------*/
2985 
2986 /** Type definition of mlan_power_cfg_t for MLAN_OID_POWER_CFG */
2987 typedef struct _mlan_power_cfg_t {
2988 	/** Is power auto */
2989 	t_u32 is_power_auto;
2990 	/** Power level in dBm */
2991 	t_s32 power_level;
2992 } mlan_power_cfg_t;
2993 
2994 /** max power table size */
2995 #define MAX_POWER_TABLE_SIZE 128
2996 #define TX_PWR_CFG_AUTO_CTRL_OFF 0xFF
2997 #define MAX_POWER_GROUP 64
2998 /** Type definition of mlan_power group info */
2999 typedef struct mlan_power_group {
3000 	/** rate format (LG: 0, HT: 1, VHT: 2, no auto ctrl: 0xFF) */
3001 	t_u32 rate_format;
3002 	/** bandwidth (LG: 20 MHz, HT: 20/40 MHz, VHT: 80/160/80+80 MHz) */
3003 	t_u8 bandwidth;
3004 	/** NSS */
3005 	t_u32 nss;
3006 	/** LG: first rate index, HT/VHT: first MCS */
3007 	t_u8 first_rate_ind;
3008 	/** LG: last rate index, HT/VHT: last MCS */
3009 	t_u8 last_rate_ind;
3010 	/** minmum tx power (dBm) */
3011 	t_s8 power_min;
3012 	/** maximum tx power (dBm) */
3013 	t_s8 power_max;
3014 	/** tx power step (dB) */
3015 	t_s8 power_step;
3016 } mlan_power_group;
3017 
3018 /** Type definition of mlan_power_cfg_ext for MLAN_OID_POWER_CFG_EXT */
3019 typedef struct _mlan_power_cfg_ext {
3020 	/** number of power_groups */
3021 	t_u32 num_pwr_grp;
3022 	/** array of power groups */
3023 	mlan_power_group power_group[MAX_POWER_GROUP];
3024 } mlan_power_cfg_ext;
3025 
3026 /** Type definition of mlan_ds_power_cfg for MLAN_IOCTL_POWER_CFG */
3027 typedef struct _mlan_ds_power_cfg {
3028 	/** Sub-command */
3029 	t_u32 sub_command;
3030 	/** Power configuration parameter */
3031 	union {
3032 		/** Power configuration for MLAN_OID_POWER_CFG */
3033 		mlan_power_cfg_t power_cfg;
3034 		/** Extended power configuration for MLAN_OID_POWER_CFG_EXT */
3035 		mlan_power_cfg_ext power_ext;
3036 		/** Low power mode for MLAN_OID_POWER_LOW_POWER_MODE */
3037 		t_u16 lpm;
3038 	} param;
3039 } mlan_ds_power_cfg, *pmlan_ds_power_cfg;
3040 
3041 /** Type definition of mlan_ds_band_steer_cfg for MLAN_IOCTL_POWER_CFG */
3042 typedef struct _mlan_ds_band_steer_cfg {
3043 	/** Set/Get */
3044 	t_u8 action;
3045 	/** enable/disable band steering*/
3046 	t_u8 state;
3047 	/** Probe Response will be blocked to 2G channel for first
3048 	 * block_2g_prb_req probe requests*/
3049 	t_u8 block_2g_prb_req;
3050 	/** When band steering is enabled, limit the btm request sent to STA at
3051 	 * <max_btm_req_allowed>*/
3052 	t_u8 max_btm_req_allowed;
3053 } mlan_ds_band_steer_cfg, *pmlan_ds_band_steer_cfg;
3054 
3055 /** Type definition of mlan_ds_beacon_stuck_param_cfg for MLAN_IOCTL_POWER_CFG
3056  */
3057 typedef struct _mlan_ds_beacon_stuck_param_cfg {
3058 	/** subcmd */
3059 	t_u32 subcmd;
3060 	/** Set/Get */
3061 	t_u8 action;
3062 	/** No of beacon interval after which firmware will check if beacon Tx
3063 	 * is going fine */
3064 	t_u8 beacon_stuck_detect_count;
3065 	/** Upon performing MAC reset, no of beacon interval after which
3066 	 * firmware will check if recovery was successful */
3067 	t_u8 recovery_confirm_count;
3068 } mlan_ds_beacon_stuck_param_cfg, *pmlan_ds_beacon_stuck_param_cfg;
3069 
3070 /*-----------------------------------------------------------------*/
3071 /** Power Management Configuration Group */
3072 /*-----------------------------------------------------------------*/
3073 /** Host sleep config conditions : Cancel */
3074 #define HOST_SLEEP_CFG_CANCEL 0xffffffff
3075 
3076 /** Host sleep config condition: broadcast data */
3077 #define HOST_SLEEP_COND_BROADCAST_DATA MBIT(0)
3078 /** Host sleep config condition: unicast data */
3079 #define HOST_SLEEP_COND_UNICAST_DATA MBIT(1)
3080 /** Host sleep config condition: mac event */
3081 #define HOST_SLEEP_COND_MAC_EVENT MBIT(2)
3082 /** Host sleep config condition: multicast data */
3083 #define HOST_SLEEP_COND_MULTICAST_DATA MBIT(3)
3084 /** Host sleep config condition: IPV6 packet */
3085 #define HOST_SLEEP_COND_IPV6_PACKET MBIT(31)
3086 
3087 /** Host sleep config conditions: Default */
3088 #define HOST_SLEEP_DEF_COND                                                    \
3089 	(HOST_SLEEP_COND_BROADCAST_DATA | HOST_SLEEP_COND_UNICAST_DATA |       \
3090 	 HOST_SLEEP_COND_MAC_EVENT)
3091 
3092 /** Host sleep config GPIO : Default */
3093 #define HOST_SLEEP_DEF_GPIO 0xff
3094 /** Host sleep config gap : Default */
3095 #define HOST_SLEEP_DEF_GAP 200
3096 /** Host sleep config min wake holdoff */
3097 #define HOST_SLEEP_DEF_WAKE_HOLDOFF 0;
3098 /** Host sleep config inactivity timeout */
3099 #define HOST_SLEEP_DEF_INACTIVITY_TIMEOUT 10;
3100 
3101 /** Type definition of mlan_ds_hs_cfg for MLAN_OID_PM_CFG_HS_CFG */
3102 typedef struct _mlan_ds_hs_cfg {
3103 	/** MTRUE to invoke the HostCmd, MFALSE otherwise */
3104 	t_u32 is_invoke_hostcmd;
3105 	/** Host sleep config condition */
3106 	/** Bit0: broadcast data
3107 	 *  Bit1: unicast data
3108 	 *  Bit2: mac event
3109 	 *  Bit3: multicast data
3110 	 */
3111 	t_u32 conditions;
3112 	/** GPIO pin or 0xff for interface */
3113 	t_u32 gpio;
3114 	/** Gap in milliseconds or or 0xff for special
3115 	 *  setting when GPIO is used to wakeup host
3116 	 */
3117 	t_u32 gap;
3118 	/** Host sleep wake interval */
3119 	t_u32 hs_wake_interval;
3120 	/** Parameter type for indication gpio*/
3121 	t_u8 param_type_ind;
3122 	/** GPIO pin for indication wakeup source */
3123 	t_u32 ind_gpio;
3124 	/** Level on ind_gpio pin for indication normal wakeup source */
3125 	t_u32 level;
3126 	/** Parameter type for extend hscfg*/
3127 	t_u8 param_type_ext;
3128 	/** Events that will be forced ignore*/
3129 	t_u32 event_force_ignore;
3130 	/** Events that will use extend gap to inform host*/
3131 	t_u32 event_use_ext_gap;
3132 	/** Ext gap*/
3133 	t_u8 ext_gap;
3134 	/** GPIO wave level for extend hscfg*/
3135 	t_u8 gpio_wave;
3136 	/** Minimum delay between HsActive and HostWake (in msec) */
3137 	t_u16 min_wake_holdoff;
3138 } mlan_ds_hs_cfg, *pmlan_ds_hs_cfg;
3139 
3140 #define MAX_MGMT_FRAME_FILTER 2
3141 typedef struct _mlan_mgmt_frame_wakeup {
3142 	/** action - bitmap
3143 	 ** On matching rx'd pkt and filter during NON_HOSTSLEEP mode:
3144 	 **   Action[1]=0  Discard
3145 	 **   Action[1]=1  Allow
3146 	 ** Note that default action on non-match is "Allow".
3147 	 **
3148 	 ** On matching rx'd pkt and filter during HOSTSLEEP mode:
3149 	 **   Action[1:0]=00  Discard and Not Wake host
3150 	 **   Action[1:0]=01  Discard and Wake host
3151 	 **   Action[1:0]=10  Invalid
3152 	 ** Note that default action on non-match is "Discard and Not Wake
3153 	 *host".
3154 	 **/
3155 	t_u32 action;
3156 	/** Frame type(p2p, tdls...)
3157 	 ** type=0: invalid
3158 	 ** type=1: p2p
3159 	 ** type=others: reserved
3160 	 **/
3161 	t_u32 type;
3162 	/** Frame mask according to each type
3163 	 ** When type=1 for p2p, frame-mask have following define:
3164 	 **    Bit      Frame
3165 	 **     0       GO Negotiation Request
3166 	 **     1       GO Negotiation Response
3167 	 **     2       GO Negotiation Confirmation
3168 	 **     3       P2P Invitation Request
3169 	 **     4       P2P Invitation Response
3170 	 **     5       Device Discoverability Request
3171 	 **     6       Device Discoverability Response
3172 	 **     7       Provision Discovery Request
3173 	 **     8       Provision Discovery Response
3174 	 **     9       Notice of Absence
3175 	 **     10      P2P Presence Request
3176 	 **     11      P2P Presence Response
3177 	 **     12      GO Discoverability Request
3178 	 **     13-31   Reserved
3179 	 **
3180 	 ** When type=others, frame-mask is reserved.
3181 	 **/
3182 	t_u32 frame_mask;
3183 } mlan_mgmt_frame_wakeup, *pmlan_mgmt_frame_wakeup;
3184 
3185 /** Enable deep sleep mode */
3186 #define DEEP_SLEEP_ON 1
3187 /** Disable deep sleep mode */
3188 #define DEEP_SLEEP_OFF 0
3189 
3190 /** Default idle time in milliseconds for auto deep sleep */
3191 #define DEEP_SLEEP_IDLE_TIME 100
3192 
3193 typedef struct _mlan_ds_auto_ds {
3194 	/** auto ds mode, 0 - disable, 1 - enable */
3195 	t_u16 auto_ds;
3196 	/** auto ds idle time in milliseconds */
3197 	t_u16 idletime;
3198 } mlan_ds_auto_ds;
3199 
3200 /** Type definition of mlan_ds_inactivity_to
3201  *  for MLAN_OID_PM_CFG_INACTIVITY_TO
3202  */
3203 typedef struct _mlan_ds_inactivity_to {
3204 	/** Timeout unit in microsecond, 0 means 1000us (1ms) */
3205 	t_u32 timeout_unit;
3206 	/** Inactivity timeout for unicast data */
3207 	t_u32 unicast_timeout;
3208 	/** Inactivity timeout for multicast data */
3209 	t_u32 mcast_timeout;
3210 	/** Timeout for additional Rx traffic after Null PM1 packet exchange */
3211 	t_u32 ps_entry_timeout;
3212 } mlan_ds_inactivity_to, *pmlan_ds_inactivity_to;
3213 
3214 /** Minimum sleep period in milliseconds */
3215 #define MIN_SLEEP_PERIOD 10
3216 /** Maximum sleep period in milliseconds */
3217 #define MAX_SLEEP_PERIOD 60
3218 /** Special setting for UPSD certification tests */
3219 #define SLEEP_PERIOD_RESERVED_FF 0xFF
3220 
3221 /** PS null interval disable */
3222 #define PS_NULL_DISABLE (-1)
3223 
3224 /** Local listen interval disable */
3225 #define MRVDRV_LISTEN_INTERVAL_DISABLE (-1)
3226 /** Minimum listen interval */
3227 #define MRVDRV_MIN_LISTEN_INTERVAL 0
3228 
3229 /** Minimum multiple DTIM */
3230 #define MRVDRV_MIN_MULTIPLE_DTIM 0
3231 /** Maximum multiple DTIM */
3232 #define MRVDRV_MAX_MULTIPLE_DTIM 5
3233 /** Ignore multiple DTIM */
3234 #define MRVDRV_IGNORE_MULTIPLE_DTIM 0xfffe
3235 /** Match listen interval to closest DTIM */
3236 #define MRVDRV_MATCH_CLOSEST_DTIM 0xfffd
3237 
3238 /** Minimum beacon miss timeout in milliseconds */
3239 #define MIN_BCN_MISS_TO 0
3240 /** Maximum beacon miss timeout in milliseconds */
3241 #define MAX_BCN_MISS_TO 50
3242 /** Disable beacon miss timeout */
3243 #define DISABLE_BCN_MISS_TO 65535
3244 
3245 /** Minimum delay to PS in milliseconds */
3246 #define MIN_DELAY_TO_PS 0
3247 /** Maximum delay to PS in milliseconds */
3248 #define MAX_DELAY_TO_PS 65535
3249 /** Delay to PS unchanged */
3250 #define DELAY_TO_PS_UNCHANGED (-1)
3251 /** Default delay to PS in milliseconds */
3252 #define DELAY_TO_PS_DEFAULT 1000
3253 
3254 /** PS mode: Unchanged */
3255 #define PS_MODE_UNCHANGED 0
3256 /** PS mode: Auto */
3257 #define PS_MODE_AUTO 1
3258 /** PS mode: Poll */
3259 #define PS_MODE_POLL 2
3260 /** PS mode: Null */
3261 #define PS_MODE_NULL 3
3262 
3263 /** Type definition of mlan_ds_ps_cfg for MLAN_OID_PM_CFG_PS_CFG */
3264 typedef struct _mlan_ds_ps_cfg {
3265 	/** PS null interval in seconds */
3266 	t_u32 ps_null_interval;
3267 	/** Multiple DTIM interval */
3268 	t_u32 multiple_dtim_interval;
3269 	/** Listen interval */
3270 	t_u32 listen_interval;
3271 	/** Beacon miss timeout in milliseconds */
3272 	t_u32 bcn_miss_timeout;
3273 	/** Delay to PS in milliseconds */
3274 	t_s32 delay_to_ps;
3275 	/** PS mode */
3276 	t_u32 ps_mode;
3277 } mlan_ds_ps_cfg, *pmlan_ds_ps_cfg;
3278 
3279 /** Type definition of mlan_ds_sleep_params for MLAN_OID_PM_CFG_SLEEP_PARAMS */
3280 typedef struct _mlan_ds_sleep_params {
3281 	/** Error */
3282 	t_u32 error;
3283 	/** Offset in microseconds */
3284 	t_u32 offset;
3285 	/** Stable time in microseconds */
3286 	t_u32 stable_time;
3287 	/** Calibration control */
3288 	t_u32 cal_control;
3289 	/** External sleep clock */
3290 	t_u32 ext_sleep_clk;
3291 	/** Reserved */
3292 	t_u32 reserved;
3293 } mlan_ds_sleep_params, *pmlan_ds_sleep_params;
3294 
3295 /** sleep_param */
3296 typedef struct _ps_sleep_param {
3297 	/** control bitmap */
3298 	t_u32 ctrl_bitmap;
3299 	/** minimum sleep period (micro second) */
3300 	t_u32 min_sleep;
3301 	/** maximum sleep period (micro second) */
3302 	t_u32 max_sleep;
3303 } ps_sleep_param;
3304 
3305 /** inactivity sleep_param */
3306 typedef struct _inact_sleep_param {
3307 	/** inactivity timeout (micro second) */
3308 	t_u32 inactivity_to;
3309 	/** miniumu awake period (micro second) */
3310 	t_u32 min_awake;
3311 	/** maximum awake period (micro second) */
3312 	t_u32 max_awake;
3313 } inact_sleep_param;
3314 
3315 /** flag for ps mode */
3316 #define PS_FLAG_PS_MODE 1
3317 /** flag for sleep param */
3318 #define PS_FLAG_SLEEP_PARAM 2
3319 /** flag for inactivity sleep param */
3320 #define PS_FLAG_INACT_SLEEP_PARAM 4
3321 
3322 /** Enable Robust Coex mode */
3323 #define ROBUSTCOEX_GPIOCFG_ENABLE 1
3324 /** Disable Robust Coex mode */
3325 #define ROBUSTCOEX_GPIOCFG_DISABLE 0
3326 
3327 /** Disable power mode */
3328 #define PS_MODE_DISABLE 0
3329 /** Enable periodic dtim ps */
3330 #define PS_MODE_PERIODIC_DTIM 1
3331 /** Enable inactivity ps */
3332 #define PS_MODE_INACTIVITY 2
3333 /** FW wake up method interface */
3334 #define FW_WAKEUP_METHOD_INTERFACE 1
3335 /** FW wake up method gpio */
3336 #define FW_WAKEUP_METHOD_GPIO 2
3337 /** mlan_ds_ps_mgmt */
3338 typedef struct _mlan_ds_ps_mgmt {
3339 	/** flags for valid field */
3340 	t_u16 flags;
3341 	/** power mode */
3342 	t_u16 ps_mode;
3343 	/** sleep param */
3344 	ps_sleep_param sleep_param;
3345 	/** inactivity sleep param */
3346 	inact_sleep_param inact_param;
3347 } mlan_ds_ps_mgmt;
3348 
3349 /** mlan_ds_ps_info */
3350 typedef struct _mlan_ds_ps_info {
3351 	/** suspend allowed flag */
3352 	t_u32 is_suspend_allowed;
3353 } mlan_ds_ps_info;
3354 
3355 /** Type definition of mlan_ds_wakeup_reason for MLAN_OID_PM_HS_WAKEUP_REASON */
3356 typedef struct _mlan_ds_hs_wakeup_reason {
3357 	t_u16 hs_wakeup_reason;
3358 } mlan_ds_hs_wakeup_reason;
3359 
3360 /** Type definition of mlan_ds_ps_cfg for MLAN_OID_PM_CFG_PS_CFG */
3361 typedef struct _mlan_ds_bcn_timeout {
3362 	/** Beacon miss timeout period window */
3363 	t_u16 bcn_miss_tmo_window;
3364 	/** Beacon miss timeout period */
3365 	t_u16 bcn_miss_tmo_period;
3366 	/** Beacon reacquire timeout period window */
3367 	t_u16 bcn_rq_tmo_window;
3368 	/** Beacon reacquire timeout period */
3369 	t_u16 bcn_rq_tmo_period;
3370 } mlan_ds_bcn_timeout, *pmlan_ds_bcn_timeout;
3371 
3372 /** Type definition of mlan_ds_pm_cfg for MLAN_IOCTL_PM_CFG */
3373 typedef struct _mlan_ds_pm_cfg {
3374 	/** Sub-command */
3375 	t_u32 sub_command;
3376 	/** Power management parameter */
3377 	union {
3378 		/** Power saving mode for MLAN_OID_PM_CFG_IEEE_PS */
3379 		t_u32 ps_mode;
3380 		/** Host Sleep configuration for MLAN_OID_PM_CFG_HS_CFG */
3381 		mlan_ds_hs_cfg hs_cfg;
3382 		/** Deep sleep mode for MLAN_OID_PM_CFG_DEEP_SLEEP */
3383 		mlan_ds_auto_ds auto_deep_sleep;
3384 		/** Inactivity timeout for MLAN_OID_PM_CFG_INACTIVITY_TO */
3385 		mlan_ds_inactivity_to inactivity_to;
3386 		/** Sleep period for MLAN_OID_PM_CFG_SLEEP_PD */
3387 		t_u32 sleep_period;
3388 		/** PS configuration parameters for MLAN_OID_PM_CFG_PS_CFG */
3389 		mlan_ds_ps_cfg ps_cfg;
3390 		/** PS configuration parameters for MLAN_OID_PM_CFG_SLEEP_PARAMS
3391 		 */
3392 		mlan_ds_sleep_params sleep_params;
3393 		/** PS configuration parameters for MLAN_OID_PM_CFG_PS_MODE */
3394 		mlan_ds_ps_mgmt ps_mgmt;
3395 		/** power info for MLAN_OID_PM_INFO */
3396 		mlan_ds_ps_info ps_info;
3397 		/** hs wakeup reason for MLAN_OID_PM_HS_WAKEUP_REASON */
3398 		mlan_ds_hs_wakeup_reason wakeup_reason;
3399 		/** config manamgement frame for hs wakeup */
3400 		mlan_mgmt_frame_wakeup mgmt_filter[MAX_MGMT_FRAME_FILTER];
3401 		/** Beacon timout parameters for MLAN_OID_PM_CFG_BCN_TIMEOUT */
3402 		mlan_ds_bcn_timeout bcn_timeout;
3403 	} param;
3404 } mlan_ds_pm_cfg, *pmlan_ds_pm_cfg;
3405 
3406 #ifdef RX_PACKET_COALESCE
3407 typedef struct {
3408 	mlan_cmd_result_e cmd_result; /**< Firmware execution result */
3409 
3410 	t_u32 pkt_threshold; /** Packet threshold */
3411 	t_u16 delay; /** Timeout value in milliseconds */
3412 } wlan_ioctl_rx_pkt_coalesce_config_t;
3413 #endif
3414 
3415 /*-----------------------------------------------------------------*/
3416 /** WMM Configuration Group */
3417 /*-----------------------------------------------------------------*/
3418 
3419 /** WMM TSpec size */
3420 #define MLAN_WMM_TSPEC_SIZE 63
3421 /** WMM Add TS extra IE bytes */
3422 #define MLAN_WMM_ADDTS_EXTRA_IE_BYTES 256
3423 /** WMM statistics for packets hist bins */
3424 #define MLAN_WMM_STATS_PKTS_HIST_BINS 7
3425 /** Maximum number of AC QOS queues available */
3426 #define MLAN_WMM_MAX_AC_QUEUES 4
3427 
3428 /**
3429  *  @brief IOCTL structure to send an ADDTS request and retrieve the response.
3430  *
3431  *  IOCTL structure from the application layer relayed to firmware to
3432  *    instigate an ADDTS management frame with an appropriate TSPEC IE as well
3433  *    as any additional IEs appended in the ADDTS Action frame.
3434  *
3435  *  @sa woal_wmm_addts_req_ioctl
3436  */
3437 typedef struct {
3438 	mlan_cmd_result_e cmd_result; /**< Firmware execution result */
3439 
3440 	t_u32 timeout_ms; /**< Timeout value in milliseconds */
3441 	t_u8 ieee_status_code; /**< IEEE status code */
3442 
3443 	t_u32 ie_data_len; /**< Length of ie block in ie_data */
3444 	t_u8 ie_data[MLAN_WMM_TSPEC_SIZE /**< TSPEC to send in the ADDTS */
3445 		     + MLAN_WMM_ADDTS_EXTRA_IE_BYTES]; /**< Extra IE buf*/
3446 } wlan_ioctl_wmm_addts_req_t;
3447 
3448 /**
3449  *  @brief IOCTL structure to send a DELTS request.
3450  *
3451  *  IOCTL structure from the application layer relayed to firmware to
3452  *    instigate an DELTS management frame with an appropriate TSPEC IE.
3453  *
3454  *  @sa woal_wmm_delts_req_ioctl
3455  */
3456 typedef struct {
3457 	mlan_cmd_result_e cmd_result; /**< Firmware execution result */
3458 	t_u8 ieee_reason_code; /**< IEEE reason code sent, unused for WMM */
3459 	t_u32 ie_data_len; /**< Length of ie block in ie_data */
3460 	t_u8 ie_data[MLAN_WMM_TSPEC_SIZE]; /**< TSPEC to send in the DELTS */
3461 } wlan_ioctl_wmm_delts_req_t;
3462 
3463 /**
3464  *  @brief IOCTL structure to configure a specific AC Queue's parameters
3465  *
3466  *  IOCTL structure from the application layer relayed to firmware to
3467  *    get, set, or default the WMM AC queue parameters.
3468  *
3469  *  - msdu_lifetime_expiry is ignored if set to 0 on a set command
3470  *
3471  *  @sa woal_wmm_queue_config_ioctl
3472  */
3473 typedef struct {
3474 	mlan_wmm_queue_config_action_e action; /**< Set, Get, or Default */
3475 	mlan_wmm_ac_e access_category; /**< WMM_AC_BK(0) to WMM_AC_VO(3) */
3476 	t_u16 msdu_lifetime_expiry; /**< lifetime expiry in TUs */
3477 	t_u8 supported_rates[10]; /**< Not supported yet */
3478 } wlan_ioctl_wmm_queue_config_t;
3479 
3480 /**
3481  *  @brief IOCTL structure to start, stop, and get statistics for a WMM AC
3482  *
3483  *  IOCTL structure from the application layer relayed to firmware to
3484  *    start or stop statistical collection for a given AC.  Also used to
3485  *    retrieve and clear the collected stats on a given AC.
3486  *
3487  *  @sa woal_wmm_queue_stats_ioctl
3488  */
3489 typedef struct {
3490 	/** Action of Queue Config : Start, Stop, or Get */
3491 	mlan_wmm_queue_stats_action_e action;
3492 	/** User Priority */
3493 	t_u8 user_priority;
3494 	/** Number of successful packets transmitted */
3495 	t_u16 pkt_count;
3496 	/** Packets lost; not included in pkt_count */
3497 	t_u16 pkt_loss;
3498 	/** Average Queue delay in microseconds */
3499 	t_u32 avg_queue_delay;
3500 	/** Average Transmission delay in microseconds */
3501 	t_u32 avg_tx_delay;
3502 	/** Calculated used time in units of 32 microseconds */
3503 	t_u16 used_time;
3504 	/** Calculated policed time in units of 32 microseconds */
3505 	t_u16 policed_time;
3506 	/** Queue Delay Histogram; number of packets per queue delay range
3507 	 *
3508 	 *  [0] -  0ms <= delay < 5ms
3509 	 *  [1] -  5ms <= delay < 10ms
3510 	 *  [2] - 10ms <= delay < 20ms
3511 	 *  [3] - 20ms <= delay < 30ms
3512 	 *  [4] - 30ms <= delay < 40ms
3513 	 *  [5] - 40ms <= delay < 50ms
3514 	 *  [6] - 50ms <= delay < msduLifetime (TUs)
3515 	 */
3516 	t_u16 delay_histogram[MLAN_WMM_STATS_PKTS_HIST_BINS];
3517 } wlan_ioctl_wmm_queue_stats_t,
3518 	/** Type definition of mlan_ds_wmm_queue_stats
3519 	 *  for MLAN_OID_WMM_CFG_QUEUE_STATS
3520 	 */
3521 	mlan_ds_wmm_queue_stats, *pmlan_ds_wmm_queue_stats;
3522 
3523 /**
3524  *  @brief IOCTL sub structure for a specific WMM AC Status
3525  */
3526 typedef struct {
3527 	/** WMM Acm */
3528 	t_u8 wmm_acm;
3529 	/** Flow required flag */
3530 	t_u8 flow_required;
3531 	/** Flow created flag */
3532 	t_u8 flow_created;
3533 	/** Disabled flag */
3534 	t_u8 disabled;
3535 } wlan_ioctl_wmm_queue_status_ac_t;
3536 
3537 /**
3538  *  @brief IOCTL structure to retrieve the WMM AC Queue status
3539  *
3540  *  IOCTL structure from the application layer to retrieve:
3541  *     - ACM bit setting for the AC
3542  *     - Firmware status (flow required, flow created, flow disabled)
3543  *
3544  *  @sa woal_wmm_queue_status_ioctl
3545  */
3546 typedef struct {
3547 	/** WMM AC queue status */
3548 	wlan_ioctl_wmm_queue_status_ac_t ac_status[MLAN_WMM_MAX_AC_QUEUES];
3549 } wlan_ioctl_wmm_queue_status_t,
3550 	/** Type definition of mlan_ds_wmm_queue_status
3551 	 *  for MLAN_OID_WMM_CFG_QUEUE_STATUS
3552 	 */
3553 	mlan_ds_wmm_queue_status, *pmlan_ds_wmm_queue_status;
3554 
3555 /** Type definition of mlan_ds_wmm_addts for MLAN_OID_WMM_CFG_ADDTS */
3556 typedef struct _mlan_ds_wmm_addts {
3557 	/** Result of ADDTS request */
3558 	mlan_cmd_result_e result;
3559 	/** Timeout value in milliseconds */
3560 	t_u32 timeout;
3561 	/** IEEE status code */
3562 	t_u32 status_code;
3563 	/** Dialog token */
3564 	t_u8 dialog_tok;
3565 	/** TSPEC data length */
3566 	t_u32 ie_data_len;
3567 	/** TSPEC to send in the ADDTS + buffering for any extra IEs */
3568 	t_u8 ie_data[MLAN_WMM_TSPEC_SIZE + MLAN_WMM_ADDTS_EXTRA_IE_BYTES];
3569 } mlan_ds_wmm_addts, *pmlan_ds_wmm_addts;
3570 
3571 /** Type definition of mlan_ds_wmm_delts for MLAN_OID_WMM_CFG_DELTS */
3572 typedef struct _mlan_ds_wmm_delts {
3573 	/** Result of DELTS request */
3574 	mlan_cmd_result_e result;
3575 	/** IEEE status code */
3576 	t_u32 status_code;
3577 	/** TSPEC data length */
3578 	t_u8 ie_data_len;
3579 	/** TSPEC to send in the DELTS */
3580 	t_u8 ie_data[MLAN_WMM_TSPEC_SIZE];
3581 } mlan_ds_wmm_delts, *pmlan_ds_wmm_delts;
3582 
3583 /** Type definition of mlan_ds_wmm_queue_config
3584  *  for MLAN_OID_WMM_CFG_QUEUE_CONFIG
3585  */
3586 typedef struct _mlan_ds_wmm_queue_config {
3587 	/** Action of Queue Config : Set, Get, or Default */
3588 	mlan_wmm_queue_config_action_e action;
3589 	/** WMM Access Category: WMM_AC_BK(0) to WMM_AC_VO(3) */
3590 	mlan_wmm_ac_e access_category;
3591 	/** Lifetime expiry in TUs */
3592 	t_u16 msdu_lifetime_expiry;
3593 	/** Reserve for future use */
3594 	t_u8 reserved[10];
3595 } mlan_ds_wmm_queue_config, *pmlan_ds_wmm_queue_config;
3596 
3597 /** Type definition of mlan_ds_wmm_cfg for MLAN_IOCTL_WMM_CFG */
3598 typedef struct _mlan_ds_wmm_cfg {
3599 	/** Sub-command */
3600 	t_u32 sub_command;
3601 	/** WMM configuration parameter */
3602 	union {
3603 		/** WMM enable for MLAN_OID_WMM_CFG_ENABLE */
3604 		t_u32 wmm_enable;
3605 		/** QoS configuration for MLAN_OID_WMM_CFG_QOS */
3606 		t_u8 qos_cfg;
3607 		/** WMM add TS for MLAN_OID_WMM_CFG_ADDTS */
3608 		mlan_ds_wmm_addts addts;
3609 		/** WMM delete TS for MLAN_OID_WMM_CFG_DELTS */
3610 		mlan_ds_wmm_delts delts;
3611 		/** WMM queue configuration for MLAN_OID_WMM_CFG_QUEUE_CONFIG */
3612 		mlan_ds_wmm_queue_config q_cfg;
3613 		/** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI,
3614 		 * WMM_AC_VO */
3615 		wmm_ac_parameters_t ac_params[MAX_AC_QUEUES];
3616 		/** WMM queue status for MLAN_OID_WMM_CFG_QUEUE_STATS */
3617 		mlan_ds_wmm_queue_stats q_stats;
3618 		/** WMM queue status for MLAN_OID_WMM_CFG_QUEUE_STATUS */
3619 		mlan_ds_wmm_queue_status q_status;
3620 		/** WMM TS status for MLAN_OID_WMM_CFG_TS_STATUS */
3621 		mlan_ds_wmm_ts_status ts_status;
3622 	} param;
3623 } mlan_ds_wmm_cfg, *pmlan_ds_wmm_cfg;
3624 
3625 /*-----------------------------------------------------------------*/
3626 /** WPS Configuration Group */
3627 /*-----------------------------------------------------------------*/
3628 /** Enumeration for WPS session */
3629 enum _mlan_wps_status {
3630 	MLAN_WPS_CFG_SESSION_START = 1,
3631 	MLAN_WPS_CFG_SESSION_END = 0
3632 };
3633 
3634 /** Type definition of mlan_ds_wps_cfg for MLAN_IOCTL_WPS_CFG */
3635 typedef struct _mlan_ds_wps_cfg {
3636 	/** Sub-command */
3637 	t_u32 sub_command;
3638 	/** WPS configuration parameter */
3639 	union {
3640 		/** WPS session for MLAN_OID_WPS_CFG_SESSION */
3641 		t_u32 wps_session;
3642 	} param;
3643 } mlan_ds_wps_cfg, *pmlan_ds_wps_cfg;
3644 
3645 /*-----------------------------------------------------------------*/
3646 /** 802.11n Configuration Group */
3647 /*-----------------------------------------------------------------*/
3648 /** Maximum MCS */
3649 #define NUM_MCS_FIELD 16
3650 
3651 /** Supported stream modes */
3652 #define HT_STREAM_MODE_1X1 0x11
3653 #define HT_STREAM_MODE_2X2 0x22
3654 
3655 /* Both 2.4G and 5G band selected */
3656 #define BAND_SELECT_BOTH 0
3657 /* Band 2.4G selected */
3658 #define BAND_SELECT_BG 1
3659 /* Band 5G selected */
3660 #define BAND_SELECT_A 2
3661 
3662 /** Type definition of mlan_ds_11n_htcap_cfg for MLAN_OID_11N_HTCAP_CFG */
3663 typedef struct _mlan_ds_11n_htcap_cfg {
3664 	/** HT Capability information */
3665 	t_u32 htcap;
3666 	/** Band selection */
3667 	t_u32 misc_cfg;
3668 	/** Hardware HT cap information required */
3669 	t_u32 hw_cap_req;
3670 } mlan_ds_11n_htcap_cfg, *pmlan_ds_11n_htcap_cfg;
3671 
3672 /** Type definition of mlan_ds_11n_addba_param
3673  * for MLAN_OID_11N_CFG_ADDBA_PARAM
3674  */
3675 typedef struct _mlan_ds_11n_addba_param {
3676 	/** Timeout */
3677 	t_u32 timeout;
3678 	/** Buffer size for ADDBA request */
3679 	t_u32 txwinsize;
3680 	/** Buffer size for ADDBA response */
3681 	t_u32 rxwinsize;
3682 	/** amsdu for ADDBA request */
3683 	t_u8 txamsdu;
3684 	/** amsdu for ADDBA response */
3685 	t_u8 rxamsdu;
3686 } mlan_ds_11n_addba_param, *pmlan_ds_11n_addba_param;
3687 
3688 /** Type definition of mlan_ds_11n_tx_cfg for MLAN_OID_11N_CFG_TX */
3689 typedef struct _mlan_ds_11n_tx_cfg {
3690 	/** HTTxCap */
3691 	t_u16 httxcap;
3692 	/** HTTxInfo */
3693 	t_u16 httxinfo;
3694 	/** Band selection */
3695 	t_u32 misc_cfg;
3696 } mlan_ds_11n_tx_cfg, *pmlan_ds_11n_tx_cfg;
3697 
3698 /** BF Global Configuration */
3699 #define BF_GLOBAL_CONFIGURATION 0x00
3700 /** Performs NDP sounding for PEER specified */
3701 #define TRIGGER_SOUNDING_FOR_PEER 0x01
3702 /** TX BF interval for channel sounding */
3703 #define SET_GET_BF_PERIODICITY 0x02
3704 /** Tell FW not to perform any sounding for peer */
3705 #define TX_BF_FOR_PEER_ENBL 0x03
3706 /** TX BF SNR threshold for peer */
3707 #define SET_SNR_THR_PEER 0x04
3708 /** TX Sounding*/
3709 #define TX_SOUNDING_CFG 0x05
3710 
3711 /* Maximum number of peer MAC and status/SNR tuples */
3712 #define MAX_PEER_MAC_TUPLES 10
3713 
3714 /** Any new subcommand structure should be declare here */
3715 
3716 /** bf global cfg args */
3717 typedef struct _mlan_bf_global_cfg_args {
3718 	/** Global enable/disable bf */
3719 	t_u8 bf_enbl;
3720 	/** Global enable/disable sounding */
3721 	t_u8 sounding_enbl;
3722 	/** FB Type */
3723 	t_u8 fb_type;
3724 	/** SNR Threshold */
3725 	t_u8 snr_threshold;
3726 	/** Sounding interval in milliseconds */
3727 	t_u16 sounding_interval;
3728 	/** BF mode */
3729 	t_u8 bf_mode;
3730 	/** Reserved */
3731 	t_u8 reserved;
3732 } mlan_bf_global_cfg_args;
3733 
3734 /** trigger sounding args */
3735 typedef struct _mlan_trigger_sound_args {
3736 	/** Peer MAC address */
3737 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
3738 	/** Status */
3739 	t_u8 status;
3740 } mlan_trigger_sound_args;
3741 
3742 /** bf periodicity args */
3743 typedef struct _mlan_bf_periodicity_args {
3744 	/** Peer MAC address */
3745 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
3746 	/** Current Tx BF Interval in milliseconds */
3747 	t_u16 interval;
3748 	/** Status */
3749 	t_u8 status;
3750 } mlan_bf_periodicity_args;
3751 
3752 /** tx bf peer args */
3753 typedef struct _mlan_tx_bf_peer_args {
3754 	/** Peer MAC address */
3755 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
3756 	/** Reserved */
3757 	t_u16 reserved;
3758 	/** Enable/Disable Beamforming */
3759 	t_u8 bf_enbl;
3760 	/** Enable/Disable sounding */
3761 	t_u8 sounding_enbl;
3762 	/** FB Type */
3763 	t_u8 fb_type;
3764 } mlan_tx_bf_peer_args;
3765 
3766 /** SNR threshold args */
3767 typedef struct _mlan_snr_thr_args {
3768 	/** Peer MAC address */
3769 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
3770 	/** SNR for peer */
3771 	t_u8 snr;
3772 } mlan_snr_thr_args;
3773 
3774 /** Type definition of mlan_ds_11n_tx_bf_cfg for MLAN_OID_11N_CFG_TX_BF_CFG */
3775 typedef struct _mlan_ds_11n_tx_bf_cfg {
3776 	/** BF Action */
3777 	t_u16 bf_action;
3778 	/** Action */
3779 	t_u16 action;
3780 	/** Number of peers */
3781 	t_u32 no_of_peers;
3782 	union {
3783 		mlan_bf_global_cfg_args bf_global_cfg;
3784 		mlan_trigger_sound_args bf_sound[MAX_PEER_MAC_TUPLES];
3785 		mlan_bf_periodicity_args bf_periodicity[MAX_PEER_MAC_TUPLES];
3786 		mlan_tx_bf_peer_args tx_bf_peer[MAX_PEER_MAC_TUPLES];
3787 		mlan_snr_thr_args bf_snr[MAX_PEER_MAC_TUPLES];
3788 	} body;
3789 } mlan_ds_11n_tx_bf_cfg, *pmlan_ds_11n_tx_bf_cfg;
3790 
3791 /** Type definition of mlan_ds_11n_amsdu_aggr_ctrl for
3792  * MLAN_OID_11N_AMSDU_AGGR_CTRL*/
3793 typedef struct _mlan_ds_11n_amsdu_aggr_ctrl {
3794 	/** Enable/Disable */
3795 	t_u16 enable;
3796 	/** Current AMSDU size valid */
3797 	t_u16 curr_buf_size;
3798 } mlan_ds_11n_amsdu_aggr_ctrl, *pmlan_ds_11n_amsdu_aggr_ctrl;
3799 
3800 /** Type definition of mlan_ds_11n_aggr_prio_tbl
3801  *  for MLAN_OID_11N_CFG_AGGR_PRIO_TBL
3802  */
3803 typedef struct _mlan_ds_11n_aggr_prio_tbl {
3804 	/** ampdu priority table */
3805 	t_u8 ampdu[MAX_NUM_TID];
3806 	/** amsdu priority table */
3807 	t_u8 amsdu[MAX_NUM_TID];
3808 } mlan_ds_11n_aggr_prio_tbl, *pmlan_ds_11n_aggr_prio_tbl;
3809 
3810 /** DelBA All TIDs */
3811 #define DELBA_ALL_TIDS 0xff
3812 /** DelBA Tx */
3813 #define DELBA_TX MBIT(0)
3814 /** DelBA Rx */
3815 #define DELBA_RX MBIT(1)
3816 
3817 /** Type definition of mlan_ds_11n_delba for MLAN_OID_11N_CFG_DELBA */
3818 typedef struct _mlan_ds_11n_delba {
3819 	/** TID */
3820 	t_u8 tid;
3821 	/** Peer MAC address */
3822 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3823 	/** Direction (Tx: bit 0, Rx: bit 1) */
3824 	t_u8 direction;
3825 } mlan_ds_11n_delba, *pmlan_ds_11n_delba;
3826 
3827 /** Type definition of mlan_ds_delba for MLAN_OID_11N_CFG_REJECT_ADDBA_REQ */
3828 typedef struct _mlan_ds_reject_addba_req {
3829 	/** Bit0    : host sleep activated
3830 	 *  Bit1    : auto reconnect enabled
3831 	 *  Others  : reserved
3832 	 */
3833 	t_u32 conditions;
3834 } mlan_ds_reject_addba_req, *pmlan_ds_reject_addba_req;
3835 
3836 /** Type definition of mlan_ds_ibss_ampdu_param */
3837 typedef struct _mlan_ds_ibss_ampdu_param {
3838 	/** ampdu priority table */
3839 	t_u8 ampdu[MAX_NUM_TID];
3840 	/** rx amdpdu setting */
3841 	t_u8 addba_reject[MAX_NUM_TID];
3842 } mlan_ds_ibss_ampdu_param, *pmlan_ds_ibss_ampdu_param;
3843 
3844 /** Type definition of mlan_ds_11n_cfg for MLAN_IOCTL_11N_CFG */
3845 typedef struct _mlan_ds_11n_cfg {
3846 	/** Sub-command */
3847 	t_u32 sub_command;
3848 	/** 802.11n configuration parameter */
3849 	union {
3850 		/** Tx param for 11n for MLAN_OID_11N_CFG_TX */
3851 		mlan_ds_11n_tx_cfg tx_cfg;
3852 		/** Aggr priority table for MLAN_OID_11N_CFG_AGGR_PRIO_TBL */
3853 		mlan_ds_11n_aggr_prio_tbl aggr_prio_tbl;
3854 		/** Add BA param for MLAN_OID_11N_CFG_ADDBA_PARAM */
3855 		mlan_ds_11n_addba_param addba_param;
3856 		/** Add BA Reject paramters for MLAN_OID_11N_CFG_ADDBA_REJECT */
3857 		t_u8 addba_reject[MAX_NUM_TID];
3858 		/** Tx buf size for MLAN_OID_11N_CFG_MAX_TX_BUF_SIZE */
3859 		t_u32 tx_buf_size;
3860 		/** HT cap info configuration for MLAN_OID_11N_HTCAP_CFG */
3861 		mlan_ds_11n_htcap_cfg htcap_cfg;
3862 		/** Tx param for 11n for MLAN_OID_11N_AMSDU_AGGR_CTRL */
3863 		mlan_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
3864 		/** Supported MCS Set field */
3865 		t_u8 supported_mcs_set[NUM_MCS_FIELD];
3866 		/** Transmit Beamforming Capabilities field */
3867 		t_u32 tx_bf_cap;
3868 		/** Transmit Beamforming configuration */
3869 		mlan_ds_11n_tx_bf_cfg tx_bf;
3870 		/** HT stream configuration */
3871 		t_u32 stream_cfg;
3872 		/** DelBA for MLAN_OID_11N_CFG_DELBA */
3873 		mlan_ds_11n_delba del_ba;
3874 		/** Reject Addba Req for MLAN_OID_11N_CFG_REJECT_ADDBA_REQ */
3875 		mlan_ds_reject_addba_req reject_addba_req;
3876 		/** Control coex RX window size configuration */
3877 		t_u32 coex_rx_winsize;
3878 		/** Control TX AMPDU configuration */
3879 		t_u32 txaggrctrl;
3880 		/** aggrprirotity table for MLAN_OID_11N_CFG_IBSS_AMPDU_PARAM */
3881 		mlan_ds_ibss_ampdu_param ibss_ampdu;
3882 		/** Minimum BA Threshold for MLAN_OID_11N_CFG_MIN_BA_THRESHOLD
3883 		 */
3884 		t_u8 min_ba_threshold;
3885 	} param;
3886 } mlan_ds_11n_cfg, *pmlan_ds_11n_cfg;
3887 
3888 #define NUM_MCS_SUPP 20
3889 #define VHT_MCS_SET_LEN 8
3890 
3891 /** Type definition of mlan_ds_11ac_vhtcap_cfg for MLAN_OID_11AC_VHTCAP_CFG */
3892 typedef struct _mlan_ds_11ac_vhtcap_cfg {
3893 	/** HT Capability information */
3894 	t_u32 vhtcap;
3895 	/** Band selection */
3896 	t_u32 misc_cfg;
3897 	/** Hardware HT cap information required */
3898 	t_u32 hw_cap_req;
3899 } mlan_ds_11ac_vhtcap_cfg, *pmlan_ds_11ac_vhtcap_cfg;
3900 
3901 /** Type definition of mlan_ds_11ac_tx_cfg for MLAN_OID_11AC_CFG_TX */
3902 typedef struct _mlan_ds_11ac_tx_cfg {
3903 	/** Band selection */
3904 	t_u8 band_cfg;
3905 	/** misc configuration */
3906 	t_u8 misc_cfg;
3907 	/** HTTxCap */
3908 	t_u16 vhttxcap;
3909 	/** HTTxInfo */
3910 	t_u16 vhttxinfo;
3911 } mlan_ds_11ac_tx_cfg, *pmlan_ds_11ac_tx_cfg;
3912 
3913 /** Tx */
3914 #define MLAN_RADIO_TX MBIT(0)
3915 /** Rx */
3916 #define MLAN_RADIO_RX MBIT(1)
3917 /** Tx & Rx */
3918 #define MLAN_RADIO_TXRX (MLAN_RADIO_TX | MLAN_RADIO_RX)
3919 
3920 /** Type definition of mlan_ds_11ac_tx_cfg for MLAN_OID_11AC_CFG */
3921 typedef struct _mlan_ds_11ac_vht_cfg {
3922 	/** Band selection (1: 2.4G, 2: 5 G, 3: both 2.4G and 5G) */
3923 	t_u32 band;
3924 	/** TxRx (1: Tx, 2: Rx, 3: both Tx and Rx) */
3925 	t_u32 txrx;
3926 	/** BW CFG (0: 11N CFG, 1: vhtcap) */
3927 	t_u32 bwcfg;
3928 	/** VHT capabilities. */
3929 	t_u32 vht_cap_info;
3930 	/** VHT Tx mcs */
3931 	t_u32 vht_tx_mcs;
3932 	/** VHT Rx mcs */
3933 	t_u32 vht_rx_mcs;
3934 	/** VHT rx max rate */
3935 	t_u16 vht_rx_max_rate;
3936 	/** VHT max tx rate */
3937 	t_u16 vht_tx_max_rate;
3938 	/** Skip usr 11ac mcs cfg */
3939 	t_bool skip_usr_11ac_mcs_cfg;
3940 } mlan_ds_11ac_vht_cfg, *pmlan_ds_11ac_vht_cfg;
3941 
3942 /** Type definition of mlan_ds_11ac_tx_cfg for MLAN_OID_11AC_CFG */
3943 typedef struct _mlan_ds_11ac_opermode_cfg {
3944 	/** channel width: 1-20MHz, 2-40MHz, 3-80MHz, 4-160MHz or 80+80MHz */
3945 	t_u8 bw;
3946 	/** Rx NSS */
3947 	t_u8 nss;
3948 } mlan_ds_11ac_opermode_cfg, *pmlan_ds_11ac_opermode_cfg;
3949 
3950 /** Type definition of mlan_ds_11ac_cfg for MLAN_IOCTL_11AC_CFG */
3951 typedef struct _mlan_ds_11ac_cfg {
3952 	/** Sub-command */
3953 	t_u32 sub_command;
3954 	/** 802.11n configuration parameter */
3955 	union {
3956 		/** VHT configuration for MLAN_OID_11AC_VHT_CFG */
3957 		mlan_ds_11ac_vht_cfg vht_cfg;
3958 		/** Supported MCS Set field */
3959 		t_u8 supported_mcs_set[NUM_MCS_SUPP];
3960 		/** Oper mode configuration for MLAN_OID_11AC_OPERMODE_CFG */
3961 		mlan_ds_11ac_opermode_cfg opermode_cfg;
3962 	} param;
3963 } mlan_ds_11ac_cfg, *pmlan_ds_11ac_cfg;
3964 
3965 /** Type definition of mlan_ds_11ax_he_capa for MLAN_OID_11AX_HE_CFG */
3966 typedef MLAN_PACK_START struct _mlan_ds_11ax_he_capa {
3967 	/** tlv id of he capability */
3968 	t_u16 id;
3969 	/** length of the payload */
3970 	t_u16 len;
3971 	/** extension id */
3972 	t_u8 ext_id;
3973 	/** he mac capability info */
3974 	t_u8 he_mac_cap[6];
3975 	/** he phy capability info */
3976 	t_u8 he_phy_cap[11];
3977 	/** he txrx mcs support for 80MHz */
3978 	t_u8 he_txrx_mcs_support[4];
3979 	/** val for txrx mcs 160Mhz or 80+80, and PPE thresholds */
3980 	t_u8 val[28];
3981 } MLAN_PACK_END mlan_ds_11ax_he_capa, *pmlan_ds_11ax_he_capa;
3982 
3983 /** Type definition of mlan_ds_11ax_he_cfg for MLAN_OID_11AX_HE_CFG */
3984 typedef struct _mlan_ds_11ax_he_cfg {
3985 	/** band, BIT0:2.4G, BIT1:5G BIT2:6G*/
3986 	t_u8 band;
3987 	/** mlan_ds_11ax_he_capa */
3988 	mlan_ds_11ax_he_capa he_cap;
3989 } mlan_ds_11ax_he_cfg, *pmlan_ds_11ax_he_cfg;
3990 /** Type definition of mlan_ds_11as_cfg for MLAN_IOCTL_11AX_CFG */
3991 typedef struct _mlan_ds_11ax_cfg {
3992 	/** Sub-command */
3993 	t_u32 sub_command;
3994 	/** 802.11n configuration parameter */
3995 	union {
3996 		/** HE configuration for MLAN_OID_11AX_HE_CFG */
3997 		mlan_ds_11ax_he_cfg he_cfg;
3998 	} param;
3999 } mlan_ds_11ax_cfg, *pmlan_ds_11ax_cfg;
4000 
4001 #define MLAN_11AXCMD_CFG_ID_SR_OBSS_PD_OFFSET 1
4002 #define MLAN_11AXCMD_CFG_ID_SR_ENABLE 2
4003 #define MLAN_11AXCMD_CFG_ID_BEAM_CHANGE 3
4004 #define MLAN_11AXCMD_CFG_ID_HTC_ENABLE 4
4005 #define MLAN_11AXCMD_CFG_ID_TXOP_RTS 5
4006 #define MLAN_11AXCMD_CFG_ID_TX_OMI 6
4007 #define MLAN_11AXCMD_CFG_ID_OBSSNBRU_TOLTIME 7
4008 
4009 #define MLAN_11AXCMD_SR_SUBID 0x102
4010 #define MLAN_11AXCMD_BEAM_SUBID 0x103
4011 #define MLAN_11AXCMD_HTC_SUBID 0x104
4012 #define MLAN_11AXCMD_TXOMI_SUBID 0x105
4013 #define MLAN_11AXCMD_OBSS_TOLTIME_SUBID 0x106
4014 #define MLAN_11AXCMD_TXOPRTS_SUBID 0x108
4015 
4016 #define MLAN_11AX_TWT_SETUP_SUBID 0x114
4017 #define MLAN_11AX_TWT_TEARDOWN_SUBID 0x115
4018 
4019 #define MRVL_DOT11AX_ENABLE_SR_TLV_ID (PROPRIETARY_TLV_BASE_ID + 322)
4020 #define MRVL_DOT11AX_OBSS_PD_OFFSET_TLV_ID (PROPRIETARY_TLV_BASE_ID + 323)
4021 
4022 /** Type definition of mlan_11axcmdcfg_obss_pd_offset for MLAN_OID_11AX_CMD_CFG
4023  */
4024 typedef struct MLAN_PACK_START _mlan_11axcmdcfg_obss_pd_offset {
4025 	/** <NON_SRG_OffSET, SRG_OFFSET> */
4026 	t_u8 offset[2];
4027 } MLAN_PACK_END mlan_11axcmdcfg_obss_pd_offset;
4028 
4029 /** Type definition of mlan_11axcmdcfg_sr_control for MLAN_OID_11AX_CMD_CFG */
4030 typedef struct MLAN_PACK_START _mlan_11axcmdcfg_sr_control {
4031 	/** 1 enable, 0 disable */
4032 	t_u8 control;
4033 } MLAN_PACK_END mlan_11axcmdcfg_sr_control;
4034 
4035 /** Type definition of mlan_ds_11ax_sr_cmd for MLAN_OID_11AX_CMD_CFG */
4036 typedef struct MLAN_PACK_START _mlan_ds_11ax_sr_cmd {
4037 	/** type*/
4038 	t_u16 type;
4039 	/** length of TLV */
4040 	t_u16 len;
4041 	/** value */
4042 	union {
4043 		mlan_11axcmdcfg_obss_pd_offset obss_pd_offset;
4044 		mlan_11axcmdcfg_sr_control sr_control;
4045 	} param;
4046 } MLAN_PACK_END mlan_ds_11ax_sr_cmd, *pmlan_ds_11ax_sr_cmd;
4047 
4048 /** Type definition of mlan_ds_11ax_beam_cmd for MLAN_OID_11AX_CMD_CFG */
4049 typedef struct _mlan_ds_11ax_beam_cmd {
4050 	/** command value: 1 is disable, 0 is enable*/
4051 	t_u8 value;
4052 } mlan_ds_11ax_beam_cmd, *pmlan_ds_11ax_beam_cmd;
4053 
4054 /** Type definition of mlan_ds_11ax_htc_cmd for MLAN_OID_11AX_CMD_CFG */
4055 typedef struct _mlan_ds_11ax_htc_cmd {
4056 	/** command value: 1 is enable, 0 is disable*/
4057 	t_u8 value;
4058 } mlan_ds_11ax_htc_cmd, *pmlan_ds_11ax_htc_cmd;
4059 
4060 /** Type definition of mlan_ds_11ax_htc_cmd for MLAN_OID_11AX_CMD_CFG */
4061 typedef struct _mlan_ds_11ax_txop_cmd {
4062 	/** Two byte rts threshold value of which only 10 bits, bit 0 to bit 9
4063 	 * are valid */
4064 	t_u16 rts_thres;
4065 } mlan_ds_11ax_txop_cmd, *pmlan_ds_11ax_txop_cmd;
4066 
4067 /** Type definition of mlan_ds_11ax_htc_cmd for MLAN_OID_11AX_CMD_CFG */
4068 typedef struct _mlan_ds_11ax_txomi_cmd {
4069 	/* 11ax spec 9.2.4.6a.2 OM Control 12 bits. Bit 0 to bit 11 */
4070 	t_u16 omi;
4071 } mlan_ds_11ax_txomi_cmd, *pmlan_ds_11ax_txomi_cmd;
4072 
4073 /** Type definition of mlan_ds_11ax_toltime_cmd for MLAN_OID_11AX_CMD_CFG */
4074 typedef struct _mlan_ds_11ax_toltime_cmd {
4075 	/* OBSS Narrow Bandwidth RU Tolerance Time */
4076 	t_u32 tol_time;
4077 } mlan_ds_11ax_toltime_cmd, *pmlan_ds_11ax_toltime_cmd;
4078 
4079 /** Type definition of mlan_ds_11ax_cmd_cfg for MLAN_OID_11AX_CMD_CFG */
4080 typedef struct _mlan_ds_11ax_cmd_cfg {
4081 	/** Sub-command */
4082 	t_u32 sub_command;
4083 	/** Sub-id */
4084 	t_u32 sub_id;
4085 	/** 802.11n configuration parameter */
4086 	union {
4087 		/** SR configuration for MLAN_11AXCMD_SR_SUBID */
4088 		mlan_ds_11ax_sr_cmd sr_cfg;
4089 		/** Beam configuration for MLAN_11AXCMD_BEAM_SUBID */
4090 		mlan_ds_11ax_beam_cmd beam_cfg;
4091 		/** HTC configuration for MLAN_11AXCMD_HTC_SUBID */
4092 		mlan_ds_11ax_htc_cmd htc_cfg;
4093 		/** txop RTS configuration for MLAN_11AXCMD_TXOPRTS_SUBID */
4094 		mlan_ds_11ax_txop_cmd txop_cfg;
4095 		/** tx omi configuration for MLAN_11AXCMD_TXOMI_SUBID */
4096 		mlan_ds_11ax_txomi_cmd txomi_cfg;
4097 		/** OBSS tolerance time configuration for
4098 		 * MLAN_11AXCMD_TOLTIME_SUBID */
4099 		mlan_ds_11ax_toltime_cmd toltime_cfg;
4100 	} param;
4101 } mlan_ds_11ax_cmd_cfg, *pmlan_ds_11ax_cmd_cfg;
4102 
4103 /** Type definition of mlan_ds_twt_setup for MLAN_OID_11AX_TWT_CFG */
4104 typedef struct MLAN_PACK_START _mlan_ds_twt_setup {
4105 	/** Implicit, 0: TWT session is explicit, 1: Session is implicit */
4106 	t_u8 implicit;
4107 	/** Announced, 0: Unannounced, 1: Announced TWT */
4108 	t_u8 announced;
4109 	/** Trigger Enabled, 0: Non-Trigger enabled, 1: Trigger enabled TWT */
4110 	t_u8 trigger_enabled;
4111 	/** TWT Information Disabled, 0: TWT info enabled, 1: TWT info disabled
4112 	 */
4113 	t_u8 twt_info_disabled;
4114 	/** Negotiation Type, 0: Future Individual TWT SP start time, 1: Next
4115 	 * Wake TBTT time */
4116 	t_u8 negotiation_type;
4117 	/** TWT Wakeup Duration, time after which the TWT requesting STA can
4118 	 * transition to doze state */
4119 	t_u8 twt_wakeup_duration;
4120 	/** Flow Identifier. Range: [0-7]*/
4121 	t_u8 flow_identifier;
4122 	/** Hard Constraint, 0: FW can tweak the TWT setup parameters if it is
4123 	 *rejected by AP.
4124 	 ** 1: Firmware should not tweak any parameters. */
4125 	t_u8 hard_constraint;
4126 	/** TWT Exponent, Range: [0-63] */
4127 	t_u8 twt_exponent;
4128 	/** TWT Mantissa Range: [0-sizeof(UINT16)] */
4129 	t_u16 twt_mantissa;
4130 	/** TWT Request Type, 0: REQUEST_TWT, 1: SUGGEST_TWT*/
4131 	t_u8 twt_request;
4132 } MLAN_PACK_END mlan_ds_twt_setup, *pmlan_ds_twt_setup;
4133 
4134 /** Type definition of mlan_ds_twt_teardown for MLAN_OID_11AX_TWT_CFG */
4135 typedef struct MLAN_PACK_START _mlan_ds_twt_teardown {
4136 	/** TWT Flow Identifier. Range: [0-7] */
4137 	t_u8 flow_identifier;
4138 	/** Negotiation Type. 0: Future Individual TWT SP start time, 1: Next
4139 	 * Wake TBTT time */
4140 	t_u8 negotiation_type;
4141 	/** Tear down all TWT. 1: To teardown all TWT, 0 otherwise */
4142 	t_u8 teardown_all_twt;
4143 } MLAN_PACK_END mlan_ds_twt_teardown, *pmlan_ds_twt_teardown;
4144 
4145 /** Type definition of mlan_ds_twtcfg for MLAN_OID_11AX_TWT_CFG */
4146 typedef struct MLAN_PACK_START _mlan_ds_twtcfg {
4147 	/** Sub-command */
4148 	t_u32 sub_command;
4149 	/** Sub-id */
4150 	t_u32 sub_id;
4151 	/** TWT Setup/Teardown configuration parameter */
4152 	union {
4153 		/** TWT Setup config for Sub ID: MLAN_11AX_TWT_SETUP_SUBID */
4154 		mlan_ds_twt_setup twt_setup;
4155 		/** TWT Teardown config for Sub ID: MLAN_11AX_TWT_TEARDOWN_SUBID
4156 		 */
4157 		mlan_ds_twt_teardown twt_teardown;
4158 	} param;
4159 } MLAN_PACK_END mlan_ds_twtcfg, *pmlan_ds_twtcfg;
4160 
4161 /** Country code length */
4162 #define COUNTRY_CODE_LEN 3
4163 
4164 /*-----------------------------------------------------------------*/
4165 /** 802.11d Configuration Group */
4166 /*-----------------------------------------------------------------*/
4167 /** Maximum subbands for 11d */
4168 #define MRVDRV_MAX_SUBBAND_802_11D 83
4169 
4170 /** Data structure for subband set */
4171 typedef struct _mlan_ds_subband_set_t {
4172 	/** First channel */
4173 	t_u8 first_chan;
4174 	/** Number of channels */
4175 	t_u8 no_of_chan;
4176 	/** Maximum Tx power in dBm */
4177 	t_u8 max_tx_pwr;
4178 } mlan_ds_subband_set_t;
4179 
4180 #define NXP_DFS_UNSET 0
4181 #define NXP_DFS_FCC 1
4182 #define NXP_DFS_ETSI 2
4183 #define NXP_DFS_JP 3
4184 #define NXP_DFS_UNKNOWN 0xFF
4185 /** Domain regulatory information */
4186 typedef struct _mlan_ds_11d_domain_info {
4187 	/** DFS region code */
4188 	t_u8 dfs_region;
4189 	/** Country Code */
4190 	t_u8 country_code[COUNTRY_CODE_LEN];
4191 	/** Band that channels in sub_band belong to */
4192 	t_u16 band;
4193 	/** No. of subband in below */
4194 	t_u8 no_of_sub_band;
4195 	/** Subband data to send/last sent */
4196 	mlan_ds_subband_set_t sub_band[MRVDRV_MAX_SUBBAND_802_11D];
4197 } mlan_ds_11d_domain_info;
4198 
4199 /** Type definition of mlan_ds_11d_cfg for MLAN_IOCTL_11D_CFG */
4200 typedef struct _mlan_ds_11d_cfg {
4201 	/** Sub-command */
4202 	t_u32 sub_command;
4203 	/** 802.11d configuration parameter */
4204 	union {
4205 #ifdef STA_SUPPORT
4206 		/** Enable for MLAN_OID_11D_CFG_ENABLE */
4207 		t_u32 enable_11d;
4208 #endif /* STA_SUPPORT */
4209 		/** Domain info for MLAN_OID_11D_DOMAIN_INFO_EXT */
4210 		mlan_ds_11d_domain_info domain_info;
4211 #ifdef UAP_SUPPORT
4212 		/** tlv data for MLAN_OID_11D_DOMAIN_INFO */
4213 		t_u8 domain_tlv[MAX_IE_SIZE];
4214 #endif /* UAP_SUPPORT */
4215 	} param;
4216 } mlan_ds_11d_cfg, *pmlan_ds_11d_cfg;
4217 
4218 /*-----------------------------------------------------------------*/
4219 /** Register Memory Access Group */
4220 /*-----------------------------------------------------------------*/
4221 /** Enumeration for CSU target device type */
4222 enum _mlan_csu_target_type {
4223 	MLAN_CSU_TARGET_CAU = 1,
4224 	MLAN_CSU_TARGET_PSU,
4225 };
4226 
4227 /** Enumeration for register type */
4228 enum _mlan_reg_type {
4229 	MLAN_REG_MAC = 1,
4230 	MLAN_REG_BBP,
4231 	MLAN_REG_RF,
4232 	MLAN_REG_CAU = 5,
4233 	MLAN_REG_PSU = 6,
4234 	MLAN_REG_BCA = 7,
4235 #if defined(PCIE9098) || defined(SD9098) || defined(USB9098) ||                \
4236 	defined(PCIE9097) || defined(USB9097) || defined(SDNW62X) ||           \
4237 	defined(PCIENW62X) || defined(USBNW62X) || defined(SD9097) ||          \
4238 	defined(SD9177)
4239 	MLAN_REG_CIU = 8,
4240 #endif
4241 #if defined(PCIE9098) || defined(SD9098) || defined(USB9098) ||                \
4242 	defined(PCIE9097) || defined(USB9097) || defined(SDNW62X) ||           \
4243 	defined(PCIENW62X) || defined(USBNW62X) || defined(SD9097)
4244 	MLAN_REG_MAC2 = 0x81,
4245 	MLAN_REG_BBP2 = 0x82,
4246 	MLAN_REG_RF2 = 0x83,
4247 	MLAN_REG_BCA2 = 0x87
4248 #endif
4249 };
4250 
4251 /** Type definition of mlan_ds_reg_rw for MLAN_OID_REG_RW */
4252 typedef struct _mlan_ds_reg_rw {
4253 	/** Register type */
4254 	t_u32 type;
4255 	/** Offset */
4256 	t_u32 offset;
4257 	/** Value */
4258 	t_u32 value;
4259 } mlan_ds_reg_rw;
4260 
4261 /** Maximum EEPROM data */
4262 #define MAX_EEPROM_DATA 256
4263 
4264 /** Type definition of mlan_ds_read_eeprom for MLAN_OID_EEPROM_RD */
4265 typedef struct _mlan_ds_read_eeprom {
4266 	/** Multiples of 4 */
4267 	t_u16 offset;
4268 	/** Number of bytes */
4269 	t_u16 byte_count;
4270 	/** Value */
4271 	t_u8 value[MAX_EEPROM_DATA];
4272 } mlan_ds_read_eeprom;
4273 
4274 /** Type definition of mlan_ds_mem_rw for MLAN_OID_MEM_RW */
4275 typedef struct _mlan_ds_mem_rw {
4276 	/** Address */
4277 	t_u32 addr;
4278 	/** Value */
4279 	t_u32 value;
4280 } mlan_ds_mem_rw;
4281 
4282 /** Type definition of mlan_ds_reg_mem for MLAN_IOCTL_REG_MEM */
4283 typedef struct _mlan_ds_reg_mem {
4284 	/** Sub-command */
4285 	t_u32 sub_command;
4286 	/** Register memory access parameter */
4287 	union {
4288 		/** Register access for MLAN_OID_REG_RW */
4289 		mlan_ds_reg_rw reg_rw;
4290 		/** EEPROM access for MLAN_OID_EEPROM_RD */
4291 		mlan_ds_read_eeprom rd_eeprom;
4292 		/** Memory access for MLAN_OID_MEM_RW */
4293 		mlan_ds_mem_rw mem_rw;
4294 	} param;
4295 } mlan_ds_reg_mem, *pmlan_ds_reg_mem;
4296 
4297 /*-----------------------------------------------------------------*/
4298 /** Multi-Radio Configuration Group */
4299 /*-----------------------------------------------------------------*/
4300 /*-----------------------------------------------------------------*/
4301 /** 802.11h Configuration Group */
4302 /*-----------------------------------------------------------------*/
4303 /** Type definition of mlan_ds_11h_dfs_testing for MLAN_OID_11H_DFS_TESTING */
4304 typedef struct _mlan_ds_11h_dfs_testing {
4305 	/** User-configured CAC period in milliseconds, 0 to use default */
4306 	t_u32 usr_cac_period_msec;
4307 	/** User-configured NOP period in seconds, 0 to use default */
4308 	t_u16 usr_nop_period_sec;
4309 	/** User-configured skip channel change, 0 to disable */
4310 	t_u8 usr_no_chan_change;
4311 	/** User-configured fixed channel to change to, 0 to use random channel
4312 	 */
4313 	t_u8 usr_fixed_new_chan;
4314 	/** User-configured cac restart */
4315 	t_u8 usr_cac_restart;
4316 } mlan_ds_11h_dfs_testing, *pmlan_ds_11h_dfs_testing;
4317 
4318 /** Type definition of mlan_ds_11h_dfs_testing for MLAN_OID_11H_CHAN_NOP_INFO */
4319 typedef struct _mlan_ds_11h_chan_nop_info {
4320 	/** current channel */
4321 	t_u8 curr_chan;
4322 	/** channel_width */
4323 	t_u8 chan_width;
4324 	/** check new channel flag */
4325 	t_u8 check_new_chan;
4326 	/** flag for chan under nop */
4327 	t_bool chan_under_nop;
4328 	/** chan_ban_info for new channel */
4329 	chan_band_info new_chan;
4330 } mlan_ds_11h_chan_nop_info, *pmlan_ds_11h_chan_nop_info;
4331 
4332 /** Type definition of mlan_ds_11h_nop_chan_list for MLAN_OID_11H_NOP_CHAN_LIST
4333  */
4334 typedef struct _mlan_ds_11h_nop_chan_list {
4335 	/** number of nop channel */
4336 	t_u8 num_chan;
4337 	/** chan list array */
4338 	t_u8 chan_list[20];
4339 } mlan_ds_11h_nop_chan_list, *pmlan_ds_11h_nop_chan_list;
4340 
4341 typedef struct _mlan_ds_11h_chan_rep_req {
4342 	t_u16 startFreq;
4343 	Band_Config_t bandcfg;
4344 	t_u8 chanNum;
4345 	t_u32 millisec_dwell_time; /**< Channel dwell time in milliseconds */
4346 	t_u8 host_based;
4347 } mlan_ds_11h_chan_rep_req;
4348 
4349 /** channel dfs state for MLAN_OID_11H_CHAN_DFS_STATE */
4350 typedef struct _mlan_ds_11h_chan_dfs_state {
4351 	/** channel */
4352 	t_u8 channel;
4353 	/** is dfs channel */
4354 	t_u8 dfs_required;
4355 	/** dfs state */
4356 	dfs_state_t dfs_state;
4357 } mlan_ds_11h_chan_dfs_state;
4358 
4359 typedef struct _mlan_ds_11h_dfs_w53_cfg {
4360 	/** dfs w53 cfg */
4361 	t_u8 dfs53cfg;
4362 } mlan_ds_11h_dfs_w53_cfg;
4363 
4364 /** Type definition of mlan_ds_11h_cfg for MLAN_IOCTL_11H_CFG */
4365 typedef struct _mlan_ds_11h_cfg {
4366 	/** Sub-command */
4367 	t_u32 sub_command;
4368 	union {
4369 		/** Local power constraint for
4370 		 * MLAN_OID_11H_LOCAL_POWER_CONSTRAINT */
4371 		t_s8 usr_local_power_constraint;
4372 		/** User-configuation for MLAN_OID_11H_DFS_TESTING */
4373 		mlan_ds_11h_dfs_testing dfs_testing;
4374 		/** channel NOP information for MLAN_OID_11H_CHAN_NOP_INFO */
4375 		mlan_ds_11h_chan_nop_info ch_nop_info;
4376 		/** NOP channel list for MLAN_OID_11H_NOP_CHAN_LIST */
4377 		mlan_ds_11h_nop_chan_list nop_chan_list;
4378 		/** channel report req for MLAN_OID_11H_CHAN_REPORT_REQUEST */
4379 		mlan_ds_11h_chan_rep_req chan_rpt_req;
4380 		/** channel switch count for MLAN_OID_11H_CHAN_SWITCH_COUNT*/
4381 		t_s8 cs_count;
4382 		/** channel dfs state for MLAN_OID_11H_CHAN_DFS_STATE */
4383 		mlan_ds_11h_chan_dfs_state ch_dfs_state;
4384 		mlan_ds_11h_dfs_w53_cfg dfs_w53_cfg;
4385 		/** dfs_mode for MLAN_OID_11H_DFS_MODE */
4386 		t_u8 dfs_mode;
4387 	} param;
4388 } mlan_ds_11h_cfg, *pmlan_ds_11h_cfg;
4389 
4390 /*-----------------------------------------------------------------*/
4391 /** Miscellaneous Configuration Group */
4392 /*-----------------------------------------------------------------*/
4393 
4394 /** CMD buffer size */
4395 #define MLAN_SIZE_OF_CMD_BUFFER (3 * 1024)
4396 
4397 /** LDO Internal */
4398 #define LDO_INTERNAL 0
4399 /** LDO External */
4400 #define LDO_EXTERNAL 1
4401 
4402 /** Enumeration for IE type */
4403 enum _mlan_ie_type {
4404 	MLAN_IE_TYPE_GEN_IE = 0,
4405 #ifdef STA_SUPPORT
4406 	MLAN_IE_TYPE_ARP_FILTER,
4407 #endif /* STA_SUPPORT */
4408 };
4409 
4410 /** Type definition of mlan_ds_misc_gen_ie for MLAN_OID_MISC_GEN_IE */
4411 typedef struct _mlan_ds_misc_gen_ie {
4412 	/** IE type */
4413 	t_u32 type;
4414 	/** IE length */
4415 	t_u32 len;
4416 	/** IE buffer */
4417 	t_u8 ie_data[MAX_IE_SIZE];
4418 } mlan_ds_misc_gen_ie;
4419 
4420 #ifdef SDIO
4421 /** Type definition of mlan_ds_misc_sdio_mpa_ctrl
4422  *  for MLAN_OID_MISC_SDIO_MPA_CTRL
4423  */
4424 typedef struct _mlan_ds_misc_sdio_mpa_ctrl {
4425 	/** SDIO MP-A TX enable/disable */
4426 	t_u16 tx_enable;
4427 	/** SDIO MP-A RX enable/disable */
4428 	t_u16 rx_enable;
4429 	/** SDIO MP-A TX buf size */
4430 	t_u16 tx_buf_size;
4431 	/** SDIO MP-A RX buf size */
4432 	t_u16 rx_buf_size;
4433 	/** SDIO MP-A TX Max Ports */
4434 	t_u16 tx_max_ports;
4435 	/** SDIO MP-A RX Max Ports */
4436 	t_u16 rx_max_ports;
4437 } mlan_ds_misc_sdio_mpa_ctrl;
4438 #endif
4439 
4440 /** Type definition of mlan_ds_misc_cmd for MLAN_OID_MISC_HOST_CMD */
4441 typedef struct _mlan_ds_misc_cmd {
4442 	/** Command length */
4443 	t_u32 len;
4444 	/** Command buffer */
4445 	t_u8 cmd[MRVDRV_SIZE_OF_CMD_BUFFER];
4446 } mlan_ds_misc_cmd;
4447 
4448 /** Maximum number of system clocks */
4449 #define MLAN_MAX_CLK_NUM 16
4450 
4451 /** Clock type : Configurable */
4452 #define MLAN_CLK_CONFIGURABLE 0
4453 /** Clock type : Supported */
4454 #define MLAN_CLK_SUPPORTED 1
4455 
4456 /** Type definition of mlan_ds_misc_sys_clock for MLAN_OID_MISC_SYS_CLOCK */
4457 typedef struct _mlan_ds_misc_sys_clock {
4458 	/** Current system clock */
4459 	t_u16 cur_sys_clk;
4460 	/** Clock type */
4461 	t_u16 sys_clk_type;
4462 	/** Number of clocks */
4463 	t_u16 sys_clk_num;
4464 	/** System clocks */
4465 	t_u16 sys_clk[MLAN_MAX_CLK_NUM];
4466 } mlan_ds_misc_sys_clock;
4467 
4468 /** Enumeration for function init/shutdown */
4469 enum _mlan_func_cmd {
4470 	MLAN_FUNC_INIT = 1,
4471 	MLAN_FUNC_SHUTDOWN,
4472 };
4473 
4474 /** Net monitor filter: management frame */
4475 #define MLAN_NETMON_MANAGEMENT_FRAME MBIT(0)
4476 /** Net monitor filter: control frame */
4477 #define MLAN_NETMON_CONTROL_FRAME MBIT(1)
4478 /** Net monitor filter: data frame */
4479 #define MLAN_NETMON_DATA_FRAME MBIT(2)
4480 
4481 typedef struct _mlan_ds_misc_net_monitor {
4482 	/** Enable/disable network monitor */
4483 	t_u32 enable_net_mon;
4484 	/** Set net monitor filer flag */
4485 	t_u32 filter_flag;
4486 	/** Radio type */
4487 	t_u32 band;
4488 	/** Channel */
4489 	t_u32 channel;
4490 	/** Secondary channel bandwidth */
4491 	t_u32 chan_bandwidth;
4492 } mlan_ds_misc_net_monitor;
4493 
4494 /** Type definition of mlan_ds_misc_tx_datapause
4495  * for MLAN_OID_MISC_TX_DATAPAUSE
4496  */
4497 typedef struct _mlan_ds_misc_tx_datapause {
4498 	/** Tx data pause flag */
4499 	t_u16 tx_pause;
4500 	/** Max number of Tx buffers for all PS clients */
4501 	t_u16 tx_buf_cnt;
4502 } mlan_ds_misc_tx_datapause;
4503 
4504 /** Type definition of mlan_ds_misc_rx_abort_cfg
4505  * for MLAN_OID_MISC_RX_ABORT_CFG
4506  */
4507 typedef struct _mlan_ds_misc_rx_abort_cfg {
4508 	/** enable/disable rx abort */
4509 	t_u8 enable;
4510 	/** Rx weak RSSI pkt threshold */
4511 	t_s8 rssi_threshold;
4512 } mlan_ds_misc_rx_abort_cfg;
4513 
4514 /** Type definition of mlan_ds_misc_rx_abort_cfg_ext
4515  * for MLAN_OID_MISC_RX_ABORT_CFG_EXT
4516  */
4517 typedef struct _mlan_ds_misc_rx_abort_cfg_ext {
4518 	/** enable/disable dynamic rx abort */
4519 	t_u8 enable;
4520 	/** rssi margin */
4521 	t_s8 rssi_margin;
4522 	/** specify ceil rssi threshold */
4523 	t_s8 ceil_rssi_threshold;
4524 } mlan_ds_misc_rx_abort_cfg_ext;
4525 
4526 /** Type definition of mlan_ds_misc_rx_abort_cfg_ext
4527  * for MLAN_OID_MISC_TX_AMDPU_PROT_MODE
4528  */
4529 typedef struct _mlan_ds_misc_tx_ampdu_prot_mode {
4530 	/** set prot mode */
4531 	t_u16 mode;
4532 } mlan_ds_misc_tx_ampdu_prot_mode;
4533 
4534 /** Type definition of mlan_ds_misc_dot11mc_unassoc_ftm_cfg
4535  * for MLAN_OID_MISC_DOT11MC_UNASSOC_FTM_CFG
4536  */
4537 typedef struct _mlan_ds_misc_dot11mc_unassoc_ftm_cfg {
4538 	/** set the state */
4539 	t_u16 state;
4540 } mlan_ds_misc_dot11mc_unassoc_ftm_cfg;
4541 
4542 #define RATEADAPT_ALGO_LEGACY 0
4543 #define RATEADAPT_ALGO_SR 1
4544 
4545 /** Type definition of mlan_ds_misc_rate_adapt_cfg
4546  * for MLAN_OID_MISC_RATE_ADAPT_CFG
4547  */
4548 typedef struct _mlan_ds_misc_rate_adapt_cfg {
4549 	/** SR Rateadapt */
4550 	t_u8 sr_rateadapt;
4551 	/** set low threshold */
4552 	t_u8 ra_low_thresh;
4553 	/** set high threshold */
4554 	t_u8 ra_high_thresh;
4555 	/** set interval */
4556 	t_u16 ra_interval;
4557 } mlan_ds_misc_rate_adapt_cfg;
4558 
4559 /** Type definition of mlan_ds_misc_cck_desense_cfg
4560  * for MLAN_OID_MISC_CCK_DESENSE_CFG
4561  */
4562 typedef struct _mlan_ds_misc_cck_desense_cfg {
4563 	/** cck desense mode: 0:disable 1:normal 2:dynamic */
4564 	t_u16 mode;
4565 	/** specify rssi margin */
4566 	t_s8 margin;
4567 	/** specify ceil rssi threshold */
4568 	t_s8 ceil_thresh;
4569 	/** cck desense "on" interval count */
4570 	t_u8 num_on_intervals;
4571 	/** cck desense "off" interval count */
4572 	t_u8 num_off_intervals;
4573 } mlan_ds_misc_cck_desense_cfg;
4574 
4575 /** IP address length */
4576 #define IPADDR_LEN (16)
4577 /** Max number of ip */
4578 #define MAX_IPADDR (4)
4579 /** IP address type - NONE*/
4580 #define IPADDR_TYPE_NONE (0)
4581 /** IP address type - IPv4*/
4582 #define IPADDR_TYPE_IPV4 (1)
4583 /** IP operation remove */
4584 #define MLAN_IPADDR_OP_IP_REMOVE (0)
4585 /** IP operation ARP filter */
4586 #define MLAN_IPADDR_OP_ARP_FILTER MBIT(0)
4587 /** IP operation ARP response */
4588 #define MLAN_IPADDR_OP_AUTO_ARP_RESP MBIT(1)
4589 /** Enable opcode bit for MDNS & NS when device enter into suspend **/
4590 #define MLAN_OP_ADD_MDNS MBIT(2)
4591 #define MLAN_OP_ADD_IPV6_NS MBIT(3)
4592 
4593 /** Type definition of mlan_ds_misc_ipaddr_cfg for MLAN_OID_MISC_IP_ADDR */
4594 typedef struct _mlan_ds_misc_ipaddr_cfg {
4595 	/** Operation code */
4596 	t_u32 op_code;
4597 	/** IP address type */
4598 	t_u32 ip_addr_type;
4599 	/** Number of IP */
4600 	t_u32 ip_addr_num;
4601 	/** IP address */
4602 	t_u8 ip_addr[MAX_IPADDR][IPADDR_LEN];
4603 } mlan_ds_misc_ipaddr_cfg;
4604 
4605 /** Type definnition of mlan_ds_misc_ipv6_ra_offload for
4606  * MLAN_OID_MISC_IPV6_RA_OFFLOAD*/
4607 typedef struct _mlan_ds_misc_ipv6_ra_offload {
4608 	/** 0: disable; 1: enable*/
4609 	t_u8 enable;
4610 	t_u8 ipv6_addr[16];
4611 } mlan_ds_misc_ipv6_ra_offload;
4612 
4613 /* MEF configuration disable */
4614 #define MEF_CFG_DISABLE 0
4615 /* MEF configuration Rx filter enable */
4616 #define MEF_CFG_RX_FILTER_ENABLE 1
4617 /* MEF configuration auto ARP response */
4618 #define MEF_CFG_AUTO_ARP_RESP 2
4619 /* MEF configuration host command */
4620 #define MEF_CFG_HOSTCMD 0xFFFF
4621 
4622 /** Type definition of mlan_ds_misc_mef_cfg for MLAN_OID_MISC_MEF_CFG */
4623 typedef struct _mlan_ds_misc_mef_cfg {
4624 	/** Sub-ID for operation */
4625 	t_u32 sub_id;
4626 	/** Parameter according to sub-ID */
4627 	union {
4628 		/** MEF command buffer for MEF_CFG_HOSTCMD */
4629 		mlan_ds_misc_cmd cmd_buf;
4630 	} param;
4631 } mlan_ds_misc_mef_cfg;
4632 
4633 /** Type definition of mlan_ds_misc_cfp_code for MLAN_OID_MISC_CFP_CODE */
4634 typedef struct _mlan_ds_misc_cfp_code {
4635 	/** CFP table code for 2.4GHz */
4636 	t_u32 cfp_code_bg;
4637 	/** CFP table code for 5GHz */
4638 	t_u32 cfp_code_a;
4639 } mlan_ds_misc_cfp_code;
4640 
4641 /** Type definition of mlan_ds_misc_arb_cfg
4642  * for MLAN_OID_MISC_ARB_CFG
4643  */
4644 typedef struct _mlan_ds_misc_arb_cfg {
4645 	/** arb mode 0-4 */
4646 	t_u32 arb_mode;
4647 } mlan_ds_misc_arb_cfg;
4648 
4649 /** Type definition of mlan_ds_misc_tp_state
4650  *  for MLAN_OID_MISC_TP_STATE
4651  */
4652 typedef struct _mlan_ds_misc_tp_state {
4653 	/** TP account mode 0-disable 1-enable */
4654 	t_u32 on;
4655 	/** Packet drop point */
4656 	t_u32 drop_point;
4657 } mlan_ds_misc_tp_state;
4658 
4659 /** Type definition of mlan_ds_misc_country_code
4660  *  for MLAN_OID_MISC_COUNTRY_CODE
4661  */
4662 typedef struct _mlan_ds_misc_country_code {
4663 	/** Country Code */
4664 	t_u8 country_code[COUNTRY_CODE_LEN];
4665 } mlan_ds_misc_country_code;
4666 
4667 /** action for set */
4668 #define SUBSCRIBE_EVT_ACT_BITWISE_SET 0x0002
4669 /** action for clear */
4670 #define SUBSCRIBE_EVT_ACT_BITWISE_CLR 0x0003
4671 /** BITMAP for subscribe event rssi low */
4672 #define SUBSCRIBE_EVT_RSSI_LOW MBIT(0)
4673 /** BITMAP for subscribe event snr low */
4674 #define SUBSCRIBE_EVT_SNR_LOW MBIT(1)
4675 /** BITMAP for subscribe event max fail */
4676 #define SUBSCRIBE_EVT_MAX_FAIL MBIT(2)
4677 /** BITMAP for subscribe event beacon missed */
4678 #define SUBSCRIBE_EVT_BEACON_MISSED MBIT(3)
4679 /** BITMAP for subscribe event rssi high */
4680 #define SUBSCRIBE_EVT_RSSI_HIGH MBIT(4)
4681 /** BITMAP for subscribe event snr high */
4682 #define SUBSCRIBE_EVT_SNR_HIGH MBIT(5)
4683 /** BITMAP for subscribe event data rssi low */
4684 #define SUBSCRIBE_EVT_DATA_RSSI_LOW MBIT(6)
4685 /** BITMAP for subscribe event data snr low */
4686 #define SUBSCRIBE_EVT_DATA_SNR_LOW MBIT(7)
4687 /** BITMAP for subscribe event data rssi high */
4688 #define SUBSCRIBE_EVT_DATA_RSSI_HIGH MBIT(8)
4689 /** BITMAP for subscribe event data snr high */
4690 #define SUBSCRIBE_EVT_DATA_SNR_HIGH MBIT(9)
4691 /** BITMAP for subscribe event link quality */
4692 #define SUBSCRIBE_EVT_LINK_QUALITY MBIT(10)
4693 /** BITMAP for subscribe event pre_beacon_lost */
4694 #define SUBSCRIBE_EVT_PRE_BEACON_LOST MBIT(11)
4695 /** default PRE_BEACON_MISS_COUNT */
4696 #define DEFAULT_PRE_BEACON_MISS 30
4697 
4698 /** Type definition of mlan_ds_subscribe_evt for MLAN_OID_MISC_CFP_CODE */
4699 typedef struct _mlan_ds_subscribe_evt {
4700 	/** evt action */
4701 	t_u16 evt_action;
4702 	/** bitmap for subscribe event */
4703 	t_u16 evt_bitmap;
4704 	/** Absolute value of RSSI threshold value (dBm) */
4705 	t_u8 low_rssi;
4706 	/** 0--report once, 1--report everytime happen,
4707 	 * N -- report only happend > N consecutive times
4708 	 */
4709 	t_u8 low_rssi_freq;
4710 	/** SNR threshold value (dB) */
4711 	t_u8 low_snr;
4712 	/** 0--report once, 1--report everytime happen,
4713 	 *  N -- report only happend > N consecutive times
4714 	 */
4715 	t_u8 low_snr_freq;
4716 	/** Failure count threshold */
4717 	t_u8 failure_count;
4718 	/** 0--report once, 1--report everytime happen,
4719 	 *  N -- report only happend > N consecutive times
4720 	 */
4721 	t_u8 failure_count_freq;
4722 	/** num of missed beacons */
4723 	t_u8 beacon_miss;
4724 	/** 0--report once, 1--report everytime happen,
4725 	 *  N -- report only happend > N consecutive times
4726 	 */
4727 	t_u8 beacon_miss_freq;
4728 	/** Absolute value of RSSI threshold value (dBm) */
4729 	t_u8 high_rssi;
4730 	/** 0--report once, 1--report everytime happen,
4731 	 *  N -- report only happend > N consecutive times
4732 	 */
4733 	t_u8 high_rssi_freq;
4734 	/** SNR threshold value (dB) */
4735 	t_u8 high_snr;
4736 	/** 0--report once, 1--report everytime happen,
4737 	 *  N -- report only happend > N consecutive times
4738 	 */
4739 	t_u8 high_snr_freq;
4740 	/** Absolute value of data RSSI threshold value (dBm) */
4741 	t_u8 data_low_rssi;
4742 	/** 0--report once, 1--report everytime happen,
4743 	 *  N -- report only happend > N consecutive times
4744 	 */
4745 	t_u8 data_low_rssi_freq;
4746 	/** Absolute value of data SNR threshold value (dBm) */
4747 	t_u8 data_low_snr;
4748 	/** 0--report once, 1--report everytime happen,
4749 	 *  N -- report only happend > N consecutive times
4750 	 */
4751 	t_u8 data_low_snr_freq;
4752 	/** Absolute value of data RSSI threshold value (dBm) */
4753 	t_u8 data_high_rssi;
4754 	/** 0--report once, 1--report everytime happen,
4755 	 *  N -- report only happend > N consecutive times
4756 	 */
4757 	t_u8 data_high_rssi_freq;
4758 	/** Absolute value of data SNR threshold value (dBm) */
4759 	t_u8 data_high_snr;
4760 	/** 0--report once, 1--report everytime happen,
4761 	 *  N -- report only happend > N consecutive times
4762 	 */
4763 	t_u8 data_high_snr_freq;
4764 	/* Link SNR threshold (dB)*/
4765 	t_u16 link_snr;
4766 	/* Link SNR frequency */
4767 	t_u16 link_snr_freq;
4768 	/* Second minimum rate value as per the rate table below */
4769 	t_u16 link_rate;
4770 	/* Second minimum rate frequency */
4771 	t_u16 link_rate_freq;
4772 	/* Tx latency value (us) */
4773 	t_u16 link_tx_latency;
4774 	/* Tx latency frequency */
4775 	t_u16 link_tx_lantency_freq;
4776 	/* Number of pre missed beacons */
4777 	t_u8 pre_beacon_miss;
4778 } mlan_ds_subscribe_evt;
4779 
4780 /** Max OTP user data length */
4781 #define MAX_OTP_USER_DATA_LEN 252
4782 
4783 /** Type definition of mlan_ds_misc_otp_user_data
4784  * for MLAN_OID_MISC_OTP_USER_DATA
4785  */
4786 typedef struct _mlan_ds_misc_otp_user_data {
4787 	/** Reserved */
4788 	t_u16 reserved;
4789 	/** OTP user data length */
4790 	t_u16 user_data_length;
4791 	/** User data buffer */
4792 	t_u8 user_data[MAX_OTP_USER_DATA_LEN];
4793 } mlan_ds_misc_otp_user_data;
4794 
4795 /** Type definition of mlan_ds_fw_reconnect for MLAN_OID_MISC_AUTO_ASSOC */
4796 typedef struct _mlan_ds_fw_reconnect {
4797 	/* fw auto re-connect counter */
4798 	t_u8 fw_reconn_counter;
4799 	/* fw auto re-connect interval */
4800 	t_u8 fw_reconn_interval;
4801 	/* fw auto re-connect flags */
4802 	t_u16 fw_reconn_flags;
4803 } mlan_ds_fw_reconnect;
4804 
4805 typedef struct _aggr_ctrl_cfg {
4806 	/** Enable */
4807 	t_u16 enable;
4808 	/** Aggregation alignment */
4809 	t_u16 aggr_align;
4810 	/** Aggregation max size */
4811 	t_u16 aggr_max_size;
4812 	/** Aggregation max packet number */
4813 	t_u16 aggr_max_num;
4814 	/** Aggrgation timeout, in microseconds */
4815 	t_u16 aggr_tmo;
4816 } aggr_ctrl_cfg;
4817 
4818 /** Type definition of mlan_ds_misc_aggr_ctrl
4819  *  for MLAN_OID_MISC_AGGR_CTRL
4820  */
4821 typedef struct _mlan_ds_misc_aggr_ctrl {
4822 	/** Tx aggregation control */
4823 	aggr_ctrl_cfg tx;
4824 } mlan_ds_misc_aggr_ctrl;
4825 
4826 #ifdef USB
4827 typedef struct _usb_aggr_ctrl_cfg {
4828 	/** Enable */
4829 	t_u16 enable;
4830 	/** Aggregation mode */
4831 	t_u16 aggr_mode;
4832 	/** Aggregation alignment */
4833 	t_u16 aggr_align;
4834 	/** Aggregation max packet/size */
4835 	t_u16 aggr_max;
4836 	/** Aggrgation timeout, in microseconds */
4837 	t_u16 aggr_tmo;
4838 } usb_aggr_ctrl_cfg;
4839 
4840 /** Type definition of mlan_ds_misc_usb_aggr_ctrl
4841  *  for MLAN_OID_MISC_USB_AGGR_CTRL
4842  */
4843 typedef struct _mlan_ds_misc_usb_aggr_ctrl {
4844 	/** Tx aggregation control */
4845 	usb_aggr_ctrl_cfg tx_aggr_ctrl;
4846 	/** Rx deaggregation control */
4847 	usb_aggr_ctrl_cfg rx_deaggr_ctrl;
4848 } mlan_ds_misc_usb_aggr_ctrl;
4849 #endif
4850 
4851 #ifdef WIFI_DIRECT_SUPPORT
4852 /** flag for NOA */
4853 #define WIFI_DIRECT_NOA 1
4854 /** flag for OPP_PS */
4855 #define WIFI_DIRECT_OPP_PS 2
4856 /** Type definition of mlan_ds_wifi_direct_config
4857  *  for MLAN_OID_MISC_WIFI_DIRECT_CONFIG
4858  */
4859 typedef struct _mlan_ds_wifi_direct_config {
4860 	/** flags for NOA/OPP_PS */
4861 	t_u8 flags;
4862 	/** NoA enable/disable */
4863 	t_u8 noa_enable;
4864 	/** index */
4865 	t_u16 index;
4866 	/** NoA count */
4867 	t_u8 noa_count;
4868 	/** NoA duration */
4869 	t_u32 noa_duration;
4870 	/** NoA interval */
4871 	t_u32 noa_interval;
4872 	/** opp ps enable/disable */
4873 	t_u8 opp_ps_enable;
4874 	/** CT window value */
4875 	t_u8 ct_window;
4876 } mlan_ds_wifi_direct_config;
4877 #endif
4878 
4879 /** Type definition of mlan_ds_gpio_tsf_latch */
4880 typedef struct _mlan_ds_gpio_tsf_latch {
4881 	/**clock sync Mode */
4882 	t_u8 clock_sync_mode;
4883 	/**clock sync Role */
4884 	t_u8 clock_sync_Role;
4885 	/**clock sync GPIO Pin Number */
4886 	t_u8 clock_sync_gpio_pin_number;
4887 	/**clock sync GPIO Level or Toggle */
4888 	t_u8 clock_sync_gpio_level_toggle;
4889 	/**clock sync GPIO Pulse Width */
4890 	t_u16 clock_sync_gpio_pulse_width;
4891 } mlan_ds_gpio_tsf_latch;
4892 
4893 /** Type definition of mlan_ds_tsf_info */
4894 typedef struct _mlan_ds_tsf_info {
4895 	/**get tsf info format */
4896 	t_u16 tsf_format;
4897 	/**tsf info */
4898 	t_u16 tsf_info;
4899 	/**tsf */
4900 	t_u64 tsf;
4901 	/**Positive or negative offset in microsecond from Beacon TSF to GPIO
4902 	 * toggle TSF  */
4903 	t_s32 tsf_offset;
4904 } mlan_ds_tsf_info;
4905 
4906 #if defined(STA_SUPPORT)
4907 typedef struct _mlan_ds_misc_pmfcfg {
4908 	/** Management Frame Protection Capable */
4909 	t_u8 mfpc;
4910 	/** Management Frame Protection Required */
4911 	t_u8 mfpr;
4912 } mlan_ds_misc_pmfcfg;
4913 #endif
4914 
4915 #define MAX_SSID_NUM 16
4916 #define MAX_AP_LIST 8
4917 #define RETRY_UNLIMITED_TIME 0xFF
4918 
4919 #define FW_ROAM_ENABLE MBIT(0)
4920 #define FW_ROAM_TRIGGER_COND MBIT(1)
4921 #define FW_ROAM_BSSID MBIT(2)
4922 #define FW_ROAM_SSID MBIT(3)
4923 #define FW_ROAM_RETRY_COUNT MBIT(4)
4924 #define FW_ROAM_RSSI_PARA MBIT(5)
4925 #define FW_ROAM_BAND_RSSI MBIT(6)
4926 #define FW_ROAM_BGSCAN_PARAM MBIT(7)
4927 #define FW_ROAM_EES_PARAM MBIT(8)
4928 #define FW_ROAM_BCN_MISS_THRESHOLD MBIT(9)
4929 #define FW_ROAM_PRE_BCN_MISS_THRESHOLD MBIT(10)
4930 #define FW_ROAM_BLACKLIST MBIT(11)
4931 #define FW_ROAM_REPEAT_CNT MBIT(12)
4932 
4933 /*Roam offload configuration for auto reconnection when suspend and resume*/
4934 typedef enum _roam_offload_config_mode {
4935 	ROAM_OFFLOAD_ENABLE = 1,
4936 	ROAM_OFFLOAD_SUSPEND_CFG,
4937 	ROAM_OFFLOAD_RESUME_CFG,
4938 	ROAM_OFFLOAD_PARAM_CFG,
4939 } roam_offload_config_mode;
4940 
4941 typedef enum _roam_offload_set_mode {
4942 	ROAM_OFFLOAD_DISABLE = 0,
4943 	ROAM_OFFLOAD_WITH_APLIST,
4944 	ROAM_OFFLOAD_WITHOUT_APLIST,
4945 	ROAM_OFFLOAD_WITH_BSSID,
4946 	ROAM_OFFLOAD_WITH_SSID,
4947 	AUTO_RECONNECT,
4948 } roam_offload_set_mode;
4949 
4950 typedef enum _roam_offload_trigger_mode {
4951 	NO_TRIGGER = 0x00,
4952 	RSSI_LOW_TRIGGER = 0x01,
4953 	PRE_BEACON_LOST_TRIGGER = 0x02,
4954 	LINK_LOST_TRIGGER = 0x04,
4955 	DEAUTH_WITH_EXT_AP_TRIGGER = 0x08,
4956 } roam_offload_trigger_mode;
4957 
4958 /** mlan_ds_misc_ees_cfg structure */
4959 typedef MLAN_PACK_START struct _mlan_ds_misc_ees_cfg {
4960 	/* EES mode*/
4961 	t_u16 ees_mode;
4962 	/* EES report condition*/
4963 	t_u16 ees_rpt_condition;
4964 	/* High scan period(milliseconds)*/
4965 	t_u16 high_scan_period;
4966 	/* High scan count*/
4967 	t_u16 high_scan_count;
4968 	/* Middle scan period(milliseconds)*/
4969 	t_u16 mid_scan_period;
4970 	/* Middle scan count*/
4971 	t_u16 mid_scan_count;
4972 	/* Low scan period(milliseconds)*/
4973 	t_u16 low_scan_period;
4974 	/* Low scan count*/
4975 	t_u16 low_scan_count;
4976 } MLAN_PACK_END mlan_ds_misc_ees_cfg;
4977 
4978 /** mlan_ds_misc_bgscan_cfg structure */
4979 typedef MLAN_PACK_START struct _mlan_ds_misc_bgscan_cfg {
4980 	/* BSS Type  0x1-bss independent, 0x2-bss infrastructure, 0x3-bss any*/
4981 	t_u8 bss_type;
4982 	/* Number of channels scanned for each scan*/
4983 	t_u8 channels_per_scan;
4984 	/* Interval between consective scans*/
4985 	t_u32 scan_interval;
4986 	/* Conditons to trigger report to host*/
4987 	t_u32 bg_rpt_condition;
4988 } MLAN_PACK_END mlan_ds_misc_bgscan_cfg;
4989 
4990 /** mlan_ds_misc_band_rssi structure */
4991 typedef MLAN_PACK_START struct _mlan_ds_misc_band_rssi {
4992 	/* RSSI hysteresis*/
4993 	t_u8 rssi_hysteresis;
4994 	/*  Preferred channel band for fw roaming
4995 	 *  0:2.4G band; 1: 5G band; 2:4G band; 0xFF:band not set(invalid)
4996 	 */
4997 	t_u8 band_preferred;
4998 } MLAN_PACK_END mlan_ds_misc_band_rssi;
4999 
5000 /** mlan_ds_misc_ssid_list structure */
5001 typedef MLAN_PACK_START struct _mlan_ds_misc_ssid_list {
5002 	/* SSID number*/
5003 	t_u8 ssid_num;
5004 	/* SSID for fw roaming/auto_reconnect*/
5005 	mlan_802_11_ssid ssids[MAX_SSID_NUM];
5006 } MLAN_PACK_END mlan_ds_misc_ssid_list;
5007 
5008 typedef MLAN_PACK_START struct _mlan_ds_misc_roam_offload_aplist {
5009 	/** Number of AP**/
5010 	t_u8 ap_num;
5011 	/** AP mac addrs**/
5012 	t_u8 ap_mac[MAX_AP_LIST][MLAN_MAC_ADDR_LENGTH];
5013 } MLAN_PACK_END mlan_ds_misc_roam_offload_aplist;
5014 
5015 typedef MLAN_PACK_START struct _mlan_ds_misc_roam_offload_para_rssi {
5016 	/** Setting flag**/
5017 	t_u8 set_flag;
5018 	/** Max value of RSSI threshold**/
5019 	t_u8 max_rssi;
5020 	/** Min value of RSSI threshold**/
5021 	t_u8 min_rssi;
5022 	/** Adjusting step value of RSSI threshold**/
5023 	t_u8 step_rssi;
5024 } MLAN_PACK_END mlan_ds_misc_roam_offload_para_rssi;
5025 
5026 typedef MLAN_PACK_START struct _mlan_ds_misc_roam_offload {
5027 	/** Enable roam offload**/
5028 	t_u8 enable;
5029 	/** User set passphrase**/
5030 	t_u8 userset_passphrase;
5031 	/* Condition to trigger roaming
5032 	 * Bit0 : RSSI low trigger
5033 	 * Bit1 : Pre-beacon lost trigger
5034 	 * Bit2 : Link Lost trigger
5035 	 * Bit3 : Deauth by ext-AP trigger
5036 	 * Bit4 ~ Bit15 : Reserved
5037 	 * value 0 : no trigger
5038 	 * value 0xff : invalid
5039 	 */
5040 	t_u16 trigger_condition;
5041 	/** AP list**/
5042 	mlan_ds_misc_roam_offload_aplist aplist;
5043 	/*Roam offload configuration mode for auto connection when suspend and
5044 	 * resume*/
5045 	roam_offload_config_mode config_mode;
5046 	/** Retry count**/
5047 	t_u8 retry_count;
5048 	/** RSSI para**/
5049 	mlan_ds_misc_roam_offload_para_rssi para_rssi;
5050 	/** BSSID of reconnection**/
5051 	mlan_802_11_mac_addr bssid_reconnect;
5052 	/* SSID List(White list)*/
5053 	mlan_ds_misc_ssid_list ssid_list;
5054 	/* Black list(BSSID list)*/
5055 	mlan_ds_misc_roam_offload_aplist black_list;
5056 	/* BAND and RSSI_HYSTERESIS set flag*/
5057 	t_u8 band_rssi_flag;
5058 	mlan_ds_misc_band_rssi band_rssi;
5059 
5060 	/* BGSCAN params set flag*/
5061 	t_u8 bgscan_set_flag;
5062 	mlan_ds_misc_bgscan_cfg bgscan_cfg;
5063 
5064 	/* EES mode params set flag*/
5065 	t_u8 ees_param_set_flag;
5066 	mlan_ds_misc_ees_cfg ees_cfg;
5067 
5068 	/* Beacon miss threshold*/
5069 	t_u8 bcn_miss_threshold;
5070 
5071 	/* Beacon miss threshold*/
5072 	t_u8 pre_bcn_miss_threshold;
5073 
5074 	/* Scan repeat count*/
5075 	t_u16 repeat_count;
5076 } MLAN_PACK_END mlan_ds_misc_roam_offload;
5077 
5078 /**Action ID for TDLS disable link*/
5079 #define WLAN_TDLS_DISABLE_LINK 0x00
5080 /**Action ID for TDLS enable link*/
5081 #define WLAN_TDLS_ENABLE_LINK 0x01
5082 /**Action ID for TDLS create link*/
5083 #define WLAN_TDLS_CREATE_LINK 0x02
5084 /**Action ID for TDLS config link*/
5085 #define WLAN_TDLS_CONFIG_LINK 0x03
5086 /*reason code*/
5087 #define MLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
5088 /** TDLS operation buffer */
5089 typedef struct _mlan_ds_misc_tdls_oper {
5090 	/** TDLS Action */
5091 	t_u16 tdls_action;
5092 	/** TDLS peer address */
5093 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
5094 	/** peer capability */
5095 	t_u16 capability;
5096 	/** peer qos info */
5097 	t_u8 qos_info;
5098 	/** peer extend capability */
5099 	t_u8 *ext_capab;
5100 	/** extend capability len */
5101 	t_u8 ext_capab_len;
5102 	/** support rates */
5103 	t_u8 *supported_rates;
5104 	/** supported rates len */
5105 	t_u8 supported_rates_len;
5106 	/** peer ht_cap */
5107 	t_u8 *ht_capa;
5108 	/** peer vht capability */
5109 	t_u8 *vht_cap;
5110 } mlan_ds_misc_tdls_oper;
5111 
5112 /** flag for TDLS extcap */
5113 #define TDLS_IE_FLAGS_EXTCAP 0x0001
5114 /** flag for TDLS HTCAP */
5115 #define TDLS_IE_FLAGS_HTCAP 0x0002
5116 /** flag for TDLS HTINFO */
5117 #define TDLS_IE_FLAGS_HTINFO 0x0004
5118 /** flag for TDLS VHTCAP */
5119 #define TDLS_IE_FLAGS_VHTCAP 0x0008
5120 /** flag for TDLS VHTOPRAT */
5121 #define TDLS_IE_FLAGS_VHTOPRAT 0x0010
5122 /** flag for TDLS AID inof */
5123 #define TDLS_IE_FLAGS_AID 0x0020
5124 /** flag for TDLS Supported channels and regulatory class IE*/
5125 #define TDLS_IE_FLAGS_SUPP_CS_IE 0x0040
5126 /** flag for TDLS Qos info */
5127 #define TDLS_IE_FLAGS_QOS_INFO 0x0080
5128 /** flag for TDLS SETUP */
5129 #define TDLS_IE_FLAGS_SETUP 0x0100
5130 #define TDLS_IE_FLAGS_HECAP 0x0200
5131 #define TDLS_IE_FLAGS_HEOP 0x0400
5132 
5133 /** TDLS ie buffer */
5134 typedef struct _mlan_ds_misc_tdls_ies {
5135 	/** TDLS peer address */
5136 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
5137 	/** flags for request IEs */
5138 	t_u16 flags;
5139 	/** Qos info */
5140 	t_u8 QosInfo;
5141 	/** Extended Capabilities IE */
5142 	t_u8 ext_cap[IEEE_MAX_IE_SIZE];
5143 	/** HT Capabilities IE */
5144 	t_u8 ht_cap[IEEE_MAX_IE_SIZE];
5145 	/** HT Information IE */
5146 	t_u8 ht_info[IEEE_MAX_IE_SIZE];
5147 	/** VHT Capabilities IE */
5148 	t_u8 vht_cap[IEEE_MAX_IE_SIZE];
5149 	/** VHT Operations IE */
5150 	t_u8 vht_oprat[IEEE_MAX_IE_SIZE];
5151 	/** aid Info */
5152 	t_u8 aid_info[IEEE_MAX_IE_SIZE];
5153 	/** HE Capabilities IE */
5154 	t_u8 he_cap[IEEE_MAX_IE_SIZE];
5155 	/** HE Operation IE */
5156 	t_u8 he_op[IEEE_MAX_IE_SIZE];
5157 	/** supported channels */
5158 	t_u8 supp_chan[IEEE_MAX_IE_SIZE];
5159 	/** supported regulatory class */
5160 	t_u8 regulatory_class[IEEE_MAX_IE_SIZE];
5161 } mlan_ds_misc_tdls_ies;
5162 
5163 #ifdef RX_PACKET_COALESCE
5164 typedef struct _mlan_ds_misc_rx_packet_coalesce {
5165 	/** packet threshold */
5166 	t_u32 packet_threshold;
5167 	/** timeout value */
5168 	t_u16 delay;
5169 } mlan_ds_misc_rx_packet_coalesce;
5170 #endif
5171 
5172 typedef struct _mlan_ds_misc_dfs_repeater {
5173 	/** Set or Get */
5174 	t_u16 action;
5175 	/** 1 on or 0 off */
5176 	t_u16 mode;
5177 } mlan_ds_misc_dfs_repeater;
5178 
5179 #define WOWLAN_MAX_PATTERN_LEN 20
5180 #define WOWLAN_MAX_OFFSET_LEN 50
5181 #define MAX_NUM_FILTERS 10
5182 #define MEF_MODE_HOST_SLEEP (1 << 0)
5183 #define MEF_MODE_NON_HOST_SLEEP (1 << 1)
5184 #define MEF_ACTION_WAKE (1 << 0)
5185 #define MEF_ACTION_ALLOW (1 << 1)
5186 #define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
5187 #define MEF_AUTO_ARP 0x10
5188 #define MEF_AUTO_PING 0x20
5189 #define MEF_NS_RESP 0x40
5190 #define MEF_MAGIC_PKT 0x80
5191 #define CRITERIA_BROADCAST BIT(0)
5192 #define CRITERIA_UNICAST BIT(1)
5193 #define CRITERIA_MULTICAST BIT(3)
5194 
5195 #define MAX_NUM_ENTRIES 8
5196 #define MAX_NUM_BYTE_SEQ 6
5197 #define MAX_NUM_MASK_SEQ 6
5198 
5199 #define OPERAND_DNUM 1
5200 #define OPERAND_BYTE_SEQ 2
5201 
5202 #define MAX_OPERAND 0x40
5203 #define TYPE_BYTE_EQ (MAX_OPERAND + 1)
5204 #define TYPE_DNUM_EQ (MAX_OPERAND + 2)
5205 #define TYPE_BIT_EQ (MAX_OPERAND + 3)
5206 
5207 #define RPN_TYPE_AND (MAX_OPERAND + 4)
5208 #define RPN_TYPE_OR (MAX_OPERAND + 5)
5209 
5210 #define ICMP_OF_IP_PROTOCOL 0x01
5211 #define TCP_OF_IP_PROTOCOL 0x06
5212 #define UDP_OF_IP_PROTOCOL 0x11
5213 
5214 #define IPV4_PKT_OFFSET 20
5215 #define IP_PROTOCOL_OFFSET 31
5216 #define PORT_PROTOCOL_OFFSET 44
5217 
5218 #define FILLING_TYPE MBIT(0)
5219 #define FILLING_PATTERN MBIT(1)
5220 #define FILLING_OFFSET MBIT(2)
5221 #define FILLING_NUM_BYTES MBIT(3)
5222 #define FILLING_REPEAT MBIT(4)
5223 #define FILLING_BYTE_SEQ MBIT(5)
5224 #define FILLING_MASK_SEQ MBIT(6)
5225 
5226 /** Type definition of filter_item
5227  *  Support three match methods:
5228  *  <1>Byte comparison type=0x41
5229  *  <2>Decimal comparison type=0x42
5230  *  <3>Bit comparison type=0x43
5231  */
5232 typedef struct _mef_filter_t {
5233 	/** flag*/
5234 	t_u32 fill_flag;
5235 	/** BYTE 0X41; Decimal 0X42; Bit 0x43*/
5236 	t_u16 type;
5237 	/** value*/
5238 	t_u32 pattern;
5239 	/** offset*/
5240 	t_u16 offset;
5241 	/** number of bytes*/
5242 	t_u16 num_bytes;
5243 	/** repeat*/
5244 	t_u16 repeat;
5245 	/** byte number*/
5246 	t_u8 num_byte_seq;
5247 	/** array*/
5248 	t_u8 byte_seq[MAX_NUM_BYTE_SEQ];
5249 	/** mask numbers*/
5250 	t_u8 num_mask_seq;
5251 	/** array*/
5252 	t_u8 mask_seq[MAX_NUM_MASK_SEQ];
5253 } mef_filter_t;
5254 
5255 typedef struct _mef_entry_t {
5256 	/** mode: bit0--hostsleep mode; bit1--non hostsleep mode */
5257 	t_u8 mode;
5258 	/** action: 0--discard and not wake host;
5259 		    1--discard and wake host;
5260 		    3--allow and wake host;*/
5261 	t_u8 action;
5262 	/** filter number */
5263 	t_u8 filter_num;
5264 	/** filter array*/
5265 	mef_filter_t filter_item[MAX_NUM_FILTERS];
5266 	/** rpn array*/
5267 	t_u8 rpn[MAX_NUM_FILTERS];
5268 } mef_entry_t;
5269 
5270 /** Type definition of mlan_ds_nvflt_mef_entry
5271  *for MLAN_OID_MISC_MEF_FLT_CFG
5272  */
5273 typedef struct _mlan_ds_misc_mef_flt_cfg {
5274 	/** Type of action*/
5275 	int mef_act_type;
5276 	/** Operation code*/
5277 	t_u32 op_code;
5278 	/** NV Filter Criteria*/
5279 	t_u32 criteria;
5280 	/** NV MEF entry*/
5281 	mef_entry_t mef_entry;
5282 } mlan_ds_misc_mef_flt_cfg;
5283 
5284 /** Enumeration for action type*/
5285 enum _mlan_act_mef_act_type {
5286 	MEF_ACT_ADD = 1,
5287 	MEF_ACT_ENABLE,
5288 	MEF_ACT_DISABLE,
5289 	MEF_ACT_CANCEL,
5290 	MEF_ACT_AUTOARP,
5291 	MEF_ACT_WOWLAN,
5292 	MEF_ACT_IPV6_NS,
5293 };
5294 
5295 typedef struct _mlan_ds_sensor_temp {
5296 	t_u32 temperature;
5297 } mlan_ds_sensor_temp;
5298 
5299 #define MLAN_KCK_LEN 16
5300 #define MLAN_KEK_LEN 16
5301 #define MLAN_REPLAY_CTR_LEN 8
5302 /** mlan_ds_misc_gtk_rekey_data */
5303 typedef struct _mlan_ds_misc_gtk_rekey_data {
5304 	/** key encryption key */
5305 	t_u8 kek[MLAN_KEK_LEN];
5306 	/** key confirmation key */
5307 	t_u8 kck[MLAN_KCK_LEN];
5308 	/** replay counter */
5309 	t_u8 replay_ctr[MLAN_REPLAY_CTR_LEN];
5310 } mlan_ds_misc_gtk_rekey_data;
5311 typedef struct _mlan_ds_bw_chan_oper {
5312 	/* bandwidth 20:20M 40:40M 80:80M*/
5313 	t_u8 bandwidth;
5314 	/* channel number */
5315 	t_u8 channel;
5316 	/* Non-global operating class */
5317 	t_u8 oper_class;
5318 } mlan_ds_bw_chan_oper;
5319 
5320 typedef struct _mlan_ds_ind_rst_cfg {
5321 	/** Set or Get */
5322 	t_u16 action;
5323 	/** oob mode enable/ disable */
5324 	t_u8 ir_mode;
5325 	/** gpio pin */
5326 	t_u8 gpio_pin;
5327 } mlan_ds_ind_rst_cfg;
5328 
5329 #define MKEEP_ALIVE_IP_PKT_MAX 256
5330 typedef struct _mlan_ds_misc_keep_alive {
5331 	t_u8 mkeep_alive_id;
5332 	t_u8 enable;
5333 	/** enable/disable tcp reset*/
5334 	t_u8 reset;
5335 	/**True means saved in driver, false means not saved or download*/
5336 	t_u8 cached;
5337 	t_u32 send_interval;
5338 	t_u16 retry_interval;
5339 	t_u16 retry_count;
5340 	t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH];
5341 	t_u8 src_mac[MLAN_MAC_ADDR_LENGTH];
5342 	t_u16 pkt_len;
5343 	t_u8 packet[MKEEP_ALIVE_IP_PKT_MAX];
5344 	/** Ethernet type */
5345 	t_u16 ether_type;
5346 } mlan_ds_misc_keep_alive, *pmlan_ds_misc_keep_alive;
5347 
5348 /** TX and RX histogram statistic parameters*/
5349 typedef MLAN_PACK_START struct _mlan_ds_misc_tx_rx_histogram {
5350 	/** Enable or disable get tx/rx histogram statistic */
5351 	t_u8 enable;
5352 	/** Choose to get TX, RX or both histogram statistic */
5353 	t_u16 action;
5354 	/** Size of Tx/Rx info */
5355 	t_u16 size;
5356 	/** Store Tx/Rx info */
5357 	t_u8 value[1];
5358 } MLAN_PACK_END mlan_ds_misc_tx_rx_histogram;
5359 
5360 typedef MLAN_PACK_START struct _mlan_ds_cw_mode_ctrl {
5361 	/** Mode of Operation 0: Disable 1: Tx Continuous Packet 2: Tx
5362 	 * Continuous Wave */
5363 	t_u8 mode;
5364 	/*channel*/
5365 	t_u8 channel;
5366 	/* channel info*/
5367 	t_u8 chanInfo;
5368 	/** Tx Power level in dBm */
5369 	t_u16 txPower;
5370 	/** Packet Length */
5371 	t_u16 pktLength;
5372 	/** bit rate Info */
5373 	t_u32 rateInfo;
5374 } MLAN_PACK_END mlan_ds_cw_mode_ctrl;
5375 
5376 #define RX_PKT_INFO MBIT(1)
5377 /** Struct for per-packet configuration */
5378 typedef struct _mlan_per_pkt_cfg {
5379 	/** Type ID*/
5380 	t_u16 type;
5381 	/** Length of payload*/
5382 	t_u16 len;
5383 	/**  Tx/Rx per-packet control */
5384 	t_u8 tx_rx_control;
5385 	/** Number of ethernet types in ether_type array */
5386 	t_u8 proto_type_num;
5387 	/** Array of ether_type for per-packet control */
5388 	t_u16 ether_type[];
5389 } mlan_per_pkt_cfg;
5390 
5391 /** Type definition of mlan_ds_misc_robustcoex_params for MLAN_IOCTL_MISC_CFG */
5392 typedef struct _mlan_ds_misc_robustcoex_params {
5393 	t_u16 method;
5394 	/** enable/disable robustcoex gpio cfg */
5395 	t_u8 enable;
5396 	/** Number of GPIO */
5397 	t_u8 gpio_num;
5398 	/** Polarity of GPIO */
5399 	t_u8 gpio_polarity;
5400 } mlan_ds_misc_robustcoex_params;
5401 
5402 #if defined(PCIE)
5403 typedef struct _mlan_ds_ssu_params {
5404 	t_u32 nskip;
5405 	t_u32 nsel;
5406 	t_u32 adcdownsample;
5407 	t_u32 mask_adc_pkt;
5408 	t_u32 out_16bits;
5409 	t_u32 spec_pwr_enable;
5410 	t_u32 rate_deduction;
5411 	t_u32 n_pkt_avg;
5412 } mlan_ds_ssu_params;
5413 #endif
5414 
5415 #define CSI_FILTER_MAX 16
5416 /** Structure of CSI filters */
5417 typedef MLAN_PACK_START struct _mlan_csi_filter_t {
5418 	/** Source address of the packet to receive */
5419 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
5420 	/** Pakcet type of the interested CSI */
5421 	t_u8 pkt_type;
5422 	/* Packet subtype of the interested CSI */
5423 	t_u8 subtype;
5424 	/* Other filter flags */
5425 	t_u8 flags;
5426 } MLAN_PACK_END mlan_csi_filter_t;
5427 /** Structure of CSI parameters */
5428 typedef MLAN_PACK_START struct _mlan_ds_csi_params {
5429 	/** CSI enable flag. 1: enable, 0: disable */
5430 	t_u16 csi_enable;
5431 	/** Header ID*/
5432 	t_u32 head_id;
5433 	/** Tail ID */
5434 	t_u32 tail_id;
5435 	/** Number of CSI filters */
5436 	t_u8 csi_filter_cnt;
5437 	/** Chip ID */
5438 	t_u8 chip_id;
5439 	/** CSI filters */
5440 	mlan_csi_filter_t csi_filter[CSI_FILTER_MAX];
5441 } MLAN_PACK_END mlan_ds_csi_params;
5442 
5443 typedef MLAN_PACK_START struct _mlan_ds_hal_phy_cfg_params {
5444 	/** 11b pwr spectral density mask enable/disable */
5445 	t_u8 dot11b_psd_mask_cfg;
5446 	/** reserved fields for future hal/phy cfg use */
5447 	t_u8 reserved[7];
5448 } MLAN_PACK_END mlan_ds_hal_phy_cfg_params;
5449 
5450 #define MAX_NUM_MAC 2
5451 /** Type definition of mlan_ds_misc_mapping_policy */
5452 typedef struct _mlan_ds_misc_mapping_policy {
5453 	/** Enable/disable dynamic mapping */
5454 	t_u16 subcmd;
5455 	/** Mapping policy */
5456 	t_u8 mapping_policy;
5457 } mlan_ds_misc_mapping_policy, *pmlan_ds_misc_mapping_policy;
5458 
5459 typedef struct _dmcsChanStatus_t {
5460 	/** Channel number */
5461 	t_u8 channel;
5462 	/** Number of ap on this channel */
5463 	t_u8 ap_count;
5464 	/** Number of sta on this channel */
5465 	t_u8 sta_count;
5466 } dmcsChanStatus_t, *pdmcsChanStatus_t;
5467 
5468 typedef struct _dmcsStatus_t {
5469 	/** Radio ID */
5470 	t_u8 radio_id;
5471 	/** Running mode
5472 	** 0 - Idle
5473 	** 1 - DBC
5474 	** 2 - DRCS
5475 	*/
5476 	t_u8 running_mode;
5477 	/** Current channel status */
5478 	dmcsChanStatus_t chan_status[2];
5479 } dmcsStatus_t, *pdmcsStatus_t;
5480 
5481 /** Type definition of mlan_ds_misc_dmcs_status */
5482 typedef struct _mlan_ds_misc_dmcs_status {
5483 	t_u8 mapping_policy;
5484 	dmcsStatus_t radio_status[MAX_NUM_MAC];
5485 } mlan_ds_misc_dmcs_status, *pmlan_ds_misc_dmcs_status;
5486 
5487 /** Type definition of mlan_ds_misc_chan_trpc_cfg for
5488  * MLAN_OID_MISC_GET_CHAN_TRPC_CFG */
5489 typedef struct _mlan_ds_misc_chan_trpc_cfg {
5490 	/** sub_band */
5491 	t_u16 sub_band;
5492 	/** length */
5493 	t_u16 length;
5494 	/** buf */
5495 	t_u8 trpc_buf[2048];
5496 } mlan_ds_misc_chan_trpc_cfg;
5497 
5498 #define MFG_CMD_SET_TEST_MODE 1
5499 #define MFG_CMD_UNSET_TEST_MODE 0
5500 #define MFG_CMD_TX_ANT 0x1004
5501 #define MFG_CMD_RX_ANT 0x1005
5502 #define MFG_CMD_TX_CONT 0x1009
5503 #define MFG_CMD_RF_CHAN 0x100A
5504 #define MFG_CMD_CLR_RX_ERR 0x1010
5505 #define MFG_CMD_TX_FRAME 0x1021
5506 #define MFG_CMD_RFPWR 0x1033
5507 #define MFG_CMD_RF_BAND_AG 0x1034
5508 #define MFG_CMD_RF_CHANNELBW 0x1044
5509 #define MFG_CMD_RADIO_MODE_CFG 0x1211
5510 #define MFG_CMD_CONFIG_MAC_HE_TB_TX 0x110A
5511 /** MFG CMD generic cfg */
5512 struct MLAN_PACK_START mfg_cmd_generic_cfg {
5513 	/** MFG command code */
5514 	t_u32 mfg_cmd;
5515 	/** Action */
5516 	t_u16 action;
5517 	/** Device ID */
5518 	t_u16 device_id;
5519 	/** MFG Error code */
5520 	t_u32 error;
5521 	/** value 1 */
5522 	t_u32 data1;
5523 	/** value 2 */
5524 	t_u32 data2;
5525 	/** value 3 */
5526 	t_u32 data3;
5527 } MLAN_PACK_END;
5528 
5529 /** MFG CMD Tx Frame 2 */
5530 struct MLAN_PACK_START mfg_cmd_tx_frame2 {
5531 	/** MFG command code */
5532 	t_u32 mfg_cmd;
5533 	/** Action */
5534 	t_u16 action;
5535 	/** Device ID */
5536 	t_u16 device_id;
5537 	/** MFG Error code */
5538 	t_u32 error;
5539 	/** enable */
5540 	t_u32 enable;
5541 	/** data_rate */
5542 	t_u32 data_rate;
5543 	/** frame pattern */
5544 	t_u32 frame_pattern;
5545 	/** frame length */
5546 	t_u32 frame_length;
5547 	/** BSSID */
5548 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
5549 	/** Adjust burst sifs */
5550 	t_u16 adjust_burst_sifs;
5551 	/** Burst sifs in us*/
5552 	t_u32 burst_sifs_in_us;
5553 	/** short preamble */
5554 	t_u32 short_preamble;
5555 	/** active sub channel */
5556 	t_u32 act_sub_ch;
5557 	/** short GI */
5558 	t_u32 short_gi;
5559 	/** Adv coding */
5560 	t_u32 adv_coding;
5561 	/** Tx beamforming */
5562 	t_u32 tx_bf;
5563 	/** HT Greenfield Mode*/
5564 	t_u32 gf_mode;
5565 	/** STBC */
5566 	t_u32 stbc;
5567 	/** power id */
5568 	t_u32 rsvd[2];
5569 	/** NumPkt */
5570 	t_u32 NumPkt;
5571 	/** MaxPE */
5572 	t_u32 MaxPE;
5573 	/** BeamChange */
5574 	t_u32 BeamChange;
5575 	/** Dcm */
5576 	t_u32 Dcm;
5577 	/** Doppler */
5578 	t_u32 Doppler;
5579 	/** MidP */
5580 	t_u32 MidP;
5581 	/** QNum */
5582 	t_u32 QNum;
5583 
5584 } MLAN_PACK_END;
5585 
5586 /* MFG CMD Tx Continuous */
5587 struct MLAN_PACK_START mfg_cmd_tx_cont {
5588 	/** MFG command code */
5589 	t_u32 mfg_cmd;
5590 	/** Action */
5591 	t_u16 action;
5592 	/** Device ID */
5593 	t_u16 device_id;
5594 	/** MFG Error code */
5595 	t_u32 error;
5596 	/** enable Tx*/
5597 	t_u32 enable_tx;
5598 	/** Continuous Wave mode */
5599 	t_u32 cw_mode;
5600 	/** payload pattern */
5601 	t_u32 payload_pattern;
5602 	/** CS Mode */
5603 	t_u32 cs_mode;
5604 	/** active sub channel */
5605 	t_u32 act_sub_ch;
5606 	/** Tx rate */
5607 	t_u32 tx_rate;
5608 	/** power id */
5609 	t_u32 rsvd;
5610 } MLAN_PACK_END;
5611 
5612 struct MLAN_PACK_START mfg_Cmd_HE_TBTx_t {
5613 	/** MFG command code */
5614 	t_u32 mfg_cmd;
5615 	/** Action */
5616 	t_u16 action;
5617 	/** Device ID */
5618 	t_u16 device_id;
5619 	/** MFG Error code */
5620 	t_u32 error;
5621 	/** Enable Tx */
5622 	t_u16 enable;
5623 	/** Q num */
5624 	t_u16 qnum;
5625 	/** AID */
5626 	t_u16 aid;
5627 	/** AXQ Mu Timer */
5628 	t_u16 axq_mu_timer;
5629 	/** Tx Power */
5630 	t_u16 tx_power;
5631 } MLAN_PACK_END;
5632 
5633 typedef struct _mlan_ds_misc_chnrgpwr_cfg {
5634 	/** length */
5635 	t_u16 length;
5636 	/** chnrgpwr buf */
5637 	t_u8 chnrgpwr_buf[2048];
5638 } mlan_ds_misc_chnrgpwr_cfg;
5639 
5640 /** dfs chan list for MLAN_OID_MISC_CFP_TABLE */
5641 typedef struct _mlan_ds_misc_cfp_tbl {
5642 	/** band */
5643 	t_u8 band;
5644 	/** num chan */
5645 	t_u8 num_chan;
5646 	/** cfp table */
5647 	chan_freq_power_t cfp_tbl[];
5648 } mlan_ds_misc_cfp_tbl;
5649 
5650 /** mlan_ds_mc_aggr_cfg for MLAN_OID_MISC_MC_AGGR_CFG */
5651 typedef struct _mlan_ds_mc_aggr_cfg {
5652 	/** action */
5653 	t_u8 action;
5654 	/* 1 enable, 0 disable
5655 	 * bit 0 MC aggregation
5656 	 * bit 1 packet expiry
5657 	 * bit 2 CTS2Self
5658 	 * bit 3 CTS2Self duration offset*/
5659 	t_u8 enable_bitmap;
5660 	/* 1 valid, 0 invalid
5661 	 * bit 0 MC aggregation
5662 	 * bit 1 packet expiry
5663 	 * bit 2 CTS2Self
5664 	 * bit 3 CTS2Self duration offset*/
5665 	t_u8 mask_bitmap;
5666 	/** CTS2Self duration offset */
5667 	t_u16 cts2self_offset;
5668 } mlan_ds_mc_aggr_cfg;
5669 
5670 /** mlan_ds_stats */
5671 typedef struct _mlan_ds_stats {
5672 	/** action */
5673 	t_u16 action;
5674 	/** tlv len */
5675 	t_u16 tlv_len;
5676 	/** TLV buffer */
5677 	t_u8 tlv_buf[1];
5678 } mlan_ds_stats;
5679 
5680 typedef struct _mlan_ds_ch_load {
5681 	/** action */
5682 	t_u8 action;
5683 	t_u16 ch_load_param;
5684 	t_s16 noise;
5685 	t_u16 rx_quality;
5686 	t_u16 duration;
5687 } mlan_ds_ch_load;
5688 
5689 /** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */
5690 typedef struct _mlan_ds_misc_cfg {
5691 	/** Sub-command */
5692 	t_u32 sub_command;
5693 	/** Miscellaneous configuration parameter */
5694 	union {
5695 		/** Generic IE for MLAN_OID_MISC_GEN_IE */
5696 		mlan_ds_misc_gen_ie gen_ie;
5697 		/** Region code for MLAN_OID_MISC_REGION */
5698 		t_u32 region_code;
5699 #ifdef SDIO
5700 		/** SDIO MP-A Ctrl command for MLAN_OID_MISC_SDIO_MPA_CTRL */
5701 		mlan_ds_misc_sdio_mpa_ctrl mpa_ctrl;
5702 #endif
5703 		/** Hostcmd for MLAN_OID_MISC_HOST_CMD */
5704 		mlan_ds_misc_cmd hostcmd;
5705 		/** System clock for MLAN_OID_MISC_SYS_CLOCK */
5706 		mlan_ds_misc_sys_clock sys_clock;
5707 		/** WWS set/get for MLAN_OID_MISC_WWS */
5708 		t_u32 wws_cfg;
5709 		/** Get associate response for MLAN_OID_MISC_ASSOC_RSP */
5710 		mlan_ds_misc_assoc_rsp assoc_resp;
5711 		/** Get associate request for MLAN_OID_MISC_ASSOC_REQ */
5712 		mlan_ds_misc_assoc_req assoc_req;
5713 		/** Function init/shutdown for MLAN_OID_MISC_INIT_SHUTDOWN */
5714 		t_u32 func_init_shutdown;
5715 		/** Custom IE for MLAN_OID_MISC_CUSTOM_IE */
5716 		mlan_ds_misc_custom_ie cust_ie;
5717 		t_u16 tdls_idle_time;
5718 		/** Config dynamic bandwidth*/
5719 		t_u16 dyn_bw;
5720 		/** TDLS configuration for MLAN_OID_MISC_TDLS_CONFIG */
5721 		mlan_ds_misc_tdls_config tdls_config;
5722 		/** TDLS operation for MLAN_OID_MISC_TDLS_OPER */
5723 		mlan_ds_misc_tdls_oper tdls_oper;
5724 		/** TDLS ies for  MLAN_OID_MISC_GET_TDLS_IES */
5725 		mlan_ds_misc_tdls_ies tdls_ies;
5726 		/**tdls cs off channel*/
5727 		t_u8 tdls_cs_channel;
5728 		/** Net monitor for MLAN_OID_MISC_NET_MONITOR */
5729 		mlan_ds_misc_net_monitor net_mon;
5730 		/** Tx data pause for MLAN_OID_MISC_TX_DATAPAUSE */
5731 		mlan_ds_misc_tx_datapause tx_datapause;
5732 		/** IP address configuration */
5733 		mlan_ds_misc_ipaddr_cfg ipaddr_cfg;
5734 		/** IPv6 Router Advertisement offload configuration */
5735 		mlan_ds_misc_ipv6_ra_offload ipv6_ra_offload;
5736 		/** MAC control for MLAN_OID_MISC_MAC_CONTROL */
5737 		t_u32 mac_ctrl;
5738 		/** MEF configuration for MLAN_OID_MISC_MEF_CFG */
5739 		mlan_ds_misc_mef_cfg mef_cfg;
5740 		/** CFP code for MLAN_OID_MISC_CFP_CODE */
5741 		mlan_ds_misc_cfp_code cfp_code;
5742 		/** Country code for MLAN_OID_MISC_COUNTRY_CODE */
5743 		mlan_ds_misc_country_code country_code;
5744 		/** Thermal reading for MLAN_OID_MISC_THERMAL */
5745 		t_u32 thermal;
5746 		/** Mgmt subtype mask for MLAN_OID_MISC_RX_MGMT_IND */
5747 		t_u32 mgmt_subtype_mask;
5748 		/** subscribe event for MLAN_OID_MISC_SUBSCRIBE_EVENT */
5749 		mlan_ds_subscribe_evt subscribe_event;
5750 #ifdef DEBUG_LEVEL1
5751 		/** Driver debug bit masks */
5752 		t_u32 drvdbg;
5753 #endif
5754 		/** Hotspot config param set */
5755 		t_u32 hotspot_cfg;
5756 #ifdef STA_SUPPORT
5757 		ExtCap_t ext_cap;
5758 #endif
5759 		mlan_ds_misc_otp_user_data otp_user_data;
5760 		/** fw re-connect cfg param set */
5761 		mlan_ds_fw_reconnect fw_auto_reconnect;
5762 #ifdef USB
5763 		/** USB aggregation parameters for MLAN_OID_MISC_USB_AGGR_CTRL
5764 		 */
5765 		mlan_ds_misc_usb_aggr_ctrl usb_aggr_params;
5766 #endif
5767 		mlan_ds_misc_aggr_ctrl aggr_params;
5768 		/** Tx control */
5769 		t_u32 tx_control;
5770 #if defined(STA_SUPPORT)
5771 		mlan_ds_misc_pmfcfg pmfcfg;
5772 #endif
5773 #ifdef WIFI_DIRECT_SUPPORT
5774 		mlan_ds_wifi_direct_config p2p_config;
5775 #endif
5776 		mlan_ds_gpio_tsf_latch gpio_tsf_latch_config;
5777 		mlan_ds_tsf_info tsf_info;
5778 		mlan_ds_coalesce_cfg coalesce_cfg;
5779 		t_u8 low_pwr_mode;
5780 		/** MEF-FLT-CONFIG for MLAN_OID_MISC_NV_FLT_CFG */
5781 		mlan_ds_misc_mef_flt_cfg mef_flt_cfg;
5782 		mlan_ds_misc_dfs_repeater dfs_repeater;
5783 #ifdef RX_PACKET_COALESCE
5784 		mlan_ds_misc_rx_packet_coalesce rx_coalesce;
5785 #endif
5786 		/** FW reload flag */
5787 		t_u8 fw_reload;
5788 		mlan_ds_sensor_temp sensor_temp;
5789 		/** GTK rekey data */
5790 		mlan_ds_misc_gtk_rekey_data gtk_rekey;
5791 		mlan_ds_bw_chan_oper bw_chan_oper;
5792 		mlan_ds_ind_rst_cfg ind_rst_cfg;
5793 		/** Roam offload */
5794 		mlan_ds_misc_roam_offload roam_offload;
5795 		t_u64 misc_tsf;
5796 		mlan_ds_custom_reg_domain custom_reg_domain;
5797 		mlan_ds_misc_keep_alive keep_alive;
5798 		mlan_ds_misc_tx_rx_histogram tx_rx_histogram;
5799 		mlan_ds_cw_mode_ctrl cwmode;
5800 		/**  Tx/Rx per-packet control */
5801 		t_u8 txrx_pkt_ctrl;
5802 		mlan_ds_misc_robustcoex_params robustcoexparams;
5803 #if defined(PCIE)
5804 		mlan_ds_ssu_params ssu_params;
5805 #endif
5806 		mlan_ds_csi_params csi_params;
5807 		/** boot sleep enable or disable */
5808 		t_u16 boot_sleep;
5809 		/** Mapping Policy */
5810 		mlan_ds_misc_mapping_policy dmcs_policy;
5811 		mlan_ds_misc_dmcs_status dmcs_status;
5812 		mlan_ds_misc_rx_abort_cfg rx_abort_cfg;
5813 		mlan_ds_misc_rx_abort_cfg_ext rx_abort_cfg_ext;
5814 		mlan_ds_misc_tx_ampdu_prot_mode tx_ampdu_prot_mode;
5815 		mlan_ds_misc_rate_adapt_cfg rate_adapt_cfg;
5816 		mlan_ds_misc_cck_desense_cfg cck_desense_cfg;
5817 		mlan_ds_misc_chan_trpc_cfg trpc_cfg;
5818 		mlan_ds_misc_chnrgpwr_cfg rgchnpwr_cfg;
5819 
5820 		mlan_ds_band_steer_cfg band_steer_cfg;
5821 		mlan_ds_beacon_stuck_param_cfg beacon_stuck_cfg;
5822 		struct mfg_cmd_generic_cfg mfg_generic_cfg;
5823 		struct mfg_cmd_tx_cont mfg_tx_cont;
5824 		struct mfg_cmd_tx_frame2 mfg_tx_frame2;
5825 		struct mfg_Cmd_HE_TBTx_t mfg_he_power;
5826 		mlan_ds_misc_arb_cfg arb_cfg;
5827 		mlan_ds_misc_cfp_tbl cfp;
5828 		t_u8 range_ext_mode;
5829 		mlan_ds_misc_dot11mc_unassoc_ftm_cfg dot11mc_unassoc_ftm_cfg;
5830 		mlan_ds_misc_tp_state tp_state;
5831 		mlan_ds_hal_phy_cfg_params hal_phy_cfg_params;
5832 		mlan_ds_mc_aggr_cfg mc_aggr_cfg;
5833 		mlan_ds_stats stats;
5834 #ifdef UAP_SUPPORT
5835 		t_u8 wacp_mode;
5836 #endif
5837 		t_u32 ips_ctrl;
5838 		mlan_ds_ch_load ch_load;
5839 	} param;
5840 } mlan_ds_misc_cfg, *pmlan_ds_misc_cfg;
5841 
5842 /** Hotspot status enable */
5843 #define HOTSPOT_ENABLED MBIT(0)
5844 /** Hotspot status disable */
5845 #define HOTSPOT_DISABLED MFALSE
5846 /** Keep Hotspot2.0 compatible in mwu and wpa_supplicant */
5847 #define HOTSPOT_BY_SUPPLICANT MBIT(1)
5848 
5849 /** Reason codes */
5850 #define MLAN_REASON_UNSPECIFIED 1
5851 #define MLAN_REASON_PREV_AUTH_NOT_VALID 2
5852 #define MLAN_REASON_DEAUTH_LEAVING 3
5853 #define MLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
5854 #define MLAN_REASON_DISASSOC_AP_BUSY 5
5855 #define MLAN_REASON_CLASS2_FRAME_FROM_NOAUTH_STA 6
5856 #define MLAN_REASON_CLASS3_FRAME_FROM_NOASSOC_STA 7
5857 #define MLAN_REASON_DISASSOC_STA_HAS_LEFT 8
5858 #define MLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
5859 #endif /* !_MLAN_IOCTL_H_ */
5860