xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/mlan_fw.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file mlan_fw.h
2  *
3  *  @brief This file contains firmware specific defines.
4  *  structures and declares global function prototypes used
5  *  in MLAN module.
6  *
7  *  Copyright (C) 2008-2017, Marvell International Ltd.
8  *
9  *  This software file (the "File") is distributed by Marvell International
10  *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
11  *  (the "License").  You may use, redistribute and/or modify this File in
12  *  accordance with the terms and conditions of the License, a copy of which
13  *  is available by writing to the Free Software Foundation, Inc.,
14  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
15  *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
16  *
17  *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
18  *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
19  *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
20  *  this warranty disclaimer.
21  */
22 
23 /******************************************************
24 Change log:
25     10/27/2008: initial version
26 ******************************************************/
27 
28 #ifndef _MLAN_FW_H_
29 #define _MLAN_FW_H_
30 
31 /** Interface header length */
32 #define INTF_HEADER_LEN     4
33 
34 #ifdef PRAGMA_PACK
35 #pragma pack(push, 1)
36 #endif
37 
38 /** Ethernet header */
39 typedef MLAN_PACK_START struct {
40     /** Ethernet header destination address */
41 	t_u8 dest_addr[MLAN_MAC_ADDR_LENGTH];
42     /** Ethernet header source address */
43 	t_u8 src_addr[MLAN_MAC_ADDR_LENGTH];
44     /** Ethernet header length */
45 	t_u16 h803_len;
46 
47 } MLAN_PACK_END Eth803Hdr_t;
48 
49 /** RFC 1042 header */
50 typedef MLAN_PACK_START struct {
51     /** LLC DSAP */
52 	t_u8 llc_dsap;
53     /** LLC SSAP */
54 	t_u8 llc_ssap;
55     /** LLC CTRL */
56 	t_u8 llc_ctrl;
57     /** SNAP OUI */
58 	t_u8 snap_oui[3];
59     /** SNAP type */
60 	t_u16 snap_type;
61 
62 } MLAN_PACK_END Rfc1042Hdr_t;
63 
64 /** Rx packet header */
65 typedef MLAN_PACK_START struct {
66     /** Etherner header */
67 	Eth803Hdr_t eth803_hdr;
68     /** RFC 1042 header */
69 	Rfc1042Hdr_t rfc1042_hdr;
70 
71 } MLAN_PACK_END RxPacketHdr_t;
72 
73 /** Rates supported in band B */
74 #define B_SUPPORTED_RATES               5
75 /** Rates supported in band G */
76 #define G_SUPPORTED_RATES               9
77 /** Rates supported in band BG */
78 #define BG_SUPPORTED_RATES              13
79 
80 /** Setup the number of rates passed in the driver/firmware API */
81 #define A_SUPPORTED_RATES               9
82 
83 /** CapInfo Short Slot Time Disabled */
84 /* #define SHORT_SLOT_TIME_DISABLED(CapInfo) ((IEEEtypes_CapInfo_t)(CapInfo).short_slot_time = 0) */
85 #define SHORT_SLOT_TIME_DISABLED(CapInfo) (CapInfo &= ~MBIT(10))
86 /** CapInfo Short Slot Time Enabled */
87 #define SHORT_SLOT_TIME_ENABLED(CapInfo)  (CapInfo |= MBIT(10))
88 /** CapInfo Spectrum Mgmt Disabled */
89 #define SPECTRUM_MGMT_DISABLED(CapInfo) (CapInfo &= ~MBIT(8))
90 /** CapInfo Spectrum Mgmt Enabled */
91 #define SPECTRUM_MGMT_ENABLED(CapInfo)  ( CapInfo |= MBIT(8))
92 /** CapInfo Radio Measurement Disabled */
93 #define RADIO_MEASUREMENT_DISABLED(CapInfo) (CapInfo &= ~MBIT(12))
94 /** CapInfo Radio Measurement Enabled */
95 #define RADIO_MEASUREMENT_ENABLED(CapInfo)  ( CapInfo |= MBIT(12))
96 
97 /** Setup the number of rates passed in the driver/firmware API */
98 #define HOSTCMD_SUPPORTED_RATES         14
99 
100 /** Rates supported in band N */
101 #define N_SUPPORTED_RATES               3
102 #ifdef STA_SUPPORT
103 /** All bands (B, G, N) */
104 #define ALL_802_11_BANDS           (BAND_A | BAND_B | BAND_G | BAND_GN)
105 #else
106 /** All bands (B, G, A) */
107 #define ALL_802_11_BANDS        (BAND_B | BAND_G | BAND_A)
108 #endif /* STA_SUPPORT */
109 
110 #ifdef STA_SUPPORT
111 /** Firmware multiple bands support */
112 #define FW_MULTI_BANDS_SUPPORT  (MBIT(8) | MBIT(9) | MBIT(10) | MBIT(11))
113 #else
114 /** Firmware multiple bands support */
115 #define FW_MULTI_BANDS_SUPPORT  (MBIT(8) | MBIT(9) | MBIT(10))
116 #endif /* STA_SUPPORT */
117 /** Check if multiple bands support is enabled in firmware */
118 #define IS_SUPPORT_MULTI_BANDS(_adapter)        \
119 	(_adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
120 /** Get default bands of the firmware */
121 #define GET_FW_DEFAULT_BANDS(_adapter)  \
122 	((_adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
123 
124 extern t_u8 SupportedRates_B[B_SUPPORTED_RATES];
125 extern t_u8 SupportedRates_G[G_SUPPORTED_RATES];
126 extern t_u8 SupportedRates_BG[BG_SUPPORTED_RATES];
127 extern t_u8 SupportedRates_A[A_SUPPORTED_RATES];
128 extern t_u8 SupportedRates_N[N_SUPPORTED_RATES];
129 extern t_u8 AdhocRates_G[G_SUPPORTED_RATES];
130 extern t_u8 AdhocRates_B[B_SUPPORTED_RATES];
131 extern t_u8 AdhocRates_BG[BG_SUPPORTED_RATES];
132 extern t_u8 AdhocRates_A[A_SUPPORTED_RATES];
133 
134 /** Firmware wakeup method : Unchanged */
135 #define WAKEUP_FW_UNCHANGED                     0
136 /** Firmware wakeup method : Through interface */
137 #define WAKEUP_FW_THRU_INTERFACE                1
138 /** Firmware wakeup method : Through GPIO*/
139 #define WAKEUP_FW_THRU_GPIO                     2
140 /** Default value of GPIO */
141 #define DEF_WAKEUP_FW_GPIO                      0
142 
143 /** Default auto deep sleep mode */
144 #define DEFAULT_AUTO_DS_MODE                  MTRUE
145 /** Default power save mode */
146 #define DEFAULT_PS_MODE                 Wlan802_11PowerModePSP
147 
148 #define EVENT_NAN_GENERIC 0x00000075
149 #define NAN_EVT_SUBTYPE_SD_EVENT 0
150 #define NAN_EVT_SUBTYPE_NAN_STARTED 1
151 #define NAN_EVT_SUBTYPE_SDF_TX_DONE 2
152 
153 #define EVENT_WLS_FTM_COMPLETE 0x00000086
154 
155 #define WLS_SUB_EVENT_FTM_COMPLETE          0
156 #define WLS_SUB_EVENT_RADIO_RECEIVED        1
157 #define WLS_SUB_EVENT_RADIO_RPT_RECEIVED    2
158 #define WLS_SUB_EVENT_ANQP_RESP_RECEIVED    3
159 
160 /** WEP Key index mask */
161 #define HostCmd_WEP_KEY_INDEX_MASK              0x3fff
162 /** Length of WEP 40 bit key */
163 #define WEP_40_BIT_LEN  5
164 /** Length of WEP 104 bit key */
165 #define WEP_104_BIT_LEN 13
166 
167 /** Key information enabled */
168 #define KEY_INFO_ENABLED        0x01
169 /** KEY_TYPE_ID */
170 typedef enum _KEY_TYPE_ID {
171     /** Key type : WEP */
172 	KEY_TYPE_ID_WEP = 0,
173     /** Key type : TKIP */
174 	KEY_TYPE_ID_TKIP = 1,
175     /** Key type : AES */
176 	KEY_TYPE_ID_AES = 2,
177 	KEY_TYPE_ID_WAPI = 3,
178 	KEY_TYPE_ID_AES_CMAC = 4,
179 } KEY_TYPE_ID;
180 
181 /** Key Info flag for multicast key */
182 #define KEY_INFO_MCAST_KEY      0x01
183 /** Key Info flag for unicast key */
184 #define KEY_INFO_UCAST_KEY      0x02
185 
186 /** KEY_INFO_WEP*/
187 typedef enum _KEY_INFO_WEP {
188 	KEY_INFO_WEP_MCAST = 0x01,
189 	KEY_INFO_WEP_UNICAST = 0x02,
190 	KEY_INFO_WEP_ENABLED = 0x04
191 } KEY_INFO_WEP;
192 
193 /** KEY_INFO_TKIP */
194 typedef enum _KEY_INFO_TKIP {
195 	KEY_INFO_TKIP_MCAST = 0x01,
196 	KEY_INFO_TKIP_UNICAST = 0x02,
197 	KEY_INFO_TKIP_ENABLED = 0x04
198 } KEY_INFO_TKIP;
199 
200 /** KEY_INFO_AES*/
201 typedef enum _KEY_INFO_AES {
202 	KEY_INFO_AES_MCAST = 0x01,
203 	KEY_INFO_AES_UNICAST = 0x02,
204 	KEY_INFO_AES_ENABLED = 0x04,
205 	KEY_INFO_AES_MCAST_IGTK = 0x400,
206 } KEY_INFO_AES;
207 
208 /** WPA AES key length */
209 #define WPA_AES_KEY_LEN                 16
210 /** WPA TKIP key length */
211 #define WPA_TKIP_KEY_LEN                32
212 /** WPA AES IGTK key length */
213 #define CMAC_AES_KEY_LEN                16
214 /** IGTK key length */
215 #define WPA_IGTK_KEY_LEN                16
216 
217 /** WAPI key length */
218 #define WAPI_KEY_LEN            50
219 /** KEY_INFO_WAPI*/
220 typedef enum _KEY_INFO_WAPI {
221 	KEY_INFO_WAPI_MCAST = 0x01,
222 	KEY_INFO_WAPI_UNICAST = 0x02,
223 	KEY_INFO_WAPI_ENABLED = 0x04
224 } KEY_INFO_WAPI;
225 
226 /** Maximum ethernet frame length sans FCS */
227 #define MV_ETH_FRAME_LEN   1514
228 
229 /** Length of SNAP header */
230 #define MRVDRV_SNAP_HEADER_LEN          8
231 
232 /** The number of times to try when polling for status bits */
233 #define MAX_POLL_TRIES			100
234 
235 /** The number of times to try when waiting for downloaded firmware to
236      become active when multiple interface is present */
237 #define MAX_MULTI_INTERFACE_POLL_TRIES  150
238 
239 /** The number of times to try when waiting for downloaded firmware to
240      become active. (polling the scratch register). */
241 #define MAX_FIRMWARE_POLL_TRIES		100
242 
243 /** This is for firmware specific length */
244 #define EXTRA_LEN	36
245 
246 /** Buffer size for ethernet Tx packets */
247 #define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE \
248 	(MV_ETH_FRAME_LEN + sizeof(TxPD) + EXTRA_LEN)
249 
250 /** Buffer size for ethernet Rx packets */
251 #define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \
252 	(MV_ETH_FRAME_LEN + sizeof(RxPD) \
253 	 + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN)
254 
255 /* Macros in interface module */
256 /** Firmware ready */
257 #define FIRMWARE_READY          0xfedc
258 
259 /** Number of firmware blocks to transfer */
260 #define FIRMWARE_TRANSFER_NBLOCK	2
261 
262 /** Enumeration definition*/
263 /** WLAN_802_11_PRIVACY_FILTER */
264 typedef enum _WLAN_802_11_PRIVACY_FILTER {
265 	Wlan802_11PrivFilterAcceptAll,
266 	Wlan802_11PrivFilter8021xWEP
267 } WLAN_802_11_PRIVACY_FILTER;
268 
269 /** WLAN_802_11_WEP_STATUS */
270 typedef enum _WLAN_802_11_WEP_STATUS {
271 	Wlan802_11WEPEnabled,
272 	Wlan802_11WEPDisabled,
273 	Wlan802_11WEPKeyAbsent,
274 	Wlan802_11WEPNotSupported
275 } WLAN_802_11_WEP_STATUS;
276 
277 /** SNR calculation */
278 #define CAL_SNR(RSSI, NF)		((t_s16)((t_s16)(RSSI) - (t_s16)(NF)))
279 
280 /** 2K buf size */
281 #define MLAN_TX_DATA_BUF_SIZE_2K        2048
282 
283 /** TLV  type ID definition */
284 #define PROPRIETARY_TLV_BASE_ID                 0x0100
285 
286 /** Terminating TLV Type */
287 #define MRVL_TERMINATE_TLV_ID                   0xffff
288 
289 /** TLV type : SSID */
290 #define TLV_TYPE_SSID                           0x0000
291 /** TLV type : Rates */
292 #define TLV_TYPE_RATES                          0x0001
293 /** TLV type : PHY FH */
294 #define TLV_TYPE_PHY_FH                         0x0002
295 /** TLV type : PHY DS */
296 #define TLV_TYPE_PHY_DS                         0x0003
297 /** TLV type : CF */
298 #define TLV_TYPE_CF                             0x0004
299 /** TLV type : IBSS */
300 #define TLV_TYPE_IBSS                           0x0006
301 
302 /** TLV type : Domain */
303 #define TLV_TYPE_DOMAIN                         0x0007
304 
305 /** TLV type : Power constraint */
306 #define TLV_TYPE_POWER_CONSTRAINT               0x0020
307 
308 /** TLV type : Power capability */
309 #define TLV_TYPE_POWER_CAPABILITY               0x0021
310 
311 #define TLV_TYPE_HT_CAPABILITY                  0x002d
312 
313 /** TLV type : Vendor Specific IE */
314 #define TLV_TYPE_VENDOR_SPECIFIC_IE             0x00dd
315 
316 /** TLV type : Key material */
317 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0x00)	/* 0x0100 */
318 /** TLV type : Channel list */
319 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 0x01)	/* 0x0101 */
320 /** TLV type : Number of probes */
321 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 0x02)	/* 0x0102 */
322 /** TLV type : Beacon RSSI low */
323 #define TLV_TYPE_RSSI_LOW           (PROPRIETARY_TLV_BASE_ID + 0x04)	/* 0x0104 */
324 /** TLV type : Beacon SNR low */
325 #define TLV_TYPE_SNR_LOW            (PROPRIETARY_TLV_BASE_ID + 0x05)	/* 0x0105 */
326 /** TLV type : Fail count */
327 #define TLV_TYPE_FAILCOUNT          (PROPRIETARY_TLV_BASE_ID + 0x06)	/* 0x0106 */
328 /** TLV type : BCN miss */
329 #define TLV_TYPE_BCNMISS            (PROPRIETARY_TLV_BASE_ID + 0x07)	/* 0x0107 */
330 /** TLV type : LED behavior */
331 #define TLV_TYPE_LEDBEHAVIOR        (PROPRIETARY_TLV_BASE_ID + 0x09)	/* 0x0109 */
332 /** TLV type : Passthrough */
333 #define TLV_TYPE_PASSTHROUGH        (PROPRIETARY_TLV_BASE_ID + 0x0a)	/* 0x010a */
334 /** TLV type : Power TBL 2.4 Ghz */
335 #define TLV_TYPE_POWER_TBL_2_4GHZ   (PROPRIETARY_TLV_BASE_ID + 0x0c)	/* 0x010c */
336 /** TLV type : Power TBL 5 GHz */
337 #define TLV_TYPE_POWER_TBL_5GHZ     (PROPRIETARY_TLV_BASE_ID + 0x0d)	/* 0x010d */
338 /** TLV type : WMM queue status */
339 #define TLV_TYPE_WMMQSTATUS         (PROPRIETARY_TLV_BASE_ID + 0x10)	/* 0x0110 */
340 /** TLV type : Wildcard SSID */
341 #define TLV_TYPE_WILDCARDSSID       (PROPRIETARY_TLV_BASE_ID + 0x12)	/* 0x0112 */
342 /** TLV type : TSF timestamp */
343 #define TLV_TYPE_TSFTIMESTAMP       (PROPRIETARY_TLV_BASE_ID + 0x13)	/* 0x0113 */
344 /** TLV type : ARP filter */
345 #define TLV_TYPE_ARP_FILTER         (PROPRIETARY_TLV_BASE_ID + 0x15)	/* 0x0115 */
346 /** TLV type : Beacon RSSI high */
347 #define TLV_TYPE_RSSI_HIGH          (PROPRIETARY_TLV_BASE_ID + 0x16)	/* 0x0116 */
348 /** TLV type : Beacon SNR high */
349 #define TLV_TYPE_SNR_HIGH           (PROPRIETARY_TLV_BASE_ID + 0x17)	/* 0x0117 */
350 /** TLV type : Start BG scan later */
351 #define TLV_TYPE_STARTBGSCANLATER   (PROPRIETARY_TLV_BASE_ID + 0x1e)	/* 0x011e */
352 /** TLV type: BG scan repeat count */
353 #define TLV_TYPE_REPEAT_COUNT       (PROPRIETARY_TLV_BASE_ID + 0xb0)	/* 0x01b0 */
354 /** TLV type : Authentication type */
355 #define TLV_TYPE_AUTH_TYPE          (PROPRIETARY_TLV_BASE_ID + 0x1f)	/* 0x011f */
356 /** TLV type : BSSID */
357 #define TLV_TYPE_BSSID              (PROPRIETARY_TLV_BASE_ID + 0x23)	/* 0x0123 */
358 
359 /** TLV type : Link Quality */
360 #define TLV_TYPE_LINK_QUALITY       (PROPRIETARY_TLV_BASE_ID + 0x24)	/* 0x0124 */
361 
362 /** TLV type : Data RSSI low */
363 #define TLV_TYPE_RSSI_LOW_DATA      (PROPRIETARY_TLV_BASE_ID + 0x26)	/* 0x0126 */
364 /** TLV type : Data SNR low */
365 #define TLV_TYPE_SNR_LOW_DATA       (PROPRIETARY_TLV_BASE_ID + 0x27)	/* 0x0127 */
366 /** TLV type : Data RSSI high */
367 #define TLV_TYPE_RSSI_HIGH_DATA     (PROPRIETARY_TLV_BASE_ID + 0x28)	/* 0x0128 */
368 /** TLV type : Data SNR high */
369 #define TLV_TYPE_SNR_HIGH_DATA      (PROPRIETARY_TLV_BASE_ID + 0x29)	/* 0x0129 */
370 
371 /** TLV type : Channel band list */
372 #define TLV_TYPE_CHANNELBANDLIST    (PROPRIETARY_TLV_BASE_ID + 0x2a)	/* 0x012a */
373 
374 /** TLV type : Passphrase */
375 #define TLV_TYPE_PASSPHRASE         (PROPRIETARY_TLV_BASE_ID + 0x3c)	/* 0x013c */
376 
377 /** TLV type : Encryption Protocol TLV */
378 #define TLV_TYPE_ENCRYPTION_PROTO   (PROPRIETARY_TLV_BASE_ID + 0x40)	/* 0x0140 */
379 /** TLV type : Cipher TLV */
380 #define TLV_TYPE_CIPHER             (PROPRIETARY_TLV_BASE_ID + 0x42)	/* 0x0142 */
381 /** TLV type : PMK */
382 #define TLV_TYPE_PMK                (PROPRIETARY_TLV_BASE_ID + 0x44)	/* 0x0144 */
383 
384 /** TLV type : BCN miss */
385 #define TLV_TYPE_PRE_BCNMISS         (PROPRIETARY_TLV_BASE_ID + 0x49)	/* 0x0149 */
386 
387 /** TLV type : ENABLE ROAM IE */
388 #define TLV_TYPE_ROAM                (PROPRIETARY_TLV_BASE_ID + 245)
389 /** TLV type : AP LIST IE */
390 #define TLV_TYPE_APLIST              (PROPRIETARY_TLV_BASE_ID + 246)
391 /** TLV type : PMK */
392 #define TLV_TYPE_PMK_R0             (PROPRIETARY_TLV_BASE_ID + 247)
393 /** TLV type : PMK */
394 #define TLV_TYPE_PMK_R0_NAME        (PROPRIETARY_TLV_BASE_ID + 248)
395 /** TLV type : TRIGGER CONDITION*/
396 #define TLV_TYPE_ROM_TRIGGER        (PROPRIETARY_TLV_BASE_ID + 264)
397 /** TLV type : RETRY_COUNT*/
398 #define TLV_TYPE_ROM_RETRY_COUNT    (PROPRIETARY_TLV_BASE_ID + 265)
399 /** TLV type : BGSCAN SETTING*/
400 #define TLV_TYPE_ROM_BGSCAN         (PROPRIETARY_TLV_BASE_ID + 266)
401 /** TLV type : PARA RSSI*/
402 #define TLV_TYPE_ROM_PARA_RSSI      (PROPRIETARY_TLV_BASE_ID + 267)
403 /** TLV type : BSSID blacklist*/
404 #define TLV_TYPE_BLACKLIST_BSSID    (PROPRIETARY_TLV_BASE_ID + 0x11d)
405 /** TLV type : BAND & RSSI*/
406 #define TLV_TYPE_BAND_RSSI          (PROPRIETARY_TLV_BASE_ID + 0x11e)
407 /** TLV type : ESS scan*/
408 #define TLV_TYPE_ENERGYEFFICIENTSCAN	(PROPRIETARY_TLV_BASE_ID + 0xda)
409 /** TLV type : KEY params*/
410 #define TLV_TYPE_ROAM_OFFLOAD_USER_SET_PMK  	(PROPRIETARY_TLV_BASE_ID + 291)
411 
412 /** TLV type: WAPI IE */
413 #define TLV_TYPE_WAPI_IE             (PROPRIETARY_TLV_BASE_ID + 0x5e)	/* 0x015e */
414 
415 /** TLV type: MGMT IE */
416 #define TLV_TYPE_MGMT_IE             (PROPRIETARY_TLV_BASE_ID + 0x69)	/* 0x0169 */
417 /** TLV type: MAX_MGMT_IE */
418 #define TLV_TYPE_MAX_MGMT_IE         (PROPRIETARY_TLV_BASE_ID + 0xaa)	/* 0x01aa */
419 
420 /** TLV type: key param v2 */
421 #define TLV_TYPE_KEY_PARAM_V2        (PROPRIETARY_TLV_BASE_ID + 0x9C)	/* 0x019C */
422 
423 /** TLV type: ps params in hs */
424 #define TLV_TYPE_PS_PARAMS_IN_HS     (PROPRIETARY_TLV_BASE_ID + 0xB5)	/* 0x01b5 */
425 /** TLV type: hs wake hold off */
426 #define TLV_TYPE_HS_WAKE_HOLDOFF     (PROPRIETARY_TLV_BASE_ID + 0xB6)	/* 0x01b6 */
427 /** TLV type: wake up source */
428 #define TLV_TYPE_HS_WAKEUP_SOURCE_GPIO     (PROPRIETARY_TLV_BASE_ID + 0x105)	/* 0x0205 */
429 /** TLV type: management filter  */
430 #define TLV_TYPE_MGMT_FRAME_WAKEUP     (PROPRIETARY_TLV_BASE_ID + 0x116)	/* 0x0216 */
431 /** TLV type: extend wakeup source */
432 #define TLV_TYPE_WAKEUP_EXTEND       (PROPRIETARY_TLV_BASE_ID + 0x118)	/* 0x0218 */
433 
434 /** TLV type: robustcoex mode */
435 #define TLV_TYPE_ROBUSTCOEX           (PROPRIETARY_TLV_BASE_ID + 0x11B)	/* 0x021B */
436 
437 /** TLV type : TDLS IDLE TIMEOUT */
438 #define TLV_TYPE_TDLS_IDLE_TIMEOUT   (PROPRIETARY_TLV_BASE_ID + 0xC2)	/* 0x01C2 */
439 
440 /** TLV type : HT Capabilities */
441 #define TLV_TYPE_HT_CAP              (PROPRIETARY_TLV_BASE_ID + 0x4a)	/* 0x014a */
442 /** TLV type : HT Information */
443 #define TLV_TYPE_HT_INFO             (PROPRIETARY_TLV_BASE_ID + 0x4b)	/* 0x014b */
444 /** TLV type : Secondary Channel Offset */
445 #define TLV_SECONDARY_CHANNEL_OFFSET (PROPRIETARY_TLV_BASE_ID + 0x4c)	/* 0x014c */
446 /** TLV type : 20/40 BSS Coexistence */
447 #define TLV_TYPE_2040BSS_COEXISTENCE (PROPRIETARY_TLV_BASE_ID + 0x4d)	/* 0x014d */
448 /** TLV type : Overlapping BSS Scan Parameters */
449 #define TLV_TYPE_OVERLAP_BSS_SCAN_PARAM (PROPRIETARY_TLV_BASE_ID + 0x4e)	/* 0x014e */
450 /** TLV type : Extended capabilities */
451 #define TLV_TYPE_EXTCAP              (PROPRIETARY_TLV_BASE_ID + 0x4f)	/* 0x014f */
452 /** TLV type : Set of MCS values that STA desires to use within the BSS */
453 #define TLV_TYPE_HT_OPERATIONAL_MCS_SET (PROPRIETARY_TLV_BASE_ID + 0x50)	/* 0x0150 */
454 /** TLV ID : Management Frame */
455 #define TLV_TYPE_MGMT_FRAME          (PROPRIETARY_TLV_BASE_ID + 0x68)	/* 0x0168 */
456 /** TLV type : RXBA_SYNC */
457 #define TLV_TYPE_RXBA_SYNC           (PROPRIETARY_TLV_BASE_ID + 0x99)	/* 0x0199 */
458 
459 #ifdef WIFI_DIRECT_SUPPORT
460 /** TLV type : AP PSK */
461 #define TLV_TYPE_UAP_PSK   (PROPRIETARY_TLV_BASE_ID + 0xa8)	/* 0x01a8 */
462 /** TLV type : p2p NOA */
463 #define TLV_TYPE_WIFI_DIRECT_NOA            (PROPRIETARY_TLV_BASE_ID + 0x83)
464 /** TLV type : p2p opp ps */
465 #define TLV_TYPE_WIFI_DIRECT_OPP_PS         (PROPRIETARY_TLV_BASE_ID + 0x84)
466 #endif /* WIFI_DIRECT_SUPPORT */
467 
468 /** TLV : 20/40 coex config */
469 #define TLV_TYPE_2040_BSS_COEX_CONTROL\
470 		(PROPRIETARY_TLV_BASE_ID + 0x98)	/* 0x0198 */
471 
472 /** TLV type :  aggr win size */
473 #define TLV_BTCOEX_WL_AGGR_WINSIZE					(PROPRIETARY_TLV_BASE_ID + 0xca)
474 /** TLV type :  scan time */
475 #define TLV_BTCOEX_WL_SCANTIME    					(PROPRIETARY_TLV_BASE_ID + 0Xcb)
476 /** TLV type : Ewpa_eapol_pkt */
477 #define TLV_TYPE_EAPOL_PKT                          (PROPRIETARY_TLV_BASE_ID + 0xcf)
478 
479 #define TLV_TYPE_COALESCE_RULE                      (PROPRIETARY_TLV_BASE_ID + 0x9a)
480 
481 /** ADDBA TID mask */
482 #define ADDBA_TID_MASK   (MBIT(2) | MBIT(3) | MBIT(4) | MBIT(5))
483 /** DELBA TID mask */
484 #define DELBA_TID_MASK   (MBIT(12) | MBIT(13) | MBIT(14) | MBIT(15))
485 /** ADDBA Starting Sequence Number Mask */
486 #define SSN_MASK         0xfff0
487 
488 /** Block Ack result status */
489 /** Block Ack Result : Success */
490 #define BA_RESULT_SUCCESS        0x0
491 /** Block Ack Result : Execution failure */
492 #define BA_RESULT_FAILURE        0x1
493 /** Block Ack Result : Timeout */
494 #define BA_RESULT_TIMEOUT        0x2
495 /** Block Ack Result : Data invalid */
496 #define BA_RESULT_DATA_INVALID   0x3
497 
498 /** Get the baStatus (NOT_SETUP, COMPLETE, IN_PROGRESS)
499  *  in Tx BA stream table */
500 #define IS_BASTREAM_SETUP(ptr)  (ptr->ba_status)
501 
502 /** An AMPDU/AMSDU could be disallowed for certain TID. 0xff means
503  *  no aggregation is enabled for the assigned TID */
504 #define BA_STREAM_NOT_ALLOWED   0xff
505 
506 #ifdef STA_SUPPORT
507 /** Test if adhoc 11n is enabled */
508 #define IS_11N_ADHOC_ENABLED(priv) ((priv->bss_mode == MLAN_BSS_MODE_IBSS) && pmadapter->adhoc_11n_enabled)
509 #endif
510 
511 /** Test if 11n is enabled by checking the HTCap IE */
512 #define IS_11N_ENABLED(priv) ((priv->config_bands & BAND_GN || priv->config_bands & BAND_AN) \
513 	&& priv->curr_bss_params.bss_descriptor.pht_cap)
514 /** Find out if we are the initiator or not */
515 #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) & \
516 			MBIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
517 
518 /** 4K buf size */
519 #define MLAN_TX_DATA_BUF_SIZE_4K        4096
520 /** 8K buf size */
521 #define MLAN_TX_DATA_BUF_SIZE_8K        8192
522 /** Max Rx AMPDU Size */
523 #define MAX_RX_AMPDU_SIZE_64K   0x03
524 /** Non green field station */
525 #define NON_GREENFIELD_STAS     0x04
526 
527 /** Greenfield support */
528 #define HWSPEC_GREENFIELD_SUPP   MBIT(29)
529 /** RX STBC support */
530 #define HWSPEC_RXSTBC_SUPP   MBIT(26)
531 /** ShortGI @ 40Mhz support */
532 #define HWSPEC_SHORTGI40_SUPP    MBIT(24)
533 /** ShortGI @ 20Mhz support */
534 #define HWSPEC_SHORTGI20_SUPP    MBIT(23)
535 /** RX LDPC support */
536 #define HWSPEC_LDPC_SUPP         MBIT(22)
537 /** Channel width 40Mhz support */
538 #define HWSPEC_CHANBW40_SUPP     MBIT(17)
539 /** 40Mhz intolarent enable */
540 #define CAPINFO_40MHZ_INTOLARENT MBIT(8)
541 
542 /** Default 11n capability mask for 2.4GHz */
543 #define DEFAULT_11N_CAP_MASK_BG (HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP | HWSPEC_LDPC_SUPP)
544 /** Default 11n capability mask for 5GHz */
545 #define DEFAULT_11N_CAP_MASK_A  (HWSPEC_CHANBW40_SUPP | HWSPEC_SHORTGI20_SUPP | \
546 		HWSPEC_SHORTGI40_SUPP | HWSPEC_RXSTBC_SUPP | HWSPEC_LDPC_SUPP)
547 
548 /** Default 11n TX BF capability **/
549 #define DEFAULT_11N_TX_BF_CAP   0x19E74608
550 
551 /** Bits to ignore in hw_dev_cap as these bits are set in get_hw_spec */
552 #define IGN_HW_DEV_CAP      (CAPINFO_40MHZ_INTOLARENT)
553 
554 /** HW_SPEC FwCapInfo */
555 #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & MBIT(11))
556 
557 /** HW_SPEC Dot11nDevCap : MAX AMSDU supported */
558 #define ISSUPP_MAXAMSDU(Dot11nDevCap) (Dot11nDevCap & MBIT(31))
559 /** HW_SPEC Dot11nDevCap : Beamforming support */
560 #define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & MBIT(30))
561 /** HW_SPEC Dot11nDevCap : Green field support */
562 #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & MBIT(29))
563 /** HW_SPEC Dot11nDevCap : AMPDU support */
564 #define ISSUPP_AMPDU(Dot11nDevCap) (Dot11nDevCap & MBIT(28))
565 /** HW_SPEC Dot11nDevCap : MIMO PS support  */
566 #define ISSUPP_MIMOPS(Dot11nDevCap) (Dot11nDevCap & MBIT(27))
567 /** HW_SPEC Dot11nDevCap : Rx STBC support */
568 #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & MBIT(26))
569 /** HW_SPEC Dot11nDevCap : Tx STBC support */
570 #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & MBIT(25))
571 /** HW_SPEC Dot11nDevCap : Short GI @ 40Mhz support */
572 #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & MBIT(24))
573 /** HW_SPEC Dot11nDevCap : Reset Short GI @ 40Mhz support */
574 #define RESETSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap &= ~MBIT(24))
575 /** HW_SPEC Dot11nDevCap : Short GI @ 20Mhz support */
576 #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & MBIT(23))
577 /** HW_SPEC Dot11nDevCap : Rx LDPC support */
578 #define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & MBIT(22))
579 /** HW_SPEC Dot11nDevCap : Number of TX BA streams supported */
580 #define ISSUPP_GETTXBASTREAM(Dot11nDevCap) ((Dot11nDevCap >> 18) & 0xF)
581 /** HW_SPEC Dot11nDevCap : Channel BW support @ 40Mhz  support */
582 #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & MBIT(17))
583 /** HW_SPEC Dot11nDevCap : Channel BW support @ 20Mhz  support */
584 #define ISSUPP_CHANWIDTH20(Dot11nDevCap) (Dot11nDevCap & MBIT(16))
585 /** HW_SPEC Dot11nDevCap : Channel BW support @ 10Mhz  support */
586 #define ISSUPP_CHANWIDTH10(Dot11nDevCap) (Dot11nDevCap & MBIT(15))
587 /** Dot11nUsrCap : 40Mhz intolarance enabled */
588 #define ISENABLED_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap & MBIT(8))
589 /** Dot11nUsrCap : Reset 40Mhz intolarance enabled */
590 #define RESET_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap &= ~MBIT(8))
591 /** HW_SPEC Dot11nDevCap : Rx AntennaD support */
592 #define ISSUPP_RXANTENNAD(Dot11nDevCap) (Dot11nDevCap & MBIT(7))
593 /** HW_SPEC Dot11nDevCap : Rx AntennaC support */
594 #define ISSUPP_RXANTENNAC(Dot11nDevCap) (Dot11nDevCap & MBIT(6))
595 /** HW_SPEC Dot11nDevCap : Rx AntennaB support */
596 #define ISSUPP_RXANTENNAB(Dot11nDevCap) (Dot11nDevCap & MBIT(5))
597 /** HW_SPEC Dot11nDevCap : Rx AntennaA support */
598 #define ISSUPP_RXANTENNAA(Dot11nDevCap) (Dot11nDevCap & MBIT(4))
599 /** HW_SPEC Dot11nDevCap : Tx AntennaD support */
600 #define ISSUPP_TXANTENNAD(Dot11nDevCap) (Dot11nDevCap & MBIT(3))
601 /** HW_SPEC Dot11nDevCap : Tx AntennaC support */
602 #define ISSUPP_TXANTENNAC(Dot11nDevCap) (Dot11nDevCap & MBIT(2))
603 /** HW_SPEC Dot11nDevCap : Tx AntennaB support */
604 #define ISSUPP_TXANTENNAB(Dot11nDevCap) (Dot11nDevCap & MBIT(1))
605 /** HW_SPEC Dot11nDevCap : Tx AntennaA support */
606 #define ISSUPP_TXANTENNAA(Dot11nDevCap) (Dot11nDevCap & MBIT(0))
607 
608 /** HW_SPEC Dot11nDevCap : Set support of channel bw @ 40Mhz */
609 #define SETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap |= MBIT(17))
610 /** HW_SPEC Dot11nDevCap : Reset support of channel bw @ 40Mhz */
611 #define RESETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap &= ~MBIT(17))
612 
613 /** DevMCSSupported : Tx MCS supported */
614 #define GET_TXMCSSUPP(DevMCSSupported) (DevMCSSupported >> 4)
615 /** DevMCSSupported : Rx MCS supported */
616 #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
617 
618 /** GET HTCapInfo : Supported Channel BW */
619 #define GETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo & MBIT(1))
620 /** GET HTCapInfo : Support for Greenfield */
621 #define GETHT_GREENFIELD(HTCapInfo) (HTCapInfo & MBIT(4))
622 /** GET HTCapInfo : Support for Short GI @ 20Mhz */
623 #define GETHT_SHORTGI20(HTCapInfo) (HTCapInfo & MBIT(5))
624 /** GET HTCapInfo : Support for Short GI @ 40Mhz */
625 #define GETHT_SHORTGI40(HTCapInfo) (HTCapInfo & MBIT(6))
626 /** GET HTCapInfo : Support for Tx STBC */
627 #define GETHT_TXSTBC(HTCapInfo) (HTCapInfo & MBIT(7))
628 
629 /** GET HTCapInfo : Support for Rx STBC */
630 #define GETHT_RXSTBC(HTCapInfo) ((HTCapInfo >> 8) & 0x03)
631 /** GET HTCapInfo : Support for Delayed ACK */
632 #define GETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo & MBIT(10))
633 /** GET HTCapInfo : Support for Max AMSDU */
634 #define GETHT_MAXAMSDU(HTCapInfo) (HTCapInfo & MBIT(11))
635 
636 /** SET HTCapInfo : Set support for LDPC coding capability */
637 #define SETHT_LDPCCODINGCAP(HTCapInfo) (HTCapInfo |= MBIT(0))
638 /** SET HTCapInfo : Set support for Channel BW */
639 #define SETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo |= MBIT(1))
640 /** SET HTCapInfo : Set support for Greenfield */
641 #define SETHT_GREENFIELD(HTCapInfo) (HTCapInfo |= MBIT(4))
642 /** SET HTCapInfo : Set support for Short GI @ 20Mhz */
643 #define SETHT_SHORTGI20(HTCapInfo) (HTCapInfo |= MBIT(5))
644 /** SET HTCapInfo : Set support for Short GI @ 40Mhz */
645 #define SETHT_SHORTGI40(HTCapInfo) (HTCapInfo |= MBIT(6))
646 /** SET HTCapInfo : Set support for Tx STBC */
647 #define SETHT_TXSTBC(HTCapInfo) (HTCapInfo |= MBIT(7))
648 /** SET HTCapInfo : Set support for Rx STBC */
649 #define SETHT_RXSTBC(HTCapInfo, value) (HTCapInfo |= (value << 8))
650 /** SET HTCapInfo : Set support for delayed block ack */
651 #define SETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo |= MBIT(10))
652 /** SET HTCapInfo : Set support for Max size AMSDU */
653 #define SETHT_MAXAMSDU(HTCapInfo) (HTCapInfo |= MBIT(11))
654 /** SET HTCapInfo : Set support for DSSS/CCK Rates @ 40Mhz */
655 #define SETHT_DSSSCCK40(HTCapInfo) (HTCapInfo |= MBIT(12))
656 /** SET HTCapInfo : Enable 40Mhz Intolarence */
657 #define SETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo |= MBIT(14))
658 /** SET HTCapInfo : Disable Static SM power save */
659 #define SETHT_STATIC_SMPS(HTCapInfo) ((HTCapInfo) |= (MBIT(2) | MBIT(3)))
660 
661 /** RESET HTCapInfo : Set support for LDPC coding capability */
662 #define RESETHT_LDPCCODINGCAP(HTCapInfo) (HTCapInfo &= ~MBIT(0))
663 /** RESET HTCapInfo : Set support for Channel BW */
664 #define RESETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo &= ~MBIT(1))
665 /** RESET HTCapInfo : Set support for Greenfield */
666 #define RESETHT_GREENFIELD(HTCapInfo) (HTCapInfo &= ~MBIT(4))
667 /** RESET HTCapInfo : Set support for Short GI @ 20Mhz */
668 #define RESETHT_SHORTGI20(HTCapInfo) (HTCapInfo &= ~MBIT(5))
669 /** RESET HTCapInfo : Set support for Short GI @ 40Mhz */
670 #define RESETHT_SHORTGI40(HTCapInfo) (HTCapInfo &= ~MBIT(6))
671 /** RESET HTCapInfo : Set support for Tx STBC */
672 #define RESETHT_TXSTBC(HTCapInfo) (HTCapInfo &= ~MBIT(7))
673 /** RESET HTCapInfo : Set support for Rx STBC */
674 #define RESETHT_RXSTBC(HTCapInfo) (HTCapInfo &= ~(0x03 << 8))
675 /** RESET HTCapInfo : Set support for delayed block ack */
676 #define RESETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo &= ~MBIT(10))
677 /** RESET HTCapInfo : Set support for Max size AMSDU */
678 #define RESETHT_MAXAMSDU(HTCapInfo) (HTCapInfo &= ~MBIT(11))
679 /** RESET HTCapInfo : Disable 40Mhz Intolarence */
680 #define RESETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo &= ~MBIT(14))
681 /** RESET HTCapInfo: Enable SM power save */
682 #define RESETHT_SM_POWERSAVE(HTCapInfo) ((HTCapInfo) &= ~(MBIT(2) | MBIT(3)))
683 /** RESET HTExtCap : Clear RD Responder bit */
684 #define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~MBIT(11))
685 /** SET MCS32 */
686 #define SETHT_MCS32(x) (x[4] |= 1)
687 /** Set mcs set defined bit */
688 #define SETHT_MCS_SET_DEFINED(x) (x[12] |= 1)
689 /** Set the highest Rx data rate */
690 #define SETHT_RX_HIGHEST_DT_SUPP(x, y) ((*(t_u16 *) (x + 10)) = y)
691 /** AMPDU factor size */
692 #define AMPDU_FACTOR_64K	0x03
693 /** Set AMPDU size in A-MPDU paramter field */
694 #define SETAMPDU_SIZE(x, y) do { \
695 	x = x & ~0x03; \
696 	x |= y & 0x03; \
697 } while (0) \
698 /** Set AMPDU spacing in A-MPDU paramter field */
699 #define SETAMPDU_SPACING(x, y) do { \
700 	x = x & ~0x1c; \
701 	x |= (y & 0x07) << 2; \
702 } while (0) \
703 
704 /** RadioType : Support for Band A */
705 #define ISSUPP_BANDA(FwCapInfo) (FwCapInfo & MBIT(10))
706 /** RadioType : Support for 40Mhz channel BW */
707 #define ISALLOWED_CHANWIDTH40(Field2) (Field2 & MBIT(2))
708 /** RadioType : Set support 40Mhz channel */
709 #define SET_CHANWIDTH40(Field2) (Field2 |= MBIT(2))
710 /** RadioType : Reset support 40Mhz channel */
711 #define RESET_CHANWIDTH40(Field2) (Field2 &= ~(MBIT(0) | MBIT(1) | MBIT(2)))
712 /** RadioType : Get secondary channel */
713 #define GET_SECONDARYCHAN(Field2) (Field2 & (MBIT(0) | MBIT(1)))
714 
715 /** ExtCap : Support for FILS */
716 #define ISSUPP_EXTCAP_FILS(ext_cap) (ext_cap.FILS)
717 /** ExtCap : Set support FILS */
718 #define SET_EXTCAP_FILS(ext_cap) (ext_cap.FILS = 1)
719 /** ExtCap : Reset support FILS */
720 #define RESET_EXTCAP_FILS(ext_cap) (ext_cap.FILS = 0)
721 
722 /** ExtCap : Support for TDLS */
723 #define ISSUPP_EXTCAP_TDLS(ext_cap) (ext_cap.TDLSSupport)
724 /** ExtCap : Set support TDLS */
725 #define SET_EXTCAP_TDLS(ext_cap) (ext_cap.TDLSSupport = 1)
726 /** ExtCap : Reset support TDLS */
727 #define RESET_EXTCAP_TDLS(ext_cap) (ext_cap.TDLSSupport = 0)
728 /** ExtCap : Support for TDLS UAPSD */
729 #define ISSUPP_EXTCAP_TDLS_UAPSD(ext_cap) (ext_cap.TDLSPeerUAPSDSupport)
730 /** ExtCap : Set support TDLS UAPSD */
731 #define SET_EXTCAP_TDLS_UAPSD(ext_cap) (ext_cap.TDLSPeerUAPSDSupport = 1)
732 /** ExtCap : Reset support TDLS UAPSD */
733 #define RESET_EXTCAP_TDLS_UAPSD(ext_cap) (ext_cap.TDLSPeerUAPSDSupport = 0)
734 /** ExtCap : Support for TDLS CHANNEL SWITCH */
735 #define ISSUPP_EXTCAP_TDLS_CHAN_SWITCH(ext_cap) (ext_cap.TDLSChannelSwitching)
736 /** ExtCap : Set support TDLS CHANNEL SWITCH */
737 #define SET_EXTCAP_TDLS_CHAN_SWITCH(ext_cap) (ext_cap.TDLSChannelSwitching = 1)
738 /** ExtCap : Reset support TDLS CHANNEL SWITCH */
739 #define RESET_EXTCAP_TDLS_CHAN_SWITCH(ext_cap) (ext_cap.TDLSChannelSwitching = 0)
740 
741 /** ExtCap : Support for Interworking */
742 #define ISSUPP_EXTCAP_INTERWORKING(ext_cap) (ext_cap.Interworking)
743 /** ExtCap : Set support Interworking */
744 #define SET_EXTCAP_INTERWORKING(ext_cap) (ext_cap.Interworking = 1)
745 /** ExtCap : Reset support Interworking */
746 #define RESET_EXTCAP_INTERWORKING(ext_cap) (ext_cap.Interworking = 0)
747 /** ExtCap : Support for Operation Mode Notification */
748 #define ISSUPP_EXTCAP_OPERMODENTF(ext_cap) (ext_cap.OperModeNtf)
749 /** ExtCap : Set support Operation Mode Notification */
750 #define SET_EXTCAP_OPERMODENTF(ext_cap) (ext_cap.OperModeNtf = 1)
751 /** ExtCap : Reset support Operation Mode Notification */
752 #define RESET_EXTCAP_OPERMODENTF(ext_cap) (ext_cap.OperModeNtf = 0)
753 /** ExtCap : Support for QosMap */
754 #define ISSUPP_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map)
755 /** ExtCap : Set Support QosMap */
756 #define SET_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map = 1)
757 /** ExtCap : Reset support QosMap */
758 #define RESET_EXTCAP_QOS_MAP(ext_cap) (ext_cap.Qos_Map = 0)
759 /** ExtCap : Support for BSS_Transition */
760 #define ISSUPP_EXTCAP_BSS_TRANSITION(ext_cap) (ext_cap.BSS_Transition)
761 /** ExtCap : Set Support BSS_Transition */
762 #define SET_EXTCAP_BSS_TRANSITION(ext_cap) (ext_cap.BSS_Transition = 1)
763 /** ExtCap : Reset support BSS_Transition */
764 #define RESET_EXTCAP_BSS_TRANSITION(ext_cap) (ext_cap.BSS_Transition = 0)
765 
766 /** ExtCap : Support for TDLS wider bandwidth */
767 #define ISSUPP_EXTCAP_TDLS_WIDER_BANDWIDTH(ext_cap) (ext_cap.TDLSWildBandwidth)
768 /** ExtCap : Set support TDLS wider bandwidth */
769 #define SET_EXTCAP_TDLS_WIDER_BANDWIDTH(ext_cap) (ext_cap.TDLSWildBandwidth = 1)
770 /** ExtCap : Reset support TDLS wider bandwidth */
771 #define RESET_EXTCAP_TDLS_WIDER_BANDWIDTH(ext_cap) (ext_cap.TDLSWildBandwidth = 0)
772 
773 /** ExtCap : Support for extend channel switch */
774 #define ISSUPP_EXTCAP_EXT_CHANNEL_SWITCH(ext_cap) (ext_cap.ExtChanSwitching)
775 /** ExtCap : Set support Ext Channel Switch */
776 #define SET_EXTCAP_EXT_CHANNEL_SWITCH(ext_cap) (ext_cap.ExtChanSwitching = 1)
777 /** ExtCap: Set Timing Measurement */
778 #define SET_EXTCAP_EXT_TIMING_MEASUREMENT(ext_cap) (ext_cap.TimingMeasurement = 1)
779 /** ExtCap : Reset support Ext Channel Switch */
780 #define RESET_EXTCAP_EXT_CHANNEL_SWITCH(ext_cap) (ext_cap.ExtChanSwitching = 0)
781 
782 /** ExtCap : Set FTMI bit(bit 71) */
783 #define SET_EXTCAP_FTMI(ext_cap) (ext_cap.FTMI = 1)
784 #define SET_EXTCAP_INTERNETWORKING(ext_cap) (ext_cap.Interworking = 1)
785 /** LLC/SNAP header len   */
786 #define LLC_SNAP_LEN    8
787 
788 /** TLV type : Rate scope */
789 #define TLV_TYPE_RATE_DROP_PATTERN  (PROPRIETARY_TLV_BASE_ID + 0x51)	/* 0x0151 */
790 /** TLV type : Rate drop pattern */
791 #define TLV_TYPE_RATE_DROP_CONTROL  (PROPRIETARY_TLV_BASE_ID + 0x52)	/* 0x0152 */
792 /** TLV type : Rate scope */
793 #define TLV_TYPE_RATE_SCOPE         (PROPRIETARY_TLV_BASE_ID + 0x53)	/* 0x0153 */
794 
795 /** TLV type : Power group */
796 #define TLV_TYPE_POWER_GROUP        (PROPRIETARY_TLV_BASE_ID + 0x54)	/* 0x0154 */
797 
798 /** Modulation class for DSSS Rates */
799 #define MOD_CLASS_HR_DSSS       0x03
800 /** Modulation class for OFDM Rates */
801 #define MOD_CLASS_OFDM          0x07
802 /** Modulation class for HT Rates */
803 #define MOD_CLASS_HT            0x08
804 /** Modulation class for VHT Rates */
805 #define MOD_CLASS_VHT           0x09
806 /** HT bandwidth 20 MHz */
807 #define HT_BW_20    0
808 /** HT bandwidth 40 MHz */
809 #define HT_BW_40    1
810 /** HT bandwidth 80 MHz */
811 #define HT_BW_80    2
812 
813 /** TLV type : Scan Response */
814 #define TLV_TYPE_BSS_SCAN_RSP        (PROPRIETARY_TLV_BASE_ID + 0x56)	/* 0x0156 */
815 /** TLV type : Scan Response Stats */
816 #define TLV_TYPE_BSS_SCAN_INFO       (PROPRIETARY_TLV_BASE_ID + 0x57)	/* 0x0157 */
817 
818 /** TLV type : 11h Basic Rpt */
819 #define TLV_TYPE_CHANRPT_11H_BASIC   (PROPRIETARY_TLV_BASE_ID + 0x5b)	/* 0x015b */
820 
821 /** TLV type : Action frame */
822 #define TLV_TYPE_IEEE_ACTION_FRAME   (PROPRIETARY_TLV_BASE_ID + 0x8c)	/* 0x018c */
823 
824 /** TLV type : SCAN channel gap */
825 #define TLV_TYPE_SCAN_CHANNEL_GAP    (PROPRIETARY_TLV_BASE_ID + 0xc5)	/* 0x01c5 */
826 /** TLV type : Channel statistics */
827 #define TLV_TYPE_CHANNEL_STATS       (PROPRIETARY_TLV_BASE_ID + 0xc6)	/* 0x01c6 */
828 /** TLV type : BSS_MODE */
829 #define TLV_TYPE_BSS_MODE            (PROPRIETARY_TLV_BASE_ID + 0xce)	/* 0x01ce */
830 
831 /** Firmware Host Command ID Constants */
832 /** Host Command ID : Get hardware specifications */
833 #define HostCmd_CMD_GET_HW_SPEC               0x0003
834 /** Host Command ID : 802.11 scan */
835 #define HostCmd_CMD_802_11_SCAN               0x0006
836 /** Host Command ID : 802.11 get log */
837 #define HostCmd_CMD_802_11_GET_LOG            0x000b
838 
839 /** Host Command ID : MAC multicast address */
840 #define HostCmd_CMD_MAC_MULTICAST_ADR         0x0010
841 /** Host Command ID : 802.11 EEPROM access */
842 #define HostCmd_CMD_802_11_EEPROM_ACCESS      0x0059
843 /** Host Command ID : 802.11 associate */
844 #define HostCmd_CMD_802_11_ASSOCIATE          0x0012
845 
846 /** Host Command ID : 802.11 SNMP MIB */
847 #define HostCmd_CMD_802_11_SNMP_MIB           0x0016
848 /** Host Command ID : MAC register access */
849 #define HostCmd_CMD_MAC_REG_ACCESS            0x0019
850 /** Host Command ID : BBP register access */
851 #define HostCmd_CMD_BBP_REG_ACCESS            0x001a
852 /** Host Command ID : RF register access */
853 #define HostCmd_CMD_RF_REG_ACCESS             0x001b
854 
855 /** Host Command ID : 802.11 radio control */
856 #define HostCmd_CMD_802_11_RADIO_CONTROL      0x001c
857 /** Host Command ID : 802.11 RF channel */
858 #define HostCmd_CMD_802_11_RF_CHANNEL         0x001d
859 /** Host Command ID : 802.11 RF Tx power */
860 #define HostCmd_CMD_802_11_RF_TX_POWER        0x001e
861 
862 /** Host Command ID : 802.11 RF antenna */
863 #define HostCmd_CMD_802_11_RF_ANTENNA         0x0020
864 
865 /** Host Command ID : 802.11 deauthenticate */
866 #define HostCmd_CMD_802_11_DEAUTHENTICATE     0x0024
867 /** Host Command ID: 802.11 disassoicate */
868 #define HostCmd_CMD_802_11_DISASSOCIATE       0x0026
869 /** Host Command ID : MAC control */
870 #define HostCmd_CMD_MAC_CONTROL               0x0028
871 /** Host Command ID : 802.11 Ad-Hoc start */
872 #define HostCmd_CMD_802_11_AD_HOC_START       0x002b
873 /** Host Command ID : 802.11 Ad-Hoc join */
874 #define HostCmd_CMD_802_11_AD_HOC_JOIN        0x002c
875 
876 /** Host Command ID: CW Mode */
877 #define HostCmd_CMD_CW_MODE_CTRL              0x0239
878 
879 /** Host Command ID : 802.11 key material */
880 #define HostCmd_CMD_802_11_KEY_MATERIAL       0x005e
881 
882 /** Host Command ID : 802.11 Ad-Hoc stop */
883 #define HostCmd_CMD_802_11_AD_HOC_STOP        0x0040
884 
885 /** Host Command ID : 802.22 MAC address */
886 #define HostCmd_CMD_802_11_MAC_ADDRESS        0x004D
887 
888 /** Host Command ID : WMM Traffic Stream Status */
889 #define HostCmd_CMD_WMM_TS_STATUS             0x005d
890 
891 /** Host Command ID : 802.11 D domain information */
892 #define HostCmd_CMD_802_11D_DOMAIN_INFO       0x005b
893 
894 /** Host Command ID : 802.11 K Feature Control */
895 #define HostCmd_CMD_OFFLOAD_FEATURE_CONTROL     0x00fd
896 /** Host Command ID : 802.11 K Get  Neighbor AP list*/
897 #define HostCmd_CMD_802_11K_GET_NLIST     0x0231
898 
899 /** Host Command ID : 802.11 TPC information */
900 #define HostCmd_CMD_802_11_TPC_INFO           0x005f
901 /** Host Command ID : 802.11 TPC adapt req */
902 #define HostCmd_CMD_802_11_TPC_ADAPT_REQ      0x0060
903 /** Host Command ID : 802.11 channel SW ann */
904 #define HostCmd_CMD_802_11_CHAN_SW_ANN        0x0061
905 
906 /** Host Command ID : Measurement request */
907 #define HostCmd_CMD_MEASUREMENT_REQUEST       0x0062
908 /** Host Command ID : Measurement report */
909 #define HostCmd_CMD_MEASUREMENT_REPORT        0x0063
910 
911 /** Host Command ID : 802.11 sleep parameters */
912 #define HostCmd_CMD_802_11_SLEEP_PARAMS       0x0066
913 
914 /** Host Command ID : 802.11 ps inactivity timeout */
915 #define HostCmd_CMD_802_11_PS_INACTIVITY_TIMEOUT 0x0067
916 
917 /** Host Command ID : 802.11 sleep period */
918 #define HostCmd_CMD_802_11_SLEEP_PERIOD       0x0068
919 
920 /** Host Command ID: 802.11 BG scan config */
921 #define HostCmd_CMD_802_11_BG_SCAN_CONFIG     0x006b
922 /** Host Command ID : 802.11 BG scan query */
923 #define HostCmd_CMD_802_11_BG_SCAN_QUERY      0x006c
924 
925 /** Host Command ID : WMM ADDTS req */
926 #define HostCmd_CMD_WMM_ADDTS_REQ             0x006E
927 /** Host Command ID : WMM DELTS req */
928 #define HostCmd_CMD_WMM_DELTS_REQ             0x006F
929 /** Host Command ID : WMM queue configuration */
930 #define HostCmd_CMD_WMM_QUEUE_CONFIG          0x0070
931 /** Host Command ID : 802.11 get status */
932 #define HostCmd_CMD_WMM_GET_STATUS            0x0071
933 
934 /** Host Command ID : 802.11 firmware wakeup method */
935 #define HostCmd_CMD_802_11_FW_WAKE_METHOD     0x0074
936 /** Host Command ID : 802.11 subscribe event */
937 #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT    0x0075
938 
939 /** Host Command ID : 802.11 Tx rate query */
940 #define HostCmd_CMD_802_11_TX_RATE_QUERY      0x007f
941 /** Host Command ID :Get timestamp value */
942 #define HostCmd_CMD_GET_TSF                   0x0080
943 
944 /** Host Command ID : WMM queue stats */
945 #define HostCmd_CMD_WMM_QUEUE_STATS           0x0081
946 
947 /** Host Command ID : 802.11 IBSS coalescing status */
948 #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
949 
950 /** Host Command ID : Memory access */
951 #define HostCmd_CMD_MEM_ACCESS                0x0086
952 
953 /** Host Command ID : SDIO GPIO interrupt configuration */
954 #define HostCmd_CMD_SDIO_GPIO_INT_CONFIG      0x0088
955 
956 #ifdef MFG_CMD_SUPPORT
957 /** Host Command ID : Mfg command */
958 #define HostCmd_CMD_MFG_COMMAND               0x0089
959 #endif
960 /** Host Command ID : Inactivity timeout ext */
961 #define HostCmd_CMD_INACTIVITY_TIMEOUT_EXT    0x008a
962 
963 /** Host Command ID : DBGS configuration */
964 #define HostCmd_CMD_DBGS_CFG                  0x008b
965 /** Host Command ID : Get memory */
966 #define HostCmd_CMD_GET_MEM                   0x008c
967 
968 /** Host Command ID : Cal data dnld */
969 #define HostCmd_CMD_CFG_DATA                  0x008f
970 
971 /** Host Command ID : SDIO pull control */
972 #define HostCmd_CMD_SDIO_PULL_CTRL            0x0093
973 
974 /** Host Command ID : ECL system clock configuration */
975 #define HostCmd_CMD_ECL_SYSTEM_CLOCK_CONFIG   0x0094
976 
977 /** Host Command ID : Extended version */
978 #define HostCmd_CMD_VERSION_EXT               0x0097
979 
980 /** Host Command ID : MEF configuration */
981 #define HostCmd_CMD_MEF_CFG                   0x009a
982 
983 /** Host Command ID : 802.11 RSSI INFO*/
984 #define HostCmd_CMD_RSSI_INFO                 0x00a4
985 
986 /** Host Command ID : Function initialization */
987 #define HostCmd_CMD_FUNC_INIT                 0x00a9
988 /** Host Command ID : Function shutdown */
989 #define HostCmd_CMD_FUNC_SHUTDOWN             0x00aa
990 
991 /** Host Command ID : Robustcoex */
992 #define HostCmd_CMD_802_11_ROBUSTCOEX                0x00e0
993 
994 /** Host Command ID :EAPOL PKT */
995 #define HostCmd_CMD_802_11_EAPOL_PKT    			0x012e
996 
997 /** Host Command ID : 802.11 RSSI INFO EXT*/
998 #define HostCmd_CMD_RSSI_INFO_EXT             0x0237
999 /** Host Command ID : ROAMING OFFLOAD TO FW*/
1000 #define HostCmd_CMD_ROAM_OFFLOAD              0x0245
1001 
1002 /** Host Command ID: Multi chan config */
1003 #define HostCmd_CMD_MULTI_CHAN_CONFIG                0x011e
1004 /** Host Command ID: Multi chan policy */
1005 #define HostCmd_CMD_MULTI_CHAN_POLICY                0x0121
1006 /** TLV ID for multi chan info */
1007 #define TLV_TYPE_MULTI_CHAN_INFO             (PROPRIETARY_TLV_BASE_ID + 0xb7)
1008 /** TLV ID for multi chan group info */
1009 #define TLV_TYPE_MULTI_CHAN_GROUP_INFO_TLV_ID (PROPRIETARY_TLV_BASE_ID + 0xb8)
1010 /** TLV ID for DRCS TimeSlice */
1011 #define MRVL_DRCS_TIME_SLICE_TLV_ID  (PROPRIETARY_TLV_BASE_ID + 263)
1012 /** Host Command ID: DRCS config */
1013 #define HostCmd_CMD_DRCS_CONFIG                     0x024a
1014 
1015 #ifdef RX_PACKET_COALESCE
1016 /** TLV ID for RX pkt coalesce config */
1017 #define TLV_TYPE_RX_PKT_COAL_CONFIG           (PROPRIETARY_TLV_BASE_ID + 0xC9)
1018 #endif
1019 
1020 /** Host Command ID : Channel report request */
1021 #define HostCmd_CMD_CHAN_REPORT_REQUEST              0x00dd
1022 
1023 /** Host Command ID: SUPPLICANT_PMK */
1024 #define HostCmd_CMD_SUPPLICANT_PMK            0x00c4
1025 /** Host Command ID: SUPPLICANT_PROFILE */
1026 #define HostCmd_CMD_SUPPLICANT_PROFILE        0x00c5
1027 
1028 /** Host Command ID : Add Block Ack Request */
1029 #define HostCmd_CMD_11N_ADDBA_REQ             0x00ce
1030 /** Host Command ID : Delete a Block Ack Request */
1031 #define HostCmd_CMD_11N_CFG                   0x00cd
1032 /** Host Command ID : Add Block Ack Response */
1033 #define HostCmd_CMD_11N_ADDBA_RSP             0x00cf
1034 /** Host Command ID : Delete a Block Ack Request */
1035 #define HostCmd_CMD_11N_DELBA                 0x00d0
1036 /** Host Command ID: Configure Tx Buf size */
1037 #define HostCmd_CMD_RECONFIGURE_TX_BUFF       0x00d9
1038 /** Host Command ID: AMSDU Aggr Ctrl */
1039 #define HostCmd_CMD_AMSDU_AGGR_CTRL           0x00df
1040 /** Host Command ID: Configure TX Beamforming capability */
1041 #define HostCmd_CMD_TX_BF_CFG                 0x0104
1042 
1043 /** Host Command ID : 802.11 TX power configuration */
1044 #define HostCmd_CMD_TXPWR_CFG                 0x00d1
1045 
1046 /** Host Command ID : Soft Reset */
1047 #define  HostCmd_CMD_SOFT_RESET               0x00d5
1048 
1049 /** Host Command ID : 802.11 b/g/n rate configration */
1050 #define HostCmd_CMD_TX_RATE_CFG               0x00d6
1051 
1052 /** Host Command ID : Enhanced PS mode */
1053 #define HostCmd_CMD_802_11_PS_MODE_ENH        0x00e4
1054 
1055 /** Host command action : Host sleep configuration */
1056 #define HostCmd_CMD_802_11_HS_CFG_ENH         0x00e5
1057 
1058 /** Host Command ID : CAU register access */
1059 #define HostCmd_CMD_CAU_REG_ACCESS            0x00ed
1060 
1061 /** Host Command ID : mgmt IE list */
1062 #define  HostCmd_CMD_MGMT_IE_LIST             0x00f2
1063 
1064 /** Host Command ID : TDLS configuration */
1065 #define  HostCmd_CMD_TDLS_CONFIG              0x0100
1066 /** Host Command ID : TDLS operation */
1067 #define HostCmd_CMD_TDLS_OPERATION          0x0122
1068 
1069 /** Host Command ID : SDIO single port RX aggr */
1070 #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG     0x0223
1071 /** fw_cap_info bit16 for sdio sp rx aggr flag*/
1072 #define SDIO_SP_RX_AGGR_ENABLE          MBIT(16)
1073 
1074 /* fw_cap_info bit18 for ecsa support*/
1075 #define FW_CAPINFO_ECSA          MBIT(18)
1076 
1077 /* fw_cap_info bit20 for get log*/
1078 #define FW_CAPINFO_GET_LOG          MBIT(20)
1079 
1080 /** fw_cap_info bit22 for embedded supplicant support*/
1081 #define FW_CAPINFO_SUPPLICANT_SUPPORT    MBIT(21)
1082 
1083 /** fw_cap_info bit23 for embedded authenticator support*/
1084 #define FW_CAPINFO_AUTH_SUPPORT    MBIT(22)
1085 
1086 /** fw_cap_info bit23 for firmware roaming*/
1087 #define FW_ROAMING_SUPPORT    MBIT(23)
1088 
1089 /** fw_cap_info bit25 for adhoc support*/
1090 #define FW_CAPINFO_ADHOC_SUPPORT    MBIT(25)
1091 /** Check if adhoc is supported by firmware */
1092 #define IS_FW_SUPPORT_ADHOC(_adapter)    (_adapter->fw_cap_info & FW_CAPINFO_ADHOC_SUPPORT)
1093 
1094 /** Check if supplicant is supported by firmware */
1095 #define IS_FW_SUPPORT_SUPPLICANT(_adapter)    (_adapter->fw_cap_info & FW_CAPINFO_SUPPLICANT_SUPPORT)
1096 
1097 /** Check if authenticator is supported by firmware */
1098 #define IS_FW_SUPPORT_AUTHENTICATOR(_adapter)    (_adapter->fw_cap_info & FW_CAPINFO_AUTH_SUPPORT)
1099 
1100 #ifdef RX_PACKET_COALESCE
1101 /** Host Command ID : Rx packet coalescing configuration */
1102 #define HostCmd_CMD_RX_PKT_COALESCE_CFG       0x012c
1103 #endif
1104 
1105 /** Host Command ID : Extended scan support */
1106 #define  HostCmd_CMD_802_11_SCAN_EXT          0x0107
1107 
1108 /** Host Command ID : Forward mgmt frame */
1109 #define HostCmd_CMD_RX_MGMT_IND               0x010c
1110 
1111 /** Host Command ID : Set BSS_MODE */
1112 #define HostCmd_CMD_SET_BSS_MODE               0x00f7
1113 
1114 #ifdef UAP_SUPPORT
1115 /**  Host Command id: SYS_INFO */
1116 #define HOST_CMD_APCMD_SYS_INFO                0x00ae
1117 /** Host Command id: sys_reset */
1118 #define HOST_CMD_APCMD_SYS_RESET               0x00af
1119 /** Host Command id: SYS_CONFIGURE  */
1120 #define HOST_CMD_APCMD_SYS_CONFIGURE           0x00b0
1121 /** Host Command id: BSS_START */
1122 #define HOST_CMD_APCMD_BSS_START               0x00b1
1123 /** Host Command id: BSS_STOP  */
1124 #define HOST_CMD_APCMD_BSS_STOP                0x00b2
1125 /** Host Command id: sta_list */
1126 #define HOST_CMD_APCMD_STA_LIST                0x00b3
1127 /** Host Command id: STA_DEAUTH */
1128 #define HOST_CMD_APCMD_STA_DEAUTH              0x00b5
1129 
1130 /** Host Command id: UAP_OPER_CTRL */
1131 #define HOST_CMD_APCMD_OPER_CTRL              0x0233
1132 #endif /* UAP_SUPPORT */
1133 
1134 /** Host Command id: PMIC CONFIGURE*/
1135 #define HOST_CMD_PMIC_CONFIGURE                0x23E
1136 
1137 /** Host Command ID: 802.11 Network Monitor */
1138 #define HostCmd_CMD_802_11_NET_MONITOR         0x0102
1139 
1140 /** Host Command ID: Tx data pause */
1141 #define HostCmd_CMD_CFG_TX_DATA_PAUSE           0x0103
1142 
1143 #ifdef WIFI_DIRECT_SUPPORT
1144 /** Host Command ID: P2P PARAMS CONFIG */
1145 #define HOST_CMD_P2P_PARAMS_CONFIG              0x00ea
1146 /** Host Command ID: WIFI_DIRECT_MODE_CONFIG */
1147 #define HOST_CMD_WIFI_DIRECT_MODE_CONFIG    0x00eb
1148 #endif
1149 
1150 /** Host Command ID: Remain On Channel */
1151 #define HostCmd_CMD_802_11_REMAIN_ON_CHANNEL     0x010d
1152 
1153 #define HostCmd_CMD_COALESCE_CFG                 0x010a
1154 
1155 /** Host Command ID: GTK REKEY OFFLOAD CFG */
1156 #define HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG       0x010f
1157 
1158 /** Host Command ID : OTP user data */
1159 #define HostCmd_CMD_OTP_READ_USER_DATA          0x0114
1160 
1161 /** Host Command ID: HS wakeup reason */
1162 #define HostCmd_CMD_HS_WAKEUP_REASON         0x0116
1163 
1164 /** Host Command ID: reject addba request */
1165 #define HostCmd_CMD_REJECT_ADDBA_REQ         0x0119
1166 
1167 #define HostCmd_CMD_FW_DUMP_EVENT            0x0125
1168 
1169 /** Host Command ID : Target device access */
1170 #define HostCmd_CMD_TARGET_ACCESS            0x012a
1171 
1172 /** Host Command ID: DFS repeater mode */
1173 #define HostCmd_DFS_REPEATER_MODE	0x012b
1174 
1175 /** Host Command ID: Get sensor temp*/
1176 #define HostCmd_DS_GET_SENSOR_TEMP	0x0227
1177 
1178 /** Host Command ID : Configure ADHOC_OVER_IP parameters */
1179 #define HostCmd_CMD_WMM_PARAM_CONFIG                0x023a
1180 
1181 #ifdef STA_SUPPORT
1182 /** Host Command ID :  set/get sta configure */
1183 #define HostCmd_CMD_STA_CONFIGURE            0x023f
1184 #endif
1185 
1186 /** Host Command ID : GPIO independent reset configure */
1187 #define HostCmd_CMD_INDEPENDENT_RESET_CFG    0x0243
1188 
1189 #define HostCmd_CMD_HOST_CLOCK_CFG          0x0246
1190 
1191 /** Channel usability flags */
1192 #define MARVELL_CHANNEL_DISABLED		MBIT(7)
1193 #define MARVELL_CHANNEL_NOHT160			MBIT(4)
1194 #define MARVELL_CHANNEL_NOHT80			MBIT(3)
1195 #define MARVELL_CHANNEL_NOHT40			MBIT(2)
1196 #define MARVELL_CHANNEL_DFS				MBIT(1)
1197 #define MARVELL_CHANNEL_PASSIVE			MBIT(0)
1198 
1199 #define HostCmd_CMD_CHAN_REGION_CFG			0x0242
1200 /* OTP Region info */
1201 typedef MLAN_PACK_START struct _otp_region_info {
1202 	t_u8 country_code[2];
1203 	t_u8 region_code;
1204 	t_u8 environment;
1205 	t_u16 force_reg:1;
1206 	t_u16 reserved:15;
1207 } MLAN_PACK_END otp_region_info_t;
1208 
1209 #define FW_CFP_TABLE_MAX_ROWS_BG		14
1210 #define FW_CFP_TABLE_MAX_COLS_BG		11
1211 
1212 #define FW_CFP_TABLE_MAX_ROWS_A		39
1213 #define FW_CFP_TABLE_MAX_COLS_A		17
1214 
1215 #define HostCmd_CMD_BOOT_SLEEP              0x0258
1216 
1217 /** Enhanced PS modes */
1218 typedef enum _ENH_PS_MODES {
1219 	GET_PS = 0,
1220 	SLEEP_CONFIRM = 5,
1221 	DIS_AUTO_PS = 0xfe,
1222 	EN_AUTO_PS = 0xff,
1223 } ENH_PS_MODES;
1224 
1225 /** Command RET code, MSB is set to 1 */
1226 #define HostCmd_RET_BIT                       0x8000
1227 
1228 /** General purpose action : Get */
1229 #define HostCmd_ACT_GEN_GET                   0x0000
1230 /** General purpose action : Set */
1231 #define HostCmd_ACT_GEN_SET                   0x0001
1232 /** General purpose action : Get_Current */
1233 #define HostCmd_ACT_GEN_GET_CURRENT           0x0003
1234 /** General purpose action : Remove */
1235 #define HostCmd_ACT_GEN_REMOVE                0x0004
1236 /** General purpose action : Reset */
1237 #define HostCmd_ACT_GEN_RESET                 0x0005
1238 
1239 /** Host command action : Set Rx */
1240 #define HostCmd_ACT_SET_RX                    0x0001
1241 /** Host command action : Set Tx */
1242 #define HostCmd_ACT_SET_TX                    0x0002
1243 /** Host command action : Set both Rx and Tx */
1244 #define HostCmd_ACT_SET_BOTH                  0x0003
1245 /** Host command action : Get Rx */
1246 #define HostCmd_ACT_GET_RX                    0x0004
1247 /** Host command action : Get Tx */
1248 #define HostCmd_ACT_GET_TX                    0x0008
1249 /** Host command action : Get both Rx and Tx */
1250 #define HostCmd_ACT_GET_BOTH                  0x000c
1251 
1252 /** General Result Code*/
1253 /** General result code OK */
1254 #define HostCmd_RESULT_OK                     0x0000
1255 /** Genenral error */
1256 #define HostCmd_RESULT_ERROR                  0x0001
1257 /** Command is not valid */
1258 #define HostCmd_RESULT_NOT_SUPPORT            0x0002
1259 /** Command is pending */
1260 #define HostCmd_RESULT_PENDING                0x0003
1261 /** System is busy (command ignored) */
1262 #define HostCmd_RESULT_BUSY                   0x0004
1263 /** Data buffer is not big enough */
1264 #define HostCmd_RESULT_PARTIAL_DATA           0x0005
1265 
1266 /* Define action or option for HostCmd_CMD_MAC_CONTROL */
1267 /** MAC action : Rx on */
1268 #define HostCmd_ACT_MAC_RX_ON                 0x0001
1269 /** MAC action : Tx on */
1270 #define HostCmd_ACT_MAC_TX_ON                 0x0002
1271 /** MAC action : WEP enable */
1272 #define HostCmd_ACT_MAC_WEP_ENABLE            0x0008
1273 /** MAC action : EthernetII enable */
1274 #define HostCmd_ACT_MAC_ETHERNETII_ENABLE     0x0010
1275 /** MAC action : Promiscous mode enable */
1276 #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE    0x0080
1277 /** MAC action : All multicast enable */
1278 #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE  0x0100
1279 /** MAC action : RTS/CTS enable */
1280 #define HostCmd_ACT_MAC_RTS_CTS_ENABLE        0x0200
1281 /** MAC action : Strict protection enable */
1282 #define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE  0x0400
1283 /** MAC action : Force 11n protection disable */
1284 #define HostCmd_ACT_MAC_FORCE_11N_PROTECTION_OFF  0x0800
1285 /** MAC action : Ad-Hoc G protection on */
1286 #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON     0x2000
1287 
1288 /* Define action or option for HostCmd_CMD_802_11_SCAN */
1289 /** Scan type : BSS */
1290 #define HostCmd_BSS_MODE_BSS                0x0001
1291 /** Scan type : IBSS */
1292 #define HostCmd_BSS_MODE_IBSS               0x0002
1293 /** Scan type : Any */
1294 #define HostCmd_BSS_MODE_ANY                0x0003
1295 
1296 /** Define bitmap conditions for HOST_SLEEP_CFG : GPIO FF */
1297 #define HOST_SLEEP_CFG_GPIO_FF              0xff
1298 /** Define bitmap conditions for HOST_SLEEP_CFG : GAP FF */
1299 #define HOST_SLEEP_CFG_GAP_FF               0xff
1300 
1301 /** Buffer Constants */
1302 /** Number of command buffers */
1303 #define MRVDRV_NUM_OF_CMD_BUFFER        30
1304 /** Size of command buffer */
1305 #define MRVDRV_SIZE_OF_CMD_BUFFER       (2 * 1024)
1306 
1307 /** Maximum number of BSS Descriptors */
1308 #define MRVDRV_MAX_BSSID_LIST           200
1309 
1310 /** Host command flag in command */
1311 #define CMD_F_HOSTCMD           (1 << 0)
1312 /** command cancel flag in command */
1313 #define CMD_F_CANCELED          (1 << 1)
1314 /** scan command flag */
1315 #define CMD_F_SCAN              (1 << 2)
1316 
1317 /** Host Command ID bit mask (bit 11:0) */
1318 #define HostCmd_CMD_ID_MASK             0x0fff
1319 
1320 /** Host Command Sequence number mask (bit 7:0) */
1321 #define HostCmd_SEQ_NUM_MASK            0x00ff
1322 
1323 /** Host Command BSS number mask (bit 11:8) */
1324 #define HostCmd_BSS_NUM_MASK            0x0f00
1325 
1326 /** Host Command BSS type mask (bit 15:12) */
1327 #define HostCmd_BSS_TYPE_MASK           0xf000
1328 
1329 /** Set BSS information to Host Command */
1330 #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type)    \
1331 	((((seq) & 0x00ff) |         \
1332 		(((num) & 0x000f) << 8)) | \
1333 		(((type) & 0x000f) << 12))
1334 
1335 /** Get Sequence Number from Host Command (bit 7:0) */
1336 #define HostCmd_GET_SEQ_NO(seq)       \
1337 	((seq) & HostCmd_SEQ_NUM_MASK)
1338 
1339 /** Get BSS number from Host Command (bit 11:8) */
1340 #define HostCmd_GET_BSS_NO(seq)         \
1341 	(((seq) & HostCmd_BSS_NUM_MASK) >> 8)
1342 
1343 /** Get BSS type from Host Command (bit 15:12) */
1344 #define HostCmd_GET_BSS_TYPE(seq)       \
1345 	(((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
1346 
1347 /** Card Event definition : Dummy host wakeup signal */
1348 #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL  0x00000001
1349 /** Card Event definition : Link lost */
1350 #define EVENT_LINK_LOST                 0x00000003
1351 /** Card Event definition : Link sensed */
1352 #define EVENT_LINK_SENSED               0x00000004
1353 /** Card Event definition : MIB changed */
1354 #define EVENT_MIB_CHANGED               0x00000006
1355 /** Card Event definition : Init done */
1356 #define EVENT_INIT_DONE                 0x00000007
1357 /** Card Event definition : Deauthenticated */
1358 #define EVENT_DEAUTHENTICATED           0x00000008
1359 /** Card Event definition : Disassociated */
1360 #define EVENT_DISASSOCIATED             0x00000009
1361 /** Card Event definition : Power save awake */
1362 #define EVENT_PS_AWAKE                  0x0000000a
1363 /** Card Event definition : Power save sleep */
1364 #define EVENT_PS_SLEEP                  0x0000000b
1365 /** Card Event definition : MIC error multicast */
1366 #define EVENT_MIC_ERR_MULTICAST         0x0000000d
1367 /** Card Event definition : MIC error unicast */
1368 #define EVENT_MIC_ERR_UNICAST           0x0000000e
1369 
1370 /** Card Event definition : Ad-Hoc BCN lost */
1371 #define EVENT_ADHOC_BCN_LOST            0x00000011
1372 
1373 /** Card Event definition : Stop Tx */
1374 #define EVENT_STOP_TX                   0x00000013
1375 /** Card Event definition : Start Tx */
1376 #define EVENT_START_TX                  0x00000014
1377 /** Card Event definition : Channel switch */
1378 #define EVENT_CHANNEL_SWITCH            0x00000015
1379 
1380 /** Card Event definition : MEAS report ready */
1381 #define EVENT_MEAS_REPORT_RDY           0x00000016
1382 
1383 /** Card Event definition : WMM status change */
1384 #define EVENT_WMM_STATUS_CHANGE         0x00000017
1385 
1386 /** Card Event definition : BG scan report */
1387 #define EVENT_BG_SCAN_REPORT            0x00000018
1388 /** Card Event definition : BG scan stopped */
1389 #define EVENT_BG_SCAN_STOPPED       0x00000065
1390 
1391 /** Card Event definition : Beacon RSSI low */
1392 #define EVENT_RSSI_LOW                  0x00000019
1393 /** Card Event definition : Beacon SNR low */
1394 #define EVENT_SNR_LOW                   0x0000001a
1395 /** Card Event definition : Maximum fail */
1396 #define EVENT_MAX_FAIL                  0x0000001b
1397 /** Card Event definition : Beacon RSSI high */
1398 #define EVENT_RSSI_HIGH                 0x0000001c
1399 /** Card Event definition : Beacon SNR high */
1400 #define EVENT_SNR_HIGH                  0x0000001d
1401 
1402 /** Card Event definition : IBSS coalsced */
1403 #define EVENT_IBSS_COALESCED            0x0000001e
1404 
1405 /** Event definition : IBSS station connected */
1406 #define EVENT_IBSS_STATION_CONNECT      0x00000020
1407 /** Event definition : IBSS station dis-connected */
1408 #define EVENT_IBSS_STATION_DISCONNECT   0x00000021
1409 
1410 /** Card Event definition : Data RSSI low */
1411 #define EVENT_DATA_RSSI_LOW             0x00000024
1412 /** Card Event definition : Data SNR low */
1413 #define EVENT_DATA_SNR_LOW              0x00000025
1414 /** Card Event definition : Data RSSI high */
1415 #define EVENT_DATA_RSSI_HIGH            0x00000026
1416 /** Card Event definition : Data SNR high */
1417 #define EVENT_DATA_SNR_HIGH             0x00000027
1418 
1419 /** Card Event definition : Link Quality */
1420 #define EVENT_LINK_QUALITY              0x00000028
1421 
1422 /** Card Event definition : Port release event */
1423 #define EVENT_PORT_RELEASE              0x0000002b
1424 
1425 /** Card Event definition : Pre-Beacon Lost */
1426 #define EVENT_PRE_BEACON_LOST           0x00000031
1427 
1428 /** Card Event definition : Add BA event */
1429 #define EVENT_ADDBA                     0x00000033
1430 /** Card Event definition : Del BA event */
1431 #define EVENT_DELBA                     0x00000034
1432 /** Card Event definition: BA stream timeout*/
1433 #define EVENT_BA_STREAM_TIMEOUT         0x00000037
1434 
1435 /** Card Event definition : AMSDU aggr control */
1436 #define EVENT_AMSDU_AGGR_CTRL           0x00000042
1437 
1438 /** Card Event definition: WEP ICV error */
1439 #define EVENT_WEP_ICV_ERR               0x00000046
1440 
1441 /** Card Event definition : Host sleep enable */
1442 #define EVENT_HS_ACT_REQ                0x00000047
1443 
1444 /** Card Event definition : BW changed */
1445 #define EVENT_BW_CHANGE                 0x00000048
1446 
1447 #ifdef WIFI_DIRECT_SUPPORT
1448 /** WIFIDIRECT generic event */
1449 #define EVENT_WIFIDIRECT_GENERIC_EVENT         0x00000049
1450 /** WIFIDIRECT service discovery event */
1451 #define EVENT_WIFIDIRECT_SERVICE_DISCOVERY     0x0000004a
1452 #endif
1453 
1454 /** Remain on Channel expired event */
1455 #define EVENT_REMAIN_ON_CHANNEL_EXPIRED        0x0000005f
1456 
1457 /** TDLS generic event */
1458 #define EVENT_TDLS_GENERIC_EVENT        0x00000052
1459 
1460 /** Card Event definition: Channel switch pending announcment */
1461 #define EVENT_CHANNEL_SWITCH_ANN        0x00000050
1462 
1463 /** Event definition:  Radar Detected by card */
1464 #define EVENT_RADAR_DETECTED            0x00000053
1465 
1466 /** Event definition:  Radar Detected by card */
1467 #define EVENT_CHANNEL_REPORT_RDY        0x00000054
1468 
1469 /** Event definition:  Scan results through event */
1470 #define EVENT_EXT_SCAN_REPORT           0x00000058
1471 /** Enhance ext scan done event */
1472 #define EVENT_EXT_SCAN_STATUS_REPORT    0x0000007f
1473 
1474 /** Event definition : FW debug information */
1475 #define EVENT_FW_DEBUG_INFO             0x00000063
1476 
1477 /** Event definition: RXBA_SYNC */
1478 #define EVENT_RXBA_SYNC                 0x00000059
1479 
1480 #ifdef UAP_SUPPORT
1481 /** Event ID: STA deauth */
1482 #define EVENT_MICRO_AP_STA_DEAUTH       0x0000002c
1483 /** Event ID: STA assoicated */
1484 #define EVENT_MICRO_AP_STA_ASSOC        0x0000002d
1485 /** Event ID: BSS started */
1486 #define EVENT_MICRO_AP_BSS_START        0x0000002e
1487 /** Event ID: BSS idle event */
1488 #define EVENT_MICRO_AP_BSS_IDLE         0x00000043
1489 /** Event ID: BSS active event */
1490 #define EVENT_MICRO_AP_BSS_ACTIVE       0x00000044
1491 
1492 #endif /* UAP_SUPPORT */
1493 
1494 /** Event ID: TX data pause event */
1495 #define EVENT_TX_DATA_PAUSE                  0x00000055
1496 
1497 /** Event ID: SAD Report */
1498 #define EVENT_SAD_REPORT                     0x00000066
1499 
1500 /** Event ID: Multi Chan Info*/
1501 #define EVENT_MULTI_CHAN_INFO               0x0000006a
1502 
1503 /** Event ID: Tx status */
1504 #define EVENT_TX_STATUS_REPORT               0x00000074
1505 
1506 #define EVENT_BT_COEX_WLAN_PARA_CHANGE	 0x00000076
1507 
1508 #define EVENT_ROAM_OFFLOAD     0x00000083
1509 
1510 #define EVENT_NLIST_REPORT     0x00000079
1511 
1512 #define EVENT_EXCEED_MAX_P2P_CONN     0x00000089
1513 
1514 #define EVENT_FW_DUMP_INFO      0x00000073
1515 /** Event ID mask */
1516 #define EVENT_ID_MASK                   0xffff
1517 
1518 /** BSS number mask */
1519 #define BSS_NUM_MASK                    0xf
1520 
1521 /** Get BSS number from event cause (bit 23:16) */
1522 #define EVENT_GET_BSS_NUM(event_cause)          \
1523 	(((event_cause) >> 16) & BSS_NUM_MASK)
1524 
1525 /** Get BSS type from event cause (bit 31:24) */
1526 #define EVENT_GET_BSS_TYPE(event_cause)         \
1527 	(((event_cause) >> 24) & 0x00ff)
1528 
1529 /** event type for tdls setup failure */
1530 #define TDLS_EVENT_TYPE_SETUP_FAILURE         1
1531 /** event type for tdls setup request received */
1532 #define TDLS_EVENT_TYPE_SETUP_REQ             2
1533 /** event type for tdls link torn down */
1534 #define TDLS_EVENT_TYPE_LINK_TORN_DOWN        3
1535 /** event type for tdls link established */
1536 #define TDLS_EVENT_TYPE_LINK_ESTABLISHED      4
1537 /** event type for tdls debug */
1538 #define TDLS_EVENT_TYPE_DEBUG                 5
1539 /** event type for tdls packet */
1540 #define TDLS_EVENT_TYPE_PACKET                6
1541 /** event type for channel switch result */
1542 #define TDLS_EVENT_TYPE_CHAN_SWITCH_RESULT    7
1543 /** event type for start channel switch */
1544 #define TDLS_EVENT_TYPE_START_CHAN_SWITCH     8
1545 /** event type for stop channel switch */
1546 #define TDLS_EVENT_TYPE_CHAN_SWITCH_STOPPED    9
1547 
1548 /** Packet received on direct link */
1549 #define RXPD_FLAG_PKT_DIRECT_LINK             1
1550 /** TDLS base channel */
1551 #define TDLS_BASE_CHANNEL   0
1552 /** TDLS off channel */
1553 #define TDLS_OFF_CHANNEL    1
1554 
1555 /** structure for channel switch result from TDLS FW */
1556 typedef MLAN_PACK_START struct _chan_switch_result {
1557     /** current channel, 0 - base channel, 1 - off channel*/
1558 	t_u8 current_channel;
1559     /** channel switch status*/
1560 	t_u8 status;
1561     /** channel switch fauilure reason code*/
1562 	t_u8 reason;
1563 } MLAN_PACK_END chan_switch_result;
1564 
1565 typedef MLAN_PACK_START struct _ie_data {
1566     /** IE Length */
1567 	t_u16 ie_length;
1568     /** IE pointer */
1569 	t_u8 ie_ptr[0];
1570 } MLAN_PACK_END tdls_ie_data;
1571 
1572 /** Event structure for generic events from TDLS FW */
1573 typedef MLAN_PACK_START struct _Event_tdls_generic {
1574     /** Event Type */
1575 	t_u16 event_type;
1576     /** Peer mac address */
1577 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
1578 	union {
1579 	/** channel switch result structure*/
1580 		chan_switch_result switch_result;
1581 	/** channel switch stop reason*/
1582 		t_u8 cs_stop_reason;
1583 	/** Reason code */
1584 		t_u16 reason_code;
1585 	/** IE data */
1586 		tdls_ie_data ie_data;
1587 	} u;
1588 } MLAN_PACK_END Event_tdls_generic;
1589 
1590 typedef enum _tdls_error_code_e {
1591 	NO_ERROR = 0,
1592 	INTERNAL_ERROR,
1593 	MAX_TDLS_LINKS_EST,
1594 	TDLS_LINK_EXISTS,
1595 	TDLS_LINK_NONEXISTENT,
1596 	TDLS_PEER_STA_UNREACHABLE = 25,
1597 } tdls_error_code_e;
1598 
1599 /** Event structure for generic events from NAN FW */
1600 typedef MLAN_PACK_START struct _event_nan_generic {
1601     /** NAN Event SubType */
1602 	t_u16 event_sub_type;
1603 } MLAN_PACK_END event_nan_generic;
1604 
1605 #define RXPD_FLAG_EXTRA_HEADER             (1 << 1)
1606 
1607 /** Event_WEP_ICV_ERR structure */
1608 typedef MLAN_PACK_START struct _Event_WEP_ICV_ERR {
1609     /** Reason code */
1610 	t_u16 reason_code;
1611     /** Source MAC address */
1612 	t_u8 src_mac_addr[MLAN_MAC_ADDR_LENGTH];
1613     /** WEP decryption used key */
1614 	t_u8 wep_key_index;
1615     /** WEP key length */
1616 	t_u8 wep_key_length;
1617     /** WEP key */
1618 	t_u8 key[MAX_WEP_KEY_SIZE];
1619 } MLAN_PACK_END Event_WEP_ICV_ERR;
1620 
1621 /** WLAN_802_11_FIXED_IEs */
1622 typedef MLAN_PACK_START struct _WLAN_802_11_FIXED_IEs {
1623     /** Timestamp */
1624 	t_u8 time_stamp[8];
1625     /** Beacon interval */
1626 	t_u16 beacon_interval;
1627     /** Capabilities*/
1628 	t_u16 capabilities;
1629 } MLAN_PACK_END WLAN_802_11_FIXED_IEs;
1630 
1631 /** WLAN_802_11_VARIABLE_IEs */
1632 typedef MLAN_PACK_START struct _WLAN_802_11_VARIABLE_IEs {
1633     /** Element ID */
1634 	t_u8 element_id;
1635     /** Length */
1636 	t_u8 length;
1637     /** IE data */
1638 	t_u8 data[1];
1639 } MLAN_PACK_END WLAN_802_11_VARIABLE_IEs;
1640 
1641 /** TLV related data structures*/
1642 /** MrvlIEtypesHeader_t */
1643 typedef MLAN_PACK_START struct _MrvlIEtypesHeader {
1644     /** Header type */
1645 	t_u16 type;
1646     /** Header length */
1647 	t_u16 len;
1648 } MLAN_PACK_END MrvlIEtypesHeader_t;
1649 
1650 /** MrvlIEtypes_Data_t */
1651 typedef MLAN_PACK_START struct _MrvlIEtypes_Data_t {
1652     /** Header */
1653 	MrvlIEtypesHeader_t header;
1654     /** Data */
1655 	t_u8 data[1];
1656 } MLAN_PACK_END MrvlIEtypes_Data_t;
1657 
1658 /*TDLS TIMEOUT VALUE (seconds)*/
1659 #define TDLS_IDLE_TIMEOUT             60
1660 /** MrvlIEtypes_Data_t */
1661 typedef MLAN_PACK_START struct _MrvlIEtypes_TDLS_Idle_Timeout_t {
1662     /** Header */
1663 	MrvlIEtypesHeader_t header;
1664     /** value */
1665 	t_u16 value;
1666 } MLAN_PACK_END MrvlIEtypes_TDLS_Idle_Timeout_t;
1667 #if defined(STA_SUPPORT)
1668 /** Pairwise Cipher Suite length */
1669 #define PAIRWISE_CIPHER_SUITE_LEN    4
1670 /** AKM Suite length */
1671 #define AKM_SUITE_LEN    4
1672 /** MFPC bit in RSN capability */
1673 #define MFPC_BIT    7
1674 /** MFPR bit in RSN capability */
1675 #define MFPR_BIT    6
1676 #endif
1677 /** Bit mask for TxPD status field for null packet */
1678 #define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET 0x01
1679 /** Bit mask for TxPD status field for last packet */
1680 #define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET 0x08
1681 
1682 /** Bit mask for TxPD flags field for TDLS packet */
1683 #define MRVDRV_TxPD_FLAGS_TDLS_PACKET MBIT(4)
1684 
1685 /** Bit mask for TxPD flags field for Tx status report */
1686 #define MRVDRV_TxPD_FLAGS_TX_PACKET_STATUS  MBIT(5)
1687 
1688 /** Packet type: 802.11 */
1689 #define PKT_TYPE_802DOT11   0x05
1690 #define PKT_TYPE_MGMT_FRAME 0xE5
1691 /** Packet type: AMSDU */
1692 #define PKT_TYPE_AMSDU      0xE6
1693 /** Packet type: BAR */
1694 #define PKT_TYPE_BAR        0xE7
1695 
1696 /** Packet type: debugging */
1697 #define PKT_TYPE_DEBUG      0xEF
1698 
1699 /** channel number at bit 5-13 */
1700 #define RXPD_CHAN_MASK		0x3FE0
1701 /** Rate control mask  15-23 */
1702 #define TXPD_RATE_MASK		0xff8000
1703 /** enable bw ctrl in TxPD */
1704 #define TXPD_BW_ENABLE		MBIT(20)
1705 /** enable tx power ctrl in TxPD */
1706 #define TXPD_TXPW_ENABLE    MBIT(7)
1707 /** sign of power */
1708 #define TXPD_TXPW_NEGATIVE	MBIT(6)
1709 /** Enable Rate ctrl in TxPD */
1710 #define TXPD_TXRATE_ENABLE	MBIT(15)
1711 /** enable retry limit in TxPD */
1712 #define TXPD_RETRY_ENABLE	MBIT(12)
1713 
1714 /** TxPD descriptor */
1715 typedef MLAN_PACK_START struct _TxPD {
1716     /** BSS type */
1717 	t_u8 bss_type;
1718     /** BSS number */
1719 	t_u8 bss_num;
1720     /** Tx packet length */
1721 	t_u16 tx_pkt_length;
1722     /** Tx packet offset */
1723 	t_u16 tx_pkt_offset;
1724     /** Tx packet type */
1725 	t_u16 tx_pkt_type;
1726     /** Tx Control */
1727 	t_u32 tx_control;
1728     /** Pkt Priority */
1729 	t_u8 priority;
1730     /** Transmit Pkt Flags*/
1731 	t_u8 flags;
1732     /** Amount of time the packet has been queued
1733       * in the driver (units = 2ms)*/
1734 	t_u8 pkt_delay_2ms;
1735     /** reserved */
1736 	t_u8 reserved;
1737     /** Tx Control */
1738 	t_u32 tx_control_1;
1739 } MLAN_PACK_END TxPD, *PTxPD;
1740 
1741 /** RxPD Descriptor */
1742 typedef MLAN_PACK_START struct _RxPD {
1743     /** BSS type */
1744 	t_u8 bss_type;
1745     /** BSS number */
1746 	t_u8 bss_num;
1747     /** Rx Packet Length */
1748 	t_u16 rx_pkt_length;
1749     /** Rx Pkt offset */
1750 	t_u16 rx_pkt_offset;
1751     /** Rx packet type */
1752 	t_u16 rx_pkt_type;
1753     /** Sequence number */
1754 	t_u16 seq_num;
1755     /** Packet Priority */
1756 	t_u8 priority;
1757     /** Rx Packet Rate */
1758 	t_u8 rx_rate;
1759     /** SNR */
1760 	t_s8 snr;
1761     /** Noise Floor */
1762 	t_s8 nf;
1763     /** [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
1764      *  [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01 BW80 = 10 BW160 = 11
1765      *  [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
1766      *  [Bit 5] STBC support Enabled = 1
1767      *  [Bit 6] LDPC support Enabled = 1
1768      *  [Bit 7] Reserved */
1769 	t_u8 rate_info;
1770    /** Reserved */
1771 	t_u8 reserved[3];
1772     /** TDLS flags, bit 0: 0=InfraLink, 1=DirectLink */
1773 	t_u8 flags;
1774     /**For SD8887 antenna info: 0 = 2.4G antenna a; 1 = 2.4G antenna b; 3 = 5G antenna; 0xff = invalid value */
1775 	t_u8 antenna;
1776 	/* [31:0] ToA of the rx packet, [63:32] ToD of the ack for the rx packet Both ToA and ToD are in nanoseconds */
1777 	t_u64 toa_tod_tstamps;
1778     /** rx info */
1779 	t_u32 rx_info;
1780 } MLAN_PACK_END RxPD, *PRxPD;
1781 
1782 /** IEEEtypes_FrameCtl_t*/
1783 #ifdef BIG_ENDIAN_SUPPORT
1784 typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t {
1785 
1786     /** Order */
1787 	t_u8 order:1;
1788     /** Wep */
1789 	t_u8 wep:1;
1790     /** More Data */
1791 	t_u8 more_data:1;
1792     /** Power Mgmt */
1793 	t_u8 pwr_mgmt:1;
1794     /** Retry */
1795 	t_u8 retry:1;
1796     /** More Frag */
1797 	t_u8 more_frag:1;
1798     /** From DS */
1799 	t_u8 from_ds:1;
1800     /** To DS */
1801 	t_u8 to_ds:1;
1802     /** Sub Type */
1803 	t_u8 sub_type:4;
1804     /** Type */
1805 	t_u8 type:2;
1806     /** Protocol Version */
1807 	t_u8 protocol_version:2;
1808 } MLAN_PACK_END IEEEtypes_FrameCtl_t;
1809 #else
1810 typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t {
1811     /** Protocol Version */
1812 	t_u8 protocol_version:2;
1813     /** Type */
1814 	t_u8 type:2;
1815     /** Sub Type */
1816 	t_u8 sub_type:4;
1817     /** To DS */
1818 	t_u8 to_ds:1;
1819     /** From DS */
1820 	t_u8 from_ds:1;
1821     /** More Frag */
1822 	t_u8 more_frag:1;
1823     /** Retry */
1824 	t_u8 retry:1;
1825     /** Power Mgmt */
1826 	t_u8 pwr_mgmt:1;
1827     /** More Data */
1828 	t_u8 more_data:1;
1829     /** Wep */
1830 	t_u8 wep:1;
1831     /** Order */
1832 	t_u8 order:1;
1833 } MLAN_PACK_END IEEEtypes_FrameCtl_t;
1834 #endif
1835 
1836 /** MrvlIETypes_MgmtFrameSet_t */
1837 typedef MLAN_PACK_START struct _MrvlIETypes_MgmtFrameSet_t {
1838     /** Type */
1839 	t_u16 type;
1840     /** Length */
1841 	t_u16 len;
1842     /** Frame Control */
1843 	IEEEtypes_FrameCtl_t frame_control;
1844 	/* t_u8 frame_contents[0]; */
1845 } MLAN_PACK_END MrvlIETypes_MgmtFrameSet_t;
1846 
1847 /** Beacon */
1848 typedef MLAN_PACK_START struct _IEEEtypes_Beacon_t {
1849 	/** time stamp */
1850 	t_u8 time_stamp[8];
1851 	/** beacon interval */
1852 	t_u16 beacon_interval;
1853 	/** cap info */
1854 	t_u16 cap_info;
1855 } MLAN_PACK_END IEEEtypes_Beacon_t;
1856 
1857 /** Fixed size of station association event */
1858 #define ASSOC_EVENT_FIX_SIZE    12
1859 
1860 /** MrvlIEtypes_channel_band_t */
1861 typedef MLAN_PACK_START struct _MrvlIEtypes_channel_band_t {
1862     /** Header */
1863 	MrvlIEtypesHeader_t header;
1864     /** Band Configuration */
1865 	Band_Config_t bandcfg;
1866     /** channel */
1867 	t_u8 channel;
1868 } MLAN_PACK_END MrvlIEtypes_channel_band_t;
1869 
1870 #ifdef UAP_SUPPORT
1871 /** TxPD descriptor */
1872 typedef MLAN_PACK_START struct _UapTxPD {
1873 	/** BSS type */
1874 	t_u8 bss_type;
1875 	/** BSS number */
1876 	t_u8 bss_num;
1877 	/** Tx packet length */
1878 	t_u16 tx_pkt_length;
1879 	/** Tx packet offset */
1880 	t_u16 tx_pkt_offset;
1881 	/** Tx packet type */
1882 	t_u16 tx_pkt_type;
1883 	/** Tx Control */
1884 	t_u32 tx_control;
1885 	/** Pkt Priority */
1886 	t_u8 priority;
1887 	/** Transmit Pkt Flags*/
1888 	t_u8 flags;
1889     /** Amount of time the packet has been queued
1890       * in the driver (units = 2ms)*/
1891 	t_u8 pkt_delay_2ms;
1892     /** reserved */
1893 	t_u8 reserved;
1894     /** Tx Control */
1895 	t_u32 tx_control_1;
1896 } MLAN_PACK_END UapTxPD, *PUapTxPD;
1897 
1898 /** RxPD Descriptor */
1899 typedef MLAN_PACK_START struct _UapRxPD {
1900     /** BSS Type */
1901 	t_u8 bss_type;
1902     /** BSS number*/
1903 	t_u8 bss_num;
1904     /** Rx packet length */
1905 	t_u16 rx_pkt_length;
1906     /** Rx packet offset */
1907 	t_u16 rx_pkt_offset;
1908     /** Rx packet type */
1909 	t_u16 rx_pkt_type;
1910     /** Sequence nunmber */
1911 	t_u16 seq_num;
1912     /** Packet Priority */
1913 	t_u8 priority;
1914     /** Rx Packet Rate */
1915 	t_u8 rx_rate;
1916     /** SNR */
1917 	t_s8 snr;
1918     /** Noise Floor */
1919 	t_s8 nf;
1920     /** [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
1921      *  [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01 BW80 = 10 BW160 = 11
1922      *  [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
1923      *  [Bit 5] STBC support Enabled = 1
1924      *  [Bit 6] LDPC support Enabled = 1
1925      *  [Bit 7] Reserved */
1926 	t_u8 rate_info;
1927     /** Reserved */
1928 	t_u8 reserved1[3];
1929     /** TDLS flags, bit 0: 0=InfraLink, 1=DirectLink */
1930 	t_u8 flags;
1931     /** For SD8887 ntenna info: 0 = 2.4G antenna a; 1 = 2.4G antenna b; 3 = 5G antenna; 0xff = invalid value */
1932 	t_u8 antenna;
1933 	/* [31:0] ToA of the rx packet, [63:32] ToD of the ack for the rx packet Both ToA and ToD are in nanoseconds */
1934 	t_u64 toa_tod_tstamps;
1935     /** rx info */
1936 	t_u32 rx_info;
1937 } MLAN_PACK_END UapRxPD, *PUapRxPD;
1938 
1939 /** IEEEtypes_AssocRqst_t */
1940 typedef MLAN_PACK_START struct _IEEEtypes_AssocRqst_t {
1941     /** Capability Info */
1942 	t_u16 cap_info;
1943     /** Listen Interval */
1944 	t_u16 listen_interval;
1945 	/* t_u8 ie_buffer[0]; */
1946 } MLAN_PACK_END IEEEtypes_AssocRqst_t;
1947 
1948 /** IEEEtypes_ReAssocRqst_t */
1949 typedef MLAN_PACK_START struct _IEEEtypes_ReAssocRqst_t {
1950     /** Capability Info */
1951 	t_u16 cap_info;
1952     /** Listen Interval */
1953 	t_u16 listen_interval;
1954     /** Current AP Address */
1955 	t_u8 current_ap_addr[MLAN_MAC_ADDR_LENGTH];
1956 	/* t_u8 ie_buffer[0]; */
1957 } MLAN_PACK_END IEEEtypes_ReAssocRqst_t;
1958 #endif /* UAP_SUPPORT */
1959 
1960 /** wlan_802_11_header */
1961 typedef MLAN_PACK_START struct _wlan_802_11_header {
1962     /** Frame Control */
1963 	t_u16 frm_ctl;
1964     /** Duration ID */
1965 	t_u16 duration_id;
1966     /** Address1 */
1967 	mlan_802_11_mac_addr addr1;
1968     /** Address2 */
1969 	mlan_802_11_mac_addr addr2;
1970     /** Address3 */
1971 	mlan_802_11_mac_addr addr3;
1972     /** Sequence Control */
1973 	t_u16 seq_ctl;
1974     /** Address4 */
1975 	mlan_802_11_mac_addr addr4;
1976 } MLAN_PACK_END wlan_802_11_header;
1977 
1978 /** wlan_802_11_header packet from FW with length */
1979 typedef MLAN_PACK_START struct _wlan_mgmt_pkt {
1980     /** Packet Length */
1981 	t_u16 frm_len;
1982     /** wlan_802_11_header */
1983 	wlan_802_11_header wlan_header;
1984 } MLAN_PACK_END wlan_mgmt_pkt;
1985 
1986 #ifdef STA_SUPPORT
1987 /** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr) */
1988 #define MAX_NO_OF_CHAN          40
1989 
1990 /** Channel-power table entries */
1991 typedef MLAN_PACK_START struct _chan_power_11d {
1992     /** 11D channel */
1993 	t_u8 chan;
1994     /** Band for channel */
1995 	t_u8 band;
1996     /** 11D channel power */
1997 	t_u8 pwr;
1998     /** AP seen on channel */
1999 	t_u8 ap_seen;
2000 } MLAN_PACK_END chan_power_11d_t;
2001 
2002 /** Region channel info */
2003 typedef MLAN_PACK_START struct _parsed_region_chan_11d {
2004     /** 11D channel power per channel */
2005 	chan_power_11d_t chan_pwr[MAX_NO_OF_CHAN];
2006     /** 11D number of channels */
2007 	t_u8 no_of_chan;
2008 } MLAN_PACK_END parsed_region_chan_11d_t;
2009 #endif /* STA_SUPPORT */
2010 
2011 /** ChanScanMode_t */
2012 typedef MLAN_PACK_START struct _ChanScanMode_t {
2013 #ifdef BIG_ENDIAN_SUPPORT
2014     /** Reserved */
2015 	t_u8 reserved_6_7:2;
2016     /** First channel in scan */
2017 	t_u8 first_chan:1;
2018     /** Enable hidden ssid report */
2019 	t_u8 hidden_ssid_report:1;
2020     /** Enable probe response timeout */
2021 	t_u8 rsp_timeout_en:1;
2022     /** Multidomain scan mode */
2023 	t_u8 multidomain_scan:1;
2024     /** Disble channel filtering flag */
2025 	t_u8 disable_chan_filt:1;
2026     /** Channel scan mode passive flag */
2027 	t_u8 passive_scan:1;
2028 #else
2029     /** Channel scan mode passive flag */
2030 	t_u8 passive_scan:1;
2031     /** Disble channel filtering flag */
2032 	t_u8 disable_chan_filt:1;
2033     /** Multidomain scan mode */
2034 	t_u8 multidomain_scan:1;
2035     /** Enable probe response timeout */
2036 	t_u8 rsp_timeout_en:1;
2037     /** Enable hidden ssid report */
2038 	t_u8 hidden_ssid_report:1;
2039     /** First channel in scan */
2040 	t_u8 first_chan:1;
2041     /** Reserved */
2042 	t_u8 reserved_6_7:2;
2043 #endif
2044 } MLAN_PACK_END ChanScanMode_t;
2045 
2046 /** ChanScanParamSet_t */
2047 typedef MLAN_PACK_START struct _ChanScanParamSet_t {
2048     /** Channel scan parameter : band config */
2049 	Band_Config_t bandcfg;
2050     /** Channel scan parameter : Channel number */
2051 	t_u8 chan_number;
2052     /** Channel scan parameter : Channel scan mode */
2053 	ChanScanMode_t chan_scan_mode;
2054     /** Channel scan parameter : Minimum scan time */
2055 	t_u16 min_scan_time;
2056     /** Channel scan parameter : Maximum scan time */
2057 	t_u16 max_scan_time;
2058 } MLAN_PACK_END ChanScanParamSet_t;
2059 
2060 /** MrvlIEtypes_ChanListParamSet_t */
2061 typedef MLAN_PACK_START struct _MrvlIEtypes_ChanListParamSet_t {
2062     /** Header */
2063 	MrvlIEtypesHeader_t header;
2064     /** Channel scan parameters */
2065 	ChanScanParamSet_t chan_scan_param[1];
2066 } MLAN_PACK_END MrvlIEtypes_ChanListParamSet_t;
2067 
2068 /** ChanBandParamSet_t */
2069 typedef struct _ChanBandParamSet_t {
2070     /** Channel scan parameter : band config */
2071 	Band_Config_t bandcfg;
2072     /** Channel number */
2073 	t_u8 chan_number;
2074 } ChanBandParamSet_t;
2075 
2076 /** MrvlIEtypes_ChanBandListParamSet_t */
2077 typedef MLAN_PACK_START struct _MrvlIEtypes_ChanBandListParamSet_t {
2078     /** Header */
2079 	MrvlIEtypesHeader_t header;
2080     /** Channel Band parameters */
2081 	ChanBandParamSet_t chan_band_param[1];
2082 } MLAN_PACK_END MrvlIEtypes_ChanBandListParamSet_t;
2083 
2084 /** MrvlIEtypes_RatesParamSet_t */
2085 typedef MLAN_PACK_START struct _MrvlIEtypes_RatesParamSet_t {
2086     /** Header */
2087 	MrvlIEtypesHeader_t header;
2088     /** Rates */
2089 	t_u8 rates[1];
2090 } MLAN_PACK_END MrvlIEtypes_RatesParamSet_t;
2091 
2092 /** _MrvlIEtypes_Bssid_List_t */
2093 typedef MLAN_PACK_START struct _MrvlIEtypes_Bssid_List_t {
2094     /** Header */
2095 	MrvlIEtypesHeader_t header;
2096     /** BSSID */
2097 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
2098 } MLAN_PACK_END MrvlIEtypes_Bssid_List_t;
2099 
2100 /** MrvlIEtypes_SsIdParamSet_t */
2101 typedef MLAN_PACK_START struct _MrvlIEtypes_SsIdParamSet_t {
2102     /** Header */
2103 	MrvlIEtypesHeader_t header;
2104     /** SSID */
2105 	t_u8 ssid[1];
2106 } MLAN_PACK_END MrvlIEtypes_SsIdParamSet_t;
2107 
2108 /** MrvlIEtypes_NumProbes_t */
2109 typedef MLAN_PACK_START struct _MrvlIEtypes_NumProbes_t {
2110     /** Header */
2111 	MrvlIEtypesHeader_t header;
2112     /** Number of probes */
2113 	t_u16 num_probes;
2114 } MLAN_PACK_END MrvlIEtypes_NumProbes_t;
2115 
2116 /** MrvlIEtypes_WildCardSsIdParamSet_t */
2117 typedef MLAN_PACK_START struct _MrvlIEtypes_WildCardSsIdParamSet_t {
2118     /** Header */
2119 	MrvlIEtypesHeader_t header;
2120     /** Maximum SSID length */
2121 	t_u8 max_ssid_length;
2122     /** SSID */
2123 	t_u8 ssid[1];
2124 } MLAN_PACK_END MrvlIEtypes_WildCardSsIdParamSet_t;
2125 
2126 /**TSF data size */
2127 #define TSF_DATA_SIZE            8
2128 /** Table of TSF values returned in the scan result */
2129 typedef MLAN_PACK_START struct _MrvlIEtypes_TsfTimestamp_t {
2130     /** Header */
2131 	MrvlIEtypesHeader_t header;
2132     /** the length of each TSF data is 8 bytes, could be multiple TSF here */
2133 	t_u8 tsf_data[1];
2134 } MLAN_PACK_END MrvlIEtypes_TsfTimestamp_t;
2135 
2136 /** CfParamSet_t */
2137 typedef MLAN_PACK_START struct _CfParamSet_t {
2138     /** CF parameter : Count */
2139 	t_u8 cfp_cnt;
2140     /** CF parameter : Period */
2141 	t_u8 cfp_period;
2142     /** CF parameter : Duration */
2143 	t_u16 cfp_max_duration;
2144     /** CF parameter : Duration remaining */
2145 	t_u16 cfp_duration_remaining;
2146 } MLAN_PACK_END CfParamSet_t;
2147 
2148 /** IbssParamSet_t */
2149 typedef MLAN_PACK_START struct _IbssParamSet_t {
2150     /** ATIM window value */
2151 	t_u16 atim_window;
2152 } MLAN_PACK_END IbssParamSet_t;
2153 
2154 /** MrvlIEtypes_SsParamSet_t */
2155 typedef MLAN_PACK_START struct _MrvlIEtypes_SsParamSet_t {
2156     /** Header */
2157 	MrvlIEtypesHeader_t header;
2158     /** CF/IBSS parameters sets */
2159 	union {
2160 	/** CF parameter set */
2161 		CfParamSet_t cf_param_set[1];
2162 	/** IBSS parameter set */
2163 		IbssParamSet_t ibss_param_set[1];
2164 	} cf_ibss;
2165 } MLAN_PACK_END MrvlIEtypes_SsParamSet_t;
2166 
2167 /** FhParamSet_t */
2168 typedef MLAN_PACK_START struct _FhParamSet_t {
2169     /** FH parameter : Dwell time */
2170 	t_u16 dwell_time;
2171     /** FH parameter : Hop set */
2172 	t_u8 hop_set;
2173     /** FH parameter : Hop pattern */
2174 	t_u8 hop_pattern;
2175     /** FH parameter : Hop index */
2176 	t_u8 hop_index;
2177 } MLAN_PACK_END FhParamSet_t;
2178 
2179 /** DsParamSet_t */
2180 typedef MLAN_PACK_START struct _DsParamSet_t {
2181     /** Current channel number */
2182 	t_u8 current_chan;
2183 } MLAN_PACK_END DsParamSet_t;
2184 
2185 /** MrvlIEtypes_PhyParamSet_t */
2186 typedef MLAN_PACK_START struct _MrvlIEtypes_PhyParamSet_t {
2187     /** Header */
2188 	MrvlIEtypesHeader_t header;
2189     /** FH/DS parameters */
2190 	union {
2191 	/** FH parameter set */
2192 		FhParamSet_t fh_param_set[1];
2193 	/** DS parameter set */
2194 		DsParamSet_t ds_param_set[1];
2195 	} fh_ds;
2196 } MLAN_PACK_END MrvlIEtypes_PhyParamSet_t;
2197 
2198 /* Auth type to be used in the Authentication portion of an Assoc seq */
2199 /** MrvlIEtypes_AuthType_t */
2200 typedef MLAN_PACK_START struct _MrvlIEtypes_AuthType_t {
2201     /** Header */
2202 	MrvlIEtypesHeader_t header;
2203     /** Authentication type */
2204 	t_u16 auth_type;
2205 } MLAN_PACK_END MrvlIEtypes_AuthType_t;
2206 
2207 /** MrvlIEtypes_ScanChanGap_t */
2208 typedef MLAN_PACK_START struct _MrvlIEtypes_ScanChanGap_t {
2209     /** Header */
2210 	MrvlIEtypesHeader_t header;
2211     /** Time gap in units to TUs to be used between
2212       * two consecutive channels scan */
2213 	t_u16 gap;
2214 } MLAN_PACK_END MrvlIEtypes_ScanChanGap_t;
2215 
2216 /** channel statictics tlv */
2217 typedef MLAN_PACK_START struct _MrvlIEtypes_ChannelStats_t {
2218     /** Header */
2219 	MrvlIEtypesHeader_t header;
2220     /** channel statictics */
2221 	ChanStatistics_t chanStat[0];
2222 } MLAN_PACK_END MrvlIEtypes_ChannelStats_t;
2223 
2224 /** MrvlIETypes_ActionFrame_t */
2225 typedef MLAN_PACK_START struct {
2226 	MrvlIEtypesHeader_t header;
2227 				  /**< Header */
2228 
2229     /** Source Address */
2230 	t_u8 srcAddr[MLAN_MAC_ADDR_LENGTH];
2231     /** Destination Address */
2232 	t_u8 dstAddr[MLAN_MAC_ADDR_LENGTH];
2233 
2234     /** IEEEtypes Action frame structure */
2235 	IEEEtypes_ActionFrame_t actionFrame;
2236 
2237 } MLAN_PACK_END MrvlIETypes_ActionFrame_t;
2238 
2239 /** MrvlIEtypes_RxBaSync_t */
2240 typedef MLAN_PACK_START struct _MrvlIEtypes_RxBaSync_t {
2241     /** Header */
2242 	MrvlIEtypesHeader_t header;
2243     /** mac address */
2244 	t_u8 mac[MLAN_MAC_ADDR_LENGTH];
2245     /** tid */
2246 	t_u8 tid;
2247     /** reserved field */
2248 	t_u8 reserved;
2249     /** start seq num */
2250 	t_u16 seq_num;
2251     /** bitmap len */
2252 	t_u16 bitmap_len;
2253     /** bitmap */
2254 	t_u8 bitmap[1];
2255 } MLAN_PACK_END MrvlIEtypes_RxBaSync_t;
2256 
2257 /** MrvlIEtypes_RsnParamSet_t */
2258 typedef MLAN_PACK_START struct _MrvlIEtypes_RsnParamSet_t {
2259     /** Header */
2260 	MrvlIEtypesHeader_t header;
2261     /** RSN IE */
2262 	t_u8 rsn_ie[0];
2263 } MLAN_PACK_END MrvlIEtypes_RsnParamSet_t;
2264 
2265 /** Key Info flag for multicast key */
2266 #define KEY_INFO_MCAST_KEY      0x01
2267 /** Key Info flag for unicast key */
2268 #define KEY_INFO_UCAST_KEY      0x02
2269 /** Key Info flag for enable key */
2270 #define KEY_INFO_ENABLE_KEY     0x04
2271 /** Key Info flag for default key */
2272 #define KEY_INFO_DEFAULT_KEY    0x08
2273 /** Key Info flag for TX key */
2274 #define KEY_INFO_TX_KEY         0x10
2275 /** Key Info flag for RX key */
2276 #define KEY_INFO_RX_KEY         0x20
2277 #define KEY_INFO_CMAC_AES_KEY   0x400
2278 /** PN size for WPA/WPA2 */
2279 #define WPA_PN_SIZE             8
2280 /** PN size for PMF IGTK */
2281 #define IGTK_PN_SIZE            8
2282 /** WAPI KEY size */
2283 #define WAPI_KEY_SIZE           32
2284 /** key params fix size */
2285 #define KEY_PARAMS_FIXED_LEN    10
2286 /** key index mask */
2287 #define KEY_INDEX_MASK          0xf
2288 
2289 /** wep_param */
2290 typedef MLAN_PACK_START struct _wep_param_t {
2291     /** key_len */
2292 	t_u16 key_len;
2293     /** wep key */
2294 	t_u8 key[MAX_WEP_KEY_SIZE];
2295 } MLAN_PACK_END wep_param_t;
2296 
2297 /** tkip_param */
2298 typedef MLAN_PACK_START struct _tkip_param {
2299     /** Rx packet num */
2300 	t_u8 pn[WPA_PN_SIZE];
2301     /** key_len */
2302 	t_u16 key_len;
2303     /** tkip key */
2304 	t_u8 key[WPA_TKIP_KEY_LEN];
2305 } MLAN_PACK_END tkip_param;
2306 
2307 /** aes_param */
2308 typedef MLAN_PACK_START struct _aes_param {
2309     /** Rx packet num */
2310 	t_u8 pn[WPA_PN_SIZE];
2311     /** key_len */
2312 	t_u16 key_len;
2313     /** aes key */
2314 	t_u8 key[WPA_AES_KEY_LEN];
2315 } MLAN_PACK_END aes_param;
2316 
2317 /** wapi_param */
2318 typedef MLAN_PACK_START struct _wapi_param {
2319     /** Rx packet num */
2320 	t_u8 pn[PN_SIZE];
2321     /** key_len */
2322 	t_u16 key_len;
2323     /** wapi key */
2324 	t_u8 key[WAPI_KEY_SIZE];
2325 } MLAN_PACK_END wapi_param;
2326 
2327 /** cmac_aes_param */
2328 typedef MLAN_PACK_START struct _cmac_aes_param {
2329     /** IGTK pn */
2330 	t_u8 ipn[IGTK_PN_SIZE];
2331     /** key_len */
2332 	t_u16 key_len;
2333     /** aes key */
2334 	t_u8 key[CMAC_AES_KEY_LEN];
2335 } MLAN_PACK_END cmac_aes_param;
2336 
2337 /** MrvlIEtype_KeyParamSet_t */
2338 typedef MLAN_PACK_START struct _MrvlIEtype_KeyParamSetV2_t {
2339     /** Type ID */
2340 	t_u16 type;
2341     /** Length of Payload */
2342 	t_u16 length;
2343     /** mac address */
2344 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
2345     /** key index */
2346 	t_u8 key_idx;
2347     /** Type of Key: WEP=0, TKIP=1, AES=2, WAPI=3 AES_CMAC=4 */
2348 	t_u8 key_type;
2349     /** Key Control Info specific to a key_type_id */
2350 	t_u16 key_info;
2351 	union {
2352 	/** wep key param */
2353 		wep_param_t wep;
2354 	/** tkip key param */
2355 		tkip_param tkip;
2356 	/** aes key param */
2357 		aes_param aes;
2358 	/** wapi key param */
2359 		wapi_param wapi;
2360 	/** IGTK key param */
2361 		cmac_aes_param cmac_aes;
2362 	} key_params;
2363 } MLAN_PACK_END MrvlIEtype_KeyParamSetV2_t;
2364 
2365 /** HostCmd_DS_802_11_KEY_MATERIAL */
2366 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_KEY_MATERIAL {
2367     /** Action */
2368 	t_u16 action;
2369     /** Key parameter set */
2370 	MrvlIEtype_KeyParamSetV2_t key_param_set;
2371 } MLAN_PACK_END HostCmd_DS_802_11_KEY_MATERIAL;
2372 
2373 /** HostCmd_DS_GTK_REKEY_PARAMS */
2374 typedef MLAN_PACK_START struct _HostCmd_DS_GTK_REKEY_PARAMS {
2375     /** Action */
2376 	t_u16 action;
2377     /** Key confirmation key */
2378 	t_u8 kck[MLAN_KCK_LEN];
2379     /** Key encryption key */
2380 	t_u8 kek[MLAN_KEK_LEN];
2381     /** Replay counter low 32 bit */
2382 	t_u32 replay_ctr_low;
2383     /** Replay counter high 32 bit */
2384 	t_u32 replay_ctr_high;
2385 } MLAN_PACK_END HostCmd_DS_GTK_REKEY_PARAMS;
2386 
2387 /** Data structure of WMM QoS information */
2388 typedef MLAN_PACK_START struct _WmmQosInfo_t {
2389 #ifdef BIG_ENDIAN_SUPPORT
2390     /** QoS UAPSD */
2391 	t_u8 qos_uapsd:1;
2392     /** Reserved */
2393 	t_u8 reserved:3;
2394     /** Parameter set count */
2395 	t_u8 para_set_count:4;
2396 #else
2397     /** Parameter set count */
2398 	t_u8 para_set_count:4;
2399     /** Reserved */
2400 	t_u8 reserved:3;
2401     /** QoS UAPSD */
2402 	t_u8 qos_uapsd:1;
2403 #endif				/* BIG_ENDIAN_SUPPORT */
2404 } MLAN_PACK_END WmmQosInfo_t, *pWmmQosInfo_t;
2405 
2406 /** Data structure of WMM ECW */
2407 typedef MLAN_PACK_START struct _WmmEcw_t {
2408 #ifdef BIG_ENDIAN_SUPPORT
2409     /** Maximum Ecw */
2410 	t_u8 ecw_max:4;
2411     /** Minimum Ecw */
2412 	t_u8 ecw_min:4;
2413 #else
2414     /** Minimum Ecw */
2415 	t_u8 ecw_min:4;
2416     /** Maximum Ecw */
2417 	t_u8 ecw_max:4;
2418 #endif				/* BIG_ENDIAN_SUPPORT */
2419 } MLAN_PACK_END WmmEcw_t, *pWmmEcw_t;
2420 
2421 /** Data structure of WMM Aci/Aifsn */
2422 typedef MLAN_PACK_START struct _WmmAciAifsn_t {
2423 #ifdef BIG_ENDIAN_SUPPORT
2424     /** Reserved */
2425 	t_u8 reserved:1;
2426     /** Aci */
2427 	t_u8 aci:2;
2428     /** Acm */
2429 	t_u8 acm:1;
2430     /** Aifsn */
2431 	t_u8 aifsn:4;
2432 #else
2433     /** Aifsn */
2434 	t_u8 aifsn:4;
2435     /** Acm */
2436 	t_u8 acm:1;
2437     /** Aci */
2438 	t_u8 aci:2;
2439     /** Reserved */
2440 	t_u8 reserved:1;
2441 #endif				/* BIG_ENDIAN_SUPPORT */
2442 } MLAN_PACK_END WmmAciAifsn_t, *pWmmAciAifsn_t;
2443 
2444 /** Data structure of WMM AC parameters  */
2445 typedef MLAN_PACK_START struct _WmmAcParameters_t {
2446 	WmmAciAifsn_t aci_aifsn;   /**< AciAifSn */
2447 	WmmEcw_t ecw;		  /**< Ecw */
2448 	t_u16 tx_op_limit;		      /**< Tx op limit */
2449 } MLAN_PACK_END WmmAcParameters_t, *pWmmAcParameters_t;
2450 
2451 /** Data structure of WMM parameter  */
2452 typedef MLAN_PACK_START struct _WmmParameter_t {
2453     /** OuiType:  00:50:f2:02 */
2454 	t_u8 ouitype[4];
2455     /** Oui subtype: 01 */
2456 	t_u8 ouisubtype;
2457     /** version: 01 */
2458 	t_u8 version;
2459     /** QoS information */
2460 	t_u8 qos_info;
2461     /** Reserved */
2462 	t_u8 reserved;
2463     /** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
2464 	WmmAcParameters_t ac_params[MAX_AC_QUEUES];
2465 } MLAN_PACK_END WmmParameter_t, *pWmmParameter_t;
2466 
2467 /** Data structure of Host command WMM_PARAM_CFG  */
2468 typedef MLAN_PACK_START struct _HostCmd_DS_WMM_PARAM_CONFIG {
2469     /** action */
2470 	t_u16 action;
2471     /** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
2472 	WmmAcParameters_t ac_params[MAX_AC_QUEUES];
2473 } MLAN_PACK_END HostCmd_DS_WMM_PARAM_CONFIG;
2474 
2475 /* Definition of firmware host command */
2476 /** HostCmd_DS_GEN */
2477 typedef MLAN_PACK_START struct _HostCmd_DS_GEN {
2478     /** Command */
2479 	t_u16 command;
2480     /** Size */
2481 	t_u16 size;
2482     /** Sequence number */
2483 	t_u16 seq_num;
2484     /** Result */
2485 	t_u16 result;
2486 } MLAN_PACK_END HostCmd_DS_GEN
2487 ;
2488 
2489 /** Size of HostCmd_DS_GEN */
2490 #define S_DS_GEN        sizeof(HostCmd_DS_GEN)
2491 
2492 /** Address type: broadcast */
2493 #define ADDR_TYPE_BROADCAST		1
2494 /* Address type: unicast */
2495 #define ADDR_TYPE_UNICAST		2
2496 /* Address type: multicast */
2497 #define ADDR_TYPE_MULTICAST		3
2498 
2499 /** Ether type: any */
2500 #define ETHER_TYPE_ANY			0xffff
2501 /** Ether type: ARP */
2502 #define ETHER_TYPE_ARP			0x0608
2503 
2504 /** IPv4 address any */
2505 #define IPV4_ADDR_ANY			0xffffffff
2506 
2507 /** Header structure for ARP filter */
2508 typedef MLAN_PACK_START struct _arpfilter_header {
2509 	/** Type */
2510 	t_u16 type;
2511 	/** TLV length */
2512 	t_u16 len;
2513 } MLAN_PACK_END arpfilter_header;
2514 
2515 /** Filter entry structure */
2516 typedef MLAN_PACK_START struct _filter_entry {
2517 	/** Address type */
2518 	t_u16 addr_type;
2519 	/** Ether type */
2520 	t_u16 eth_type;
2521 	/** IPv4 address */
2522 	t_u32 ipv4_addr;
2523 } MLAN_PACK_END filter_entry;
2524 
2525 typedef MLAN_PACK_START struct _HostCmd_DS_MEF_CFG {
2526     /** Criteria */
2527 	t_u32 criteria;
2528     /** Number of entries */
2529 	t_u16 nentries;
2530 } MLAN_PACK_END HostCmd_DS_MEF_CFG;
2531 
2532 /* HostCmd_DS_802_11_SLEEP_PERIOD */
2533 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SLEEP_PERIOD {
2534     /** ACT_GET/ACT_SET */
2535 	t_u16 action;
2536 
2537     /** Sleep Period in msec */
2538 	t_u16 sleep_pd;
2539 } MLAN_PACK_END HostCmd_DS_802_11_SLEEP_PERIOD;
2540 
2541 /* HostCmd_DS_802_11_SLEEP_PARAMS */
2542 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SLEEP_PARAMS {
2543     /** ACT_GET/ACT_SET */
2544 	t_u16 action;
2545     /** Sleep clock error in ppm */
2546 	t_u16 error;
2547     /** Wakeup offset in usec */
2548 	t_u16 offset;
2549     /** Clock stabilization time in usec */
2550 	t_u16 stable_time;
2551     /** Control periodic calibration */
2552 	t_u8 cal_control;
2553     /** Control the use of external sleep clock */
2554 	t_u8 external_sleep_clk;
2555     /** Reserved field, should be set to zero */
2556 	t_u16 reserved;
2557 } MLAN_PACK_END HostCmd_DS_802_11_SLEEP_PARAMS;
2558 
2559 /** Sleep response control */
2560 typedef enum _sleep_resp_ctrl {
2561 	RESP_NOT_NEEDED = 0,
2562 	RESP_NEEDED,
2563 } sleep_resp_ctrl;
2564 
2565 /** Structure definition for the new ieee power save parameters*/
2566 typedef MLAN_PACK_START struct __ps_param {
2567       /** Null packet interval */
2568 	t_u16 null_pkt_interval;
2569       /** Num dtims */
2570 	t_u16 multiple_dtims;
2571       /** becaon miss interval */
2572 	t_u16 bcn_miss_timeout;
2573       /** local listen interval */
2574 	t_u16 local_listen_interval;
2575      /** Adhoc awake period */
2576 	t_u16 adhoc_wake_period;
2577      /** mode - (0x01 - firmware to automatically choose PS_POLL or NULL mode,
2578       *  0x02 - PS_POLL, 0x03 - NULL mode )
2579       */
2580 	t_u16 mode;
2581      /** Delay to PS in milliseconds */
2582 	t_u16 delay_to_ps;
2583 } MLAN_PACK_END ps_param;
2584 
2585 /** Structure definition for the new auto deep sleep command */
2586 typedef MLAN_PACK_START struct __auto_ds_param {
2587      /** Deep sleep inactivity timeout */
2588 	t_u16 deep_sleep_timeout;
2589 } MLAN_PACK_END auto_ds_param;
2590 
2591 /** Structure definition for sleep confirmation in the new ps command */
2592 typedef MLAN_PACK_START struct __sleep_confirm_param {
2593      /** response control 0x00 - response not needed, 0x01 - response needed */
2594 	t_u16 resp_ctrl;
2595 } MLAN_PACK_END sleep_confirm_param;
2596 
2597 /** bitmap for get auto deepsleep */
2598 #define BITMAP_AUTO_DS         0x01
2599 /** bitmap for sta power save */
2600 #define BITMAP_STA_PS          0x10
2601 /** bitmap for beacon timeout */
2602 #define BITMAP_BCN_TMO         0x20
2603 /** bitmap for uap inactivity based PS */
2604 #define BITMAP_UAP_INACT_PS    0x100
2605 /** bitmap for uap DTIM PS */
2606 #define BITMAP_UAP_DTIM_PS     0x200
2607 /** Structure definition for the new ieee power save parameters*/
2608 typedef MLAN_PACK_START struct _auto_ps_param {
2609     /** bitmap for enable power save mode */
2610 	t_u16 ps_bitmap;
2611 	/* auto deep sleep parameter,
2612 	 * sta power save parameter
2613 	 * uap inactivity parameter
2614 	 * uap DTIM parameter */
2615 } MLAN_PACK_END auto_ps_param;
2616 
2617 /** fix size for auto ps */
2618 #define AUTO_PS_FIX_SIZE    4
2619 
2620 /** TLV type : auto ds param */
2621 #define TLV_TYPE_AUTO_DS_PARAM        (PROPRIETARY_TLV_BASE_ID + 0x71)	/* 0x0171 */
2622 /** TLV type : ps param */
2623 #define TLV_TYPE_PS_PARAM             (PROPRIETARY_TLV_BASE_ID + 0x72)	/* 0x0172 */
2624 /** TLV type : beacon timeout */
2625 #define TLV_TYPE_BCN_TIMEOUT          (PROPRIETARY_TLV_BASE_ID + 0x11F)	/* 0x011F */
2626 
2627 /** MrvlIEtypes_auto_ds_param_t */
2628 typedef MLAN_PACK_START struct _MrvlIEtypes_auto_ds_param_t {
2629     /** Header */
2630 	MrvlIEtypesHeader_t header;
2631     /** auto ds param */
2632 	auto_ds_param param;
2633 } MLAN_PACK_END MrvlIEtypes_auto_ds_param_t;
2634 
2635 /** MrvlIEtypes_ps_param_t */
2636 typedef MLAN_PACK_START struct _MrvlIEtypes_ps_param_t {
2637     /** Header */
2638 	MrvlIEtypesHeader_t header;
2639     /** ps param */
2640 	ps_param param;
2641 } MLAN_PACK_END MrvlIEtypes_ps_param_t;
2642 
2643 /** MrvlIEtypes_bcn_timeout_t */
2644 typedef MLAN_PACK_START struct _MrvlIEtypes_bcn_timeout_t {
2645     /** Header */
2646 	MrvlIEtypesHeader_t header;
2647     /** Beacon miss timeout period window */
2648 	t_u16 bcn_miss_tmo_window;
2649     /** Beacon miss timeout period */
2650 	t_u16 bcn_miss_tmo_period;
2651     /** Beacon reacquire timeout period window */
2652 	t_u16 bcn_rq_tmo_window;
2653     /** Beacon reacquire timeout period */
2654 	t_u16 bcn_rq_tmo_period;
2655 } MLAN_PACK_END MrvlIEtypes_bcn_timeout_t;
2656 
2657 /** Structure definition for new power save command */
2658 typedef MLAN_PACK_START struct _HostCmd_DS_PS_MODE_ENH {
2659     /** Action */
2660 	t_u16 action;
2661     /** Data speciifc to action */
2662 	/* For IEEE power save data will be as
2663 	 * UINT16 mode (0x01 - firmware to automatically choose PS_POLL or NULL mode, 0x02 - PS_POLL, 0x03 - NULL mode )
2664 	 * UINT16 NullpacketInterval
2665 	 * UINT16 NumDtims
2666 	 * UINT16 BeaconMissInterval
2667 	 * UINT16 locallisteninterval
2668 	 * UINT16 adhocawakeperiod */
2669 
2670 	/* For auto deep sleep */
2671 	/* UINT16 Deep sleep inactivity timeout */
2672 
2673 	/* For PS sleep confirm
2674 	 * UINT16 responeCtrl - 0x00 - reponse from fw not needed, 0x01 - response from fw is needed */
2675 
2676 	union {
2677     /** PS param definition */
2678 		ps_param opt_ps;
2679     /** Auto ds param definition */
2680 		auto_ds_param auto_ds;
2681     /** Sleep comfirm param definition */
2682 		sleep_confirm_param sleep_cfm;
2683     /** bitmap for get PS info and Disable PS mode */
2684 		t_u16 ps_bitmap;
2685     /** auto ps param */
2686 		auto_ps_param auto_ps;
2687 	} params;
2688 } MLAN_PACK_END HostCmd_DS_802_11_PS_MODE_ENH;
2689 
2690 /** FW VERSION tlv */
2691 #define TLV_TYPE_FW_VER_INFO        (PROPRIETARY_TLV_BASE_ID + 0xC7)	/* 0x1C7 */
2692 
2693 /** MrvlIEtypes_fw_ver_info_t */
2694 typedef MLAN_PACK_START struct _MrvlIEtypes_fw_ver_info_t {
2695     /** Header */
2696 	MrvlIEtypesHeader_t header;
2697     /** API id */
2698 	t_u16 api_id;
2699     /** major version */
2700 	t_u8 major_ver;
2701     /** minor version */
2702 	t_u8 minor_ver;
2703 } MLAN_PACK_END MrvlIEtypes_fw_ver_info_t;
2704 
2705 /** API ID */
2706 enum API_VER_ID {
2707 	KEY_API_VER_ID = 1,
2708 	FW_API_VER_ID = 2,
2709 	UAP_FW_API_VER_ID = 3,
2710 	CHANRPT_API_VER_ID = 4,
2711 };
2712 
2713 /** FW AP V15 */
2714 #define HOST_API_VERSION_V15  15
2715 /** FW minor version 1 */
2716 #define FW_MINOR_VERSION_1    1
2717 
2718 /** HostCmd_DS_GET_HW_SPEC */
2719 typedef MLAN_PACK_START struct _HostCmd_DS_GET_HW_SPEC {
2720     /** HW Interface version number */
2721 	t_u16 hw_if_version;
2722     /** HW version number */
2723 	t_u16 version;
2724     /** Reserved field */
2725 	t_u16 reserved;
2726     /** Max no of Multicast address  */
2727 	t_u16 num_of_mcast_adr;
2728     /** MAC address */
2729 	t_u8 permanent_addr[MLAN_MAC_ADDR_LENGTH];
2730     /** Region Code */
2731 	t_u16 region_code;
2732     /** Number of antenna used */
2733 	t_u16 number_of_antenna;
2734     /** FW release number, example 0x1234=1.2.3.4 */
2735 	t_u32 fw_release_number;
2736     /** Reserved field */
2737 	t_u32 reserved_1;
2738     /** Reserved field */
2739 	t_u32 reserved_2;
2740     /** Reserved field */
2741 	t_u32 reserved_3;
2742     /** FW/HW Capability */
2743 	t_u32 fw_cap_info;
2744     /** 802.11n Device Capabilities */
2745 	t_u32 dot_11n_dev_cap;
2746     /** MIMO abstraction of MCSs supported by device */
2747 	t_u8 dev_mcs_support;
2748 	/** Valid end port at init */
2749 	t_u16 mp_end_port;
2750 	/** mgmt IE buffer count */
2751 	t_u16 mgmt_buf_count;
2752     /** Reserved */
2753 	t_u32 reserved_8;
2754     /** Reserved */
2755 	t_u32 reserved_9;
2756     /** Reserved */
2757 	t_u32 reserved_10;
2758     /** Reserved */
2759 	t_u32 reserved_11;
2760 } MLAN_PACK_END HostCmd_DS_GET_HW_SPEC;
2761 
2762 /* HostCmd_DS_SDIO_SP_RX_AGGR_CFG */
2763 typedef MLAN_PACK_START struct _HostCmd_DS_SDIO_SP_RX_AGGR_CFG {
2764     /** Action */
2765 	t_u8 action;
2766     /** Enable */
2767 	t_u8 enable;
2768     /** Sdio block size */
2769 	t_u16 sdio_block_size;
2770 } MLAN_PACK_END HostCmd_DS_SDIO_SP_RX_AGGR_CFG;
2771 
2772 /**  HostCmd_DS_802_11_CFG_DATA */
2773 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_CFG_DATA {
2774     /** Action */
2775 	t_u16 action;
2776     /** Type */
2777 	t_u16 type;
2778     /** Data length */
2779 	t_u16 data_len;
2780     /** Data */
2781 } MLAN_PACK_END HostCmd_DS_802_11_CFG_DATA;
2782 
2783 /**  HostCmd_DS_CMD_802_11_RSSI_INFO_EXT */
2784 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RSSI_INFO_EXT {
2785     /** Action */
2786 	t_u16 action;
2787     /** Parameter used for exponential averaging for Data */
2788 	t_u16 ndata;
2789     /** Parameter used for exponential averaging for Beacon */
2790 	t_u16 nbcn;
2791     /** Last RSSI beacon TSF(only for Get action) */
2792 	t_u64 tsfbcn;
2793     /** TLV info**/
2794 	t_u8 *tlv_buf[0];
2795 } MLAN_PACK_END HostCmd_DS_802_11_RSSI_INFO_EXT;
2796 
2797 /** TLV rssi info */
2798 #define TLV_TYPE_RSSI_INFO      (PROPRIETARY_TLV_BASE_ID + 0xe5)	/* 0x01E5 */
2799 
2800 /** MrvlIEtypes_eapol_pkt_t */
2801 typedef MLAN_PACK_START struct _MrvlIEtypes_RSSI_EXT_t {
2802     /** Header */
2803 	MrvlIEtypesHeader_t header;
2804 	/** Path ID
2805              [Bit1:Bit0] = [0:1]: path A
2806              [Bit1:Bit0] = [1:0]: path B
2807              [Bit1:Bit0] = [1:1]: combined signal of path A and path B
2808              [Bit7:Bit2] : Reserved
2809 	**/
2810 	t_u16 path_id;
2811     /** Last Data RSSI in dBm */
2812 	t_s16 data_rssi_last;
2813     /** Last Data NF in dBm */
2814 	t_s16 data_nf_last;
2815     /** AVG DATA RSSI in dBm */
2816 	t_s16 data_rssi_avg;
2817     /** AVG DATA NF in dBm */
2818 	t_s16 data_nf_avg;
2819     /** Last BEACON RSSI in dBm */
2820 	t_s16 bcn_rssi_last;
2821     /** Last BEACON NF in dBm */
2822 	t_s16 bcn_nf_last;
2823     /** AVG BEACON RSSI in dBm */
2824 	t_s16 bcn_rssi_avg;
2825     /** AVG BEACON NF in dBm */
2826 	t_s16 bcn_nf_avg;
2827 } MLAN_PACK_END MrvlIEtypes_RSSI_EXT_t;
2828 
2829 /**  HostCmd_DS_CMD_802_11_RSSI_INFO */
2830 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RSSI_INFO {
2831     /** Action */
2832 	t_u16 action;
2833     /** Parameter used for exponential averaging for Data */
2834 	t_u16 ndata;
2835     /** Parameter used for exponential averaging for Beacon */
2836 	t_u16 nbcn;
2837     /** Reserved field 0 */
2838 	t_u16 reserved[9];
2839     /** Reserved field 1 */
2840 	t_u64 reserved_1;
2841 } MLAN_PACK_END HostCmd_DS_802_11_RSSI_INFO;
2842 
2843 /** HostCmd_DS_802_11_RSSI_INFO_RSP */
2844 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RSSI_INFO_RSP {
2845     /** Action */
2846 	t_u16 action;
2847     /** Parameter used for exponential averaging for Data */
2848 	t_u16 ndata;
2849     /** Parameter used for exponential averaging for beacon */
2850 	t_u16 nbcn;
2851     /** Last Data RSSI in dBm */
2852 	t_s16 data_rssi_last;
2853     /** Last Data NF in dBm */
2854 	t_s16 data_nf_last;
2855     /** AVG DATA RSSI in dBm */
2856 	t_s16 data_rssi_avg;
2857     /** AVG DATA NF in dBm */
2858 	t_s16 data_nf_avg;
2859     /** Last BEACON RSSI in dBm */
2860 	t_s16 bcn_rssi_last;
2861     /** Last BEACON NF in dBm */
2862 	t_s16 bcn_nf_last;
2863     /** AVG BEACON RSSI in dBm */
2864 	t_s16 bcn_rssi_avg;
2865     /** AVG BEACON NF in dBm */
2866 	t_s16 bcn_nf_avg;
2867     /** Last RSSI Beacon TSF */
2868 	t_u64 tsf_bcn;
2869 } MLAN_PACK_END HostCmd_DS_802_11_RSSI_INFO_RSP;
2870 
2871 /** HostCmd_DS_802_11_MAC_ADDRESS */
2872 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_MAC_ADDRESS {
2873     /** Action */
2874 	t_u16 action;
2875     /** MAC address */
2876 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
2877 } MLAN_PACK_END HostCmd_DS_802_11_MAC_ADDRESS;
2878 
2879 /** HostCmd_DS_MAC_CONTROL */
2880 typedef MLAN_PACK_START struct _HostCmd_DS_MAC_CONTROL {
2881     /** Action */
2882 	t_u32 action;
2883 } MLAN_PACK_END HostCmd_DS_MAC_CONTROL;
2884 
2885 /** HostCmd_DS_802_11_NET_MONITOR */
2886 typedef MLAN_PACK_START struct _HostCmd_802_11_DS_NET_MONITOR {
2887     /** Action */
2888 	t_u16 action;
2889     /** Enable/disable net monitor */
2890 	t_u16 enable_net_mon;
2891     /** set net monitor filer flag */
2892 	t_u16 filter_flag;
2893     /** Channel to monitor */
2894 	MrvlIEtypes_ChanBandListParamSet_t monitor_chan;
2895 } MLAN_PACK_END HostCmd_DS_802_11_NET_MONITOR;
2896 
2897 /** HostCmd_DS_CMD_TX_DATA_PAUSE */
2898 typedef MLAN_PACK_START struct _HostCmd_DS_CMD_TX_DATA_PAUSE {
2899     /** Action */
2900 	t_u16 action;
2901     /** Enable/disable Tx data pause */
2902 	t_u8 enable_tx_pause;
2903     /** Max number of TX buffers allowed for all PS clients*/
2904 	t_u8 pause_tx_count;
2905 } MLAN_PACK_END HostCmd_DS_CMD_TX_DATA_PAUSE;
2906 
2907 /** TLV type : TX pause TLV */
2908 #define TLV_TYPE_TX_PAUSE      (PROPRIETARY_TLV_BASE_ID + 0x94)	/* 0x0194 */
2909 /** MrvlIEtypes_SsIdParamSet_t */
2910 typedef MLAN_PACK_START struct _MrvlIEtypes_tx_pause_t {
2911     /** Header */
2912 	MrvlIEtypesHeader_t header;
2913     /** peer mac address */
2914 	t_u8 peermac[MLAN_MAC_ADDR_LENGTH];
2915     /** Tx pause state, 1--pause, 0--free flowing */
2916 	t_u8 tx_pause;
2917     /** total packets queued for the client */
2918 	t_u8 pkt_cnt;
2919 } MLAN_PACK_END MrvlIEtypes_tx_pause_t;
2920 
2921 /**  HostCmd_CMD_MAC_MULTICAST_ADR */
2922 typedef MLAN_PACK_START struct _HostCmd_DS_MAC_MULTICAST_ADR {
2923     /** Action */
2924 	t_u16 action;
2925     /** Number of addresses */
2926 	t_u16 num_of_adrs;
2927     /** List of MAC */
2928 	t_u8 mac_list[MLAN_MAC_ADDR_LENGTH * MLAN_MAX_MULTICAST_LIST_SIZE];
2929 } MLAN_PACK_END HostCmd_DS_MAC_MULTICAST_ADR;
2930 
2931 /**  HostCmd_CMD_802_11_DEAUTHENTICATE */
2932 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_DEAUTHENTICATE {
2933     /** MAC address */
2934 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];
2935     /** Deauthentication resaon code */
2936 	t_u16 reason_code;
2937 } MLAN_PACK_END HostCmd_DS_802_11_DEAUTHENTICATE;
2938 
2939 /** HostCmd_DS_802_11_ASSOCIATE */
2940 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_ASSOCIATE {
2941     /** Peer STA address */
2942 	t_u8 peer_sta_addr[MLAN_MAC_ADDR_LENGTH];
2943     /** Capability information */
2944 	IEEEtypes_CapInfo_t cap_info;
2945     /** Listen interval */
2946 	t_u16 listen_interval;
2947     /** Beacon period */
2948 	t_u16 beacon_period;
2949     /** DTIM period */
2950 	t_u8 dtim_period;
2951 
2952     /**
2953      *  MrvlIEtypes_SsIdParamSet_t  SsIdParamSet;
2954      *  MrvlIEtypes_PhyParamSet_t   PhyParamSet;
2955      *  MrvlIEtypes_SsParamSet_t    SsParamSet;
2956      *  MrvlIEtypes_RatesParamSet_t RatesParamSet;
2957      */
2958 } MLAN_PACK_END HostCmd_DS_802_11_ASSOCIATE;
2959 
2960 /** HostCmd_CMD_802_11_ASSOCIATE response */
2961 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_ASSOCIATE_RSP {
2962     /** Association response structure */
2963 	IEEEtypes_AssocRsp_t assoc_rsp;
2964 } MLAN_PACK_END HostCmd_DS_802_11_ASSOCIATE_RSP;
2965 
2966 /** HostCmd_DS_802_11_AD_HOC_START*/
2967 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_AD_HOC_START {
2968     /** AdHoc SSID */
2969 	t_u8 ssid[MLAN_MAX_SSID_LENGTH];
2970     /** BSS mode */
2971 	t_u8 bss_mode;
2972     /** Beacon period */
2973 	t_u16 beacon_period;
2974     /** DTIM period */
2975 	t_u8 dtim_period;
2976     /** SS parameter set */
2977 	IEEEtypes_SsParamSet_t ss_param_set;
2978     /** PHY parameter set */
2979 	IEEEtypes_PhyParamSet_t phy_param_set;
2980     /** Reserved field */
2981 	t_u16 reserved1;
2982     /** Capability information */
2983 	IEEEtypes_CapInfo_t cap;
2984     /** Supported data rates */
2985 	t_u8 DataRate[HOSTCMD_SUPPORTED_RATES];
2986 } MLAN_PACK_END HostCmd_DS_802_11_AD_HOC_START;
2987 
2988 /**  HostCmd_CMD_802_11_AD_HOC_START response */
2989 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_AD_HOC_START_RESULT {
2990     /** Padding */
2991 	t_u8 pad[3];
2992     /** AdHoc BSSID */
2993 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
2994     /** Padding to sync with FW structure*/
2995 	t_u8 pad2[2];
2996     /** Result */
2997 	t_u8 result;
2998 } MLAN_PACK_END HostCmd_DS_802_11_AD_HOC_START_RESULT;
2999 
3000 /**  HostCmd_CMD_802_11_AD_HOC_START response */
3001 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_AD_HOC_JOIN_RESULT {
3002     /** Result */
3003 	t_u8 result;
3004 } MLAN_PACK_END HostCmd_DS_802_11_AD_HOC_JOIN_RESULT;
3005 
3006 /** AdHoc_BssDesc_t */
3007 typedef MLAN_PACK_START struct _AdHoc_BssDesc_t {
3008     /** BSSID */
3009 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
3010     /** SSID */
3011 	t_u8 ssid[MLAN_MAX_SSID_LENGTH];
3012     /** BSS mode */
3013 	t_u8 bss_mode;
3014     /** Beacon period */
3015 	t_u16 beacon_period;
3016     /** DTIM period */
3017 	t_u8 dtim_period;
3018     /** Timestamp */
3019 	t_u8 time_stamp[8];
3020     /** Local time */
3021 	t_u8 local_time[8];
3022     /** PHY parameter set */
3023 	IEEEtypes_PhyParamSet_t phy_param_set;
3024     /** SS parameter set */
3025 	IEEEtypes_SsParamSet_t ss_param_set;
3026     /** Capability information */
3027 	IEEEtypes_CapInfo_t cap;
3028     /** Supported data rates */
3029 	t_u8 data_rates[HOSTCMD_SUPPORTED_RATES];
3030 
3031 	/*
3032 	 *  DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
3033 	 *  It is used in the Adhoc join command and will cause a
3034 	 *  binary layout mismatch with the firmware
3035 	 */
3036 } MLAN_PACK_END AdHoc_BssDesc_t;
3037 
3038 /** HostCmd_DS_802_11_AD_HOC_JOIN */
3039 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_AD_HOC_JOIN {
3040     /** AdHoc BSS descriptor */
3041 	AdHoc_BssDesc_t bss_descriptor;
3042     /** Reserved field */
3043 	t_u16 reserved1;
3044     /** Reserved field */
3045 	t_u16 reserved2;
3046 } MLAN_PACK_END HostCmd_DS_802_11_AD_HOC_JOIN;
3047 
3048 /** Interrupt Raising Edge */
3049 #define INT_RASING_EDGE     0
3050 /** Interrupt Falling Edge */
3051 #define INT_FALLING_EDGE    1
3052 
3053 /** Delay 1 usec */
3054 #define DELAY_1_US          1
3055 
3056 typedef MLAN_PACK_START struct _HostCmd_DS_SDIO_GPIO_INT_CONFIG {
3057     /** Action */
3058 	t_u16 action;
3059     /** GPIO interrupt pin */
3060 	t_u16 gpio_pin;
3061     /** GPIO interrupt edge, 1: failing edge; 0: raising edge */
3062 	t_u16 gpio_int_edge;
3063     /** GPIO interrupt pulse widthin usec units */
3064 	t_u16 gpio_pulse_width;
3065 } MLAN_PACK_END HostCmd_DS_SDIO_GPIO_INT_CONFIG;
3066 
3067 typedef MLAN_PACK_START struct _HostCmd_DS_SDIO_PULL_CTRL {
3068     /** Action */
3069 	t_u16 action;
3070     /** The delay of pulling up in us */
3071 	t_u16 pull_up;
3072     /** The delay of pulling down in us */
3073 	t_u16 pull_down;
3074 } MLAN_PACK_END HostCmd_DS_SDIO_PULL_CTRL;
3075 
3076 /** HostCmd_DS_802_11_GET_LOG */
3077 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_GET_LOG {
3078     /** Number of multicast transmitted frames */
3079 	t_u32 mcast_tx_frame;
3080     /** Number of failures */
3081 	t_u32 failed;
3082     /** Number of retries */
3083 	t_u32 retry;
3084     /** Number of multiretries */
3085 	t_u32 multiretry;
3086     /** Number of duplicate frames */
3087 	t_u32 frame_dup;
3088     /** Number of RTS success */
3089 	t_u32 rts_success;
3090     /** Number of RTS failure */
3091 	t_u32 rts_failure;
3092     /** Number of acknowledgement failure */
3093 	t_u32 ack_failure;
3094     /** Number of fragmented packets received */
3095 	t_u32 rx_frag;
3096     /** Number of multicast frames received */
3097 	t_u32 mcast_rx_frame;
3098     /** FCS error */
3099 	t_u32 fcs_error;
3100     /** Number of transmitted frames */
3101 	t_u32 tx_frame;
3102     /** Reserved field */
3103 	t_u32 reserved;
3104     /** Number of WEP icv error for each key */
3105 	t_u32 wep_icv_err_cnt[4];
3106     /** Beacon received count */
3107 	t_u32 bcn_rcv_cnt;
3108     /** Beacon missed count */
3109 	t_u32 bcn_miss_cnt;
3110     /** Tx frag count */
3111 	t_u32 tx_frag_cnt;
3112     /** Qos Tx frag count */
3113 	t_u32 qos_tx_frag_cnt[8];
3114     /** Qos failed count */
3115 	t_u32 qos_failed_cnt[8];
3116     /** Qos retry count */
3117 	t_u32 qos_retry_cnt[8];
3118     /** Qos multi retry count */
3119 	t_u32 qos_multi_retry_cnt[8];
3120     /** Qos frame dup count */
3121 	t_u32 qos_frm_dup_cnt[8];
3122     /** Qos rts success count */
3123 	t_u32 qos_rts_suc_cnt[8];
3124     /** Qos rts failure count */
3125 	t_u32 qos_rts_failure_cnt[8];
3126     /** Qos ack failure count */
3127 	t_u32 qos_ack_failure_cnt[8];
3128     /** Qos Rx frag count */
3129 	t_u32 qos_rx_frag_cnt[8];
3130     /** Qos Tx frame count */
3131 	t_u32 qos_tx_frm_cnt[8];
3132     /** Qos discarded frame count */
3133 	t_u32 qos_discarded_frm_cnt[8];
3134     /** Qos mpdus Rx count */
3135 	t_u32 qos_mpdus_rx_cnt[8];
3136     /** Qos retry rx count */
3137 	t_u32 qos_retries_rx_cnt[8];
3138     /** CMAC ICV errors count */
3139 	t_u32 cmacicv_errors;
3140     /** CMAC replays count */
3141 	t_u32 cmac_replays;
3142     /** mgmt CCMP replays count */
3143 	t_u32 mgmt_ccmp_replays;
3144     /** TKIP ICV errors count */
3145 	t_u32 tkipicv_errors;
3146     /** TKIP replays count */
3147 	t_u32 tkip_replays;
3148     /** CCMP decrypt errors count */
3149 	t_u32 ccmp_decrypt_errors;
3150     /** CCMP replays count */
3151 	t_u32 ccmp_replays;
3152     /** Tx amsdu count */
3153 	t_u32 tx_amsdu_cnt;
3154     /** failed amsdu count */
3155 	t_u32 failed_amsdu_cnt;
3156     /** retry amsdu count */
3157 	t_u32 retry_amsdu_cnt;
3158     /** multi-retry amsdu count */
3159 	t_u32 multi_retry_amsdu_cnt;
3160     /** Tx octets in amsdu count */
3161 	t_u64 tx_octets_in_amsdu_cnt;
3162     /** amsdu ack failure count */
3163 	t_u32 amsdu_ack_failure_cnt;
3164     /** Rx amsdu count */
3165 	t_u32 rx_amsdu_cnt;
3166     /** Rx octets in amsdu count */
3167 	t_u64 rx_octets_in_amsdu_cnt;
3168     /** Tx ampdu count */
3169 	t_u32 tx_ampdu_cnt;
3170     /** tx mpdus in ampdu count */
3171 	t_u32 tx_mpdus_in_ampdu_cnt;
3172     /** tx octets in ampdu count */
3173 	t_u64 tx_octets_in_ampdu_cnt;
3174     /** ampdu Rx count */
3175 	t_u32 ampdu_rx_cnt;
3176     /** mpdu in Rx ampdu count */
3177 	t_u32 mpdu_in_rx_ampdu_cnt;
3178     /** Rx octets ampdu count */
3179 	t_u64 rx_octets_in_ampdu_cnt;
3180     /** ampdu delimiter CRC error count */
3181 	t_u32 ampdu_delimiter_crc_error_cnt;
3182 } MLAN_PACK_END HostCmd_DS_802_11_GET_LOG;
3183 
3184 /**_HostCmd_TX_RATE_QUERY */
3185 typedef MLAN_PACK_START struct _HostCmd_TX_RATE_QUERY {
3186     /** Tx rate */
3187 	t_u8 tx_rate;
3188     /** Tx Rate Info:
3189      * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
3190      * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
3191      * [Bit 4]   HT/VHT Guard Interval: LGI = 0, SGI = 1 */
3192 	t_u8 tx_rate_info;
3193 } MLAN_PACK_END HostCmd_TX_RATE_QUERY;
3194 
3195 typedef MLAN_PACK_START struct _hs_config_param {
3196     /** bit0=1: broadcast data
3197       * bit1=1: unicast data
3198       * bit2=1: mac events
3199       * bit3=1: multicast data
3200       */
3201 	t_u32 conditions;
3202     /** GPIO pin or 0xff for interface */
3203 	t_u8 gpio;
3204     /** gap in milliseconds or or 0xff for special setting when
3205      *  GPIO is used to wakeup host
3206      */
3207 	t_u8 gap;
3208 } MLAN_PACK_END hs_config_param;
3209 
3210 /** HS Action 0x0001 - Configure enhanced host sleep mode,
3211  * 0x0002 - Activate enhanced host sleep mode
3212  */
3213 typedef enum _Host_Sleep_Action {
3214 	HS_CONFIGURE = 0x0001,
3215 	HS_ACTIVATE = 0x0002,
3216 } Host_Sleep_Action;
3217 
3218 /** Structure definition for activating enhanced hs */
3219 typedef MLAN_PACK_START struct __hs_activate_param {
3220      /** response control 0x00 - response not needed, 0x01 - response needed */
3221 	t_u16 resp_ctrl;
3222 } MLAN_PACK_END hs_activate_param;
3223 
3224 /** HostCmd_DS_802_11_HS_CFG_ENH */
3225 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_HS_CFG_ENH {
3226     /** Action 0x0001 - Configure enhanced host sleep mode,
3227      *  0x0002 - Activate enhanced host sleep mode
3228      */
3229 	t_u16 action;
3230 
3231 	union {
3232     /** Configure enhanced hs */
3233 		hs_config_param hs_config;
3234     /** Activate enhanced hs */
3235 		hs_activate_param hs_activate;
3236 	} params;
3237 } MLAN_PACK_END HostCmd_DS_802_11_HS_CFG_ENH;
3238 
3239 /** HostCmd_CMD_802_11_FW_WAKE_METHOD */
3240 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_FW_WAKEUP_METHOD {
3241     /** Action */
3242 	t_u16 action;
3243     /** Method */
3244 	t_u16 method;
3245 } MLAN_PACK_END HostCmd_DS_802_11_FW_WAKEUP_METHOD;
3246 
3247 /** HostCmd_CMD_802_11_ROBUSTCOEX */
3248 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_ROBUSTCOEX {
3249     /** Action */
3250 	t_u16 action;
3251     /** RSVD */
3252 	t_u16 rsvd;
3253 } MLAN_PACK_END HostCmd_DS_802_11_ROBUSTCOEX;
3254 
3255 /** SNMP_MIB_INDEX */
3256 typedef enum _SNMP_MIB_INDEX {
3257 	OpRateSet_i = 1,
3258 	DtimPeriod_i = 3,
3259 	RtsThresh_i = 5,
3260 	ShortRetryLim_i = 6,
3261 	LongRetryLim_i = 7,
3262 	FragThresh_i = 8,
3263 	Dot11D_i = 9,
3264 	Dot11H_i = 10,
3265 	WwsMode_i = 17,
3266 	Thermal_i = 34,
3267 	NullPktPeriod_i = 37,
3268 	SignalextEnable_i = 41,
3269 	ECSAEnable_i = 42,
3270 	StopDeauth_i = 44,
3271 } SNMP_MIB_INDEX;
3272 
3273 /** max SNMP buf size */
3274 #define MAX_SNMP_BUF_SIZE   128
3275 
3276 /**  HostCmd_CMD_802_11_SNMP_MIB */
3277 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SNMP_MIB {
3278     /** SNMP query type */
3279 	t_u16 query_type;
3280     /** SNMP object ID */
3281 	t_u16 oid;
3282     /** SNMP buffer size */
3283 	t_u16 buf_size;
3284     /** Value */
3285 	t_u8 value[1];
3286 } MLAN_PACK_END HostCmd_DS_802_11_SNMP_MIB;
3287 
3288 /** Radio on */
3289 #define RADIO_ON                                0x01
3290 /** Radio off */
3291 #define RADIO_OFF                               0x00
3292 
3293 /** HostCmd_CMD_802_11_RADIO_CONTROL */
3294 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RADIO_CONTROL {
3295     /** Action */
3296 	t_u16 action;
3297     /** Control */
3298 	t_u16 control;
3299 } MLAN_PACK_END HostCmd_DS_802_11_RADIO_CONTROL;
3300 
3301 /** MrvlRateScope_t */
3302 typedef MLAN_PACK_START struct _MrvlRateScope_t {
3303     /** Header Type */
3304 	t_u16 type;
3305     /** Header Length */
3306 	t_u16 length;
3307     /** Bitmap of HR/DSSS rates */
3308 	t_u16 hr_dsss_rate_bitmap;
3309     /** Bitmap of OFDM rates */
3310 	t_u16 ofdm_rate_bitmap;
3311     /** Bitmap of HT-MCSs allowed for initial rate */
3312 	t_u16 ht_mcs_rate_bitmap[8];
3313     /** Reserved */
3314 	t_u16 reserved_1[8];
3315 } MLAN_PACK_END MrvlRateScope_t;
3316 
3317 /** MrvlRateDropPattern_t */
3318 typedef MLAN_PACK_START struct _MrvlRateDropPattern_t {
3319     /** Header Type */
3320 	t_u16 type;
3321     /** Header Length */
3322 	t_u16 length;
3323     /** Rate Drop Mode */
3324 	t_u32 rate_drop_mode;
3325 	/* MrvlRateDropControl_t RateDropControl[0]; */
3326 } MLAN_PACK_END MrvlRateDropPattern_t;
3327 
3328 /** HostCmd_DS_TX_RATE_CFG */
3329 typedef MLAN_PACK_START struct _HostCmd_DS_TX_RATE_CFG {
3330     /** Action */
3331 	t_u16 action;
3332     /** Reserved */
3333 	t_u16 reserved_1;
3334 	/* MrvlRateScope_t RateScope;
3335 	 * MrvlRateDropPattern_t RateDrop; */
3336 } MLAN_PACK_END HostCmd_DS_TX_RATE_CFG;
3337 
3338 /** Power_Group_t */
3339 typedef MLAN_PACK_START struct _Power_Group_t {
3340     /** Modulation Class */
3341 	t_u8 modulation_class;
3342     /** MCS Code or Legacy RateID */
3343 	t_u8 first_rate_code;
3344     /** MCS Code or Legacy RateID */
3345 	t_u8 last_rate_code;
3346     /** Power Adjustment Step */
3347 	t_s8 power_step;
3348     /** Minimal Tx Power Level [dBm] */
3349 	t_s8 power_min;
3350     /** Maximal Tx Power Level [dBm] */
3351 	t_s8 power_max;
3352     /** 0: HTBW20, 1: HTBW40 */
3353 	t_u8 ht_bandwidth;
3354     /** Reserved */
3355 	t_u8 reserved;
3356 } MLAN_PACK_END Power_Group_t;
3357 
3358 /** MrvlTypes_Power_Group_t */
3359 typedef MLAN_PACK_START struct _MrvlTypes_Power_Group_t {
3360     /** Header Type */
3361 	t_u16 type;
3362     /** Header Length */
3363 	t_u16 length;
3364 	/* Power_Group_t PowerGroups */
3365 } MLAN_PACK_END MrvlTypes_Power_Group_t;
3366 
3367 /** HostCmd_CMD_TXPWR_CFG */
3368 typedef MLAN_PACK_START struct _HostCmd_DS_TXPWR_CFG {
3369     /** Action */
3370 	t_u16 action;
3371     /** Power group configuration index */
3372 	t_u16 cfg_index;
3373     /** Power group configuration mode */
3374 	t_u32 mode;
3375 	/* MrvlTypes_Power_Group_t PowerGrpCfg[0] */
3376 } MLAN_PACK_END HostCmd_DS_TXPWR_CFG;
3377 
3378 /** HostCmd_CMD_802_11_RF_TX_POWER */
3379 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RF_TX_POWER {
3380     /** Action */
3381 	t_u16 action;
3382     /** Current power level */
3383 	t_s16 current_level;
3384     /** Maximum power */
3385 	t_s8 max_power;
3386     /** Minimum power */
3387 	t_s8 min_power;
3388 } MLAN_PACK_END HostCmd_DS_802_11_RF_TX_POWER;
3389 
3390 /** Connection type infra */
3391 #define CONNECTION_TYPE_INFRA   0
3392 /** Connection type adhoc */
3393 #define CONNECTION_TYPE_ADHOC   1
3394 #ifdef WIFI_DIRECT_SUPPORT
3395 /** BSS Mode: WIFIDIRECT Client */
3396 #define BSS_MODE_WIFIDIRECT_CLIENT  0
3397 /** BSS Mode: WIFIDIRECT GO */
3398 #define BSS_MODE_WIFIDIRECT_GO      2
3399 #endif
3400 /** HostCmd_DS_SET_BSS_MODE */
3401 typedef MLAN_PACK_START struct _HostCmd_DS_SET_BSS_MODE {
3402     /** connection type */
3403 	t_u8 con_type;
3404 } MLAN_PACK_END HostCmd_DS_SET_BSS_MODE;
3405 
3406 #ifdef WIFI_DIRECT_SUPPORT
3407 /** HostCmd_DS_WIFI_DIRECT_MODE */
3408 typedef MLAN_PACK_START struct _HostCmd_DS_WIFI_DIRECT_MODE {
3409     /** Action 0-GET, 1-SET*/
3410 	t_u16 action;
3411     /**0:disable 1:listen 2:GO 3:p2p client 4:find 5:stop find*/
3412 	t_u16 mode;
3413 } MLAN_PACK_END HostCmd_DS_WIFI_DIRECT_MODE;
3414 
3415 /** MrvlIEtypes_NoA_setting_t */
3416 typedef MLAN_PACK_START struct _MrvlIEtypes_NoA_setting_t {
3417     /** Header */
3418 	MrvlIEtypesHeader_t header;
3419     /** enable/disable */
3420 	t_u8 enable;
3421     /** index */
3422 	t_u16 index;
3423     /** NoA count */
3424 	t_u8 noa_count;
3425     /** NoA duration */
3426 	t_u32 noa_duration;
3427     /** NoA interval */
3428 	t_u32 noa_interval;
3429 } MLAN_PACK_END MrvlIEtypes_NoA_setting_t;
3430 
3431 /** MrvlIEtypes_NoA_setting_t */
3432 typedef MLAN_PACK_START struct _MrvlIEtypes_OPP_PS_setting_t {
3433     /** Header */
3434 	MrvlIEtypesHeader_t header;
3435     /** enable/disable && ct_window */
3436 	t_u8 enable;
3437 } MLAN_PACK_END MrvlIEtypes_OPP_PS_setting_t;
3438 
3439 /** HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG */
3440 typedef MLAN_PACK_START struct _HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG {
3441     /** Action 0-GET, 1-SET */
3442 	t_u16 action;
3443     /** MrvlIEtypes_NoA_setting_t
3444      *  MrvlIEtypes_OPP_PS_setting_t
3445      */
3446 } MLAN_PACK_END HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG;
3447 #endif
3448 
3449 /** Coalesce filter field parameter */
3450 MLAN_PACK_START struct coalesce_filt_field_param {
3451     /** Operation */
3452 	t_u8 operation;
3453     /** Operation length */
3454 	t_u8 operand_len;
3455     /** Offset */
3456 	t_u16 offset;
3457     /** Operand byte stream */
3458 	t_u8 operand_byte_stream[4];
3459 } MLAN_PACK_END;
3460 
3461 /** Coalesce receive filter rule */
3462 MLAN_PACK_START struct coalesce_receive_filt_rule {
3463     /** header */
3464 	MrvlIEtypesHeader_t header;
3465     /** Number of fields */
3466 	t_u8 num_of_fields;
3467     /** packet type */
3468 	t_u8 pkt_type;
3469     /** maximum coalescing delay */
3470 	t_u16 max_coalescing_delay;
3471 	struct coalesce_filt_field_param params[0];
3472 } MLAN_PACK_END;
3473 
3474 /** HostCmd_DS_COALESCE_CONFIG */
3475 typedef MLAN_PACK_START struct _HostCmd_DS_COALESCE_CONFIG {
3476     /** Action 0-GET, 1-SET */
3477 	t_u16 action;
3478     /** Number of rules */
3479 	t_u16 num_of_rules;
3480 	struct coalesce_receive_filt_rule rule[0];
3481 } MLAN_PACK_END HostCmd_DS_COALESCE_CONFIG;
3482 
3483 /** TLV type : FW support max connection TLV */
3484 #define TLV_TYPE_MAX_CONN      (PROPRIETARY_TLV_BASE_ID + 0x117)	/* 0x0217 */
3485 /** MrvlIEtypes_Max_Conn_t */
3486 typedef MLAN_PACK_START struct _MrvlIEtypes_Max_Conn_t {
3487     /** Header */
3488 	MrvlIEtypesHeader_t header;
3489     /** FW support max P2P connection */
3490 	t_u8 max_p2p_conn;
3491     /** FW support max STA connection */
3492 	t_u8 max_sta_conn;
3493 } MLAN_PACK_END MrvlIEtypes_Max_Conn_t;
3494 
3495 /** exceed max p2p connection event */
3496 typedef MLAN_PACK_START struct _event_exceed_max_p2p_conn {
3497     /** Event ID */
3498 	t_u16 event_id;
3499     /** BSS index number for multiple BSS support */
3500 	t_u8 bss_index;
3501     /** BSS type */
3502 	t_u8 bss_type;
3503     /** When exceed max, the mac address who request p2p connect */
3504 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3505 } MLAN_PACK_END event_exceed_max_p2p_conn;
3506 
3507 #ifdef STA_SUPPORT
3508 
3509 /**
3510  * @brief Structure used internally in the wlan driver to configure a scan.
3511  *
3512  * Sent to the command process module to configure the firmware
3513  *   scan command prepared by wlan_cmd_802_11_scan.
3514  *
3515  * @sa wlan_scan_networks
3516  *
3517  */
3518 typedef MLAN_PACK_START struct _wlan_scan_cmd_config {
3519     /**
3520      *  BSS Type to be sent in the firmware command
3521      *
3522      *  Field can be used to restrict the types of networks returned in the
3523      *    scan.  Valid settings are:
3524      *
3525      *   - MLAN_SCAN_MODE_BSS  (infrastructure)
3526      *   - MLAN_SCAN_MODE_IBSS (adhoc)
3527      *   - MLAN_SCAN_MODE_ANY  (unrestricted, adhoc and infrastructure)
3528      */
3529 	t_u8 bss_mode;
3530 
3531     /**
3532      *  Specific BSSID used to filter scan results in the firmware
3533      */
3534 	t_u8 specific_bssid[MLAN_MAC_ADDR_LENGTH];
3535 
3536     /**
3537      *  Length of TLVs sent in command starting at tlvBuffer
3538      */
3539 	t_u32 tlv_buf_len;
3540 
3541     /**
3542      *  SSID TLV(s) and ChanList TLVs to be sent in the firmware command
3543      *
3544      *  TLV_TYPE_CHANLIST, MrvlIEtypes_ChanListParamSet_t
3545      *  TLV_TYPE_SSID, MrvlIEtypes_SsIdParamSet_t
3546      */
3547 	t_u8 tlv_buf[1];	/* SSID TLV(s) and ChanList TLVs are stored here */
3548 } MLAN_PACK_END wlan_scan_cmd_config;
3549 
3550 /**
3551  *  Sructure to retrieve the scan table
3552  */
3553 typedef MLAN_PACK_START struct {
3554     /**
3555      *  - Zero based scan entry to start retrieval in command request
3556      *  - Number of scans entries returned in command response
3557      */
3558 	t_u32 scan_number;
3559     /**
3560      * Buffer marker for multiple wlan_ioctl_get_scan_table_entry structures.
3561      *   Each struct is padded to the nearest 32 bit boundary.
3562      */
3563 	t_u8 scan_table_entry_buf[1];
3564 } MLAN_PACK_END wlan_get_scan_table_info;
3565 
3566 /** Generic structure defined for parsing WPA/RSN IEs for GTK/PTK OUIs */
3567 typedef MLAN_PACK_START struct {
3568 	/** Group key oui */
3569 	t_u8 GrpKeyOui[4];
3570 	/** Number of PTKs */
3571 	t_u8 PtkCnt[2];
3572 	/** Ptk body starts here */
3573 	t_u8 PtkBody[4];
3574 } MLAN_PACK_END IEBody;
3575 #endif /* STA_SUPPORT */
3576 
3577 /*
3578  * This scan handle Country Information IE(802.11d compliant)
3579  * Define data structure for HostCmd_CMD_802_11_SCAN
3580  */
3581 /** HostCmd_DS_802_11_SCAN */
3582 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SCAN {
3583     /** BSS mode */
3584 	t_u8 bss_mode;
3585     /** BSSID */
3586 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
3587     /** TLV buffer */
3588 	t_u8 tlv_buffer[1];
3589     /** MrvlIEtypes_SsIdParamSet_t      SsIdParamSet;
3590      *  MrvlIEtypes_ChanListParamSet_t  ChanListParamSet;
3591      *  MrvlIEtypes_RatesParamSet_t     OpRateSet;
3592      */
3593 } MLAN_PACK_END HostCmd_DS_802_11_SCAN;
3594 
3595 /** fw_cap_info bit to indicate enhance ext scan type */
3596 #define ENHANCE_EXT_SCAN_ENABLE MBIT(19)
3597 /** mlan_event_scan_result data structure */
3598 typedef MLAN_PACK_START struct _mlan_event_scan_result {
3599     /** Event ID */
3600 	t_u16 event_id;
3601     /** BSS index number for multiple BSS support */
3602 	t_u8 bss_index;
3603     /** BSS type */
3604 	t_u8 bss_type;
3605     /** More event available or not */
3606 	t_u8 more_event;
3607     /** Reserved */
3608 	t_u8 reserved[3];
3609     /** Size of the response buffer */
3610 	t_u16 buf_size;
3611     /** Number of BSS in scan response */
3612 	t_u8 num_of_set;
3613 } MLAN_PACK_END mlan_event_scan_result, *pmlan_event_scan_result;
3614 
3615 /** ext scan status report event */
3616 typedef MLAN_PACK_START struct _mlan_event_scan_status {
3617     /** Event ID */
3618 	t_u16 event_id;
3619     /** BSS index number for multiple BSS support */
3620 	t_u8 bss_index;
3621     /** BSS type */
3622 	t_u8 bss_type;
3623     /** scan status */
3624 	t_u8 scan_status;
3625     /** result */
3626 	t_u16 buf_len;
3627     /** event buf */
3628 	t_u8 event_buf[0];
3629 } MLAN_PACK_END mlan_event_scan_status, *pmlan_event_scan_status;
3630 
3631 /*
3632  * This scan handle Country Information IE(802.11d compliant)
3633  * Define data structure for HostCmd_CMD_802_11_SCAN_EXT
3634  */
3635 /** HostCmd_DS_802_11_SCAN_EXT */
3636 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SCAN_EXT {
3637     /** Scan type for ext scan
3638      *  0: default type: cmd resp after ext scan report event
3639      *  1: enhanced type: cmd resp before ext scan report event
3640      *  2: scan cancelled: cancel scan during scan processing
3641      */
3642 	t_u8 ext_scan_type;
3643     /** Reserved */
3644 	t_u8 reserved[3];
3645     /** TLV buffer */
3646 	t_u8 tlv_buffer[1];
3647     /** MrvlIEtypes_Bssid_List_t            BssIdList;
3648      *  MrvlIEtypes_SsIdParamSet_t          SSIDParamSet;
3649      *  MrvlIEtypes_ChanListParamSet_t      ChanListParamSet;
3650      *  MrvlIEtypes_RatesParamSet_t         OpRateSet;
3651      *  MrvlIEtypes_NumProbes_t             NumProbes;
3652      *  MrvlIEtypes_WildCardSsIdParamSet_t  WildCardSSIDParamSet;
3653      *  MrvlIEtypes_BssMode_t               BssMode;
3654      */
3655 } MLAN_PACK_END HostCmd_DS_802_11_SCAN_EXT;
3656 
3657 /** MrvlIEtypes_BssMode */
3658 typedef MLAN_PACK_START struct _MrvlIEtypes_BssMode_t {
3659     /** Header */
3660 	MrvlIEtypesHeader_t header;
3661 	/* INFRA/IBSS/AUTO */
3662 	t_u8 bss_mode;
3663 } MLAN_PACK_END MrvlIEtypes_BssMode_t;
3664 
3665 /** BSS scan Rsp */
3666 typedef MLAN_PACK_START struct _MrvlIEtypes_Bss_Scan_Rsp_t {
3667     /** Header */
3668 	MrvlIEtypesHeader_t header;
3669     /** BSSID of the BSS descriptor */
3670 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
3671     /** Beacon/Probe response buffer */
3672 	t_u8 frame_body[1];
3673 } MLAN_PACK_END MrvlIEtypes_Bss_Scan_Rsp_t;
3674 
3675 typedef MLAN_PACK_START struct _MrvlIEtypes_Bss_Scan_Info_t {
3676     /** Header */
3677 	MrvlIEtypesHeader_t header;
3678     /** RSSI for scan entry */
3679 	t_s16 rssi;
3680     /** Channel ANPI */
3681 	t_s16 anpi;
3682     /** Channel load (parts per 255) */
3683 	t_u8 cca_busy_fraction;
3684     /** Band */
3685 	Band_Config_t bandcfg;
3686     /** Channel */
3687 	t_u8 channel;
3688     /** Reserved */
3689 	t_u8 reserved;
3690     /** TSF data */
3691 	t_u64 tsf;
3692 } MLAN_PACK_END MrvlIEtypes_Bss_Scan_Info_t;
3693 
3694 /** HostCmd_DS_RX_MGMT_IND */
3695 typedef MLAN_PACK_START struct _HostCmd_DS_RX_MGMT_IND {
3696     /** Action */
3697 	t_u16 action;
3698     /** Mgmt frame subtype mask */
3699 	t_u32 mgmt_subtype_mask;
3700 } MLAN_PACK_END HostCmd_DS_RX_MGMT_IND;
3701 
3702 /** HostCmd_DS_802_11_SCAN_RSP */
3703 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SCAN_RSP {
3704     /** Size of BSS descriptor */
3705 	t_u16 bss_descript_size;
3706     /** Numner of sets */
3707 	t_u8 number_of_sets;
3708     /** BSS descriptor and TLV buffer */
3709 	t_u8 bss_desc_and_tlv_buffer[1];
3710 } MLAN_PACK_END HostCmd_DS_802_11_SCAN_RSP;
3711 
3712 /** HostCmd_DS_802_11_BG_SCAN_CONFIG */
3713 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_BG_SCAN_CONFIG {
3714     /** action */
3715 	t_u16 action;
3716     /** 0: disable, 1: enable */
3717 	t_u8 enable;
3718     /** bss type */
3719 	t_u8 bss_type;
3720     /** num of channel per scan */
3721 	t_u8 chan_per_scan;
3722     /** reserved field */
3723 	t_u8 reserved;
3724     /** reserved field */
3725 	t_u16 reserved1;
3726     /** interval between consecutive scans */
3727 	t_u32 scan_interval;
3728     /** reserved field */
3729 	t_u32 reserved2;
3730     /** condition to trigger report to host */
3731 	t_u32 report_condition;
3732     /** reserved field */
3733 	t_u16 reserved3;
3734 } MLAN_PACK_END HostCmd_DS_802_11_BG_SCAN_CONFIG;
3735 
3736 /** HostCmd_DS_802_11_BG_SCAN_QUERY */
3737 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_BG_SCAN_QUERY {
3738     /** Flush */
3739 	t_u8 flush;
3740 } MLAN_PACK_END HostCmd_DS_802_11_BG_SCAN_QUERY;
3741 
3742 /** HostCmd_DS_802_11_BG_SCAN_QUERY_RSP */
3743 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_BG_SCAN_QUERY_RSP {
3744     /** Report condition */
3745 	t_u32 report_condition;
3746     /** Scan response */
3747 	HostCmd_DS_802_11_SCAN_RSP scan_resp;
3748 } MLAN_PACK_END HostCmd_DS_802_11_BG_SCAN_QUERY_RSP;
3749 
3750 /** MrvlIEtypes_StartLater_t */
3751 typedef MLAN_PACK_START struct _MrvlIEtypes_StartLater_t {
3752     /** Header */
3753 	MrvlIEtypesHeader_t header;
3754 	/* 0 - BGScan start immediately, 1 - BGScan will start later after "Scan Interval" */
3755 	t_u16 value;
3756 } MLAN_PACK_END MrvlIEtypes_StartLater_t;
3757 
3758 /** MrvlIEtypes_RepeatCount_t */
3759 typedef MLAN_PACK_START struct _MrvlIEtypes_RepeatCount_t {
3760     /** Header */
3761 	MrvlIEtypesHeader_t header;
3762 	/* Repeat count */
3763 	t_u16 repeat_count;
3764 } MLAN_PACK_END MrvlIEtypes_RepeatCount_t;
3765 
3766 /** MrvlIEtypes_DomainParamSet_t */
3767 typedef MLAN_PACK_START struct _MrvlIEtypes_DomainParamSet {
3768     /** Header */
3769 	MrvlIEtypesHeader_t header;
3770     /** Country code */
3771 	t_u8 country_code[COUNTRY_CODE_LEN];
3772     /** Set of subbands */
3773 	IEEEtypes_SubbandSet_t sub_band[1];
3774 } MLAN_PACK_END MrvlIEtypes_DomainParamSet_t;
3775 
3776 /** HostCmd_DS_802_11D_DOMAIN_INFO */
3777 typedef MLAN_PACK_START struct _HostCmd_DS_802_11D_DOMAIN_INFO {
3778     /** Action */
3779 	t_u16 action;
3780     /** Domain parameter set */
3781 	MrvlIEtypes_DomainParamSet_t domain;
3782 } MLAN_PACK_END HostCmd_DS_802_11D_DOMAIN_INFO;
3783 
3784 /** HostCmd_DS_802_11D_DOMAIN_INFO_RSP */
3785 typedef MLAN_PACK_START struct _HostCmd_DS_802_11D_DOMAIN_INFO_RSP {
3786     /** Action */
3787 	t_u16 action;
3788     /** Domain parameter set */
3789 	MrvlIEtypes_DomainParamSet_t domain;
3790 } MLAN_PACK_END HostCmd_DS_802_11D_DOMAIN_INFO_RSP;
3791 
3792 /** HostCmd_DS_802_11K_GET_NLIST */
3793 typedef MLAN_PACK_START struct _HostCmd_DS_802_11K_GET_NLIST {
3794 	/** Action */
3795 	t_u16 action;
3796 	/** Dialog token */
3797 	t_u8 dialog_token;
3798 } MLAN_PACK_END HostCmd_DS_802_11K_GET_NLIST;
3799 
3800 #ifdef BIG_ENDIAN_SUPPORT
3801 /** host_OffloadFeatureStdControl_t*/
3802 typedef MLAN_PACK_START struct {
3803 	t_u8 dot11k_tsm:1;
3804 	t_u8 dot11k_lm:1;
3805 	t_u8 dot11k_nbor_support:1;
3806 	t_u8 dot11k_rm:1;
3807 	t_u8 dot11h_rm:1;
3808 	t_u8 wmm_ac_tpsec_modify:1;
3809 	t_u8 wmm_ac_dynamic_ps:1;
3810 	t_u8 client_radar_detect:1;
3811 
3812 	t_u8 reserved:3;
3813 	t_u8 rbc:1;
3814 	t_u8 dot11v_bss_trans:1;
3815 	t_u8 vowifi_probe_tpc_rpt:1;
3816 	t_u8 pmf_required:1;
3817 	t_u8 pmf_capable:1;
3818 } MLAN_PACK_END host_OffloadFeatureStdControl_t;
3819 #else
3820 /** host_OffloadFeatureStdControl_t */
3821 typedef MLAN_PACK_START struct {
3822 	t_u8 client_radar_detect:1;
3823 	t_u8 wmm_ac_dynamic_ps:1;
3824 	t_u8 wmm_ac_tpsec_modify:1;
3825 	t_u8 dot11h_rm:1;
3826 	t_u8 dot11k_rm:1;
3827 	t_u8 dot11k_nbor_support:1;
3828 	t_u8 dot11k_lm:1;
3829 	t_u8 dot11k_tsm:1;
3830 
3831 	t_u8 pmf_capable:1;
3832 	t_u8 pmf_required:1;
3833 	t_u8 vowifi_probe_tpc_rpt:1;
3834 	t_u8 dot11v_bss_trans:1;
3835 	t_u8 rbc:1;
3836 	t_u8 reserved:3;
3837 } MLAN_PACK_END host_OffloadFeatureStdControl_t;
3838 #endif
3839 
3840 /** END HostCmd_OFFLOAD_FEATURE_CTRL */
3841 typedef MLAN_PACK_START struct _HostCmd_OFFLOAD_FEATURE_CTRL {
3842 	t_u8 featureSelect;
3843 	union {
3844 		host_OffloadFeatureStdControl_t std;
3845 		t_u8 empty;
3846 	} control;
3847 } MLAN_PACK_END HostCmd_OFFLOAD_FEATURE_CTRL;
3848 /** HostCmd_DS_11N_ADDBA_REQ */
3849 typedef MLAN_PACK_START struct _HostCmd_DS_11N_ADDBA_REQ {
3850     /** Result of the ADDBA Request Operation */
3851 	t_u8 add_req_result;
3852     /** Peer MAC address */
3853 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3854     /** Dialog Token */
3855 	t_u8 dialog_token;
3856     /** Block Ack Parameter Set */
3857 	t_u16 block_ack_param_set;
3858     /** Block Act Timeout Value */
3859 	t_u16 block_ack_tmo;
3860     /** Starting Sequence Number */
3861 	t_u16 ssn;
3862 } MLAN_PACK_END HostCmd_DS_11N_ADDBA_REQ;
3863 
3864 /** HostCmd_DS_11N_ADDBA_RSP */
3865 typedef MLAN_PACK_START struct _HostCmd_DS_11N_ADDBA_RSP {
3866     /** Result of the ADDBA Response Operation */
3867 	t_u8 add_rsp_result;
3868     /** Peer MAC address */
3869 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3870     /** Dialog Token */
3871 	t_u8 dialog_token;
3872     /** Status Code */
3873 	t_u16 status_code;
3874     /** Block Ack Parameter Set */
3875 	t_u16 block_ack_param_set;
3876     /** Block Act Timeout Value */
3877 	t_u16 block_ack_tmo;
3878     /** Starting Sequence Number */
3879 	t_u16 ssn;
3880 } MLAN_PACK_END HostCmd_DS_11N_ADDBA_RSP;
3881 
3882 /** HostCmd_DS_11N_DELBA */
3883 typedef MLAN_PACK_START struct _HostCmd_DS_11N_DELBA {
3884     /** Result of the ADDBA Request Operation */
3885 	t_u8 del_result;
3886     /** Peer MAC address */
3887 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3888     /** Delete Block Ack Parameter Set */
3889 	t_u16 del_ba_param_set;
3890     /** Reason Code sent for DELBA */
3891 	t_u16 reason_code;
3892     /** Reserved */
3893 	t_u8 reserved;
3894 } MLAN_PACK_END HostCmd_DS_11N_DELBA;
3895 
3896 /** HostCmd_DS_11N_BATIMEOUT */
3897 typedef MLAN_PACK_START struct _HostCmd_DS_11N_BATIMEOUT {
3898     /** TID */
3899 	t_u8 tid;
3900     /** Peer MAC address */
3901 	t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
3902     /** Delete Block Ack Parameter Set */
3903 	t_u8 origninator;
3904 } MLAN_PACK_END HostCmd_DS_11N_BATIMEOUT;
3905 
3906 /** HostCmd_DS_11N_CFG */
3907 typedef MLAN_PACK_START struct _HostCmd_DS_11N_CFG {
3908     /** Action */
3909 	t_u16 action;
3910     /** HTTxCap */
3911 	t_u16 ht_tx_cap;
3912     /** HTTxInfo */
3913 	t_u16 ht_tx_info;
3914     /** Misc configuration */
3915 	t_u16 misc_config;
3916 } MLAN_PACK_END HostCmd_DS_11N_CFG;
3917 
3918 /** HostCmd_DS_11N_CFG */
3919 typedef MLAN_PACK_START struct _HostCmd_DS_REJECT_ADDBA_REQ {
3920     /** Action */
3921 	t_u16 action;
3922     /** Bit0    : host sleep activated
3923      *  Bit1    : auto reconnect enabled
3924      *  Others  : reserved
3925      */
3926 	t_u32 conditions;
3927 } MLAN_PACK_END HostCmd_DS_REJECT_ADDBA_REQ;
3928 
3929 /** HostCmd_DS_TXBUF_CFG*/
3930 typedef MLAN_PACK_START struct _HostCmd_DS_TXBUF_CFG {
3931     /** Action */
3932 	t_u16 action;
3933     /** Buffer Size */
3934 	t_u16 buff_size;
3935     /** End Port_for Multiport */
3936 	t_u16 mp_end_port;
3937     /** Reserved */
3938 	t_u16 reserved3;
3939 } MLAN_PACK_END HostCmd_DS_TXBUF_CFG;
3940 
3941 /** HostCmd_DS_AMSDU_AGGR_CTRL */
3942 typedef MLAN_PACK_START struct _HostCmd_DS_AMSDU_AGGR_CTRL {
3943     /** Action */
3944 	t_u16 action;
3945     /** Enable */
3946 	t_u16 enable;
3947     /** Get the current Buffer Size valid */
3948 	t_u16 curr_buf_size;
3949 } MLAN_PACK_END HostCmd_DS_AMSDU_AGGR_CTRL;
3950 
3951 /** HostCmd_DS_ECL_SYSTEM_CLOCK_CONFIG */
3952 typedef MLAN_PACK_START struct _HostCmd_DS_ECL_SYSTEM_CLOCK_CONFIG {
3953     /** Action */
3954 	t_u16 action;
3955     /** Current system clock */
3956 	t_u16 cur_sys_clk;
3957     /** Clock type */
3958 	t_u16 sys_clk_type;
3959     /** Length of clocks */
3960 	t_u16 sys_clk_len;
3961     /** System clocks */
3962 	t_u16 sys_clk[16];
3963 } MLAN_PACK_END HostCmd_DS_ECL_SYSTEM_CLOCK_CONFIG;
3964 
3965 /** MrvlIEtypes_WmmParamSet_t */
3966 typedef MLAN_PACK_START struct _MrvlIEtypes_WmmParamSet_t {
3967     /** Header */
3968 	MrvlIEtypesHeader_t header;
3969     /** WMM IE */
3970 	t_u8 wmm_ie[1];
3971 } MLAN_PACK_END MrvlIEtypes_WmmParamSet_t;
3972 
3973 /** MrvlIEtypes_WmmQueueStatus_t */
3974 typedef MLAN_PACK_START struct {
3975     /** Header */
3976 	MrvlIEtypesHeader_t header;
3977     /** Queue index */
3978 	t_u8 queue_index;
3979     /** Disabled flag */
3980 	t_u8 disabled;
3981     /** Medium time allocation in 32us units*/
3982 	t_u16 medium_time;
3983     /** Flow required flag */
3984 	t_u8 flow_required;
3985     /** Flow created flag */
3986 	t_u8 flow_created;
3987     /** Reserved */
3988 	t_u32 reserved;
3989 } MLAN_PACK_END MrvlIEtypes_WmmQueueStatus_t;
3990 
3991 /** Size of a TSPEC.  Used to allocate necessary buffer space in commands */
3992 #define WMM_TSPEC_SIZE              63
3993 
3994 /** Extra IE bytes allocated in messages for appended IEs after a TSPEC */
3995 #define WMM_ADDTS_EXTRA_IE_BYTES    256
3996 
3997 /** Extra TLV bytes allocated in messages for configuring WMM Queues */
3998 #define WMM_QUEUE_CONFIG_EXTRA_TLV_BYTES 64
3999 
4000 /** Number of bins in the histogram for the HostCmd_DS_WMM_QUEUE_STATS */
4001 #define WMM_STATS_PKTS_HIST_BINS  7
4002 
4003 /**
4004  *  @brief Firmware command structure to retrieve the firmware WMM status.
4005  *
4006  *  Used to retrieve the status of each WMM AC Queue in TLV
4007  *    format (MrvlIEtypes_WmmQueueStatus_t) as well as the current WMM
4008  *    parameter IE advertised by the AP.
4009  *
4010  *  Used in response to a EVENT_WMM_STATUS_CHANGE event signaling
4011  *    a QOS change on one of the ACs or a change in the WMM Parameter in
4012  *    the Beacon.
4013  *
4014  *  TLV based command, byte arrays used for max sizing purpose. There are no
4015  *    arguments sent in the command, the TLVs are returned by the firmware.
4016  */
4017 typedef MLAN_PACK_START struct {
4018     /** Queue status TLV */
4019 	t_u8 queue_status_tlv[sizeof(MrvlIEtypes_WmmQueueStatus_t)
4020 			      * MAX_AC_QUEUES];
4021     /** WMM parameter TLV */
4022 	t_u8 wmm_param_tlv[sizeof(IEEEtypes_WmmParameter_t) + 2];
4023 } MLAN_PACK_END HostCmd_DS_WMM_GET_STATUS;
4024 
4025 /**
4026  *  @brief Command structure for the HostCmd_CMD_WMM_ADDTS_REQ firmware command
4027  */
4028 typedef MLAN_PACK_START struct {
4029 	mlan_cmd_result_e command_result;/**< Command result */
4030 	t_u32 timeout_ms;		 /**< Timeout value in milliseconds */
4031 	t_u8 dialog_token;		 /**< Dialog token */
4032 	t_u8 ieee_status_code;		 /**< IEEE status code */
4033 	t_u8 tspec_data[WMM_TSPEC_SIZE]; /**< TSPEC data */
4034 	t_u8 addts_extra_ie_buf[WMM_ADDTS_EXTRA_IE_BYTES];
4035 							/**< Extra IE buffer */
4036 } MLAN_PACK_END HostCmd_DS_WMM_ADDTS_REQ;
4037 
4038 /**
4039  *  @brief Command structure for the HostCmd_CMD_WMM_DELTS_REQ firmware command
4040  */
4041 typedef MLAN_PACK_START struct {
4042 	mlan_cmd_result_e command_result;
4043 					/**< Command result */
4044 	t_u8 dialog_token;		/**< Dialog token */
4045 	t_u8 ieee_reason_code;		/**< IEEE reason code */
4046 	t_u8 tspec_data[WMM_TSPEC_SIZE];/**< TSPEC data */
4047 } MLAN_PACK_END HostCmd_DS_WMM_DELTS_REQ;
4048 
4049 /**
4050  *  @brief Command structure for the HostCmd_CMD_WMM_QUEUE_CONFIG firmware cmd
4051  *
4052  *  Set/Get/Default the Queue parameters for a specific AC in the firmware.
4053  */
4054 typedef MLAN_PACK_START struct {
4055 	mlan_wmm_queue_config_action_e action;
4056 					   /**< Set, Get, or Default */
4057 	mlan_wmm_ac_e access_category;	   /**< WMM_AC_BK(0) to WMM_AC_VO(3) */
4058     /** @brief MSDU lifetime expiry per 802.11e
4059      *
4060      *   - Ignored if 0 on a set command
4061      *   - Set to the 802.11e specified 500 TUs when defaulted
4062      */
4063 	t_u16 msdu_lifetime_expiry;
4064 	t_u8 tlv_buffer[WMM_QUEUE_CONFIG_EXTRA_TLV_BYTES];
4065 							/**< Not supported */
4066 } MLAN_PACK_END HostCmd_DS_WMM_QUEUE_CONFIG;
4067 
4068 /**
4069  *  @brief Command structure for the HostCmd_CMD_WMM_QUEUE_STATS firmware cmd
4070  *
4071  *  Turn statistical collection on/off for a given AC or retrieve the
4072  *    accumulated stats for an AC and clear them in the firmware.
4073  */
4074 typedef MLAN_PACK_START struct {
4075 	mlan_wmm_queue_stats_action_e action;
4076 					   /**< Start, Stop, or Get */
4077 #ifdef BIG_ENDIAN_SUPPORT
4078 	t_u8 select_bin:7;	/**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */
4079 	t_u8 select_is_userpri:1;
4080 				/**< Set if select_bin is UP, Clear for AC */
4081 #else
4082 	t_u8 select_is_userpri:1;
4083 				/**< Set if select_bin is UP, Clear for AC */
4084 	t_u8 select_bin:7;	/**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */
4085 #endif
4086 	t_u16 pkt_count;    /**< Number of successful packets transmitted */
4087 	t_u16 pkt_loss;	    /**< Packets lost; not included in pktCount */
4088 	t_u32 avg_queue_delay;
4089 			    /**< Average Queue delay in microsec */
4090 	t_u32 avg_tx_delay; /**< Average Transmission delay in microsec */
4091 	t_u16 used_time;    /**< Calc used time - units of 32 microsec */
4092 	t_u16 policed_time; /**< Calc policed time - units of 32 microsec */
4093     /** @brief Queue Delay Histogram; number of packets per queue delay range
4094      *
4095      *  [0] -  0ms <= delay < 5ms
4096      *  [1] -  5ms <= delay < 10ms
4097      *  [2] - 10ms <= delay < 20ms
4098      *  [3] - 20ms <= delay < 30ms
4099      *  [4] - 30ms <= delay < 40ms
4100      *  [5] - 40ms <= delay < 50ms
4101      *  [6] - 50ms <= delay < msduLifetime (TUs)
4102      */
4103 	t_u16 delay_histogram[WMM_STATS_PKTS_HIST_BINS];
4104     /** Reserved */
4105 	t_u16 reserved_1;
4106 } MLAN_PACK_END HostCmd_DS_WMM_QUEUE_STATS;
4107 
4108 /**
4109  *  @brief Command structure for the HostCmd_CMD_WMM_TS_STATUS firmware cmd
4110  *
4111  *  Query the firmware to get the status of the WMM Traffic Streams
4112  */
4113 typedef MLAN_PACK_START struct {
4114     /** TSID: Range: 0->7 */
4115 	t_u8 tid;
4116     /** TSID specified is valid */
4117 	t_u8 valid;
4118     /** AC TSID is active on */
4119 	t_u8 access_category;
4120     /** UP specified for the TSID */
4121 	t_u8 user_priority;
4122     /** Power save mode for TSID: 0 (legacy), 1 (UAPSD) */
4123 	t_u8 psb;
4124     /** Uplink(1), Downlink(2), Bidirectional(3) */
4125 	t_u8 flow_dir;
4126     /** Medium time granted for the TSID */
4127 	t_u16 medium_time;
4128 } MLAN_PACK_END HostCmd_DS_WMM_TS_STATUS;
4129 
4130 /** Firmware status for a specific AC */
4131 typedef MLAN_PACK_START struct {
4132     /** Disabled flag */
4133 	t_u8 disabled;
4134     /** Flow required flag */
4135 	t_u8 flow_required;
4136     /** Flow created flag */
4137 	t_u8 flow_created;
4138 } MLAN_PACK_END WmmAcStatus_t;
4139 
4140 /**  Local Power Capability */
4141 typedef MLAN_PACK_START struct _MrvlIEtypes_PowerCapability_t {
4142     /** Header */
4143 	MrvlIEtypesHeader_t header;
4144     /** Minmum power */
4145 	t_s8 min_power;
4146     /** Maximum power */
4147 	t_s8 max_power;
4148 } MLAN_PACK_END MrvlIEtypes_PowerCapability_t;
4149 
4150 /** HT Capabilities element */
4151 typedef MLAN_PACK_START struct _MrvlIETypes_HTCap_t {
4152     /** Header */
4153 	MrvlIEtypesHeader_t header;
4154 
4155     /** HTCap struct */
4156 	HTCap_t ht_cap;
4157 } MLAN_PACK_END MrvlIETypes_HTCap_t;
4158 
4159 /** HT Information element */
4160 typedef MLAN_PACK_START struct _MrvlIETypes_HTInfo_t {
4161     /** Header */
4162 	MrvlIEtypesHeader_t header;
4163 
4164     /** HTInfo struct */
4165 	HTInfo_t ht_info;
4166 } MLAN_PACK_END MrvlIETypes_HTInfo_t;
4167 
4168 /** 20/40 BSS Coexistence element */
4169 typedef MLAN_PACK_START struct _MrvlIETypes_2040BSSCo_t {
4170     /** Header */
4171 	MrvlIEtypesHeader_t header;
4172 
4173     /** BSSCo2040_t struct */
4174 	BSSCo2040_t bss_co_2040;
4175 } MLAN_PACK_END MrvlIETypes_2040BSSCo_t;
4176 
4177 /** Extended Capabilities element */
4178 typedef MLAN_PACK_START struct _MrvlIETypes_ExtCap_t {
4179     /** Header */
4180 	MrvlIEtypesHeader_t header;
4181 
4182     /** ExtCap_t struct */
4183 	ExtCap_t ext_cap;
4184 } MLAN_PACK_END MrvlIETypes_ExtCap_t;
4185 
4186 /** Supported operating classes element */
4187 typedef MLAN_PACK_START struct _MrvlIETypes_SuppOperClass_t {
4188     /** Header */
4189 	MrvlIEtypesHeader_t header;
4190     /** Current operationg class **/
4191 	t_u8 current_oper_class;
4192     /** Operating class list */
4193 	t_u8 oper_class[1];
4194 } MLAN_PACK_END MrvlIETypes_SuppOperClass_t;
4195 
4196 /** Oper_class channel bandwidth element */
4197 typedef MLAN_PACK_START struct _MrvlIEtypes_chan_bw_oper_t {
4198     /** Header */
4199 	MrvlIEtypesHeader_t header;
4200     /** channel oper bandwidth*/
4201 	mlan_ds_bw_chan_oper ds_chan_bw_oper;
4202 } MLAN_PACK_END MrvlIEtypes_chan_bw_oper_t;
4203 
4204 /** Qos Info */
4205 typedef MLAN_PACK_START struct _MrvlIETypes_qosinfo_t {
4206     /** Header */
4207 	MrvlIEtypesHeader_t header;
4208     /** qos_info*/
4209 	t_u8 qos_info;
4210 } MLAN_PACK_END MrvlIETypes_qosinfo_t;
4211 
4212 /** Overlapping BSS Scan Parameters element */
4213 typedef MLAN_PACK_START struct _MrvlIETypes_OverlapBSSScanParam_t {
4214     /** Header */
4215 	MrvlIEtypesHeader_t header;
4216 
4217     /** OBSSScanParam_t struct */
4218 	OBSSScanParam_t obss_scan_param;
4219 } MLAN_PACK_END MrvlIETypes_OverlapBSSScanParam_t;
4220 
4221 /** Set of MCS values that STA desires to use within the BSS */
4222 typedef MLAN_PACK_START struct _MrvlIETypes_HTOperationalMCSSet_t {
4223     /** Header */
4224 	MrvlIEtypesHeader_t header;
4225 
4226     /** Bitmap indicating MCSs that STA desires to use within the BSS */
4227 	t_u8 ht_operational_mcs_bitmap[16];
4228 } MLAN_PACK_END MrvlIETypes_HTOperationalMCSSet_t;
4229 
4230 /** bf global args */
4231 typedef struct MLAN_PACK_START _bf_global_cfg_args {
4232     /** Global enable/disable bf */
4233 	t_u8 bf_enbl;
4234     /** Global enable/disable sounding */
4235 	t_u8 sounding_enbl;
4236     /** FB Type */
4237 	t_u8 fb_type;
4238     /** SNR Threshold */
4239 	t_u8 snr_threshold;
4240     /** Sounding interval */
4241 	t_u16 sounding_interval;
4242     /** BF mode */
4243 	t_u8 bf_mode;
4244     /** Reserved */
4245 	t_u8 reserved;
4246 } MLAN_PACK_END bf_global_cfg_args;
4247 
4248 /** bf_trigger_sound_args_t */
4249 typedef MLAN_PACK_START struct _bf_trigger_sound_args_t {
4250     /** Peer MAC address */
4251 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
4252     /** Status */
4253 	t_u8 status;
4254 } MLAN_PACK_END bf_trigger_sound_args_t;
4255 
4256 /** bf periodicity args */
4257 typedef MLAN_PACK_START struct _bf_periodicity_args {
4258     /** Peer MAC address */
4259 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
4260     /** Current Tx BF Interval */
4261 	t_u16 interval;
4262     /** Status */
4263 	t_u8 status;
4264 } MLAN_PACK_END bf_periodicity_args;
4265 
4266 /** bf peer configuration args */
4267 typedef struct MLAN_PACK_START _bf_peer_args {
4268     /** Peer MAC address */
4269 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
4270     /** Reserved */
4271 	t_u16 reserved;
4272     /** Enable/Disable Beamforming */
4273 	t_u8 bf_enbl;
4274     /** Enable/Disable sounding */
4275 	t_u8 sounding_enbl;
4276     /** FB Type */
4277 	t_u8 fb_type;
4278 } MLAN_PACK_END bf_peer_args;
4279 
4280 /** bf_snr_thr_t */
4281 typedef MLAN_PACK_START struct _bf_snr_thr_t {
4282     /** Peer MAC address */
4283 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
4284     /** SNR */
4285 	t_u8 snr;
4286 } MLAN_PACK_END bf_snr_thr_t;
4287 
4288 /** HostCmd_DS_TX_BF_CFG */
4289 typedef MLAN_PACK_START struct _HostCmd_DS_TX_BF_CFG {
4290 	/* Beamforming action */
4291 	t_u16 bf_action;
4292 	/* action - SET/GET */
4293 	t_u16 action;
4294 
4295 	MLAN_PACK_START union {
4296 		bf_global_cfg_args bf_global_cfg;
4297 		bf_trigger_sound_args_t bf_sound_args;
4298 		bf_periodicity_args bf_periodicity;
4299 		bf_peer_args tx_bf_peer;
4300 		bf_snr_thr_t bf_snr;
4301 	} MLAN_PACK_END body;
4302 } MLAN_PACK_END HostCmd_DS_TX_BF_CFG;
4303 
4304 #ifdef WIFI_DIRECT_SUPPORT
4305 /** MrvlIEtypes_psk_t */
4306 typedef MLAN_PACK_START struct _MrvlIEtypes_psk_t {
4307     /** Header */
4308 	MrvlIEtypesHeader_t header;
4309     /** PSK */
4310 	t_u8 psk[MLAN_MAX_KEY_LENGTH];
4311 } MLAN_PACK_END MrvlIEtypes_psk_t;
4312 #endif /* WIFI_DIRECT_SUPPORT */
4313 
4314 /** Data structure for Link ID */
4315 typedef MLAN_PACK_START struct _MrvlIETypes_LinkIDElement_t {
4316     /** Header */
4317 	MrvlIEtypesHeader_t header;
4318     /** Bssid */
4319 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
4320     /** initial sta address*/
4321 	t_u8 init_sta[MLAN_MAC_ADDR_LENGTH];
4322     /** respose sta address */
4323 	t_u8 resp_sta[MLAN_MAC_ADDR_LENGTH];
4324 } MLAN_PACK_END MrvlIETypes_LinkIDElement_t;
4325 
4326 /** MrvlIEtypes_PMK_t */
4327 typedef MLAN_PACK_START struct _MrvlIEtypes_PMK_t {
4328     /** Header */
4329 	MrvlIEtypesHeader_t header;
4330     /** PMK */
4331 	t_u8 pmk[1];
4332 } MLAN_PACK_END MrvlIEtypes_PMK_t;
4333 
4334 /** MrvlIEtypes_Passphrase_t */
4335 typedef MLAN_PACK_START struct _MrvlIEtypes_Passphrase_t {
4336     /** Header */
4337 	MrvlIEtypesHeader_t header;
4338     /** Passphrase */
4339 	char passphrase[1];
4340 } MLAN_PACK_END MrvlIEtypes_Passphrase_t;
4341 
4342 /* unicastCipher -
4343  *      Bit 0   : RFU
4344  *      Bit 1   : RFU
4345  *      Bit 2   : TKIP
4346  *      Bit 3   : AES CCKM
4347  *      Bit 2-7 : RFU
4348  * multicastCipher -
4349  *      Bit 0   : WEP40
4350  *      Bit 1   : WEP104
4351  *      Bit 2   : TKIP
4352  *      Bit 3   : AES
4353  *      Bit 4-7 : Reserved for now
4354  */
4355 /** MrvlIEtypes_Cipher_t */
4356 typedef MLAN_PACK_START struct _MrvlIEtypes_Cipher_t {
4357     /** Header */
4358 	MrvlIEtypesHeader_t header;
4359     /** PairCipher */
4360 	t_u8 pair_cipher;
4361     /** GroupCipher */
4362 	t_u8 group_cipher;
4363 } MLAN_PACK_END MrvlIEtypes_Cipher_t;
4364 
4365 /* rsnMode -
4366  *      Bit 0    : No RSN
4367  *      Bit 1-2  : RFU
4368  *      Bit 3    : WPA
4369  *      Bit 4    : WPA-NONE
4370  *      Bit 5    : WPA2
4371  *      Bit 6    : AES CCKM
4372  *      Bit 7-15 : RFU
4373  */
4374 /** MrvlIEtypes_EncrProto_t */
4375 typedef MLAN_PACK_START struct _MrvlIEtypes_EncrProto_t {
4376     /** Header */
4377 	MrvlIEtypesHeader_t header;
4378     /** EncrProto */
4379 	t_u16 rsn_mode;
4380 } MLAN_PACK_END MrvlIEtypes_EncrProto_t;
4381 
4382 /** MrvlIEtypes_Bssid_t */
4383 typedef MLAN_PACK_START struct _MrvlIEtypes_Bssid_t {
4384     /** Header */
4385 	MrvlIEtypesHeader_t header;
4386     /** Bssid */
4387 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
4388 } MLAN_PACK_END MrvlIEtypes_Bssid_t;
4389 
4390 /*
4391  * This struct will handle GET,SET,CLEAR function for embedded
4392  * supplicant.
4393  * Define data structure for HostCmd_CMD_802_11_SUPPLICANT_PMK
4394  */
4395 /** HostCmd_DS_802_11_SUPPLICANT_PMK */
4396 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SUPPLICANT_PMK {
4397     /** CMD Action GET/SET/CLEAR */
4398 	t_u16 action;
4399     /** CacheResult initialized to 0 */
4400 	t_u16 cache_result;
4401     /** TLV Buffer */
4402 	t_u8 tlv_buffer[1];
4403     /** MrvlIEtypes_SsidParamSet_t  SsidParamSet;
4404       * MrvlIEtypes_PMK_t           Pmk;
4405       * MrvlIEtypes_Passphrase_t    Passphrase;
4406       * MrvlIEtypes_Bssid_t         Bssid;
4407       **/
4408 } MLAN_PACK_END HostCmd_DS_802_11_SUPPLICANT_PMK;
4409 
4410 /*
4411  * This struct will GET the Supplicant supported bitmaps
4412  * The GET_CURRENT action will get the network profile used
4413  * for the current assocation.
4414  * Define data structure for HostCmd_CMD_802_11_SUPPLICANT_PROFILE
4415  */
4416 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SUPPLICANT_PROFILE {
4417     /** GET/SET/GET_CURRENT */
4418 	t_u16 action;
4419     /** Reserved */
4420 	t_u16 reserved;
4421     /** TLVBuffer */
4422 	t_u8 tlv_buf[1];
4423 	/* MrvlIEtypes_EncrProto_t */
4424 } MLAN_PACK_END HostCmd_DS_802_11_SUPPLICANT_PROFILE;
4425 
4426 /** RFType */
4427 typedef MLAN_PACK_START struct _RFType_t {
4428 	/** band info */
4429 	Band_Config_t bandcfg;
4430 	/** reserved */
4431 	t_u8 reserved;
4432 } MLAN_PACK_END RFType_t;
4433 
4434 /** HostCmd_CMD_802_11_RF_CHANNEL */
4435 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RF_CHANNEL {
4436     /** Action */
4437 	t_u16 action;
4438     /** Current channel */
4439 	t_u16 current_channel;
4440     /** RF type */
4441 	RFType_t rf_type;
4442     /** Reserved field */
4443 	t_u16 reserved;
4444 #ifdef STA_SUPPORT
4445     /** Reserved */
4446 	t_u8 reserved_1[32];
4447 #else				/* STA_SUPPORT */
4448     /** List of channels */
4449 	t_u8 channel_list[32];
4450 #endif				/* !STA_SUPPORT */
4451 } MLAN_PACK_END HostCmd_DS_802_11_RF_CHANNEL;
4452 
4453 /** HostCmd_DS_VERSION_EXT */
4454 typedef MLAN_PACK_START struct _HostCmd_DS_VERSION_EXT {
4455     /** Selected version string */
4456 	t_u8 version_str_sel;
4457     /** Version string */
4458 	char version_str[128];
4459 } MLAN_PACK_END HostCmd_DS_VERSION_EXT;
4460 
4461 #define TLV_TYPE_CHAN_ATTR_CFG		(PROPRIETARY_TLV_BASE_ID + 237)
4462 #define TLV_TYPE_REGION_INFO		(PROPRIETARY_TLV_BASE_ID + 238)
4463 #define TLV_TYPE_POWER_TABLE		(PROPRIETARY_TLV_BASE_ID + 262)
4464 /** HostCmd_DS_CHAN_REGION_CFG */
4465 typedef MLAN_PACK_START struct _HostCmd_DS_CHAN_REGION_CFG {
4466     /** Action */
4467 	t_u16 action;
4468 } MLAN_PACK_END HostCmd_DS_CHAN_REGION_CFG;
4469 
4470 /** HostCmd_CMD_CW_MODE_CTRL */
4471 typedef MLAN_PACK_START struct _HostCmd_DS_CW_MODE_CTRL {
4472     /** Action for CW Tone Control */
4473 	t_u16 action;
4474     /** Mode of Operation 0: Disbale 1: Tx Continuous Packet 2: Tx Continuous Wave */
4475 	t_u8 mode;
4476     /** channel */
4477 	t_u8 channel;
4478     /** channel info*/
4479 	t_u8 chanInfo;
4480     /** Tx Power level in dBm */
4481 	t_u16 txPower;
4482     /** Packet Length */
4483 	t_u16 pktLength;
4484     /** bit rate Info */
4485 	t_u32 rateInfo;
4486 } MLAN_PACK_END HostCmd_DS_CW_MODE_CTRL;
4487 
4488 /** HostCmd_CMD_802_11_RF_ANTENNA */
4489 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_RF_ANTENNA {
4490     /** Action */
4491 	t_u16 action;
4492     /**  Antenna or 0xffff (diversity) */
4493 	t_u16 antenna_mode;
4494     /** Evaluate time */
4495 	t_u16 evaluate_time;
4496     /** Current antenna */
4497 	t_u16 current_antenna;
4498 } MLAN_PACK_END HostCmd_DS_802_11_RF_ANTENNA;
4499 
4500 /** HostCmd_DS_802_11_IBSS_STATUS */
4501 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_IBSS_STATUS {
4502     /** Action */
4503 	t_u16 action;
4504     /** Enable */
4505 	t_u16 enable;
4506     /** BSSID */
4507 	t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
4508     /** Beacon interval */
4509 	t_u16 beacon_interval;
4510     /** ATIM window interval */
4511 	t_u16 atim_window;
4512     /** User G rate protection */
4513 	t_u16 use_g_rate_protect;
4514 } MLAN_PACK_END HostCmd_DS_802_11_IBSS_STATUS;
4515 
4516 /** HostCmd_DS_MGMT_IE_LIST_CFG */
4517 typedef MLAN_PACK_START struct _HostCmd_DS_MGMT_IE_LIST {
4518     /** Action */
4519 	t_u16 action;
4520     /** Get/Set mgmt IE */
4521 	mlan_ds_misc_custom_ie ds_mgmt_ie;
4522 } MLAN_PACK_END HostCmd_DS_MGMT_IE_LIST_CFG;
4523 
4524 /** HostCmd_DS_TDLS_CONFIG */
4525 typedef MLAN_PACK_START struct _HostCmd_DS_TDLS_CONFIG {
4526     /** Set TDLS configuration */
4527 	mlan_ds_misc_tdls_config tdls_info;
4528 } MLAN_PACK_END HostCmd_DS_TDLS_CONFIG;
4529 
4530 /**Action ID for TDLS delete link*/
4531 #define TDLS_DELETE           0x00
4532 /**Action ID for TDLS create link*/
4533 #define TDLS_CREATE            0x01
4534 /**Action ID for TDLS config link*/
4535 #define TDLS_CONFIG            0x02
4536 /** HostCmd_DS_TDLS_OPER */
4537 typedef MLAN_PACK_START struct _HostCmd_DS_TDLS_OPER {
4538     /** Action */
4539 	t_u16 tdls_action;
4540 	/**reason*/
4541 	t_u16 reason;
4542     /** peer mac */
4543 	t_u8 peer_mac[MLAN_MAC_ADDR_LENGTH];
4544 } MLAN_PACK_END HostCmd_DS_TDLS_OPER;
4545 
4546 /** HostCmd_CMD_MAC_REG_ACCESS */
4547 typedef MLAN_PACK_START struct _HostCmd_DS_MAC_REG_ACCESS {
4548     /** Action */
4549 	t_u16 action;
4550     /** MAC register offset */
4551 	t_u16 offset;
4552     /** MAC register value */
4553 	t_u32 value;
4554 } MLAN_PACK_END HostCmd_DS_MAC_REG_ACCESS;
4555 
4556 /** HostCmd_CMD_BBP_REG_ACCESS */
4557 typedef MLAN_PACK_START struct _HostCmd_DS_BBP_REG_ACCESS {
4558     /** Acion */
4559 	t_u16 action;
4560     /** BBP register offset */
4561 	t_u16 offset;
4562     /** BBP register value */
4563 	t_u8 value;
4564     /** Reserved field */
4565 	t_u8 reserved[3];
4566 } MLAN_PACK_END HostCmd_DS_BBP_REG_ACCESS;
4567 
4568 /**  HostCmd_CMD_RF_REG_ACCESS */
4569 typedef MLAN_PACK_START struct _HostCmd_DS_RF_REG_ACCESS {
4570     /** Action */
4571 	t_u16 action;
4572     /** RF register offset */
4573 	t_u16 offset;
4574     /** RF register value */
4575 	t_u8 value;
4576     /** Reserved field */
4577 	t_u8 reserved[3];
4578 } MLAN_PACK_END HostCmd_DS_RF_REG_ACCESS;
4579 
4580 /** HostCmd_DS_802_11_EEPROM_ACCESS */
4581 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_EEPROM_ACCESS {
4582 	/** Action */
4583 	t_u16 action;
4584 
4585 	/** multiple 4 */
4586 	t_u16 offset;
4587 	/** Number of bytes */
4588 	t_u16 byte_count;
4589 	/** Value */
4590 	t_u8 value;
4591 } MLAN_PACK_END HostCmd_DS_802_11_EEPROM_ACCESS;
4592 
4593 /** HostCmd_DS_MEM_ACCESS */
4594 typedef MLAN_PACK_START struct _HostCmd_DS_MEM_ACCESS {
4595 	/** Action */
4596 	t_u16 action;
4597 	/** Reserved field */
4598 	t_u16 reserved;
4599 	/** Address */
4600 	t_u32 addr;
4601 	/** Value */
4602 	t_u32 value;
4603 } MLAN_PACK_END HostCmd_DS_MEM_ACCESS;
4604 
4605 /** HostCmd_DS_TARGET_ACCESS */
4606 typedef MLAN_PACK_START struct _HostCmd_DS_TARGET_ACCESS {
4607 	/** Action */
4608 	t_u16 action;
4609 	/** CSU Target Device. 1: CSU, 2: PSU */
4610 	t_u16 csu_target;
4611 	/** Target Device Address */
4612 	t_u16 address;
4613 	/** Data */
4614 	t_u8 data;
4615 } MLAN_PACK_END HostCmd_DS_TARGET_ACCESS;
4616 
4617 /** HostCmd_DS_SUBSCRIBE_EVENT */
4618 typedef MLAN_PACK_START struct _HostCmd_DS_SUBSCRIBE_EVENT {
4619     /** Action */
4620 	t_u16 action;
4621     /** Bitmap of subscribed events */
4622 	t_u16 event_bitmap;
4623 } MLAN_PACK_END HostCmd_DS_SUBSCRIBE_EVENT;
4624 
4625 /** HostCmd_DS_OTP_USER_DATA */
4626 typedef MLAN_PACK_START struct _HostCmd_DS_OTP_USER_DATA {
4627 	/** Action */
4628 	t_u16 action;
4629 	/** Reserved field */
4630 	t_u16 reserved;
4631 	/** User data length */
4632 	t_u16 user_data_length;
4633 	/** User data */
4634 	t_u8 user_data[1];
4635 } MLAN_PACK_END HostCmd_DS_OTP_USER_DATA;
4636 
4637 /** HostCmd_CMD_HS_WAKEUP_REASON */
4638 typedef MLAN_PACK_START struct _HostCmd_DS_HS_WAKEUP_REASON {
4639     /** wakeupReason:
4640       * 0: unknown
4641       * 1: Broadcast data matched
4642       * 2: Multicast data matched
4643       * 3: Unicast data matched
4644       * 4: Maskable event matched
4645       * 5. Non-maskable event matched
4646       * 6: Non-maskable condition matched (EAPoL rekey)
4647       * 7: Magic pattern matched
4648       * Others: reserved. (set to 0) */
4649 	t_u16 wakeup_reason;
4650 } MLAN_PACK_END HostCmd_DS_HS_WAKEUP_REASON;
4651 
4652 /** MrvlIEtypes_HsWakeHoldoff_t */
4653 typedef MLAN_PACK_START struct _MrvlIEtypes_HsWakeHoldoff_t {
4654     /** Header */
4655 	MrvlIEtypesHeader_t header;
4656     /** Minimum delay between HsActive and HostWake (in msec) */
4657 	t_u16 min_wake_holdoff;
4658 } MLAN_PACK_END MrvlIEtypes_HsWakeHoldoff_t;
4659 
4660 /** MrvlIEtypes_PsParamsInHs_t */
4661 typedef MLAN_PACK_START struct _MrvlIEtypes_PsParamsInHs_t {
4662     /** Header */
4663 	MrvlIEtypesHeader_t header;
4664     /** Host sleep wake interval(in msec) */
4665 	t_u32 hs_wake_interval;
4666     /** Host sleep inactivity timeout (in msec) */
4667 	t_u32 hs_inactivity_timeout;
4668 } MLAN_PACK_END MrvlIEtypes_PsParamsInHs_t;
4669 
4670 /** MrvlIEtypes_WakeupSourceGPIO_t */
4671 typedef MLAN_PACK_START struct _MrvlIEtypes_WakeupSourceGPIO_t {
4672     /** Header */
4673 	MrvlIEtypesHeader_t header;
4674     /** GPIO for indication of wakeup source */
4675 	t_u8 ind_gpio;
4676     /** Level on ind_gpio for normal wakeup source */
4677 	t_u8 level;
4678 } MLAN_PACK_END MrvlIEtypes_WakeupSourceGPIO_t;
4679 
4680 /** MrvlIEtypes_RobustcoexSourceGPIO_t */
4681 typedef MLAN_PACK_START struct _MrvlIEtypes_RobustcoexSourceGPIO_t {
4682     /** Header */
4683 	MrvlIEtypesHeader_t header;
4684     /** GPIO cfg for external bt request */
4685 	t_u8 enable;
4686     /** GPIO number */
4687 	t_u8 gpio_num;
4688     /** GPIO Polarity */
4689 	t_u8 gpio_polarity;
4690 } MLAN_PACK_END MrvlIEtypes_RobustcoexSourceGPIO_t;
4691 
4692 typedef MLAN_PACK_START struct _MrvlIEtypes_WakeupExtend_t {
4693     /** Header */
4694 	MrvlIEtypesHeader_t header;
4695     /** Events that will be forced ignore **/
4696 	t_u32 event_force_ignore;
4697     /** Events that will use extend gap to inform host*/
4698 	t_u32 event_use_ext_gap;
4699     /** Extend gap*/
4700 	t_u8 ext_gap;
4701     /** GPIO wave level*/
4702 	t_u8 gpio_wave;
4703 } MLAN_PACK_END MrvlIEtypes_WakeupExtend_t;
4704 
4705 #define EVENT_MANAGEMENT_FRAME_WAKEUP 136
4706 typedef MLAN_PACK_START struct _mgmt_frame_filter {
4707     /** action - bitmap
4708      ** On matching rx'd pkt and filter during NON_HOSTSLEEP mode:
4709      **   Action[1]=0  Discard
4710      **   Action[1]=1  Allow
4711      ** Note that default action on non-match is "Allow".
4712      **
4713      ** On matching rx'd pkt and filter during HOSTSLEEP mode:
4714      **   Action[1:0]=00  Discard and Not Wake host
4715      **   Action[1:0]=01  Discard and Wake host
4716      **   Action[1:0]=10  Invalid
4717      ** Note that default action on non-match is "Discard and Not Wake host".
4718      **/
4719 	t_u8 action;
4720     /** Frame type(p2p...)
4721      ** type=0: invalid
4722      ** type=1: p2p
4723      ** type=0xff: management frames(assoc req/rsp, probe req/rsp,...)
4724      ** type=others: reserved
4725      **/
4726 	t_u8 type;
4727     /** Frame mask according to each type
4728      ** When type=1 for p2p, frame-mask have following define:
4729      **    Bit      Frame
4730      **     0       GO Negotiation Request
4731      **     1       GO Negotiation Response
4732      **     2       GO Negotiation Confirmation
4733      **     3       P2P Invitation Request
4734      **     4       P2P Invitation Response
4735      **     5       Device Discoverability Request
4736      **     6       Device Discoverability Response
4737      **     7       Provision Discovery Request
4738      **     8       Provision Discovery Response
4739      **     9       Notice of Absence
4740      **     10      P2P Presence Request
4741      **     11      P2P Presence Response
4742      **     12      GO Discoverability Request
4743      **     13-31   Reserved
4744      **
4745      ** When type=others, frame-mask is reserved.
4746      **/
4747 	t_u32 frame_mask;
4748 } MLAN_PACK_END mgmt_frame_filter;
4749 
4750 #define MAX_MGMT_FRAME_FILTER 2
4751 /** MrvlIEtypes_MgmtFrameFilter_t */
4752 typedef MLAN_PACK_START struct _MrvlIEtypes_MgmtFrameFilter_t {
4753     /** Header */
4754 	MrvlIEtypesHeader_t header;
4755     /** management frame filters */
4756 	mgmt_frame_filter filter[MAX_MGMT_FRAME_FILTER];
4757 } MLAN_PACK_END MrvlIEtypes_MgmtFrameFilter_t;
4758 
4759 /** HostCmd_DS_INACTIVITY_TIMEOUT_EXT */
4760 typedef MLAN_PACK_START struct _HostCmd_DS_INACTIVITY_TIMEOUT_EXT {
4761     /** ACT_GET/ACT_SET */
4762 	t_u16 action;
4763     /** uS, 0 means 1000uS(1ms) */
4764 	t_u16 timeout_unit;
4765     /** Inactivity timeout for unicast data */
4766 	t_u16 unicast_timeout;
4767     /** Inactivity timeout for multicast data */
4768 	t_u16 mcast_timeout;
4769     /** Timeout for additional RX traffic after Null PM1 packet exchange */
4770 	t_u16 ps_entry_timeout;
4771     /** Reserved to further expansion */
4772 	t_u16 reserved;
4773 } MLAN_PACK_END HostCmd_DS_INACTIVITY_TIMEOUT_EXT;
4774 
4775 /** HostCmd_DS_INDEPENDENT_RESET_CFG */
4776 typedef MLAN_PACK_START struct _HostCmd_DS_INDEPENDENT_RESET_CFG {
4777     /** ACT_GET/ACT_SET */
4778 	t_u16 action;
4779     /** out band independent reset */
4780 	t_u8 ir_mode;
4781     /** gpio pin */
4782 	t_u8 gpio_pin;
4783 } MLAN_PACK_END HostCmd_DS_INDEPENDENT_RESET_CFG;
4784 
4785 /** HostCmd_DS_802_11_PS_INACTIVITY_TIMEOUT */
4786 typedef MLAN_PACK_START struct _HostCmd_DS_802_11_PS_INACTIVITY_TIMEOUT {
4787     /** ACT_GET/ACT_SET */
4788 	t_u16 action;
4789     /** ps inactivity timeout value */
4790 	t_u16 inact_tmo;
4791 } MLAN_PACK_END HostCmd_DS_802_11_PS_INACTIVITY_TIMEOUT;
4792 
4793 struct timestamps {
4794 	/** t2 time */
4795 	t_u32 t2;
4796 	/** t2 error */
4797 	t_u8 t2_err;
4798 	/** t3 time */
4799 	t_u32 t3;
4800 	/** t3 error */
4801 	t_u8 t3_err;
4802 	/** ingress time */
4803 	t_u64 ingress_time;
4804 } __attribute__ ((packed));
4805 
4806 /** HostCmd_DS_HOST_CLOCK_CFG */
4807 typedef MLAN_PACK_START struct _HostCmd_DS_HOST_CLOCK_CFG {
4808     /** Action */
4809 	t_u16 action;
4810     /** host time nano secs value */
4811 	t_u64 time;
4812     /** HW time in nano sec value */
4813 	t_u64 hw_time;
4814     /** diff between BBU clock and host clock */
4815 	t_u64 host_bbu_clk_delta;
4816 } MLAN_PACK_END HostCmd_DS_HOST_CLOCK_CFG;
4817 
4818 /** TLV type : STA Mac address */
4819 #define TLV_TYPE_STA_MAC_ADDRESS      (PROPRIETARY_TLV_BASE_ID + 0x20)	/* 0x0120 */
4820 
4821 /** MrvlIEtypes_MacAddr_t */
4822 typedef MLAN_PACK_START struct _MrvlIEtypes_MacAddr_t {
4823     /** Header */
4824 	MrvlIEtypesHeader_t header;
4825     /** mac address */
4826 	t_u8 mac[MLAN_MAC_ADDR_LENGTH];
4827 } MLAN_PACK_END MrvlIEtypes_MacAddr_t;
4828 
4829 /** Assoc Request */
4830 #define SUBTYPE_ASSOC_REQUEST        0
4831 /** ReAssoc Request */
4832 #define SUBTYPE_REASSOC_REQUEST      2
4833 /** Probe Resp */
4834 #define SUBTYPE_PROBE_RESP			5
4835 /** Disassoc Request */
4836 #define SUBTYPE_DISASSOC			10
4837 /** Auth Request */
4838 #define SUBTYPE_AUTH				11
4839 /** Deauth Request */
4840 #define SUBTYPE_DEAUTH              12
4841 /** Action frame */
4842 #define SUBTYPE_ACTION				13
4843 /** beacon */
4844 #define SUBTYPE_BEACON				8
4845 
4846 #ifdef UAP_SUPPORT
4847 /** TLV type : AP Channel band Config */
4848 #define TLV_TYPE_UAP_CHAN_BAND_CONFIG\
4849 		(PROPRIETARY_TLV_BASE_ID + 0x2a)	/* 0x012a */
4850 /** TLV type : AP Mac address */
4851 #define TLV_TYPE_UAP_MAC_ADDRESS\
4852 		(PROPRIETARY_TLV_BASE_ID + 0x2b)	/* 0x012b */
4853 /** TLV type : AP Beacon period */
4854 #define TLV_TYPE_UAP_BEACON_PERIOD\
4855 		(PROPRIETARY_TLV_BASE_ID + 0x2c)	/* 0x012c */
4856 /** TLV type : AP DTIM period */
4857 #define TLV_TYPE_UAP_DTIM_PERIOD\
4858 		(PROPRIETARY_TLV_BASE_ID + 0x2d)	/* 0x012d */
4859 /** TLV type : AP Tx power */
4860 #define TLV_TYPE_UAP_TX_POWER\
4861 		(PROPRIETARY_TLV_BASE_ID + 0x2f)	/* 0x012f */
4862 /** TLV type : AP SSID broadcast control */
4863 #define TLV_TYPE_UAP_BCAST_SSID_CTL\
4864 		(PROPRIETARY_TLV_BASE_ID + 0x30)	/* 0x0130 */
4865 /** TLV type : AP Preamble control */
4866 #define TLV_TYPE_UAP_PREAMBLE_CTL\
4867 		(PROPRIETARY_TLV_BASE_ID + 0x31)	/* 0x0131 */
4868 /** TLV type : AP Antenna control */
4869 #define TLV_TYPE_UAP_ANTENNA_CTL\
4870 		(PROPRIETARY_TLV_BASE_ID + 0x32)	/* 0x0132 */
4871 /** TLV type : AP RTS threshold */
4872 #define TLV_TYPE_UAP_RTS_THRESHOLD\
4873 		(PROPRIETARY_TLV_BASE_ID + 0x33)	/* 0x0133 */
4874 /** TLV type : AP Tx data rate */
4875 #define TLV_TYPE_UAP_TX_DATA_RATE\
4876 		(PROPRIETARY_TLV_BASE_ID + 0x35)	/* 0x0135 */
4877 /** TLV type: AP Packet forwarding control */
4878 #define TLV_TYPE_UAP_PKT_FWD_CTL\
4879 		(PROPRIETARY_TLV_BASE_ID + 0x36)	/* 0x0136 */
4880 /** TLV type: STA information */
4881 #define TLV_TYPE_UAP_STA_INFO\
4882 		(PROPRIETARY_TLV_BASE_ID + 0x37)	/* 0x0137 */
4883 /** TLV type: AP STA MAC address filter */
4884 #define TLV_TYPE_UAP_STA_MAC_ADDR_FILTER\
4885 		(PROPRIETARY_TLV_BASE_ID + 0x38)	/* 0x0138 */
4886 /** TLV type: AP STA ageout timer */
4887 #define TLV_TYPE_UAP_STA_AGEOUT_TIMER\
4888 		(PROPRIETARY_TLV_BASE_ID + 0x39)	/* 0x0139 */
4889 /** TLV type: AP WEP keys */
4890 #define TLV_TYPE_UAP_WEP_KEY\
4891 		(PROPRIETARY_TLV_BASE_ID + 0x3b)	/* 0x013b */
4892 /** TLV type: AP WPA passphrase */
4893 #define TLV_TYPE_UAP_WPA_PASSPHRASE\
4894 		(PROPRIETARY_TLV_BASE_ID + 0x3c)	/* 0x013c */
4895 /** TLV type: AP protocol */
4896 #define TLV_TYPE_UAP_ENCRYPT_PROTOCOL\
4897 		(PROPRIETARY_TLV_BASE_ID + 0x40)	/* 0x0140 */
4898 /** TLV type: AP AKMP */
4899 #define TLV_TYPE_UAP_AKMP\
4900 		(PROPRIETARY_TLV_BASE_ID + 0x41)	/* 0x0141 */
4901 /** TLV type: AP Fragment threshold */
4902 #define TLV_TYPE_UAP_FRAG_THRESHOLD\
4903 		(PROPRIETARY_TLV_BASE_ID + 0x46)	/* 0x0146 */
4904 /** TLV type: AP Group rekey timer */
4905 #define TLV_TYPE_UAP_GRP_REKEY_TIME\
4906 		(PROPRIETARY_TLV_BASE_ID + 0x47)	/* 0x0147 */
4907 /**TLV type : AP Max Station number */
4908 #define TLV_TYPE_UAP_MAX_STA_CNT\
4909 		(PROPRIETARY_TLV_BASE_ID + 0x55)	/* 0x0155 */
4910 /**TLV type : AP Retry limit */
4911 #define TLV_TYPE_UAP_RETRY_LIMIT\
4912 		(PROPRIETARY_TLV_BASE_ID + 0x5d)	/* 0x015d */
4913 /** TLV type : AP MCBC data rate */
4914 #define TLV_TYPE_UAP_MCBC_DATA_RATE\
4915 		(PROPRIETARY_TLV_BASE_ID + 0x62)	/* 0x0162 */
4916 /**TLV type: AP RSN replay protection */
4917 #define TLV_TYPE_UAP_RSN_REPLAY_PROTECT\
4918 		(PROPRIETARY_TLV_BASE_ID + 0x64)	/* 0x0164 */
4919 /**TLV type: AP mgmt IE passthru mask */
4920 #define TLV_TYPE_UAP_MGMT_IE_PASSTHRU_MASK\
4921 		(PROPRIETARY_TLV_BASE_ID + 0x70)	/* 0x0170 */
4922 
4923 /**TLV type: AP pairwise handshake timeout */
4924 #define TLV_TYPE_UAP_EAPOL_PWK_HSK_TIMEOUT\
4925 		(PROPRIETARY_TLV_BASE_ID + 0x75)	/* 0x0175 */
4926 /**TLV type: AP pairwise handshake retries */
4927 #define TLV_TYPE_UAP_EAPOL_PWK_HSK_RETRIES\
4928 		(PROPRIETARY_TLV_BASE_ID + 0x76)	/* 0x0176 */
4929 /**TLV type: AP groupwise handshake timeout */
4930 #define TLV_TYPE_UAP_EAPOL_GWK_HSK_TIMEOUT\
4931 		(PROPRIETARY_TLV_BASE_ID + 0x77)	/* 0x0177 */
4932 /**TLV type: AP groupwise handshake retries */
4933 #define TLV_TYPE_UAP_EAPOL_GWK_HSK_RETRIES\
4934 		(PROPRIETARY_TLV_BASE_ID + 0x78)	/* 0x0178 */
4935 /** TLV type: AP PS STA ageout timer */
4936 #define TLV_TYPE_UAP_PS_STA_AGEOUT_TIMER\
4937 		(PROPRIETARY_TLV_BASE_ID + 0x7b)	/* 0x017b */
4938 /** TLV type : Pairwise Cipher */
4939 #define TLV_TYPE_PWK_CIPHER\
4940 		(PROPRIETARY_TLV_BASE_ID + 0x91)	/* 0x0191 */
4941 /** TLV type : Group Cipher */
4942 #define TLV_TYPE_GWK_CIPHER\
4943 		(PROPRIETARY_TLV_BASE_ID + 0x92)	/* 0x0192 */
4944 /** TLV type : BSS Status */
4945 #define TLV_TYPE_BSS_STATUS\
4946 		(PROPRIETARY_TLV_BASE_ID + 0x93)	/* 0x0193 */
4947 /** TLV type :  AP WMM params */
4948 #define TLV_TYPE_AP_WMM_PARAM\
4949 		(PROPRIETARY_TLV_BASE_ID + 0xd0)	/* 0x01d0 */
4950 
4951 /** TLV type : AP Tx beacon rate */
4952 #define TLV_TYPE_UAP_TX_BEACON_RATE\
4953 		(PROPRIETARY_TLV_BASE_ID + 288)	/* 0x0220 */
4954 
4955 /** MrvlIEtypes_beacon_period_t */
4956 typedef MLAN_PACK_START struct _MrvlIEtypes_beacon_period_t {
4957     /** Header */
4958 	MrvlIEtypesHeader_t header;
4959     /** beacon period */
4960 	t_u16 beacon_period;
4961 } MLAN_PACK_END MrvlIEtypes_beacon_period_t;
4962 
4963 /** MrvlIEtypes_dtim_period_t */
4964 typedef MLAN_PACK_START struct _MrvlIEtypes_dtim_period_t {
4965     /** Header */
4966 	MrvlIEtypesHeader_t header;
4967     /** DTIM period */
4968 	t_u8 dtim_period;
4969 } MLAN_PACK_END MrvlIEtypes_dtim_period_t;
4970 
4971 /** MrvlIEtypes_tx_rate_t */
4972 typedef MLAN_PACK_START struct _MrvlIEtypes_tx_rate_t {
4973     /** Header */
4974 	MrvlIEtypesHeader_t header;
4975     /** tx data rate */
4976 	t_u16 tx_data_rate;
4977 } MLAN_PACK_END MrvlIEtypes_tx_rate_t;
4978 
4979 /** MrvlIEtypes_mcbc_rate_t */
4980 typedef MLAN_PACK_START struct _MrvlIEtypes_mcbc_rate_t {
4981     /** Header */
4982 	MrvlIEtypesHeader_t header;
4983     /** mcbc data rate */
4984 	t_u16 mcbc_data_rate;
4985 } MLAN_PACK_END MrvlIEtypes_mcbc_rate_t;
4986 
4987 /** MrvlIEtypes_tx_power_t */
4988 typedef MLAN_PACK_START struct _MrvlIEtypes_tx_power_t {
4989     /** Header */
4990 	MrvlIEtypesHeader_t header;
4991     /** tx power */
4992 	t_u8 tx_power;
4993 } MLAN_PACK_END MrvlIEtypes_tx_power_t;
4994 
4995 /** MrvlIEtypes_bcast_ssid_t */
4996 typedef MLAN_PACK_START struct _MrvlIEtypes_bcast_ssid_t {
4997     /** Header */
4998 	MrvlIEtypesHeader_t header;
4999     /** bcast ssid control*/
5000 	t_u8 bcast_ssid_ctl;
5001 } MLAN_PACK_END MrvlIEtypes_bcast_ssid_t;
5002 
5003 /** MrvlIEtypes_antenna_mode_t */
5004 typedef MLAN_PACK_START struct _MrvlIEtypes_antenna_mode_t {
5005     /** Header */
5006 	MrvlIEtypesHeader_t header;
5007     /** which antenna */
5008 	t_u8 which_antenna;
5009     /** antenna mode*/
5010 	t_u8 antenna_mode;
5011 } MLAN_PACK_END MrvlIEtypes_antenna_mode_t;
5012 
5013 /** MrvlIEtypes_pkt_forward_t */
5014 typedef MLAN_PACK_START struct _MrvlIEtypes_pkt_forward_t {
5015     /** Header */
5016 	MrvlIEtypesHeader_t header;
5017     /** pkt foward control */
5018 	t_u8 pkt_forward_ctl;
5019 } MLAN_PACK_END MrvlIEtypes_pkt_forward_t;
5020 
5021 /** MrvlIEtypes_max_sta_count_t */
5022 typedef MLAN_PACK_START struct _MrvlIEtypes_max_sta_count_t {
5023     /** Header */
5024 	MrvlIEtypesHeader_t header;
5025     /** max station count */
5026 	t_u16 max_sta_count;
5027 } MLAN_PACK_END MrvlIEtypes_max_sta_count_t;
5028 
5029 /** MrvlIEtypes_sta_ageout_t */
5030 typedef MLAN_PACK_START struct _MrvlIEtypes_sta_ageout_t {
5031     /** Header */
5032 	MrvlIEtypesHeader_t header;
5033     /** station age out timer */
5034 	t_u32 sta_ageout_timer;
5035 } MLAN_PACK_END MrvlIEtypes_sta_ageout_t;
5036 
5037 /** MrvlIEtypes_rts_threshold_t */
5038 typedef MLAN_PACK_START struct _MrvlIEtypes_rts_threshold_t {
5039     /** Header */
5040 	MrvlIEtypesHeader_t header;
5041     /** rts threshold */
5042 	t_u16 rts_threshold;
5043 } MLAN_PACK_END MrvlIEtypes_rts_threshold_t;
5044 
5045 /** MrvlIEtypes_frag_threshold_t */
5046 typedef MLAN_PACK_START struct _MrvlIEtypes_frag_threshold_t {
5047     /** Header */
5048 	MrvlIEtypesHeader_t header;
5049     /** frag threshold */
5050 	t_u16 frag_threshold;
5051 } MLAN_PACK_END MrvlIEtypes_frag_threshold_t;
5052 
5053 /** MrvlIEtypes_retry_limit_t */
5054 typedef MLAN_PACK_START struct _MrvlIEtypes_retry_limit_t {
5055     /** Header */
5056 	MrvlIEtypesHeader_t header;
5057     /** retry limit */
5058 	t_u8 retry_limit;
5059 } MLAN_PACK_END MrvlIEtypes_retry_limit_t;
5060 
5061 /** MrvlIEtypes_eapol_pwk_hsk_timeout_t */
5062 typedef MLAN_PACK_START struct _MrvlIEtypes_eapol_pwk_hsk_timeout_t {
5063     /** Header */
5064 	MrvlIEtypesHeader_t header;
5065     /** pairwise update timeout in milliseconds */
5066 	t_u32 pairwise_update_timeout;
5067 } MLAN_PACK_END MrvlIEtypes_eapol_pwk_hsk_timeout_t;
5068 
5069 /** MrvlIEtypes_eapol_pwk_hsk_retries_t */
5070 typedef MLAN_PACK_START struct _MrvlIEtypes_eapol_pwk_hsk_retries_t {
5071     /** Header */
5072 	MrvlIEtypesHeader_t header;
5073     /** pairwise handshake retries */
5074 	t_u32 pwk_retries;
5075 } MLAN_PACK_END MrvlIEtypes_eapol_pwk_hsk_retries_t;
5076 
5077 /** MrvlIEtypes_eapol_gwk_hsk_timeout_t */
5078 typedef MLAN_PACK_START struct _MrvlIEtypes_eapol_gwk_hsk_timeout_t {
5079     /** Header */
5080 	MrvlIEtypesHeader_t header;
5081     /** groupwise update timeout in milliseconds */
5082 	t_u32 groupwise_update_timeout;
5083 } MLAN_PACK_END MrvlIEtypes_eapol_gwk_hsk_timeout_t;
5084 
5085 /** MrvlIEtypes_eapol_gwk_hsk_retries_t */
5086 typedef MLAN_PACK_START struct _MrvlIEtypes_eapol_gwk_hsk_retries_t {
5087     /** Header */
5088 	MrvlIEtypesHeader_t header;
5089     /** groupwise handshake retries */
5090 	t_u32 gwk_retries;
5091 } MLAN_PACK_END MrvlIEtypes_eapol_gwk_hsk_retries_t;
5092 
5093 /** MrvlIEtypes_mgmt_ie_passthru_t */
5094 typedef MLAN_PACK_START struct _MrvlIEtypes_mgmt_ie_passthru_t {
5095     /** Header */
5096 	MrvlIEtypesHeader_t header;
5097     /** mgmt IE mask value */
5098 	t_u32 mgmt_ie_mask;
5099 } MLAN_PACK_END MrvlIEtypes_mgmt_ie_passthru_t;
5100 
5101 /** MrvlIEtypes_mac_filter_t */
5102 typedef MLAN_PACK_START struct _MrvlIEtypes_mac_filter_t {
5103     /** Header */
5104 	MrvlIEtypesHeader_t header;
5105     /** Filter mode */
5106 	t_u8 filter_mode;
5107     /** Number of STA MACs */
5108 	t_u8 count;
5109     /** STA MAC addresses buffer */
5110 	t_u8 mac_address[1];
5111 } MLAN_PACK_END MrvlIEtypes_mac_filter_t;
5112 
5113 /** MrvlIEtypes_auth_type_t */
5114 typedef MLAN_PACK_START struct _MrvlIEtypes_auth_type_t {
5115     /** Header */
5116 	MrvlIEtypesHeader_t header;
5117     /** Authentication type */
5118 	t_u8 auth_type;
5119 } MLAN_PACK_END MrvlIEtypes_auth_type_t;
5120 
5121 /** MrvlIEtypes_encrypt_protocol_t */
5122 typedef MLAN_PACK_START struct _MrvlIEtypes_encrypt_protocol_t {
5123     /** Header */
5124 	MrvlIEtypesHeader_t header;
5125     /** encryption protocol */
5126 	t_u16 protocol;
5127 } MLAN_PACK_END MrvlIEtypes_encrypt_protocol_t;
5128 
5129 /** MrvlIEtypes_pwk_cipher_t */
5130 typedef MLAN_PACK_START struct _MrvlIEtypes_pwk_cipher_t {
5131     /** Header */
5132 	MrvlIEtypesHeader_t header;
5133     /** protocol */
5134 	t_u16 protocol;
5135     /** pairwise cipher */
5136 	t_u8 pairwise_cipher;
5137     /** reserved */
5138 	t_u8 reserved;
5139 } MLAN_PACK_END MrvlIEtypes_pwk_cipher_t;
5140 
5141 /** MrvlIEtypes_gwk_cipher_t */
5142 typedef MLAN_PACK_START struct _MrvlIEtypes_gwk_cipher_t {
5143     /** Header */
5144 	MrvlIEtypesHeader_t header;
5145     /** group cipher */
5146 	t_u8 group_cipher;
5147     /** reserved */
5148 	t_u8 reserved;
5149 } MLAN_PACK_END MrvlIEtypes_gwk_cipher_t;
5150 
5151 /** MrvlIEtypes_akmp_t */
5152 typedef MLAN_PACK_START struct _MrvlIEtypes_akmp_t {
5153     /** Header */
5154 	MrvlIEtypesHeader_t header;
5155     /** key management */
5156 	t_u16 key_mgmt;
5157     /** key management operation */
5158 	t_u16 key_mgmt_operation;
5159 } MLAN_PACK_END MrvlIEtypes_akmp_t;
5160 
5161 /** MrvlIEtypes_passphrase_t */
5162 typedef MLAN_PACK_START struct _MrvlIEtypes_passphrase_t {
5163     /** Header */
5164 	MrvlIEtypesHeader_t header;
5165     /** passphrase */
5166 	t_u8 passphrase[1];
5167 } MLAN_PACK_END MrvlIEtypes_passphrase_t;
5168 
5169 /** MrvlIEtypes_rsn_replay_prot_t */
5170 typedef MLAN_PACK_START struct _MrvlIEtypes_rsn_replay_prot_t {
5171     /** Header */
5172 	MrvlIEtypesHeader_t header;
5173     /** rsn replay proection */
5174 	t_u8 rsn_replay_prot;
5175 } MLAN_PACK_END MrvlIEtypes_rsn_replay_prot_t;
5176 
5177 /** MrvlIEtypes_group_rekey_time_t */
5178 typedef MLAN_PACK_START struct _MrvlIEtypes_group_rekey_time_t {
5179     /** Header */
5180 	MrvlIEtypesHeader_t header;
5181     /** group key rekey time */
5182 	t_u32 gk_rekey_time;
5183 } MLAN_PACK_END MrvlIEtypes_group_rekey_time_t;
5184 
5185 /** MrvlIEtypes_wep_key_t */
5186 typedef MLAN_PACK_START struct _MrvlIEtypes_wep_key_t {
5187     /** Header */
5188 	MrvlIEtypesHeader_t header;
5189     /** key index */
5190 	t_u8 key_index;
5191     /** is default */
5192 	t_u8 is_default;
5193     /** key data */
5194 	t_u8 key[1];
5195 } MLAN_PACK_END MrvlIEtypes_wep_key_t;
5196 
5197 /** MrvlIEtypes_bss_status_t */
5198 typedef MLAN_PACK_START struct _MrvlIEtypes_bss_status_t {
5199     /** Header */
5200 	MrvlIEtypesHeader_t header;
5201     /** BSS status, READ only */
5202 	t_u16 bss_status;
5203 } MLAN_PACK_END MrvlIEtypes_bss_status_t;
5204 
5205 /** MrvlIEtypes_preamble_t */
5206 typedef MLAN_PACK_START struct _MrvlIEtypes_preamble_t {
5207     /** Header */
5208 	MrvlIEtypesHeader_t header;
5209     /** preamble type, READ only */
5210 	t_u8 preamble_type;
5211 } MLAN_PACK_END MrvlIEtypes_preamble_t;
5212 
5213 /** MrvlIEtypes_wmm_parameter_t */
5214 typedef MLAN_PACK_START struct _MrvlIEtypes_wmm_parameter_t {
5215     /** Header */
5216 	MrvlIEtypesHeader_t header;
5217     /** WMM parameter */
5218 	WmmParameter_t wmm_para;
5219 } MLAN_PACK_END MrvlIEtypes_wmm_parameter_t;
5220 
5221 /** SNMP_MIB_UAP_INDEX */
5222 typedef enum _SNMP_MIB_UAP_INDEX {
5223 	tkip_mic_failures = 0x0b,
5224 	ccmp_decrypt_errors = 0x0c,
5225 	wep_undecryptable_count = 0x0d,
5226 	wep_icv_error_count = 0x0e,
5227 	decrypt_failure_count = 0xf,
5228 	dot11_failed_count = 0x12,
5229 	dot11_retry_count = 0x13,
5230 	dot11_multi_retry_count = 0x14,
5231 	dot11_frame_dup_count = 0x15,
5232 	dot11_rts_success_count = 0x16,
5233 	dot11_rts_failure_count = 0x17,
5234 	dot11_ack_failure_count = 0x18,
5235 	dot11_rx_fragment_count = 0x19,
5236 	dot11_mcast_rx_frame_count = 0x1a,
5237 	dot11_fcs_error_count = 0x1b,
5238 	dot11_tx_frame_count = 0x1c,
5239 	dot11_rsna_tkip_cm_invoked = 0x1d,
5240 	dot11_rsna_4way_hshk_failures = 0x1e,
5241 	dot11_mcast_tx_count = 0x1f,
5242 } SNMP_MIB_UAP_INDEX;
5243 
5244 /** MrvlIEtypes_snmp_oid_t */
5245 typedef MLAN_PACK_START struct _MrvlIEtypes_snmp_oid_t {
5246     /** Header */
5247 	MrvlIEtypesHeader_t header;
5248     /** data */
5249 	t_u32 data;
5250 } MLAN_PACK_END MrvlIEtypes_snmp_oid_t;
5251 
5252 /** HostCmd_SYS_CONFIG */
5253 typedef MLAN_PACK_START struct _HostCmd_DS_SYS_CONFIG {
5254 	/** CMD Action GET/SET*/
5255 	t_u16 action;
5256 	/** Tlv buffer */
5257 	t_u8 tlv_buffer[1];
5258 } MLAN_PACK_END HostCmd_DS_SYS_CONFIG;
5259 
5260 /** HostCmd_SYS_CONFIG */
5261 typedef MLAN_PACK_START struct _HostCmd_DS_SYS_INFO {
5262     /** sys info */
5263 	t_u8 sys_info[64];
5264 } MLAN_PACK_END HostCmd_DS_SYS_INFO;
5265 
5266 /** HostCmd_DS_STA_DEAUTH */
5267 typedef MLAN_PACK_START struct _HostCmd_DS_STA_DEAUTH {
5268     /** mac address */
5269 	t_u8 mac[MLAN_MAC_ADDR_LENGTH];
5270     /** reason code */
5271 	t_u16 reason;
5272 } MLAN_PACK_END HostCmd_DS_STA_DEAUTH;
5273 
5274 /** HostCmd_UAP_OPER_CTRL */
5275 typedef MLAN_PACK_START struct _HostCmd_DS_UAP_OPER_CTRL {
5276     /** CMD Action GET/SET*/
5277 	t_u16 action;
5278     /** control*/
5279 	t_u16 ctrl;
5280     /**channel operation*/
5281 	t_u16 chan_opt;
5282     /**channel band tlv*/
5283 	MrvlIEtypes_channel_band_t channel_band;
5284 } MLAN_PACK_END HostCmd_DS_UAP_OPER_CTRL;
5285 
5286 /** Host Command id: POWER_MGMT  */
5287 #define HOST_CMD_POWER_MGMT_EXT                   0x00ef
5288 /** TLV type: AP Sleep param */
5289 #define TLV_TYPE_AP_SLEEP_PARAM\
5290 		(PROPRIETARY_TLV_BASE_ID + 0x6a)	/* 0x016a */
5291 /** TLV type: AP Inactivity Sleep param */
5292 #define TLV_TYPE_AP_INACT_SLEEP_PARAM\
5293 		(PROPRIETARY_TLV_BASE_ID + 0x6b)	/* 0x016b */
5294 
5295 /** MrvlIEtypes_sleep_param_t */
5296 typedef MLAN_PACK_START struct _MrvlIEtypes_sleep_param_t {
5297     /** Header */
5298 	MrvlIEtypesHeader_t header;
5299     /** control bitmap */
5300 	t_u32 ctrl_bitmap;
5301     /** min_sleep */
5302 	t_u32 min_sleep;
5303     /** max_sleep */
5304 	t_u32 max_sleep;
5305 } MLAN_PACK_END MrvlIEtypes_sleep_param_t;
5306 
5307 /** MrvlIEtypes_inact_sleep_param_t */
5308 typedef MLAN_PACK_START struct _MrvlIEtypes_inact_sleep_param_t {
5309     /** Header */
5310 	MrvlIEtypesHeader_t header;
5311     /** inactivity timeout */
5312 	t_u32 inactivity_to;
5313 
5314     /** min_awake */
5315 	t_u32 min_awake;
5316     /** max_awake */
5317 	t_u32 max_awake;
5318 } MLAN_PACK_END MrvlIEtypes_inact_sleep_param_t;
5319 
5320 /** HostCmd_DS_POWER_MGMT */
5321 typedef MLAN_PACK_START struct _HostCmd_DS_POWER_MGMT_EXT {
5322     /** CMD Action Get/Set*/
5323 	t_u16 action;
5324     /** power mode */
5325 	t_u16 power_mode;
5326 } MLAN_PACK_END HostCmd_DS_POWER_MGMT_EXT;
5327 
5328 /** MrvlIEtypes_ps_sta_ageout_t */
5329 typedef MLAN_PACK_START struct _MrvlIEtypes_ps_sta_ageout_t {
5330     /** Header */
5331 	MrvlIEtypesHeader_t header;
5332     /** station age out timer */
5333 	t_u32 ps_sta_ageout_timer;
5334 } MLAN_PACK_END MrvlIEtypes_ps_sta_ageout_t;
5335 
5336 /** MrvlIEtypes_sta_info_t */
5337 typedef MLAN_PACK_START struct _MrvlIEtypes_sta_info_t {
5338     /** Header */
5339 	MrvlIEtypesHeader_t header;
5340     /** STA MAC address */
5341 	t_u8 mac_address[MLAN_MAC_ADDR_LENGTH];
5342     /** Power mfg status */
5343 	t_u8 power_mfg_status;
5344     /** RSSI */
5345 	t_s8 rssi;
5346 } MLAN_PACK_END MrvlIEtypes_sta_info_t;
5347 
5348 /** HostCmd_DS_STA_LIST */
5349 typedef MLAN_PACK_START struct _HostCmd_DS_STA_LIST {
5350     /** Number of STAs */
5351 	t_u16 sta_count;
5352 	/* MrvlIEtypes_sta_info_t sta_info[0]; */
5353 } MLAN_PACK_END HostCmd_DS_STA_LIST;
5354 
5355 /** TLV ID : WAPI Information */
5356 #define TLV_TYPE_AP_WAPI_INFO         (PROPRIETARY_TLV_BASE_ID + 0x67)	/* 0x0167 */
5357 
5358 /** MrvlIEtypes_sta_info_t */
5359 typedef MLAN_PACK_START struct _MrvlIEtypes_wapi_info_t {
5360     /** Header */
5361 	MrvlIEtypesHeader_t header;
5362     /** Multicast PN */
5363 	t_u8 multicast_PN[16];
5364 } MLAN_PACK_END MrvlIEtypes_wapi_info_t;
5365 #endif /* UAP_SUPPORT */
5366 
5367 /** TLV buffer : 2040 coex config */
5368 typedef MLAN_PACK_START struct _MrvlIEtypes_2040_coex_enable_t {
5369     /** Header */
5370 	MrvlIEtypesHeader_t header;
5371     /** Enable */
5372 	t_u8 enable_2040coex;
5373 } MLAN_PACK_END MrvlIEtypes_2040_coex_enable_t;
5374 
5375 /** HostCmd_DS_REMAIN_ON_CHANNEL */
5376 typedef MLAN_PACK_START struct _HostCmd_DS_REMAIN_ON_CHANNEL {
5377     /** Action 0-GET, 1-SET, 4 CLEAR*/
5378 	t_u16 action;
5379     /** Not used set to zero */
5380 	t_u8 status;
5381     /** Not used set to zero */
5382 	t_u8 reserved;
5383     /** Band cfg */
5384 	Band_Config_t bandcfg;
5385     /** channel */
5386 	t_u8 channel;
5387     /** remain time: Unit ms*/
5388 	t_u32 remain_period;
5389 } MLAN_PACK_END HostCmd_DS_REMAIN_ON_CHANNEL;
5390 
5391 /**BT coexit scan time setting*/
5392 typedef MLAN_PACK_START struct _MrvlIEtypes_BtCoexScanTime_t {
5393     /** Header */
5394 	MrvlIEtypesHeader_t header;
5395     /**coex scan state  0: disable 1: enable*/
5396 	t_u8 coex_scan;
5397     /**reserved*/
5398 	t_u8 reserved;
5399     /**min scan time*/
5400 	t_u16 min_scan_time;
5401     /**max scan time*/
5402 	t_u16 max_scan_time;
5403 } MLAN_PACK_END MrvlIEtypes_BtCoexScanTime_t;
5404 
5405 /**BT coexit aggr win size */
5406 typedef MLAN_PACK_START struct _MrvlIETypes_BtCoexAggrWinSize_t {
5407     /** Header */
5408 	MrvlIEtypesHeader_t header;
5409     /**winsize  0: restore default winsize, 1: use below winsize */
5410 	t_u8 coex_win_size;
5411     /**tx win size*/
5412 	t_u8 tx_win_size;
5413     /**rx win size*/
5414 	t_u8 rx_win_size;
5415     /**reserved*/
5416 	t_u8 reserved;
5417 } MLAN_PACK_END MrvlIETypes_BtCoexAggrWinSize_t;
5418 
5419 /** MrvlIEtypes_eapol_pkt_t */
5420 typedef MLAN_PACK_START struct _MrvlIEtypes_eapol_pkt_t {
5421     /** Header */
5422 	MrvlIEtypesHeader_t header;
5423     /** eapol pkt buf */
5424 	t_u8 pkt_buf[0];
5425 } MLAN_PACK_END MrvlIEtypes_eapol_pkt_t;
5426 
5427 /** HostCmd_DS_EAPOL_PKT */
5428 typedef MLAN_PACK_START struct _HostCmd_DS_EAPOL_PKT {
5429 	/** Action */
5430 	t_u16 action;
5431 	/** TLV buffer */
5432 	MrvlIEtypes_eapol_pkt_t tlv_eapol;
5433 } MLAN_PACK_END HostCmd_DS_EAPOL_PKT;
5434 
5435 #ifdef RX_PACKET_COALESCE
5436 typedef MLAN_PACK_START struct _HostCmd_DS_RX_PKT_COAL_CFG {
5437 	/** Action */
5438 	t_u16 action;
5439 	/** Packet threshold */
5440 	t_u32 packet_threshold;
5441 	/** Timeout */
5442 	t_u16 delay;
5443 } MLAN_PACK_END HostCmd_DS_RX_PKT_COAL_CFG;
5444 #endif
5445 
5446 typedef MLAN_PACK_START struct _MrvlTypes_DrcsTimeSlice_t {
5447 	/** Header */
5448 	MrvlIEtypesHeader_t header;
5449 	/** Channel Index*/
5450 	t_u16 chan_idx;
5451 	/** Channel time (in TU) for chan_idx*/
5452 	t_u8 chantime;
5453 	/** Channel swith time (in TU) for chan_idx*/
5454 	t_u8 switchtime;
5455 	/** Undoze time (in TU) for chan_idx*/
5456 	t_u8 undozetime;
5457 	/** Rx traffic control scheme when channel switch*/
5458 	/** only valid for GC/STA interface*/
5459 	t_u8 mode;
5460 } MLAN_PACK_END MrvlTypes_DrcsTimeSlice_t;
5461 typedef MLAN_PACK_START struct _HostCmd_DS_MULTI_CHAN_CFG {
5462 	/** Action */
5463 	t_u16 action;
5464 	/** Channel time */
5465 	t_u32 channel_time;
5466 	/** Buffer weight */
5467 	t_u8 buffer_weight;
5468 	/** TLV buffer */
5469 	t_u8 tlv_buf[0];
5470 	/* t_u8 *tlv_buf; */
5471 } MLAN_PACK_END HostCmd_DS_MULTI_CHAN_CFG;
5472 
5473 typedef MLAN_PACK_START struct _HostCmd_DS_DRCS_CFG {
5474 	/** Action */
5475 	t_u16 action;
5476 	/** TLV buffer */
5477 	MrvlTypes_DrcsTimeSlice_t time_slicing;
5478 	/** TLV buffer */
5479 	MrvlTypes_DrcsTimeSlice_t drcs_buf[0];
5480 	/* t_u8 *tlv_buf; */
5481 } MLAN_PACK_END HostCmd_DS_DRCS_CFG;
5482 
5483 typedef MLAN_PACK_START struct _HostCmd_DS_MULTI_CHAN_POLICY {
5484 	/** Action */
5485 	t_u16 action;
5486 	/** Multi-channel Policy */
5487 	t_u16 policy;
5488 } MLAN_PACK_END HostCmd_DS_MULTI_CHAN_POLICY;
5489 
5490 /** Channel band info */
5491 typedef MLAN_PACK_START struct _ChannelBandInfo {
5492 	/* band config */
5493 	Band_Config_t bandcfg;
5494     /** channel num for specificed band */
5495 	t_u8 chan_num;
5496 } MLAN_PACK_END ChannelBandInfo;
5497 
5498 /** MrvlIETypes_mutli_chan_group_info_t */
5499 typedef MLAN_PACK_START struct _MrvlIETypes_mutli_chan_group_info_t {
5500     /** Header */
5501 	MrvlIEtypesHeader_t header;
5502     /** channel group id */
5503 	t_u8 chan_group_id;
5504     /** buffer weight for this channel group */
5505 	t_u8 chan_buff_weight;
5506     /** channel number and band information */
5507 	ChannelBandInfo chan_band_info;
5508     /** Max channel time (us) */
5509 	t_u32 channel_time;
5510     /** Reserved */
5511 	t_u32 reserved;
5512 	MLAN_PACK_START union {
5513 		t_u8 sdio_func_num;
5514 		t_u8 usb_epnum;
5515 	} MLAN_PACK_END hid_num;
5516     /** interface number in this group */
5517 	t_u8 num_intf;
5518     /** bss_type list */
5519 	t_u8 bss_type_numlist[0];
5520 } MLAN_PACK_END MrvlIEtypes_multi_chan_group_info_t;
5521 
5522 /** MrvlIEtypes_multi_chan_info_t */
5523 typedef MLAN_PACK_START struct _MrvlIETypes_mutli_chan_info_t {
5524     /** Header */
5525 	MrvlIEtypesHeader_t header;
5526     /** multi channel operation status */
5527 	t_u16 status;
5528     /** Tlv buffer */
5529 	t_u8 tlv_buffer[0];
5530 } MLAN_PACK_END MrvlIEtypes_multi_chan_info_t;
5531 
5532 /** TLV buffer : firmware roam keys */
5533 typedef MLAN_PACK_START struct _MrvlIEtypes_keyParams_t {
5534     /** Header */
5535 	MrvlIEtypesHeader_t header;
5536     /** Tlv buffer */
5537 	t_u8 tlv_buffer[0];
5538 } MLAN_PACK_END MrvlIEtypes_keyParams_t;
5539 /** TLV buffer : firmware roam enable */
5540 typedef MLAN_PACK_START struct _MrvlIEtypes_fw_roam_enable_t {
5541     /** Header */
5542 	MrvlIEtypesHeader_t header;
5543     /** Enable */
5544 	t_u8 roam_enable;
5545     /** User set passphrase*/
5546 	t_u8 userset_passphrase;
5547 } MLAN_PACK_END MrvlIEtypes_fw_roam_enable_t;
5548 /** HostCmd_DS_ROAM_OFFLOAD */
5549 typedef MLAN_PACK_START struct _HostCmd_DS_ROAM_OFFLOAD {
5550 	/** Action */
5551 	t_u16 action;
5552 	/** tlv */
5553 	t_u8 tlv[0];
5554 } MLAN_PACK_END HostCmd_DS_ROAM_OFFLOAD;
5555 /** HostCmd_DS_ROAM_OFFLOAD_APLIST */
5556 typedef MLAN_PACK_START struct _MrvlIEtypes_roam_aplist_t {
5557     /** Header */
5558 	MrvlIEtypesHeader_t header;
5559     /** AP mac addrs**/
5560 	t_u8 ap_mac[][MLAN_MAC_ADDR_LENGTH];
5561 } MLAN_PACK_END MrvlIEtypes_roam_aplist_t;
5562 /** MrvlIEtypes_fw_roam_trigger_condition_t */
5563 typedef MLAN_PACK_START struct _MrvlIEtypes_fw_roam_trigger_condition_t {
5564     /** Header */
5565 	MrvlIEtypesHeader_t header;
5566     /** Roam offload trigger condition**/
5567 	t_u16 trigger_condition;
5568 } MLAN_PACK_END MrvlIEtypes_fw_roam_trigger_condition_t;
5569 /** MrvlIEtypes_fw_roam_retry_count_t */
5570 typedef MLAN_PACK_START struct _MrvlIEtypes_fw_roam_retry_count_t {
5571     /** Header */
5572 	MrvlIEtypesHeader_t header;
5573     /** Roam offload retry count**/
5574 	t_u16 retry_count;
5575 } MLAN_PACK_END MrvlIEtypes_fw_roam_retry_count_t;
5576 /** MrvlIEtypes_fw_roam_bgscan_setting_t */
5577 typedef MLAN_PACK_START struct _MrvlIEtypes_fw_roam_bgscan_setting_t {
5578     /** Header */
5579 	MrvlIEtypesHeader_t header;
5580     /** Bss type of BG scan during fw roam**/
5581 	t_u8 bss_type;
5582     /** Number of channels scanned during each scan**/
5583 	t_u8 channels_perscan;
5584     /** Interval between consecutive scans**/
5585 	t_u32 scan_interval;
5586     /** Condition to trigger report to host**/
5587 	t_u32 report_condition;
5588 } MLAN_PACK_END MrvlIEtypes_fw_roam_bgscan_setting_t;
5589 /** MrvlIEtypes_para_rssi_t */
5590 typedef MLAN_PACK_START struct _MrvlIEtypes_para_rssi_t {
5591     /** Header */
5592 	MrvlIEtypesHeader_t header;
5593     /** Max value of RSSI threshold**/
5594 	t_u8 max_rssi;
5595     /** Min value of RSSI threshold**/
5596 	t_u8 min_rssi;
5597     /** Adjusting step value of RSSI threshold**/
5598 	t_u8 step_rssi;
5599 } MLAN_PACK_END MrvlIEtypes_para_rssi_t;
5600 /** MrvlIEtypes_band_rssi_t */
5601 typedef MLAN_PACK_START struct _MrvlIEtypes_band_rssi_t {
5602     /** Header */
5603 	MrvlIEtypesHeader_t header;
5604     /** BAND and RSSI gap*/
5605 	mlan_ds_misc_band_rssi band_rssi;
5606 } MLAN_PACK_END MrvlIEtypes_band_rssi_t;
5607 /** MrvlIEtypes_ees_param_set_t */
5608 typedef MLAN_PACK_START struct _MrvlIEtypes_ees_param_set_t {
5609     /** Header */
5610 	MrvlIEtypesHeader_t header;
5611     /** ees params*/
5612 	mlan_ds_misc_ees_cfg ees_cfg;
5613 } MLAN_PACK_END MrvlIEtypes_ees_param_set_t;
5614 /** MrvlIEtypes_roam_blacklist_t */
5615 typedef MLAN_PACK_START struct _MrvlIEtypes_roam_blacklist_t {
5616     /** Header */
5617 	MrvlIEtypesHeader_t header;
5618 	/* Black list(BSSID list) */
5619 	mlan_ds_misc_roam_offload_aplist blacklist;
5620 } MLAN_PACK_END MrvlIEtypes_roam_blacklist_t;
5621 /** MrvlIEtypes_beacon_miss_threshold_t */
5622 typedef MLAN_PACK_START struct _MrvlIEtypes_beacon_miss_threshold_t {
5623     /** Header */
5624 	MrvlIEtypesHeader_t header;
5625 	/* Beacon miss threshold */
5626 	t_u8 bcn_miss_threshold;
5627 } MLAN_PACK_END MrvlIEtypes_beacon_miss_threshold_t;
5628 /** MrvlIEtypes_pre_beacon_miss_threshold_t */
5629 typedef MLAN_PACK_START struct _MrvlIEtypes_pre_beacon_miss_threshold_t {
5630     /** Header */
5631 	MrvlIEtypesHeader_t header;
5632 	/* Pre-Beacon miss threshold */
5633 	t_u8 pre_bcn_miss_threshold;
5634 } MLAN_PACK_END MrvlIEtypes_pre_beacon_miss_threshold_t;
5635 
5636 /** HostCmd_CMD_GET_TSF */
5637 typedef MLAN_PACK_START struct _HostCmd_DS_TSF {
5638     /** tsf value*/
5639 	t_u64 tsf;
5640 } MLAN_PACK_END HostCmd_DS_TSF;
5641 /* WLAN_GET_TSF*/
5642 
5643 typedef struct _HostCmd_DS_DFS_REPEATER_MODE {
5644 	/** Set or Get */
5645 	t_u16 action;
5646 	/** 1 on or 0 off */
5647 	t_u16 mode;
5648 } HostCmd_DS_DFS_REPEATER_MODE;
5649 
5650 /** HostCmd_DS_BOOT_SLEEP */
5651 typedef MLAN_PACK_START struct _HostCmd_DS_BOOT_SLEEP {
5652     /** Set or Get */
5653 	t_u16 action;
5654     /** 1 on or 0 off */
5655 	t_u16 enable;
5656 } MLAN_PACK_END HostCmd_DS_BOOT_SLEEP;
5657 
5658 /**
5659  * @brief 802.11h Local Power Constraint Marvell extended TLV
5660  */
5661 typedef MLAN_PACK_START struct {
5662 	MrvlIEtypesHeader_t header;
5663 				/**< Marvell TLV header: ID/Len */
5664 	t_u8 chan;		/**< Channel local constraint applies to */
5665 
5666     /** Power constraint included in beacons
5667      *  and used by fw to offset 11d info
5668      */
5669 	t_u8 constraint;
5670 
5671 } MLAN_PACK_END MrvlIEtypes_LocalPowerConstraint_t;
5672 
5673 /*
5674  *
5675  * Data structures for driver/firmware command processing
5676  *
5677  */
5678 
5679 /**  TPC Info structure sent in CMD_802_11_TPC_INFO command to firmware */
5680 typedef MLAN_PACK_START struct {
5681     /**< Local constraint */
5682 	MrvlIEtypes_LocalPowerConstraint_t local_constraint;
5683     /**< Power Capability */
5684 	MrvlIEtypes_PowerCapability_t power_cap;
5685 
5686 } MLAN_PACK_END HostCmd_DS_802_11_TPC_INFO;
5687 
5688 /**  TPC Request structure sent in CMD_802_11_TPC_ADAPT_REQ
5689  *  command to firmware
5690  */
5691 typedef MLAN_PACK_START struct {
5692 	t_u8 dest_mac[MLAN_MAC_ADDR_LENGTH];   /**< Destination STA address  */
5693 	t_u16 timeout;			       /**< Response timeout in ms */
5694 	t_u8 rate_index;	       /**< IEEE Rate index to send request */
5695 
5696 } MLAN_PACK_END HostCmd_TpcRequest;
5697 
5698 /**  TPC Response structure received from the
5699  *   CMD_802_11_TPC_ADAPT_REQ command
5700  */
5701 typedef MLAN_PACK_START struct {
5702 	t_u8 tpc_ret_code;
5703 		       /**< Firmware command result status code */
5704 	t_s8 tx_power; /**< Reported TX Power from the TPC Report element */
5705 	t_s8 link_margin;
5706 		       /**< Reported link margin from the TPC Report element */
5707 	t_s8 rssi;     /**< RSSI of the received TPC Report frame */
5708 
5709 } MLAN_PACK_END HostCmd_TpcResponse;
5710 
5711 /**  CMD_802_11_TPC_ADAPT_REQ substruct.
5712  *   Union of the TPC request and response
5713  */
5714 typedef MLAN_PACK_START union {
5715 	HostCmd_TpcRequest req;
5716 			      /**< Request struct sent to firmware */
5717 	HostCmd_TpcResponse resp;
5718 			      /**< Response struct received from firmware */
5719 
5720 } MLAN_PACK_END HostCmd_DS_802_11_TPC_ADAPT_REQ;
5721 
5722 /**  CMD_802_11_CHAN_SW_ANN firmware command substructure */
5723 typedef MLAN_PACK_START struct {
5724 	t_u8 switch_mode;
5725 			/**< Set to 1 for a quiet switch request, no STA tx */
5726 	t_u8 new_chan;	/**< Requested new channel */
5727 	t_u8 switch_count;
5728 			/**< Number of TBTTs until the switch is to occur */
5729 } MLAN_PACK_END HostCmd_DS_802_11_CHAN_SW_ANN;
5730 
5731 /**
5732  * @brief Enumeration of measurement types, including max supported
5733  *        enum for 11h/11k
5734  */
5735 typedef MLAN_PACK_START enum _MeasType_t {
5736 	WLAN_MEAS_BASIC = 0,	      /**< 11h: Basic */
5737 	WLAN_MEAS_NUM_TYPES,	      /**< Number of enumerated measurements */
5738 	WLAN_MEAS_11H_MAX_TYPE = WLAN_MEAS_BASIC,   /**< Max 11h measurement */
5739 
5740 } MLAN_PACK_END MeasType_t;
5741 
5742 /**
5743  * @brief Mode octet of the measurement request element (7.3.2.21)
5744  */
5745 typedef MLAN_PACK_START struct {
5746 #ifdef BIG_ENDIAN_SUPPORT
5747     /**< Reserved */
5748 	t_u8 rsvd5_7:3;
5749     /**< 11k: duration spec. for meas. is mandatory */
5750 	t_u8 duration_mandatory:1;
5751     /**< 11h: en/disable report rcpt. of spec. type */
5752 	t_u8 report:1;
5753     /**< 11h: en/disable requests of specified type */
5754 	t_u8 request:1;
5755     /**< 11h: enable report/request bits */
5756 	t_u8 enable:1;
5757     /**< 11k: series or parallel with previous meas */
5758 	t_u8 parallel:1;
5759 #else
5760     /**< 11k: series or parallel with previous meas */
5761 	t_u8 parallel:1;
5762     /**< 11h: enable report/request bits */
5763 	t_u8 enable:1;
5764     /**< 11h: en/disable requests of specified type */
5765 	t_u8 request:1;
5766     /**< 11h: en/disable report rcpt. of spec. type */
5767 	t_u8 report:1;
5768     /**< 11k: duration spec. for meas. is mandatory */
5769 	t_u8 duration_mandatory:1;
5770     /**< Reserved */
5771 	t_u8 rsvd5_7:3;
5772 #endif				/* BIG_ENDIAN_SUPPORT */
5773 
5774 } MLAN_PACK_END MeasReqMode_t;
5775 
5776 /**
5777  * @brief Common measurement request structure (7.3.2.21.1 to 7.3.2.21.3)
5778  */
5779 typedef MLAN_PACK_START struct {
5780 	t_u8 channel;  /**< Channel to measure */
5781 	t_u64 start_time;
5782 		       /**< TSF Start time of measurement (0 for immediate) */
5783 	t_u16 duration;/**< TU duration of the measurement */
5784 
5785 } MLAN_PACK_END MeasReqCommonFormat_t;
5786 
5787 /**
5788  * @brief Basic measurement request structure (7.3.2.21.1)
5789  */
5790 typedef MeasReqCommonFormat_t MeasReqBasic_t;
5791 
5792 /**
5793  * @brief CCA measurement request structure (7.3.2.21.2)
5794  */
5795 typedef MeasReqCommonFormat_t MeasReqCCA_t;
5796 
5797 /**
5798  * @brief RPI measurement request structure (7.3.2.21.3)
5799  */
5800 typedef MeasReqCommonFormat_t MeasReqRPI_t;
5801 
5802 /**
5803  * @brief Union of the availble measurement request types.  Passed in the
5804  *        driver/firmware interface.
5805  */
5806 typedef union {
5807 	MeasReqBasic_t basic;
5808 			  /**< Basic measurement request */
5809 	MeasReqCCA_t cca; /**< CCA measurement request */
5810 	MeasReqRPI_t rpi; /**< RPI measurement request */
5811 
5812 } MeasRequest_t;
5813 
5814 /**
5815  * @brief Mode octet of the measurement report element (7.3.2.22)
5816  */
5817 typedef MLAN_PACK_START struct {
5818 #ifdef BIG_ENDIAN_SUPPORT
5819 	t_u8 rsvd3_7:5;	   /**< Reserved */
5820 	t_u8 refused:1;	   /**< Measurement refused */
5821 	t_u8 incapable:1;  /**< Incapable of performing measurement */
5822 	t_u8 late:1;	   /**< Start TSF time missed for measurement */
5823 #else
5824 	t_u8 late:1;	   /**< Start TSF time missed for measurement */
5825 	t_u8 incapable:1;  /**< Incapable of performing measurement */
5826 	t_u8 refused:1;	   /**< Measurement refused */
5827 	t_u8 rsvd3_7:5;	   /**< Reserved */
5828 #endif				/* BIG_ENDIAN_SUPPORT */
5829 
5830 } MLAN_PACK_END MeasRptMode_t;
5831 
5832 /**
5833  * @brief Basic measurement report (7.3.2.22.1)
5834  */
5835 typedef MLAN_PACK_START struct {
5836 	t_u8 channel;	       /**< Channel to measured */
5837 	t_u64 start_time;      /**< Start time (TSF) of measurement */
5838 	t_u16 duration;	       /**< Duration of measurement in TUs */
5839 	MeasRptBasicMap_t map; /**< Basic measurement report */
5840 
5841 } MLAN_PACK_END MeasRptBasic_t;
5842 
5843 /**
5844  * @brief CCA measurement report (7.3.2.22.2)
5845  */
5846 typedef MLAN_PACK_START struct {
5847 	t_u8 channel;	    /**< Channel to measured */
5848 	t_u64 start_time;   /**< Start time (TSF) of measurement */
5849 	t_u16 duration;	    /**< Duration of measurement in TUs  */
5850 	t_u8 busy_fraction; /**< Fractional duration CCA indicated chan busy */
5851 
5852 } MLAN_PACK_END MeasRptCCA_t;
5853 
5854 /**
5855  * @brief RPI measurement report (7.3.2.22.3)
5856  */
5857 typedef MLAN_PACK_START struct {
5858 	t_u8 channel;	       /**< Channel to measured  */
5859 	t_u64 start_time;      /**< Start time (TSF) of measurement */
5860 	t_u16 duration;	       /**< Duration of measurement in TUs  */
5861 	t_u8 density[8];       /**< RPI Density histogram report */
5862 
5863 } MLAN_PACK_END MeasRptRPI_t;
5864 
5865 /**
5866  * @brief Union of the availble measurement report types.  Passed in the
5867  *        driver/firmware interface.
5868  */
5869 typedef union {
5870 	MeasRptBasic_t basic;/**< Basic measurement report */
5871 	MeasRptCCA_t cca;    /**< CCA measurement report */
5872 	MeasRptRPI_t rpi;    /**< RPI measurement report */
5873 
5874 } MeasReport_t;
5875 
5876 /**
5877  * @brief Structure passed to firmware to perform a measurement
5878  */
5879 typedef MLAN_PACK_START struct {
5880 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];	  /**< Reporting STA address */
5881 	t_u8 dialog_token;		 /**< Measurement dialog toke */
5882 	MeasReqMode_t req_mode;		 /**< Report mode  */
5883 	MeasType_t meas_type;		 /**< Measurement type */
5884 	MeasRequest_t req;		 /**< Measurement request data */
5885 
5886 } MLAN_PACK_END HostCmd_DS_MEASUREMENT_REQUEST;
5887 
5888 /**
5889  * @brief Structure passed back from firmware with a measurement report,
5890  *        also can be to send a measurement report to another STA
5891  */
5892 typedef MLAN_PACK_START struct {
5893 	t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH];	  /**< Reporting STA address */
5894 	t_u8 dialog_token;		 /**< Measurement dialog token */
5895 	MeasRptMode_t rpt_mode;		 /**< Report mode */
5896 	MeasType_t meas_type;		 /**< Measurement type */
5897 	MeasReport_t rpt;		 /**< Measurement report data */
5898 
5899 } MLAN_PACK_END HostCmd_DS_MEASUREMENT_REPORT;
5900 
5901 typedef MLAN_PACK_START struct {
5902 	t_u16 startFreq;
5903 	Band_Config_t bandcfg;
5904 	t_u8 chanNum;
5905 
5906 } MLAN_PACK_END MrvlChannelDesc_t;
5907 
5908 typedef MLAN_PACK_START struct {
5909 	MrvlIEtypesHeader_t Header;  /**< Header */
5910 
5911 	MeasRptBasicMap_t map;	     /**< IEEE 802.11h basic meas report */
5912 } MLAN_PACK_END MrvlIEtypes_ChanRpt11hBasic_t;
5913 
5914 typedef MLAN_PACK_START struct {
5915 	MrvlChannelDesc_t chan_desc;
5916 				  /**< Channel band, number */
5917 	t_u32 millisec_dwell_time;
5918 			       /**< Channel dwell time in milliseconds */
5919 } MLAN_PACK_END HostCmd_DS_CHAN_RPT_REQ;
5920 
5921 typedef MLAN_PACK_START struct {
5922 	t_u32 cmd_result; /**< Rpt request command result (0 == SUCCESS) */
5923 	t_u64 start_tsf;  /**< TSF Measurement started */
5924 	t_u32 duration;	  /**< Duration of measurement in microsecs */
5925 	t_u8 tlv_buffer[1];
5926 			  /**< TLV Buffer */
5927 } MLAN_PACK_END HostCmd_DS_CHAN_RPT_RSP;
5928 
5929 /** statistics threshold */
5930 typedef MLAN_PACK_START struct {
5931     /** Header */
5932 	MrvlIEtypesHeader_t header;
5933     /** value */
5934 	t_u8 value;
5935     /** reporting frequency */
5936 	t_u8 frequency;
5937 } MLAN_PACK_END MrvlIEtypes_BeaconHighRssiThreshold_t,
5938 	MrvlIEtypes_BeaconLowRssiThreshold_t,
5939 	MrvlIEtypes_BeaconHighSnrThreshold_t,
5940 	MrvlIEtypes_BeaconLowSnrThreshold_t,
5941 	MrvlIEtypes_FailureCount_t,
5942 	MrvlIEtypes_DataLowRssiThreshold_t,
5943 	MrvlIEtypes_DataHighRssiThreshold_t,
5944 	MrvlIEtypes_DataLowSnrThreshold_t,
5945 	MrvlIEtypes_DataHighSnrThreshold_t,
5946 	MrvlIETypes_PreBeaconMissed_t, MrvlIEtypes_BeaconsMissed_t;
5947 
5948 /** statistics threshold for LinkQuality */
5949 typedef MLAN_PACK_START struct {
5950     /** Header */
5951 	MrvlIEtypesHeader_t header;
5952     /** Link SNR threshold (dB) */
5953 	t_u16 link_snr;
5954     /** Link SNR frequency */
5955 	t_u16 link_snr_freq;
5956 	/* Second minimum rate value as per the rate table below */
5957 	t_u16 link_rate;
5958 	/* Second minimum rate frequency */
5959 	t_u16 link_rate_freq;
5960 	/* Tx latency value (us) */
5961 	t_u16 link_tx_latency;
5962 	/* Tx latency frequency */
5963 	t_u16 link_tx_lantency_freq;
5964 } MLAN_PACK_END MrvlIEtypes_LinkQualityThreshold_t;
5965 
5966 /** HostCmd_DS_SENSOR_TEMP structure */
5967 typedef MLAN_PACK_START struct _HostCmd_DS_SENSOR_TEMP {
5968 	/** Temperature */
5969 	t_u32 temperature;
5970 } MLAN_PACK_END HostCmd_DS_SENSOR_TEMP;
5971 
5972 #ifdef STA_SUPPORT
5973 /** HostCmd_DS_STA_CONFIGURE structure */
5974 typedef MLAN_PACK_START struct _HostCmd_DS_STA_CONFIGURE {
5975     /** Action Set or get */
5976 	t_u16 action;
5977     /** Tlv buffer */
5978 	t_u8 tlv_buffer[0];
5979     /**MrvlIEtypes_channel_band_t band_channel; */
5980 } MLAN_PACK_END HostCmd_DS_STA_CONFIGURE;
5981 #endif
5982 
5983 /** TLV to indicate firmware only keep probe response while scan */
5984 #define TLV_TYPE_ONLYPROBERESP (PROPRIETARY_TLV_BASE_ID + 0xE9)	/* 0x01E9 */
5985 typedef MLAN_PACK_START struct _MrvlIEtypes_OnlyProberesp_t {
5986     /** Header */
5987 	MrvlIEtypesHeader_t header;
5988     /** only keep probe response */
5989 	t_u8 proberesp_only;
5990 } MLAN_PACK_END MrvlIEtypes_OnlyProberesp_t;
5991 
5992 /** HostCmd_DS_COMMAND */
5993 typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
5994     /** Command Header : Command */
5995 	t_u16 command;
5996     /** Command Header : Size */
5997 	t_u16 size;
5998     /** Command Header : Sequence number */
5999 	t_u16 seq_num;
6000     /** Command Header : Result */
6001 	t_u16 result;
6002     /** Command Body */
6003 	union {
6004 	/** Hardware specifications */
6005 		HostCmd_DS_GET_HW_SPEC hw_spec;
6006 		HostCmd_DS_SDIO_SP_RX_AGGR_CFG sdio_rx_aggr;
6007 	/** Cfg data */
6008 		HostCmd_DS_802_11_CFG_DATA cfg_data;
6009 	/** MAC control */
6010 		HostCmd_DS_MAC_CONTROL mac_ctrl;
6011 	/** MAC address */
6012 		HostCmd_DS_802_11_MAC_ADDRESS mac_addr;
6013 	/** MAC muticast address */
6014 		HostCmd_DS_MAC_MULTICAST_ADR mc_addr;
6015 	/** Get log */
6016 		HostCmd_DS_802_11_GET_LOG get_log;
6017 		/** RSSI information */
6018 		HostCmd_DS_802_11_RSSI_INFO_EXT rssi_info_ext;
6019 	/** RSSI information */
6020 		HostCmd_DS_802_11_RSSI_INFO rssi_info;
6021 	/** RSSI information response */
6022 		HostCmd_DS_802_11_RSSI_INFO_RSP rssi_info_rsp;
6023 	/** SNMP MIB */
6024 		HostCmd_DS_802_11_SNMP_MIB smib;
6025 	/** Radio control */
6026 		HostCmd_DS_802_11_RADIO_CONTROL radio;
6027 	/** RF channel */
6028 		HostCmd_DS_802_11_RF_CHANNEL rf_channel;
6029 	/** Tx rate query */
6030 		HostCmd_TX_RATE_QUERY tx_rate;
6031 	/** Tx rate configuration */
6032 		HostCmd_DS_TX_RATE_CFG tx_rate_cfg;
6033 	/** Tx power configuration */
6034 		HostCmd_DS_TXPWR_CFG txp_cfg;
6035 	/** RF Tx power configuration */
6036 		HostCmd_DS_802_11_RF_TX_POWER txp;
6037 
6038 	/** RF antenna */
6039 		HostCmd_DS_802_11_RF_ANTENNA antenna;
6040 
6041 	/** CW Mode: Tx CW Level control */
6042 		HostCmd_DS_CW_MODE_CTRL cwmode;
6043 	/** Enhanced power save command */
6044 		HostCmd_DS_802_11_PS_MODE_ENH psmode_enh;
6045 		HostCmd_DS_802_11_HS_CFG_ENH opt_hs_cfg;
6046 		HostCmd_DS_802_11_FW_WAKEUP_METHOD fwwakeupmethod;
6047 	/** Scan */
6048 		HostCmd_DS_802_11_SCAN scan;
6049 	/** Extended Scan */
6050 		HostCmd_DS_802_11_SCAN_EXT ext_scan;
6051 
6052 	/** Mgmt frame subtype mask */
6053 		HostCmd_DS_RX_MGMT_IND rx_mgmt_ind;
6054 	/** Scan response */
6055 		HostCmd_DS_802_11_SCAN_RSP scan_resp;
6056 
6057 		HostCmd_DS_802_11_BG_SCAN_CONFIG bg_scan_config;
6058 		HostCmd_DS_802_11_BG_SCAN_QUERY bg_scan_query;
6059 		HostCmd_DS_802_11_BG_SCAN_QUERY_RSP bg_scan_query_resp;
6060 		HostCmd_DS_SUBSCRIBE_EVENT subscribe_event;
6061 		HostCmd_DS_OTP_USER_DATA otp_user_data;
6062 	/** Associate */
6063 		HostCmd_DS_802_11_ASSOCIATE associate;
6064 
6065 	/** Associate response */
6066 		HostCmd_DS_802_11_ASSOCIATE_RSP associate_rsp;
6067 	/** Deauthenticate */
6068 		HostCmd_DS_802_11_DEAUTHENTICATE deauth;
6069 	/** Ad-Hoc start */
6070 		HostCmd_DS_802_11_AD_HOC_START adhoc_start;
6071 	/** Ad-Hoc start result */
6072 		HostCmd_DS_802_11_AD_HOC_START_RESULT adhoc_start_result;
6073 	/** Ad-Hoc join result */
6074 		HostCmd_DS_802_11_AD_HOC_JOIN_RESULT adhoc_join_result;
6075 	/** Ad-Hoc join */
6076 		HostCmd_DS_802_11_AD_HOC_JOIN adhoc_join;
6077 	/** Domain information */
6078 		HostCmd_DS_802_11D_DOMAIN_INFO domain_info;
6079 	/** Domain information response */
6080 		HostCmd_DS_802_11D_DOMAIN_INFO_RSP domain_info_resp;
6081 		/** 11K GET NLIST */
6082 		HostCmd_DS_802_11K_GET_NLIST get_nlist;
6083 		/** OFFLOAD FEATURE CTRL */
6084 		HostCmd_OFFLOAD_FEATURE_CTRL fctrl;
6085 		HostCmd_DS_802_11_TPC_ADAPT_REQ tpc_req;
6086 		HostCmd_DS_802_11_TPC_INFO tpc_info;
6087 		HostCmd_DS_802_11_CHAN_SW_ANN chan_sw_ann;
6088 		HostCmd_DS_CHAN_RPT_REQ chan_rpt_req;
6089 		HostCmd_DS_MEASUREMENT_REQUEST meas_req;
6090 		HostCmd_DS_MEASUREMENT_REPORT meas_rpt;
6091 	/** Add BA request */
6092 		HostCmd_DS_11N_ADDBA_REQ add_ba_req;
6093 	/** Add BA response */
6094 		HostCmd_DS_11N_ADDBA_RSP add_ba_rsp;
6095 	/** Delete BA entry */
6096 		HostCmd_DS_11N_DELBA del_ba;
6097 	/** Tx buffer configuration */
6098 		HostCmd_DS_TXBUF_CFG tx_buf;
6099 	/** AMSDU Aggr Ctrl configuration */
6100 		HostCmd_DS_AMSDU_AGGR_CTRL amsdu_aggr_ctrl;
6101 	/** 11n configuration */
6102 		HostCmd_DS_11N_CFG htcfg;
6103 	/** reject addba req conditions configuration */
6104 		HostCmd_DS_REJECT_ADDBA_REQ rejectaddbareq;
6105 	/** 11n configuration */
6106 		HostCmd_DS_TX_BF_CFG tx_bf_cfg;
6107 	/** WMM status get */
6108 		HostCmd_DS_WMM_GET_STATUS get_wmm_status;
6109 	/** WMM ADDTS */
6110 		HostCmd_DS_WMM_ADDTS_REQ add_ts;
6111 	/** WMM DELTS */
6112 		HostCmd_DS_WMM_DELTS_REQ del_ts;
6113 	/** WMM set/get queue config */
6114 		HostCmd_DS_WMM_QUEUE_CONFIG queue_config;
6115 	/** WMM param config*/
6116 		HostCmd_DS_WMM_PARAM_CONFIG param_config;
6117 	/** WMM on/of/get queue statistics */
6118 		HostCmd_DS_WMM_QUEUE_STATS queue_stats;
6119 	/** WMM get traffic stream status */
6120 		HostCmd_DS_WMM_TS_STATUS ts_status;
6121 	/** Key material */
6122 		HostCmd_DS_802_11_KEY_MATERIAL key_material;
6123 	/** GTK Rekey parameters */
6124 		HostCmd_DS_GTK_REKEY_PARAMS gtk_rekey;
6125 	/** E-Supplicant PSK */
6126 		HostCmd_DS_802_11_SUPPLICANT_PMK esupplicant_psk;
6127 	/** E-Supplicant profile */
6128 		HostCmd_DS_802_11_SUPPLICANT_PROFILE esupplicant_profile;
6129 	/** Extended version */
6130 		HostCmd_DS_VERSION_EXT verext;
6131 	/** Adhoc Coalescing */
6132 		HostCmd_DS_802_11_IBSS_STATUS ibss_coalescing;
6133 	/** Mgmt IE list configuration */
6134 		HostCmd_DS_MGMT_IE_LIST_CFG mgmt_ie_list;
6135 	/** TDLS configuration command */
6136 		HostCmd_DS_TDLS_CONFIG tdls_config_data;
6137 	    /** TDLS operation command */
6138 		HostCmd_DS_TDLS_OPER tdls_oper_data;
6139 	/** System clock configuration */
6140 		HostCmd_DS_ECL_SYSTEM_CLOCK_CONFIG sys_clock_cfg;
6141 	/** MAC register access */
6142 		HostCmd_DS_MAC_REG_ACCESS mac_reg;
6143 	/** BBP register access */
6144 		HostCmd_DS_BBP_REG_ACCESS bbp_reg;
6145 	/** RF register access */
6146 		HostCmd_DS_RF_REG_ACCESS rf_reg;
6147 	/** EEPROM register access */
6148 		HostCmd_DS_802_11_EEPROM_ACCESS eeprom;
6149 	/** Memory access */
6150 		HostCmd_DS_MEM_ACCESS mem;
6151 	/** Target device access */
6152 		HostCmd_DS_TARGET_ACCESS target;
6153 
6154 	/** Inactivity timeout extend */
6155 		HostCmd_DS_INACTIVITY_TIMEOUT_EXT inactivity_to;
6156 #ifdef UAP_SUPPORT
6157 		HostCmd_DS_SYS_CONFIG sys_config;
6158 		HostCmd_DS_SYS_INFO sys_info;
6159 		HostCmd_DS_STA_DEAUTH sta_deauth;
6160 		HostCmd_DS_STA_LIST sta_list;
6161 		HostCmd_DS_POWER_MGMT_EXT pm_cfg;
6162 		HostCmd_DS_UAP_OPER_CTRL uap_oper_ctrl;
6163 #endif				/* UAP_SUPPORT */
6164 
6165        /** Sleep period command */
6166 		HostCmd_DS_802_11_SLEEP_PERIOD sleep_pd;
6167        /** Sleep params command */
6168 		HostCmd_DS_802_11_SLEEP_PARAMS sleep_param;
6169 
6170        /** SDIO GPIO interrupt config command */
6171 		HostCmd_DS_SDIO_GPIO_INT_CONFIG sdio_gpio_int;
6172 		HostCmd_DS_SDIO_PULL_CTRL sdio_pull_ctl;
6173 		HostCmd_DS_SET_BSS_MODE bss_mode;
6174 		HostCmd_DS_802_11_NET_MONITOR net_mon;
6175 		HostCmd_DS_CMD_TX_DATA_PAUSE tx_data_pause;
6176 		HostCmd_DS_REMAIN_ON_CHANNEL remain_on_chan;
6177 #ifdef WIFI_DIRECT_SUPPORT
6178 		HostCmd_DS_WIFI_DIRECT_MODE wifi_direct_mode;
6179 		HostCmd_DS_WIFI_DIRECT_PARAM_CONFIG p2p_params_config;
6180 #endif
6181 		HostCmd_DS_COALESCE_CONFIG coalesce_config;
6182 		HostCmd_DS_HS_WAKEUP_REASON hs_wakeup_reason;
6183 		HostCmd_DS_MULTI_CHAN_CFG multi_chan_cfg;
6184 		HostCmd_DS_MULTI_CHAN_POLICY multi_chan_policy;
6185 		HostCmd_DS_DRCS_CFG drcs_cfg;
6186 		HostCmd_DS_TSF tsf;
6187 		HostCmd_DS_DFS_REPEATER_MODE dfs_repeater;
6188 #ifdef RX_PACKET_COALESCE
6189 		HostCmd_DS_RX_PKT_COAL_CFG rx_pkt_coal_cfg;
6190 #endif
6191 		HostCmd_DS_EAPOL_PKT eapol_pkt;
6192 		HostCmd_DS_SENSOR_TEMP temp_sensor;
6193 #ifdef STA_SUPPORT
6194 		HostCmd_DS_STA_CONFIGURE sta_cfg;
6195 #endif
6196     /** GPIO Independent reset configure */
6197 		HostCmd_DS_INDEPENDENT_RESET_CFG ind_rst_cfg;
6198 		HostCmd_DS_802_11_PS_INACTIVITY_TIMEOUT ps_inact_tmo;
6199 		HostCmd_DS_ROAM_OFFLOAD roam_offload;
6200 		HostCmd_DS_HOST_CLOCK_CFG host_clock_cfg;
6201 		HostCmd_DS_CHAN_REGION_CFG reg_cfg;
6202 		HostCmd_DS_802_11_ROBUSTCOEX robustcoexparams;
6203     /** boot sleep configure */
6204 		HostCmd_DS_BOOT_SLEEP boot_sleep;
6205 	} params;
6206 } MLAN_PACK_END HostCmd_DS_COMMAND;
6207 
6208 /** PS_CMD_ConfirmSleep */
6209 typedef MLAN_PACK_START struct _OPT_Confirm_Sleep {
6210     /** Command */
6211 	t_u16 command;
6212     /** Size */
6213 	t_u16 size;
6214     /** Sequence number */
6215 	t_u16 seq_num;
6216     /** Result */
6217 	t_u16 result;
6218     /** Action */
6219 	t_u16 action;
6220     /** Sleep comfirm param definition */
6221 	sleep_confirm_param sleep_cfm;
6222 } MLAN_PACK_END OPT_Confirm_Sleep;
6223 
6224 typedef struct MLAN_PACK_START _opt_sleep_confirm_buffer {
6225     /** Header for interface */
6226 	t_u8 hdr[4];
6227 #ifdef SPI_SUPPORT
6228     /** Header for interface */
6229 	t_u16 hdr;
6230 #endif
6231     /** New power save command used to send
6232      *  sleep confirmation to the firmware */
6233 	OPT_Confirm_Sleep ps_cfm_sleep;
6234 } MLAN_PACK_END opt_sleep_confirm_buffer;
6235 
6236 #ifdef PRAGMA_PACK
6237 #pragma pack(pop)
6238 #endif
6239 
6240 #endif /* !_MLAN_FW_H_ */
6241