]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - drivers/net/wireless/mwifiex/fw.h
mwifiex: report received management frames to cfg80211
[mirror_ubuntu-hirsute-kernel.git] / drivers / net / wireless / mwifiex / fw.h
CommitLineData
5e6e3a92
BZ
1/*
2 * Marvell Wireless LAN device driver: Firmware specific macros & structures
3 *
4 * Copyright (C) 2011, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13 *
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
18 */
19
20#ifndef _MWIFIEX_FW_H_
21#define _MWIFIEX_FW_H_
22
23#include <linux/if_ether.h>
24
25
26#define INTF_HEADER_LEN 4
27
28struct rfc_1042_hdr {
29 u8 llc_dsap;
30 u8 llc_ssap;
31 u8 llc_ctrl;
32 u8 snap_oui[3];
33 u16 snap_type;
34};
35
36struct rx_packet_hdr {
37 struct ethhdr eth803_hdr;
38 struct rfc_1042_hdr rfc1042_hdr;
39};
40
41struct tx_packet_hdr {
42 struct ethhdr eth803_hdr;
43 struct rfc_1042_hdr rfc1042_hdr;
44};
45
46#define B_SUPPORTED_RATES 5
47#define G_SUPPORTED_RATES 9
48#define BG_SUPPORTED_RATES 13
49#define A_SUPPORTED_RATES 9
50#define HOSTCMD_SUPPORTED_RATES 14
51#define N_SUPPORTED_RATES 3
52#define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN)
53
54#define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11))
55#define IS_SUPPORT_MULTI_BANDS(adapter) \
56 (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
57#define GET_FW_DEFAULT_BANDS(adapter) \
58 ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
59
5e6e3a92
BZ
60#define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
61
62#define KEY_INFO_ENABLED 0x01
63enum KEY_TYPE_ID {
64 KEY_TYPE_ID_WEP = 0,
65 KEY_TYPE_ID_TKIP,
66 KEY_TYPE_ID_AES,
67 KEY_TYPE_ID_WAPI,
b877f4cf 68 KEY_TYPE_ID_AES_CMAC,
5e6e3a92 69};
6a35a0ac
YAP
70#define KEY_MCAST BIT(0)
71#define KEY_UNICAST BIT(1)
72#define KEY_ENABLED BIT(2)
b877f4cf 73#define KEY_IGTK BIT(10)
5e6e3a92
BZ
74
75#define WAPI_KEY_LEN 50
76
5e6e3a92
BZ
77#define MAX_POLL_TRIES 100
78
79#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
80
81#define MAX_FIRMWARE_POLL_TRIES 100
82
d930faee
AK
83#define FIRMWARE_READY_SDIO 0xfedc
84#define FIRMWARE_READY_PCIE 0xfedcba00
5e6e3a92 85
4daffe35
AK
86enum mwifiex_usb_ep {
87 MWIFIEX_USB_EP_CMD_EVENT = 1,
88 MWIFIEX_USB_EP_DATA = 2,
89};
90
5e6e3a92
BZ
91enum MWIFIEX_802_11_PRIVACY_FILTER {
92 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
93 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
94};
95
5e6e3a92 96#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
2dbaf751 97#define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
5e6e3a92 98
e76268da 99#define UAP_BSS_PARAMS_I 0
ede98bfa
AP
100#define UAP_CUSTOM_IE_I 1
101#define MWIFIEX_AUTO_IDX_MASK 0xffff
102#define MWIFIEX_DELETE_MASK 0x0000
f31acabe
AP
103#define MGMT_MASK_ASSOC_REQ 0x01
104#define MGMT_MASK_REASSOC_REQ 0x04
105#define MGMT_MASK_ASSOC_RESP 0x02
106#define MGMT_MASK_REASSOC_RESP 0x08
107#define MGMT_MASK_PROBE_REQ 0x10
108#define MGMT_MASK_PROBE_RESP 0x20
109#define MGMT_MASK_BEACON 0x100
e76268da 110
12190c5d 111#define TLV_TYPE_UAP_SSID 0x0000
a3c2c4f6 112#define TLV_TYPE_UAP_RATES 0x0001
12190c5d 113
5e6e3a92
BZ
114#define PROPRIETARY_TLV_BASE_ID 0x0100
115#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
116#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
117#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
fa444bf8 118#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
5e6e3a92 119#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
5e6e3a92
BZ
120#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
121#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
122#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
fa444bf8 123#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
5e6e3a92 124#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
75edd2c6 125#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
5e6e3a92 126#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
12190c5d
AP
127#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
128#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
605b73af 129#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
9b930eae 130#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
96893538 131#define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
f752dcd5
AP
132#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
133#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
134#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
9b930eae 135#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
2b06bdbe
MY
136#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
137#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
138#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
9b930eae 139#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
5e6e3a92 140#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
e568634a 141#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
13d7ba78 142#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
2b06bdbe
MY
143#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
144#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
f752dcd5
AP
145#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
146#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
5e6e3a92
BZ
147
148#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
149
5e6e3a92
BZ
150#define SSN_MASK 0xfff0
151
152#define BA_RESULT_SUCCESS 0x0
5e6e3a92 153#define BA_RESULT_TIMEOUT 0x2
5e6e3a92
BZ
154
155#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
156
157#define BA_STREAM_NOT_ALLOWED 0xff
158
159#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
931f1584
YAP
160 priv->adapter->config_bands & BAND_AN) && \
161 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
5e6e3a92
BZ
162#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
163 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
164
165#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
166#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
5e6e3a92 167
5e6e3a92 168#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
6d2bd916 169
22281256
AP
170#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
171 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
172 IEEE80211_HT_CAP_SM_PS)
173
174#define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
175
6d2bd916
MY
176/* dev_cap bitmap
177 * BIT
178 * 0-16 reserved
179 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
180 * 18-22 reserved
181 * 23 IEEE80211_HT_CAP_SGI_20
182 * 24 IEEE80211_HT_CAP_SGI_40
183 * 25 IEEE80211_HT_CAP_TX_STBC
184 * 26 IEEE80211_HT_CAP_RX_STBC
185 * 27-28 reserved
186 * 29 IEEE80211_HT_CAP_GRN_FLD
187 * 30-31 reserved
188 */
5e6e3a92 189#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
6d2bd916
MY
190#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
191#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
192#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
193#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
194#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
195
cd27bc3c
AK
196/* httxcfg bitmap
197 * 0 reserved
198 * 1 20/40 Mhz enable(1)/disable(0)
199 * 2-3 reserved
200 * 4 green field enable(1)/disable(0)
201 * 5 short GI in 20 Mhz enable(1)/disable(0)
202 * 6 short GI in 40 Mhz enable(1)/disable(0)
203 * 7-15 reserved
204 */
205#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
206
5e6e3a92 207#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
5e6e3a92 208#define SETHT_MCS32(x) (x[4] |= 1)
e3bea1c8 209#define HT_STREAM_2X2 0x22
6d2bd916 210
5e6e3a92
BZ
211#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
212
213#define LLC_SNAP_LEN 8
214
5e6e3a92
BZ
215#define MOD_CLASS_HR_DSSS 0x03
216#define MOD_CLASS_OFDM 0x07
217#define MOD_CLASS_HT 0x08
218#define HT_BW_20 0
219#define HT_BW_40 1
220
221#define HostCmd_CMD_GET_HW_SPEC 0x0003
222#define HostCmd_CMD_802_11_SCAN 0x0006
223#define HostCmd_CMD_802_11_GET_LOG 0x000b
224#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
225#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
226#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
227#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
228#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
229#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
230#define HostCmd_CMD_RF_REG_ACCESS 0x001b
231#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
caa8984f 232#define HostCmd_CMD_RF_TX_PWR 0x001e
8a279d5b 233#define HostCmd_CMD_RF_ANTENNA 0x0020
5e6e3a92
BZ
234#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
235#define HostCmd_CMD_MAC_CONTROL 0x0028
236#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
237#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
238#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
239#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
240#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
241#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
242#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
243#define HostCmd_CMD_WMM_GET_STATUS 0x0071
fa444bf8 244#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
5e6e3a92
BZ
245#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
246#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
247#define HostCmd_CMD_VERSION_EXT 0x0097
248#define HostCmd_CMD_RSSI_INFO 0x00a4
249#define HostCmd_CMD_FUNC_INIT 0x00a9
250#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
40d07030
AP
251#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
252#define HostCmd_CMD_UAP_BSS_START 0x00b1
253#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
5e6e3a92
BZ
254#define HostCmd_CMD_11N_CFG 0x00cd
255#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
256#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
257#define HostCmd_CMD_11N_DELBA 0x00d0
258#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
259#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
260#define HostCmd_CMD_TXPWR_CFG 0x00d1
261#define HostCmd_CMD_TX_RATE_CFG 0x00d6
262#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
263#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
264#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
265#define HostCmd_CMD_SET_BSS_MODE 0x00f7
d930faee 266#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
3cec6870 267#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
5e6e3a92 268
f752dcd5
AP
269#define PROTOCOL_NO_SECURITY 0x01
270#define PROTOCOL_STATIC_WEP 0x02
271#define PROTOCOL_WPA 0x08
272#define PROTOCOL_WPA2 0x20
273#define PROTOCOL_WPA2_MIXED 0x28
274#define PROTOCOL_EAP 0x40
275#define KEY_MGMT_NONE 0x04
276#define KEY_MGMT_PSK 0x02
277#define KEY_MGMT_EAP 0x01
278#define CIPHER_TKIP 0x04
279#define CIPHER_AES_CCMP 0x08
280#define VALID_CIPHER_BITMAP 0x0c
281
5e6e3a92
BZ
282enum ENH_PS_MODES {
283 EN_PS = 1,
284 DIS_PS = 2,
285 EN_AUTO_DS = 3,
286 DIS_AUTO_DS = 4,
287 SLEEP_CONFIRM = 5,
288 GET_PS = 0,
289 EN_AUTO_PS = 0xff,
290 DIS_AUTO_PS = 0xfe,
291};
292
293#define HostCmd_RET_BIT 0x8000
294#define HostCmd_ACT_GEN_GET 0x0000
295#define HostCmd_ACT_GEN_SET 0x0001
fa444bf8
AK
296#define HostCmd_ACT_BITWISE_SET 0x0002
297#define HostCmd_ACT_BITWISE_CLR 0x0003
5e6e3a92 298#define HostCmd_RESULT_OK 0x0000
5e6e3a92
BZ
299
300#define HostCmd_ACT_MAC_RX_ON 0x0001
301#define HostCmd_ACT_MAC_TX_ON 0x0002
302#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
303#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
304#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
305#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
5e6e3a92
BZ
306#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
307
5e6e3a92
BZ
308#define HostCmd_BSS_MODE_IBSS 0x0002
309#define HostCmd_BSS_MODE_ANY 0x0003
310
311#define HostCmd_SCAN_RADIO_TYPE_BG 0
312#define HostCmd_SCAN_RADIO_TYPE_A 1
313
314#define HOST_SLEEP_CFG_CANCEL 0xffffffff
fd4c4511 315#define HOST_SLEEP_CFG_COND_DEF 0x00000000
5e6e3a92
BZ
316#define HOST_SLEEP_CFG_GPIO_DEF 0xff
317#define HOST_SLEEP_CFG_GAP_DEF 0
318
319#define CMD_F_HOSTCMD (1 << 0)
320#define CMD_F_CANCELED (1 << 1)
321
322#define HostCmd_CMD_ID_MASK 0x0fff
323
324#define HostCmd_SEQ_NUM_MASK 0x00ff
325
326#define HostCmd_BSS_NUM_MASK 0x0f00
327
328#define HostCmd_BSS_TYPE_MASK 0xf000
329
8a279d5b
AK
330#define HostCmd_ACT_SET_RX 0x0001
331#define HostCmd_ACT_SET_TX 0x0002
332#define HostCmd_ACT_SET_BOTH 0x0003
333
334#define RF_ANTENNA_AUTO 0xFFFF
335
5e6e3a92
BZ
336#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
337 (((seq) & 0x00ff) | \
338 (((num) & 0x000f) << 8)) | \
339 (((type) & 0x000f) << 12); }
340
341#define HostCmd_GET_SEQ_NO(seq) \
342 ((seq) & HostCmd_SEQ_NUM_MASK)
343
344#define HostCmd_GET_BSS_NO(seq) \
345 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
346
347#define HostCmd_GET_BSS_TYPE(seq) \
348 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
349
350#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
351#define EVENT_LINK_LOST 0x00000003
352#define EVENT_LINK_SENSED 0x00000004
353#define EVENT_MIB_CHANGED 0x00000006
354#define EVENT_INIT_DONE 0x00000007
355#define EVENT_DEAUTHENTICATED 0x00000008
356#define EVENT_DISASSOCIATED 0x00000009
357#define EVENT_PS_AWAKE 0x0000000a
358#define EVENT_PS_SLEEP 0x0000000b
359#define EVENT_MIC_ERR_MULTICAST 0x0000000d
360#define EVENT_MIC_ERR_UNICAST 0x0000000e
361#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
362#define EVENT_ADHOC_BCN_LOST 0x00000011
363
364#define EVENT_WMM_STATUS_CHANGE 0x00000017
365#define EVENT_BG_SCAN_REPORT 0x00000018
366#define EVENT_RSSI_LOW 0x00000019
367#define EVENT_SNR_LOW 0x0000001a
368#define EVENT_MAX_FAIL 0x0000001b
369#define EVENT_RSSI_HIGH 0x0000001c
370#define EVENT_SNR_HIGH 0x0000001d
371#define EVENT_IBSS_COALESCED 0x0000001e
372#define EVENT_DATA_RSSI_LOW 0x00000024
373#define EVENT_DATA_SNR_LOW 0x00000025
374#define EVENT_DATA_RSSI_HIGH 0x00000026
375#define EVENT_DATA_SNR_HIGH 0x00000027
376#define EVENT_LINK_QUALITY 0x00000028
377#define EVENT_PORT_RELEASE 0x0000002b
e568634a
AP
378#define EVENT_UAP_STA_DEAUTH 0x0000002c
379#define EVENT_UAP_STA_ASSOC 0x0000002d
380#define EVENT_UAP_BSS_START 0x0000002e
5e6e3a92
BZ
381#define EVENT_PRE_BEACON_LOST 0x00000031
382#define EVENT_ADDBA 0x00000033
383#define EVENT_DELBA 0x00000034
384#define EVENT_BA_STREAM_TIEMOUT 0x00000037
385#define EVENT_AMSDU_AGGR_CTRL 0x00000042
e568634a
AP
386#define EVENT_UAP_BSS_IDLE 0x00000043
387#define EVENT_UAP_BSS_ACTIVE 0x00000044
5e6e3a92
BZ
388#define EVENT_WEP_ICV_ERR 0x00000046
389#define EVENT_HS_ACT_REQ 0x00000047
390#define EVENT_BW_CHANGE 0x00000048
e568634a 391#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
5e6e3a92
BZ
392#define EVENT_HOSTWAKE_STAIE 0x0000004d
393
394#define EVENT_ID_MASK 0xffff
395#define BSS_NUM_MASK 0xf
396
397#define EVENT_GET_BSS_NUM(event_cause) \
398 (((event_cause) >> 16) & BSS_NUM_MASK)
399
400#define EVENT_GET_BSS_TYPE(event_cause) \
401 (((event_cause) >> 24) & 0x00ff)
402
5e6e3a92
BZ
403struct mwifiex_ie_types_header {
404 __le16 type;
405 __le16 len;
406} __packed;
407
408struct mwifiex_ie_types_data {
409 struct mwifiex_ie_types_header header;
410 u8 data[1];
411} __packed;
412
413#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
414#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
415
416struct txpd {
417 u8 bss_type;
418 u8 bss_num;
419 __le16 tx_pkt_length;
420 __le16 tx_pkt_offset;
421 __le16 tx_pkt_type;
422 __le32 tx_control;
423 u8 priority;
424 u8 flags;
425 u8 pkt_delay_2ms;
426 u8 reserved1;
427} __packed;
428
429struct rxpd {
430 u8 bss_type;
431 u8 bss_num;
ed1ea6f4
AK
432 __le16 rx_pkt_length;
433 __le16 rx_pkt_offset;
434 __le16 rx_pkt_type;
435 __le16 seq_num;
5e6e3a92
BZ
436 u8 priority;
437 u8 rx_rate;
438 s8 snr;
439 s8 nf;
440 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
441 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
442 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
443 u8 ht_info;
444 u8 reserved;
445} __packed;
446
838e4f44
AP
447struct uap_txpd {
448 u8 bss_type;
449 u8 bss_num;
450 __le16 tx_pkt_length;
451 __le16 tx_pkt_offset;
452 __le16 tx_pkt_type;
453 __le32 tx_control;
454 u8 priority;
455 u8 flags;
456 u8 pkt_delay_2ms;
457 u8 reserved1;
458 __le32 reserved2;
459};
460
461struct uap_rxpd {
462 u8 bss_type;
463 u8 bss_num;
464 __le16 rx_pkt_length;
465 __le16 rx_pkt_offset;
466 __le16 rx_pkt_type;
467 __le16 seq_num;
468 u8 priority;
469 u8 reserved1;
470};
471
5e6e3a92
BZ
472enum mwifiex_chan_scan_mode_bitmasks {
473 MWIFIEX_PASSIVE_SCAN = BIT(0),
474 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
475};
476
5e6e3a92
BZ
477struct mwifiex_chan_scan_param_set {
478 u8 radio_type;
479 u8 chan_number;
480 u8 chan_scan_mode_bitmap;
481 __le16 min_scan_time;
482 __le16 max_scan_time;
483} __packed;
484
485struct mwifiex_ie_types_chan_list_param_set {
486 struct mwifiex_ie_types_header header;
487 struct mwifiex_chan_scan_param_set chan_scan_param[1];
488} __packed;
489
490struct chan_band_param_set {
491 u8 radio_type;
492 u8 chan_number;
493};
494
495struct mwifiex_ie_types_chan_band_list_param_set {
496 struct mwifiex_ie_types_header header;
497 struct chan_band_param_set chan_band_param[1];
498} __packed;
499
500struct mwifiex_ie_types_rates_param_set {
501 struct mwifiex_ie_types_header header;
502 u8 rates[1];
503} __packed;
504
505struct mwifiex_ie_types_ssid_param_set {
506 struct mwifiex_ie_types_header header;
507 u8 ssid[1];
508} __packed;
509
510struct mwifiex_ie_types_num_probes {
511 struct mwifiex_ie_types_header header;
512 __le16 num_probes;
513} __packed;
514
515struct mwifiex_ie_types_wildcard_ssid_params {
516 struct mwifiex_ie_types_header header;
517 u8 max_ssid_length;
518 u8 ssid[1];
519} __packed;
520
521#define TSF_DATA_SIZE 8
522struct mwifiex_ie_types_tsf_timestamp {
523 struct mwifiex_ie_types_header header;
524 u8 tsf_data[1];
525} __packed;
526
527struct mwifiex_cf_param_set {
528 u8 cfp_cnt;
529 u8 cfp_period;
530 u16 cfp_max_duration;
531 u16 cfp_duration_remaining;
532} __packed;
533
534struct mwifiex_ibss_param_set {
535 u16 atim_window;
536} __packed;
537
538struct mwifiex_ie_types_ss_param_set {
539 struct mwifiex_ie_types_header header;
540 union {
541 struct mwifiex_cf_param_set cf_param_set[1];
542 struct mwifiex_ibss_param_set ibss_param_set[1];
543 } cf_ibss;
544} __packed;
545
546struct mwifiex_fh_param_set {
547 u16 dwell_time;
548 u8 hop_set;
549 u8 hop_pattern;
550 u8 hop_index;
551} __packed;
552
553struct mwifiex_ds_param_set {
554 u8 current_chan;
555} __packed;
556
557struct mwifiex_ie_types_phy_param_set {
558 struct mwifiex_ie_types_header header;
559 union {
560 struct mwifiex_fh_param_set fh_param_set[1];
561 struct mwifiex_ds_param_set ds_param_set[1];
562 } fh_ds;
563} __packed;
564
565struct mwifiex_ie_types_auth_type {
566 struct mwifiex_ie_types_header header;
567 __le16 auth_type;
568} __packed;
569
570struct mwifiex_ie_types_vendor_param_set {
571 struct mwifiex_ie_types_header header;
572 u8 ie[MWIFIEX_MAX_VSIE_LEN];
573};
574
575struct mwifiex_ie_types_rsn_param_set {
576 struct mwifiex_ie_types_header header;
577 u8 rsn_ie[1];
578} __packed;
579
580#define KEYPARAMSET_FIXED_LEN 6
581
582struct mwifiex_ie_type_key_param_set {
583 __le16 type;
584 __le16 length;
585 __le16 key_type_id;
586 __le16 key_info;
587 __le16 key_len;
588 u8 key[50];
589} __packed;
b877f4cf
YL
590
591#define IGTK_PN_LEN 8
592
593struct mwifiex_cmac_param {
594 u8 ipn[IGTK_PN_LEN];
595 u8 key[WLAN_KEY_LEN_AES_CMAC];
596} __packed;
5e6e3a92
BZ
597
598struct host_cmd_ds_802_11_key_material {
599 __le16 action;
600 struct mwifiex_ie_type_key_param_set key_param_set;
601} __packed;
602
603struct host_cmd_ds_gen {
604 u16 command;
605 u16 size;
606 u16 seq_num;
607 u16 result;
608};
609
610#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
611
612enum sleep_resp_ctrl {
613 RESP_NOT_NEEDED = 0,
614 RESP_NEEDED,
615};
616
617struct mwifiex_ps_param {
618 __le16 null_pkt_interval;
619 __le16 multiple_dtims;
620 __le16 bcn_miss_timeout;
621 __le16 local_listen_interval;
622 __le16 adhoc_wake_period;
623 __le16 mode;
624 __le16 delay_to_ps;
625};
626
5e6e3a92
BZ
627#define BITMAP_AUTO_DS 0x01
628#define BITMAP_STA_PS 0x10
5e6e3a92
BZ
629
630struct mwifiex_ie_types_auto_ds_param {
631 struct mwifiex_ie_types_header header;
2b06bdbe 632 __le16 deep_sleep_timeout;
5e6e3a92
BZ
633} __packed;
634
635struct mwifiex_ie_types_ps_param {
636 struct mwifiex_ie_types_header header;
637 struct mwifiex_ps_param param;
638} __packed;
639
640struct host_cmd_ds_802_11_ps_mode_enh {
641 __le16 action;
642
643 union {
644 struct mwifiex_ps_param opt_ps;
5e6e3a92 645 __le16 ps_bitmap;
5e6e3a92
BZ
646 } params;
647} __packed;
648
649struct host_cmd_ds_get_hw_spec {
650 __le16 hw_if_version;
651 __le16 version;
652 __le16 reserved;
653 __le16 num_of_mcast_adr;
654 u8 permanent_addr[ETH_ALEN];
655 __le16 region_code;
656 __le16 number_of_antenna;
657 __le32 fw_release_number;
658 __le32 reserved_1;
659 __le32 reserved_2;
660 __le32 reserved_3;
661 __le32 fw_cap_info;
662 __le32 dot_11n_dev_cap;
663 u8 dev_mcs_support;
664 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
665 __le16 reserved_4;
666} __packed;
667
668struct host_cmd_ds_802_11_rssi_info {
669 __le16 action;
670 __le16 ndata;
671 __le16 nbcn;
672 __le16 reserved[9];
673 long long reserved_1;
674};
675
676struct host_cmd_ds_802_11_rssi_info_rsp {
677 __le16 action;
678 __le16 ndata;
679 __le16 nbcn;
680 __le16 data_rssi_last;
681 __le16 data_nf_last;
682 __le16 data_rssi_avg;
683 __le16 data_nf_avg;
684 __le16 bcn_rssi_last;
685 __le16 bcn_nf_last;
686 __le16 bcn_rssi_avg;
687 __le16 bcn_nf_avg;
688 long long tsf_bcn;
689};
690
691struct host_cmd_ds_802_11_mac_address {
692 __le16 action;
693 u8 mac_addr[ETH_ALEN];
694};
695
696struct host_cmd_ds_mac_control {
697 __le16 action;
698 __le16 reserved;
699};
700
701struct host_cmd_ds_mac_multicast_adr {
702 __le16 action;
703 __le16 num_of_adrs;
704 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
705} __packed;
706
707struct host_cmd_ds_802_11_deauthenticate {
708 u8 mac_addr[ETH_ALEN];
709 __le16 reason_code;
710} __packed;
711
712struct host_cmd_ds_802_11_associate {
713 u8 peer_sta_addr[ETH_ALEN];
714 __le16 cap_info_bitmap;
715 __le16 listen_interval;
716 __le16 beacon_period;
717 u8 dtim_period;
718} __packed;
719
720struct ieee_types_assoc_rsp {
721 __le16 cap_info_bitmap;
722 __le16 status_code;
723 __le16 a_id;
724 u8 ie_buffer[1];
725} __packed;
726
727struct host_cmd_ds_802_11_associate_rsp {
728 struct ieee_types_assoc_rsp assoc_rsp;
729} __packed;
730
731struct ieee_types_cf_param_set {
732 u8 element_id;
733 u8 len;
734 u8 cfp_cnt;
735 u8 cfp_period;
736 u16 cfp_max_duration;
737 u16 cfp_duration_remaining;
738} __packed;
739
740struct ieee_types_ibss_param_set {
741 u8 element_id;
742 u8 len;
743 __le16 atim_window;
744} __packed;
745
746union ieee_types_ss_param_set {
747 struct ieee_types_cf_param_set cf_param_set;
748 struct ieee_types_ibss_param_set ibss_param_set;
749} __packed;
750
751struct ieee_types_fh_param_set {
752 u8 element_id;
753 u8 len;
754 __le16 dwell_time;
755 u8 hop_set;
756 u8 hop_pattern;
757 u8 hop_index;
758} __packed;
759
760struct ieee_types_ds_param_set {
761 u8 element_id;
762 u8 len;
763 u8 current_chan;
764} __packed;
765
766union ieee_types_phy_param_set {
767 struct ieee_types_fh_param_set fh_param_set;
768 struct ieee_types_ds_param_set ds_param_set;
769} __packed;
770
771struct host_cmd_ds_802_11_ad_hoc_start {
772 u8 ssid[IEEE80211_MAX_SSID_LEN];
773 u8 bss_mode;
774 __le16 beacon_period;
775 u8 dtim_period;
776 union ieee_types_ss_param_set ss_param_set;
777 union ieee_types_phy_param_set phy_param_set;
778 u16 reserved1;
779 __le16 cap_info_bitmap;
63af6333 780 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
5e6e3a92
BZ
781} __packed;
782
783struct host_cmd_ds_802_11_ad_hoc_result {
784 u8 pad[3];
785 u8 bssid[ETH_ALEN];
786} __packed;
787
788struct adhoc_bss_desc {
789 u8 bssid[ETH_ALEN];
790 u8 ssid[IEEE80211_MAX_SSID_LEN];
791 u8 bss_mode;
792 __le16 beacon_period;
793 u8 dtim_period;
794 u8 time_stamp[8];
795 u8 local_time[8];
796 union ieee_types_phy_param_set phy_param_set;
797 union ieee_types_ss_param_set ss_param_set;
798 __le16 cap_info_bitmap;
799 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
800
801 /*
802 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
803 * It is used in the Adhoc join command and will cause a
804 * binary layout mismatch with the firmware
805 */
806} __packed;
807
808struct host_cmd_ds_802_11_ad_hoc_join {
809 struct adhoc_bss_desc bss_descriptor;
810 u16 reserved1;
811 u16 reserved2;
812} __packed;
813
814struct host_cmd_ds_802_11_get_log {
815 __le32 mcast_tx_frame;
816 __le32 failed;
817 __le32 retry;
818 __le32 multi_retry;
819 __le32 frame_dup;
820 __le32 rts_success;
821 __le32 rts_failure;
822 __le32 ack_failure;
823 __le32 rx_frag;
824 __le32 mcast_rx_frame;
825 __le32 fcs_error;
826 __le32 tx_frame;
827 __le32 reserved;
828 __le32 wep_icv_err_cnt[4];
829};
830
831struct host_cmd_ds_tx_rate_query {
832 u8 tx_rate;
833 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
834 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
835 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
836 u8 ht_info;
837} __packed;
838
839enum Host_Sleep_Action {
840 HS_CONFIGURE = 0x0001,
841 HS_ACTIVATE = 0x0002,
842};
843
844struct mwifiex_hs_config_param {
845 __le32 conditions;
846 u8 gpio;
847 u8 gap;
848} __packed;
849
850struct hs_activate_param {
851 u16 resp_ctrl;
852} __packed;
853
854struct host_cmd_ds_802_11_hs_cfg_enh {
855 __le16 action;
856
857 union {
858 struct mwifiex_hs_config_param hs_config;
859 struct hs_activate_param hs_activate;
860 } params;
861} __packed;
862
863enum SNMP_MIB_INDEX {
864 OP_RATE_SET_I = 1,
865 DTIM_PERIOD_I = 3,
866 RTS_THRESH_I = 5,
867 SHORT_RETRY_LIM_I = 6,
868 LONG_RETRY_LIM_I = 7,
869 FRAG_THRESH_I = 8,
870 DOT11D_I = 9,
871};
872
873#define MAX_SNMP_BUF_SIZE 128
874
875struct host_cmd_ds_802_11_snmp_mib {
876 __le16 query_type;
877 __le16 oid;
878 __le16 buf_size;
879 u8 value[1];
880} __packed;
881
5e6e3a92
BZ
882struct mwifiex_rate_scope {
883 __le16 type;
884 __le16 length;
885 __le16 hr_dsss_rate_bitmap;
886 __le16 ofdm_rate_bitmap;
887 __le16 ht_mcs_rate_bitmap[8];
888} __packed;
889
890struct mwifiex_rate_drop_pattern {
891 __le16 type;
892 __le16 length;
893 __le32 rate_drop_mode;
894} __packed;
895
896struct host_cmd_ds_tx_rate_cfg {
897 __le16 action;
898 __le16 cfg_index;
899} __packed;
900
901struct mwifiex_power_group {
902 u8 modulation_class;
903 u8 first_rate_code;
904 u8 last_rate_code;
905 s8 power_step;
906 s8 power_min;
907 s8 power_max;
908 u8 ht_bandwidth;
909 u8 reserved;
910} __packed;
911
912struct mwifiex_types_power_group {
913 u16 type;
914 u16 length;
915} __packed;
916
917struct host_cmd_ds_txpwr_cfg {
918 __le16 action;
919 __le16 cfg_index;
920 __le32 mode;
921} __packed;
922
caa8984f
AK
923struct host_cmd_ds_rf_tx_pwr {
924 __le16 action;
925 __le16 cur_level;
926 u8 max_power;
927 u8 min_power;
928} __packed;
929
8a279d5b
AK
930struct host_cmd_ds_rf_ant_mimo {
931 __le16 action_tx;
932 __le16 tx_ant_mode;
933 __le16 action_rx;
934 __le16 rx_ant_mode;
935};
936
937struct host_cmd_ds_rf_ant_siso {
938 __le16 action;
939 __le16 ant_mode;
940};
941
7c6fa2a8
AK
942struct mwifiex_bcn_param {
943 u8 bssid[ETH_ALEN];
944 u8 rssi;
b5abcf02 945 __le64 timestamp;
7c6fa2a8
AK
946 __le16 beacon_period;
947 __le16 cap_info_bitmap;
948} __packed;
949
5e6e3a92
BZ
950#define MWIFIEX_USER_SCAN_CHAN_MAX 50
951
952#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
953
954struct mwifiex_scan_cmd_config {
955 /*
a8c48565 956 * BSS mode to be sent in the firmware command
5e6e3a92
BZ
957 */
958 u8 bss_mode;
959
960 /* Specific BSSID used to filter scan results in the firmware */
961 u8 specific_bssid[ETH_ALEN];
962
963 /* Length of TLVs sent in command starting at tlvBuffer */
964 u32 tlv_buf_len;
965
966 /*
967 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
968 *
969 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
970 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
971 */
972 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
973 here */
974} __packed;
975
976struct mwifiex_user_scan_chan {
977 u8 chan_number;
978 u8 radio_type;
979 u8 scan_type;
980 u8 reserved;
981 u32 scan_time;
982} __packed;
983
5e6e3a92 984struct mwifiex_user_scan_cfg {
5e6e3a92
BZ
985 /*
986 * BSS mode to be sent in the firmware command
5e6e3a92
BZ
987 */
988 u8 bss_mode;
989 /* Configure the number of probe requests for active chan scans */
990 u8 num_probes;
991 u8 reserved;
992 /* BSSID filter sent in the firmware command to limit the results */
993 u8 specific_bssid[ETH_ALEN];
be0b281e
AK
994 /* SSID filter list used in the firmware to limit the scan results */
995 struct cfg80211_ssid *ssid_list;
996 u8 num_ssids;
5e6e3a92
BZ
997 /* Variable number (fixed maximum) of channels to scan up */
998 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
999} __packed;
1000
1001struct ie_body {
1002 u8 grp_key_oui[4];
1003 u8 ptk_cnt[2];
1004 u8 ptk_body[4];
1005} __packed;
1006
1007struct host_cmd_ds_802_11_scan {
1008 u8 bss_mode;
1009 u8 bssid[ETH_ALEN];
1010 u8 tlv_buffer[1];
1011} __packed;
1012
1013struct host_cmd_ds_802_11_scan_rsp {
1014 __le16 bss_descript_size;
1015 u8 number_of_sets;
1016 u8 bss_desc_and_tlv_buffer[1];
1017} __packed;
1018
1019struct host_cmd_ds_802_11_bg_scan_query {
1020 u8 flush;
1021} __packed;
1022
1023struct host_cmd_ds_802_11_bg_scan_query_rsp {
1024 u32 report_condition;
1025 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1026} __packed;
1027
1028struct mwifiex_ietypes_domain_param_set {
1029 struct mwifiex_ie_types_header header;
1030 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1031 struct ieee80211_country_ie_triplet triplet[1];
1032} __packed;
1033
1034struct host_cmd_ds_802_11d_domain_info {
1035 __le16 action;
1036 struct mwifiex_ietypes_domain_param_set domain;
1037} __packed;
1038
1039struct host_cmd_ds_802_11d_domain_info_rsp {
1040 __le16 action;
1041 struct mwifiex_ietypes_domain_param_set domain;
1042} __packed;
1043
1044struct host_cmd_ds_11n_addba_req {
1045 u8 add_req_result;
1046 u8 peer_mac_addr[ETH_ALEN];
1047 u8 dialog_token;
1048 __le16 block_ack_param_set;
1049 __le16 block_ack_tmo;
1050 __le16 ssn;
1051} __packed;
1052
1053struct host_cmd_ds_11n_addba_rsp {
1054 u8 add_rsp_result;
1055 u8 peer_mac_addr[ETH_ALEN];
1056 u8 dialog_token;
1057 __le16 status_code;
1058 __le16 block_ack_param_set;
1059 __le16 block_ack_tmo;
1060 __le16 ssn;
1061} __packed;
1062
1063struct host_cmd_ds_11n_delba {
1064 u8 del_result;
1065 u8 peer_mac_addr[ETH_ALEN];
1066 __le16 del_ba_param_set;
1067 __le16 reason_code;
1068 u8 reserved;
1069} __packed;
1070
1071struct host_cmd_ds_11n_batimeout {
1072 u8 tid;
1073 u8 peer_mac_addr[ETH_ALEN];
1074 u8 origninator;
1075} __packed;
1076
1077struct host_cmd_ds_11n_cfg {
1078 __le16 action;
1079 __le16 ht_tx_cap;
1080 __le16 ht_tx_info;
1081} __packed;
1082
1083struct host_cmd_ds_txbuf_cfg {
1084 __le16 action;
1085 __le16 buff_size;
1086 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1087 __le16 reserved3;
1088} __packed;
1089
1090struct host_cmd_ds_amsdu_aggr_ctrl {
1091 __le16 action;
1092 __le16 enable;
1093 __le16 curr_buf_size;
1094} __packed;
1095
1096struct mwifiex_ie_types_wmm_param_set {
1097 struct mwifiex_ie_types_header header;
1098 u8 wmm_ie[1];
1099};
1100
1101struct mwifiex_ie_types_wmm_queue_status {
1102 struct mwifiex_ie_types_header header;
1103 u8 queue_index;
1104 u8 disabled;
1105 u16 medium_time;
1106 u8 flow_required;
1107 u8 flow_created;
1108 u32 reserved;
1109};
1110
1111struct ieee_types_vendor_header {
1112 u8 element_id;
1113 u8 len;
2e4c14a5 1114 u8 oui[4]; /* 0~2: oui, 3: oui_type */
5e6e3a92
BZ
1115 u8 oui_subtype;
1116 u8 version;
1117} __packed;
1118
1119struct ieee_types_wmm_ac_parameters {
1120 u8 aci_aifsn_bitmap;
1121 u8 ecw_bitmap;
1122 __le16 tx_op_limit;
1123} __packed;
1124
1125struct ieee_types_wmm_parameter {
1126 /*
1127 * WMM Parameter IE - Vendor Specific Header:
1128 * element_id [221/0xdd]
1129 * Len [24]
1130 * Oui [00:50:f2]
1131 * OuiType [2]
1132 * OuiSubType [1]
1133 * Version [1]
1134 */
1135 struct ieee_types_vendor_header vend_hdr;
1136 u8 qos_info_bitmap;
1137 u8 reserved;
99fec5de 1138 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
5e6e3a92
BZ
1139} __packed;
1140
1141struct ieee_types_wmm_info {
1142
1143 /*
1144 * WMM Info IE - Vendor Specific Header:
1145 * element_id [221/0xdd]
1146 * Len [7]
1147 * Oui [00:50:f2]
1148 * OuiType [2]
1149 * OuiSubType [0]
1150 * Version [1]
1151 */
1152 struct ieee_types_vendor_header vend_hdr;
1153
1154 u8 qos_info_bitmap;
1155} __packed;
1156
1157struct host_cmd_ds_wmm_get_status {
1158 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
99fec5de 1159 IEEE80211_NUM_ACS];
5e6e3a92
BZ
1160 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1161} __packed;
1162
1163struct mwifiex_wmm_ac_status {
1164 u8 disabled;
1165 u8 flow_required;
1166 u8 flow_created;
1167};
1168
1169struct mwifiex_ie_types_htcap {
1170 struct mwifiex_ie_types_header header;
1171 struct ieee80211_ht_cap ht_cap;
1172} __packed;
1173
1174struct mwifiex_ie_types_htinfo {
1175 struct mwifiex_ie_types_header header;
074d46d1 1176 struct ieee80211_ht_operation ht_oper;
5e6e3a92
BZ
1177} __packed;
1178
1179struct mwifiex_ie_types_2040bssco {
1180 struct mwifiex_ie_types_header header;
1181 u8 bss_co_2040;
1182} __packed;
1183
1184struct mwifiex_ie_types_extcap {
1185 struct mwifiex_ie_types_header header;
1186 u8 ext_cap;
1187} __packed;
1188
1189struct host_cmd_ds_mac_reg_access {
1190 __le16 action;
1191 __le16 offset;
1192 __le32 value;
1193} __packed;
1194
1195struct host_cmd_ds_bbp_reg_access {
1196 __le16 action;
1197 __le16 offset;
1198 u8 value;
1199 u8 reserved[3];
1200} __packed;
1201
1202struct host_cmd_ds_rf_reg_access {
1203 __le16 action;
1204 __le16 offset;
1205 u8 value;
1206 u8 reserved[3];
1207} __packed;
1208
1209struct host_cmd_ds_pmic_reg_access {
1210 __le16 action;
1211 __le16 offset;
1212 u8 value;
1213 u8 reserved[3];
1214} __packed;
1215
1216struct host_cmd_ds_802_11_eeprom_access {
1217 __le16 action;
1218
1219 __le16 offset;
1220 __le16 byte_count;
1221 u8 value;
1222} __packed;
1223
75edd2c6
AP
1224struct host_cmd_tlv {
1225 __le16 type;
1226 __le16 len;
1227} __packed;
1228
e568634a
AP
1229struct mwifiex_assoc_event {
1230 u8 sta_addr[ETH_ALEN];
1231 __le16 type;
1232 __le16 len;
1233 __le16 frame_control;
1234 __le16 cap_info;
1235 __le16 listen_interval;
1236 u8 data[0];
1237} __packed;
1238
4db16a18
AP
1239struct host_cmd_ds_sys_config {
1240 __le16 action;
1241 u8 tlv[0];
1242};
f752dcd5
AP
1243
1244struct host_cmd_tlv_akmp {
1245 struct host_cmd_tlv tlv;
1246 __le16 key_mgmt;
1247 __le16 key_mgmt_operation;
1248} __packed;
1249
1250struct host_cmd_tlv_pwk_cipher {
1251 struct host_cmd_tlv tlv;
1252 __le16 proto;
1253 u8 cipher;
1254 u8 reserved;
1255} __packed;
1256
1257struct host_cmd_tlv_gwk_cipher {
1258 struct host_cmd_tlv tlv;
1259 u8 cipher;
1260 u8 reserved;
1261} __packed;
1262
1263struct host_cmd_tlv_passphrase {
1264 struct host_cmd_tlv tlv;
1265 u8 passphrase[0];
1266} __packed;
1267
96893538
AP
1268struct host_cmd_tlv_wep_key {
1269 struct host_cmd_tlv tlv;
1270 u8 key_index;
1271 u8 is_default;
1272 u8 key[1];
1273};
1274
f752dcd5
AP
1275struct host_cmd_tlv_auth_type {
1276 struct host_cmd_tlv tlv;
1277 u8 auth_type;
1278} __packed;
1279
1280struct host_cmd_tlv_encrypt_protocol {
1281 struct host_cmd_tlv tlv;
1282 __le16 proto;
1283} __packed;
1284
12190c5d
AP
1285struct host_cmd_tlv_ssid {
1286 struct host_cmd_tlv tlv;
1287 u8 ssid[0];
1288} __packed;
1289
a3c2c4f6
AP
1290struct host_cmd_tlv_rates {
1291 struct host_cmd_tlv tlv;
1292 u8 rates[0];
1293} __packed;
1294
605b73af
AP
1295struct host_cmd_tlv_bcast_ssid {
1296 struct host_cmd_tlv tlv;
1297 u8 bcast_ctl;
1298} __packed;
1299
12190c5d
AP
1300struct host_cmd_tlv_beacon_period {
1301 struct host_cmd_tlv tlv;
1302 __le16 period;
1303} __packed;
1304
1305struct host_cmd_tlv_dtim_period {
1306 struct host_cmd_tlv tlv;
1307 u8 period;
1308} __packed;
4db16a18 1309
9b930eae
AP
1310struct host_cmd_tlv_frag_threshold {
1311 struct host_cmd_tlv tlv;
1312 __le16 frag_thr;
1313} __packed;
1314
1315struct host_cmd_tlv_rts_threshold {
1316 struct host_cmd_tlv tlv;
1317 __le16 rts_thr;
1318} __packed;
1319
1320struct host_cmd_tlv_retry_limit {
1321 struct host_cmd_tlv tlv;
1322 u8 limit;
1323} __packed;
1324
75edd2c6
AP
1325struct host_cmd_tlv_mac_addr {
1326 struct host_cmd_tlv tlv;
1327 u8 mac_addr[ETH_ALEN];
1328} __packed;
1329
4db16a18
AP
1330struct host_cmd_tlv_channel_band {
1331 struct host_cmd_tlv tlv;
1332 u8 band_config;
1333 u8 channel;
1334} __packed;
1335
5e6e3a92
BZ
1336struct host_cmd_ds_version_ext {
1337 u8 version_str_sel;
1338 char version_str[128];
1339} __packed;
1340
3cec6870
SP
1341struct host_cmd_ds_mgmt_frame_reg {
1342 __le16 action;
1343 __le32 mask;
1344} __packed;
1345
5e6e3a92
BZ
1346struct host_cmd_ds_802_11_ibss_status {
1347 __le16 action;
1348 __le16 enable;
1349 u8 bssid[ETH_ALEN];
1350 __le16 beacon_interval;
1351 __le16 atim_window;
1352 __le16 use_g_rate_protect;
1353} __packed;
1354
1355#define CONNECTION_TYPE_INFRA 0
1356#define CONNECTION_TYPE_ADHOC 1
1357
1358struct host_cmd_ds_set_bss_mode {
1359 u8 con_type;
1360} __packed;
1361
d930faee
AK
1362struct host_cmd_ds_pcie_details {
1363 /* TX buffer descriptor ring address */
1364 u32 txbd_addr_lo;
1365 u32 txbd_addr_hi;
1366 /* TX buffer descriptor ring count */
1367 u32 txbd_count;
1368
1369 /* RX buffer descriptor ring address */
1370 u32 rxbd_addr_lo;
1371 u32 rxbd_addr_hi;
1372 /* RX buffer descriptor ring count */
1373 u32 rxbd_count;
1374
1375 /* Event buffer descriptor ring address */
1376 u32 evtbd_addr_lo;
1377 u32 evtbd_addr_hi;
1378 /* Event buffer descriptor ring count */
1379 u32 evtbd_count;
1380
1381 /* Sleep cookie buffer physical address */
1382 u32 sleep_cookie_addr_lo;
1383 u32 sleep_cookie_addr_hi;
1384} __packed;
1385
fa444bf8
AK
1386struct mwifiex_ie_types_rssi_threshold {
1387 struct mwifiex_ie_types_header header;
1388 u8 abs_value;
1389 u8 evt_freq;
1390} __packed;
1391
1392struct host_cmd_ds_802_11_subsc_evt {
1393 __le16 action;
1394 __le16 events;
1395} __packed;
1396
ede98bfa
AP
1397struct mwifiex_ie {
1398 __le16 ie_index;
1399 __le16 mgmt_subtype_mask;
1400 __le16 ie_length;
1401 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1402} __packed;
1403
1404#define MAX_MGMT_IE_INDEX 16
1405struct mwifiex_ie_list {
1406 __le16 type;
1407 __le16 len;
1408 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1409} __packed;
1410
5e6e3a92
BZ
1411struct host_cmd_ds_command {
1412 __le16 command;
1413 __le16 size;
1414 __le16 seq_num;
1415 __le16 result;
1416 union {
1417 struct host_cmd_ds_get_hw_spec hw_spec;
1418 struct host_cmd_ds_mac_control mac_ctrl;
1419 struct host_cmd_ds_802_11_mac_address mac_addr;
1420 struct host_cmd_ds_mac_multicast_adr mc_addr;
1421 struct host_cmd_ds_802_11_get_log get_log;
1422 struct host_cmd_ds_802_11_rssi_info rssi_info;
1423 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1424 struct host_cmd_ds_802_11_snmp_mib smib;
5e6e3a92
BZ
1425 struct host_cmd_ds_tx_rate_query tx_rate;
1426 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1427 struct host_cmd_ds_txpwr_cfg txp_cfg;
caa8984f 1428 struct host_cmd_ds_rf_tx_pwr txp;
8a279d5b
AK
1429 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1430 struct host_cmd_ds_rf_ant_siso ant_siso;
5e6e3a92
BZ
1431 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1432 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1433 struct host_cmd_ds_802_11_scan scan;
1434 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1435 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1436 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1437 struct host_cmd_ds_802_11_associate associate;
1438 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1439 struct host_cmd_ds_802_11_deauthenticate deauth;
1440 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1441 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1442 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1443 struct host_cmd_ds_802_11d_domain_info domain_info;
1444 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1445 struct host_cmd_ds_11n_addba_req add_ba_req;
1446 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1447 struct host_cmd_ds_11n_delba del_ba;
1448 struct host_cmd_ds_txbuf_cfg tx_buf;
1449 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1450 struct host_cmd_ds_11n_cfg htcfg;
1451 struct host_cmd_ds_wmm_get_status get_wmm_status;
1452 struct host_cmd_ds_802_11_key_material key_material;
1453 struct host_cmd_ds_version_ext verext;
3cec6870 1454 struct host_cmd_ds_mgmt_frame_reg reg_mask;
5e6e3a92
BZ
1455 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1456 struct host_cmd_ds_mac_reg_access mac_reg;
1457 struct host_cmd_ds_bbp_reg_access bbp_reg;
1458 struct host_cmd_ds_rf_reg_access rf_reg;
1459 struct host_cmd_ds_pmic_reg_access pmic_reg;
1460 struct host_cmd_ds_set_bss_mode bss_mode;
d930faee 1461 struct host_cmd_ds_pcie_details pcie_host_spec;
5e6e3a92 1462 struct host_cmd_ds_802_11_eeprom_access eeprom;
fa444bf8 1463 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
4db16a18 1464 struct host_cmd_ds_sys_config uap_sys_config;
5e6e3a92
BZ
1465 } params;
1466} __packed;
1467
1468struct mwifiex_opt_sleep_confirm {
1469 __le16 command;
1470 __le16 size;
1471 __le16 seq_num;
1472 __le16 result;
1473 __le16 action;
2b06bdbe 1474 __le16 resp_ctrl;
5e6e3a92 1475} __packed;
5e6e3a92 1476#endif /* !_MWIFIEX_FW_H_ */