blob: 1c1274d8d78957fa88c05f5bd4716e71a1ba5a13 [file] [log] [blame]
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001/*
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
Bing Zhao5e6e3a92011-03-21 18:00:50 -070060#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,
68};
Yogesh Ashok Powar6a35a0a2011-04-06 16:46:56 -070069#define KEY_MCAST BIT(0)
70#define KEY_UNICAST BIT(1)
71#define KEY_ENABLED BIT(2)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070072
73#define WAPI_KEY_LEN 50
74
Bing Zhao5e6e3a92011-03-21 18:00:50 -070075#define MAX_POLL_TRIES 100
76
77#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
78
79#define MAX_FIRMWARE_POLL_TRIES 100
80
Amitkumar Karward930fae2011-10-11 17:41:21 -070081#define FIRMWARE_READY_SDIO 0xfedc
82#define FIRMWARE_READY_PCIE 0xfedcba00
Bing Zhao5e6e3a92011-03-21 18:00:50 -070083
Amitkumar Karwar4daffe32012-04-18 20:08:28 -070084enum mwifiex_usb_ep {
85 MWIFIEX_USB_EP_CMD_EVENT = 1,
86 MWIFIEX_USB_EP_DATA = 2,
87};
88
Bing Zhao5e6e3a92011-03-21 18:00:50 -070089enum MWIFIEX_802_11_PRIVACY_FILTER {
90 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
91 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
92};
93
Bing Zhao5e6e3a92011-03-21 18:00:50 -070094#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
95
Avinash Patile76268d2012-05-08 18:30:27 -070096#define UAP_BSS_PARAMS_I 0
Avinash Patilede98bf2012-05-08 18:30:28 -070097#define UAP_CUSTOM_IE_I 1
98#define MWIFIEX_AUTO_IDX_MASK 0xffff
99#define MWIFIEX_DELETE_MASK 0x0000
Avinash Patilf31acab2012-05-08 18:30:29 -0700100#define MGMT_MASK_ASSOC_REQ 0x01
101#define MGMT_MASK_REASSOC_REQ 0x04
102#define MGMT_MASK_ASSOC_RESP 0x02
103#define MGMT_MASK_REASSOC_RESP 0x08
104#define MGMT_MASK_PROBE_REQ 0x10
105#define MGMT_MASK_PROBE_RESP 0x20
106#define MGMT_MASK_BEACON 0x100
Avinash Patile76268d2012-05-08 18:30:27 -0700107
Avinash Patil12190c52012-05-08 18:30:24 -0700108#define TLV_TYPE_UAP_SSID 0x0000
109
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700110#define PROPRIETARY_TLV_BASE_ID 0x0100
111#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
112#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
113#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700114#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700115#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700116#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
117#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
118#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700119#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700120#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700121#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700122#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700123#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
124#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil605b73a2012-05-16 21:24:55 -0700125#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700126#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
Avinash Patil96893532012-06-15 12:21:55 -0700127#define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700128#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
129#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
130#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700131#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700132#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
133#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
134#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700135#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700136#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700137#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700138#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700139#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
140#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700141#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
142#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700143
144#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
145
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700146#define SSN_MASK 0xfff0
147
148#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700149#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700150
151#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
152
153#define BA_STREAM_NOT_ALLOWED 0xff
154
155#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700156 priv->adapter->config_bands & BAND_AN) && \
157 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700158#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
159 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
160
161#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
162#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700163
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700164#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700165
Avinash Patil22281252012-06-15 12:21:53 -0700166#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
167 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
168 IEEE80211_HT_CAP_SM_PS)
169
170#define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
171
Marc Yang6d2bd912011-03-25 19:47:02 -0700172/* dev_cap bitmap
173 * BIT
174 * 0-16 reserved
175 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
176 * 18-22 reserved
177 * 23 IEEE80211_HT_CAP_SGI_20
178 * 24 IEEE80211_HT_CAP_SGI_40
179 * 25 IEEE80211_HT_CAP_TX_STBC
180 * 26 IEEE80211_HT_CAP_RX_STBC
181 * 27-28 reserved
182 * 29 IEEE80211_HT_CAP_GRN_FLD
183 * 30-31 reserved
184 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700185#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700186#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
187#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
188#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
189#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
190#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
191
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700192/* httxcfg bitmap
193 * 0 reserved
194 * 1 20/40 Mhz enable(1)/disable(0)
195 * 2-3 reserved
196 * 4 green field enable(1)/disable(0)
197 * 5 short GI in 20 Mhz enable(1)/disable(0)
198 * 6 short GI in 40 Mhz enable(1)/disable(0)
199 * 7-15 reserved
200 */
201#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
202
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700203#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700204#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800205#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700206
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700207#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
208
209#define LLC_SNAP_LEN 8
210
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700211#define MOD_CLASS_HR_DSSS 0x03
212#define MOD_CLASS_OFDM 0x07
213#define MOD_CLASS_HT 0x08
214#define HT_BW_20 0
215#define HT_BW_40 1
216
217#define HostCmd_CMD_GET_HW_SPEC 0x0003
218#define HostCmd_CMD_802_11_SCAN 0x0006
219#define HostCmd_CMD_802_11_GET_LOG 0x000b
220#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
221#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
222#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
223#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
224#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
225#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
226#define HostCmd_CMD_RF_REG_ACCESS 0x001b
227#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700228#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700229#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700230#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
231#define HostCmd_CMD_MAC_CONTROL 0x0028
232#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
233#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
234#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
235#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
236#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
237#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
238#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
239#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700240#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700241#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
242#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
243#define HostCmd_CMD_VERSION_EXT 0x0097
244#define HostCmd_CMD_RSSI_INFO 0x00a4
245#define HostCmd_CMD_FUNC_INIT 0x00a9
246#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700247#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
248#define HostCmd_CMD_UAP_BSS_START 0x00b1
249#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700250#define HostCmd_CMD_11N_CFG 0x00cd
251#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
252#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
253#define HostCmd_CMD_11N_DELBA 0x00d0
254#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
255#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
256#define HostCmd_CMD_TXPWR_CFG 0x00d1
257#define HostCmd_CMD_TX_RATE_CFG 0x00d6
258#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
259#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
260#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
261#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700262#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700263
Avinash Patilf752dcd2012-05-08 18:30:26 -0700264#define PROTOCOL_NO_SECURITY 0x01
265#define PROTOCOL_STATIC_WEP 0x02
266#define PROTOCOL_WPA 0x08
267#define PROTOCOL_WPA2 0x20
268#define PROTOCOL_WPA2_MIXED 0x28
269#define PROTOCOL_EAP 0x40
270#define KEY_MGMT_NONE 0x04
271#define KEY_MGMT_PSK 0x02
272#define KEY_MGMT_EAP 0x01
273#define CIPHER_TKIP 0x04
274#define CIPHER_AES_CCMP 0x08
275#define VALID_CIPHER_BITMAP 0x0c
276
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700277enum ENH_PS_MODES {
278 EN_PS = 1,
279 DIS_PS = 2,
280 EN_AUTO_DS = 3,
281 DIS_AUTO_DS = 4,
282 SLEEP_CONFIRM = 5,
283 GET_PS = 0,
284 EN_AUTO_PS = 0xff,
285 DIS_AUTO_PS = 0xfe,
286};
287
288#define HostCmd_RET_BIT 0x8000
289#define HostCmd_ACT_GEN_GET 0x0000
290#define HostCmd_ACT_GEN_SET 0x0001
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700291#define HostCmd_ACT_BITWISE_SET 0x0002
292#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700293#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700294
295#define HostCmd_ACT_MAC_RX_ON 0x0001
296#define HostCmd_ACT_MAC_TX_ON 0x0002
297#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
298#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
299#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
300#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700301#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
302
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700303#define HostCmd_BSS_MODE_IBSS 0x0002
304#define HostCmd_BSS_MODE_ANY 0x0003
305
306#define HostCmd_SCAN_RADIO_TYPE_BG 0
307#define HostCmd_SCAN_RADIO_TYPE_A 1
308
309#define HOST_SLEEP_CFG_CANCEL 0xffffffff
310#define HOST_SLEEP_CFG_COND_DEF 0x0000000f
311#define HOST_SLEEP_CFG_GPIO_DEF 0xff
312#define HOST_SLEEP_CFG_GAP_DEF 0
313
314#define CMD_F_HOSTCMD (1 << 0)
315#define CMD_F_CANCELED (1 << 1)
316
317#define HostCmd_CMD_ID_MASK 0x0fff
318
319#define HostCmd_SEQ_NUM_MASK 0x00ff
320
321#define HostCmd_BSS_NUM_MASK 0x0f00
322
323#define HostCmd_BSS_TYPE_MASK 0xf000
324
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700325#define HostCmd_ACT_SET_RX 0x0001
326#define HostCmd_ACT_SET_TX 0x0002
327#define HostCmd_ACT_SET_BOTH 0x0003
328
329#define RF_ANTENNA_AUTO 0xFFFF
330
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700331#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
332 (((seq) & 0x00ff) | \
333 (((num) & 0x000f) << 8)) | \
334 (((type) & 0x000f) << 12); }
335
336#define HostCmd_GET_SEQ_NO(seq) \
337 ((seq) & HostCmd_SEQ_NUM_MASK)
338
339#define HostCmd_GET_BSS_NO(seq) \
340 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
341
342#define HostCmd_GET_BSS_TYPE(seq) \
343 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
344
345#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
346#define EVENT_LINK_LOST 0x00000003
347#define EVENT_LINK_SENSED 0x00000004
348#define EVENT_MIB_CHANGED 0x00000006
349#define EVENT_INIT_DONE 0x00000007
350#define EVENT_DEAUTHENTICATED 0x00000008
351#define EVENT_DISASSOCIATED 0x00000009
352#define EVENT_PS_AWAKE 0x0000000a
353#define EVENT_PS_SLEEP 0x0000000b
354#define EVENT_MIC_ERR_MULTICAST 0x0000000d
355#define EVENT_MIC_ERR_UNICAST 0x0000000e
356#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
357#define EVENT_ADHOC_BCN_LOST 0x00000011
358
359#define EVENT_WMM_STATUS_CHANGE 0x00000017
360#define EVENT_BG_SCAN_REPORT 0x00000018
361#define EVENT_RSSI_LOW 0x00000019
362#define EVENT_SNR_LOW 0x0000001a
363#define EVENT_MAX_FAIL 0x0000001b
364#define EVENT_RSSI_HIGH 0x0000001c
365#define EVENT_SNR_HIGH 0x0000001d
366#define EVENT_IBSS_COALESCED 0x0000001e
367#define EVENT_DATA_RSSI_LOW 0x00000024
368#define EVENT_DATA_SNR_LOW 0x00000025
369#define EVENT_DATA_RSSI_HIGH 0x00000026
370#define EVENT_DATA_SNR_HIGH 0x00000027
371#define EVENT_LINK_QUALITY 0x00000028
372#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700373#define EVENT_UAP_STA_DEAUTH 0x0000002c
374#define EVENT_UAP_STA_ASSOC 0x0000002d
375#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700376#define EVENT_PRE_BEACON_LOST 0x00000031
377#define EVENT_ADDBA 0x00000033
378#define EVENT_DELBA 0x00000034
379#define EVENT_BA_STREAM_TIEMOUT 0x00000037
380#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700381#define EVENT_UAP_BSS_IDLE 0x00000043
382#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700383#define EVENT_WEP_ICV_ERR 0x00000046
384#define EVENT_HS_ACT_REQ 0x00000047
385#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700386#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700387#define EVENT_HOSTWAKE_STAIE 0x0000004d
388
389#define EVENT_ID_MASK 0xffff
390#define BSS_NUM_MASK 0xf
391
392#define EVENT_GET_BSS_NUM(event_cause) \
393 (((event_cause) >> 16) & BSS_NUM_MASK)
394
395#define EVENT_GET_BSS_TYPE(event_cause) \
396 (((event_cause) >> 24) & 0x00ff)
397
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700398struct mwifiex_ie_types_header {
399 __le16 type;
400 __le16 len;
401} __packed;
402
403struct mwifiex_ie_types_data {
404 struct mwifiex_ie_types_header header;
405 u8 data[1];
406} __packed;
407
408#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
409#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
410
411struct txpd {
412 u8 bss_type;
413 u8 bss_num;
414 __le16 tx_pkt_length;
415 __le16 tx_pkt_offset;
416 __le16 tx_pkt_type;
417 __le32 tx_control;
418 u8 priority;
419 u8 flags;
420 u8 pkt_delay_2ms;
421 u8 reserved1;
422} __packed;
423
424struct rxpd {
425 u8 bss_type;
426 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700427 __le16 rx_pkt_length;
428 __le16 rx_pkt_offset;
429 __le16 rx_pkt_type;
430 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700431 u8 priority;
432 u8 rx_rate;
433 s8 snr;
434 s8 nf;
435 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
436 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
437 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
438 u8 ht_info;
439 u8 reserved;
440} __packed;
441
Avinash Patil838e4f42012-08-03 18:06:08 -0700442struct uap_txpd {
443 u8 bss_type;
444 u8 bss_num;
445 __le16 tx_pkt_length;
446 __le16 tx_pkt_offset;
447 __le16 tx_pkt_type;
448 __le32 tx_control;
449 u8 priority;
450 u8 flags;
451 u8 pkt_delay_2ms;
452 u8 reserved1;
453 __le32 reserved2;
454};
455
456struct uap_rxpd {
457 u8 bss_type;
458 u8 bss_num;
459 __le16 rx_pkt_length;
460 __le16 rx_pkt_offset;
461 __le16 rx_pkt_type;
462 __le16 seq_num;
463 u8 priority;
464 u8 reserved1;
465};
466
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700467enum mwifiex_chan_scan_mode_bitmasks {
468 MWIFIEX_PASSIVE_SCAN = BIT(0),
469 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
470};
471
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700472struct mwifiex_chan_scan_param_set {
473 u8 radio_type;
474 u8 chan_number;
475 u8 chan_scan_mode_bitmap;
476 __le16 min_scan_time;
477 __le16 max_scan_time;
478} __packed;
479
480struct mwifiex_ie_types_chan_list_param_set {
481 struct mwifiex_ie_types_header header;
482 struct mwifiex_chan_scan_param_set chan_scan_param[1];
483} __packed;
484
485struct chan_band_param_set {
486 u8 radio_type;
487 u8 chan_number;
488};
489
490struct mwifiex_ie_types_chan_band_list_param_set {
491 struct mwifiex_ie_types_header header;
492 struct chan_band_param_set chan_band_param[1];
493} __packed;
494
495struct mwifiex_ie_types_rates_param_set {
496 struct mwifiex_ie_types_header header;
497 u8 rates[1];
498} __packed;
499
500struct mwifiex_ie_types_ssid_param_set {
501 struct mwifiex_ie_types_header header;
502 u8 ssid[1];
503} __packed;
504
505struct mwifiex_ie_types_num_probes {
506 struct mwifiex_ie_types_header header;
507 __le16 num_probes;
508} __packed;
509
510struct mwifiex_ie_types_wildcard_ssid_params {
511 struct mwifiex_ie_types_header header;
512 u8 max_ssid_length;
513 u8 ssid[1];
514} __packed;
515
516#define TSF_DATA_SIZE 8
517struct mwifiex_ie_types_tsf_timestamp {
518 struct mwifiex_ie_types_header header;
519 u8 tsf_data[1];
520} __packed;
521
522struct mwifiex_cf_param_set {
523 u8 cfp_cnt;
524 u8 cfp_period;
525 u16 cfp_max_duration;
526 u16 cfp_duration_remaining;
527} __packed;
528
529struct mwifiex_ibss_param_set {
530 u16 atim_window;
531} __packed;
532
533struct mwifiex_ie_types_ss_param_set {
534 struct mwifiex_ie_types_header header;
535 union {
536 struct mwifiex_cf_param_set cf_param_set[1];
537 struct mwifiex_ibss_param_set ibss_param_set[1];
538 } cf_ibss;
539} __packed;
540
541struct mwifiex_fh_param_set {
542 u16 dwell_time;
543 u8 hop_set;
544 u8 hop_pattern;
545 u8 hop_index;
546} __packed;
547
548struct mwifiex_ds_param_set {
549 u8 current_chan;
550} __packed;
551
552struct mwifiex_ie_types_phy_param_set {
553 struct mwifiex_ie_types_header header;
554 union {
555 struct mwifiex_fh_param_set fh_param_set[1];
556 struct mwifiex_ds_param_set ds_param_set[1];
557 } fh_ds;
558} __packed;
559
560struct mwifiex_ie_types_auth_type {
561 struct mwifiex_ie_types_header header;
562 __le16 auth_type;
563} __packed;
564
565struct mwifiex_ie_types_vendor_param_set {
566 struct mwifiex_ie_types_header header;
567 u8 ie[MWIFIEX_MAX_VSIE_LEN];
568};
569
570struct mwifiex_ie_types_rsn_param_set {
571 struct mwifiex_ie_types_header header;
572 u8 rsn_ie[1];
573} __packed;
574
575#define KEYPARAMSET_FIXED_LEN 6
576
577struct mwifiex_ie_type_key_param_set {
578 __le16 type;
579 __le16 length;
580 __le16 key_type_id;
581 __le16 key_info;
582 __le16 key_len;
583 u8 key[50];
584} __packed;
585
586struct host_cmd_ds_802_11_key_material {
587 __le16 action;
588 struct mwifiex_ie_type_key_param_set key_param_set;
589} __packed;
590
591struct host_cmd_ds_gen {
592 u16 command;
593 u16 size;
594 u16 seq_num;
595 u16 result;
596};
597
598#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
599
600enum sleep_resp_ctrl {
601 RESP_NOT_NEEDED = 0,
602 RESP_NEEDED,
603};
604
605struct mwifiex_ps_param {
606 __le16 null_pkt_interval;
607 __le16 multiple_dtims;
608 __le16 bcn_miss_timeout;
609 __le16 local_listen_interval;
610 __le16 adhoc_wake_period;
611 __le16 mode;
612 __le16 delay_to_ps;
613};
614
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700615#define BITMAP_AUTO_DS 0x01
616#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700617
618struct mwifiex_ie_types_auto_ds_param {
619 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700620 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700621} __packed;
622
623struct mwifiex_ie_types_ps_param {
624 struct mwifiex_ie_types_header header;
625 struct mwifiex_ps_param param;
626} __packed;
627
628struct host_cmd_ds_802_11_ps_mode_enh {
629 __le16 action;
630
631 union {
632 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700633 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700634 } params;
635} __packed;
636
637struct host_cmd_ds_get_hw_spec {
638 __le16 hw_if_version;
639 __le16 version;
640 __le16 reserved;
641 __le16 num_of_mcast_adr;
642 u8 permanent_addr[ETH_ALEN];
643 __le16 region_code;
644 __le16 number_of_antenna;
645 __le32 fw_release_number;
646 __le32 reserved_1;
647 __le32 reserved_2;
648 __le32 reserved_3;
649 __le32 fw_cap_info;
650 __le32 dot_11n_dev_cap;
651 u8 dev_mcs_support;
652 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
653 __le16 reserved_4;
654} __packed;
655
656struct host_cmd_ds_802_11_rssi_info {
657 __le16 action;
658 __le16 ndata;
659 __le16 nbcn;
660 __le16 reserved[9];
661 long long reserved_1;
662};
663
664struct host_cmd_ds_802_11_rssi_info_rsp {
665 __le16 action;
666 __le16 ndata;
667 __le16 nbcn;
668 __le16 data_rssi_last;
669 __le16 data_nf_last;
670 __le16 data_rssi_avg;
671 __le16 data_nf_avg;
672 __le16 bcn_rssi_last;
673 __le16 bcn_nf_last;
674 __le16 bcn_rssi_avg;
675 __le16 bcn_nf_avg;
676 long long tsf_bcn;
677};
678
679struct host_cmd_ds_802_11_mac_address {
680 __le16 action;
681 u8 mac_addr[ETH_ALEN];
682};
683
684struct host_cmd_ds_mac_control {
685 __le16 action;
686 __le16 reserved;
687};
688
689struct host_cmd_ds_mac_multicast_adr {
690 __le16 action;
691 __le16 num_of_adrs;
692 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
693} __packed;
694
695struct host_cmd_ds_802_11_deauthenticate {
696 u8 mac_addr[ETH_ALEN];
697 __le16 reason_code;
698} __packed;
699
700struct host_cmd_ds_802_11_associate {
701 u8 peer_sta_addr[ETH_ALEN];
702 __le16 cap_info_bitmap;
703 __le16 listen_interval;
704 __le16 beacon_period;
705 u8 dtim_period;
706} __packed;
707
708struct ieee_types_assoc_rsp {
709 __le16 cap_info_bitmap;
710 __le16 status_code;
711 __le16 a_id;
712 u8 ie_buffer[1];
713} __packed;
714
715struct host_cmd_ds_802_11_associate_rsp {
716 struct ieee_types_assoc_rsp assoc_rsp;
717} __packed;
718
719struct ieee_types_cf_param_set {
720 u8 element_id;
721 u8 len;
722 u8 cfp_cnt;
723 u8 cfp_period;
724 u16 cfp_max_duration;
725 u16 cfp_duration_remaining;
726} __packed;
727
728struct ieee_types_ibss_param_set {
729 u8 element_id;
730 u8 len;
731 __le16 atim_window;
732} __packed;
733
734union ieee_types_ss_param_set {
735 struct ieee_types_cf_param_set cf_param_set;
736 struct ieee_types_ibss_param_set ibss_param_set;
737} __packed;
738
739struct ieee_types_fh_param_set {
740 u8 element_id;
741 u8 len;
742 __le16 dwell_time;
743 u8 hop_set;
744 u8 hop_pattern;
745 u8 hop_index;
746} __packed;
747
748struct ieee_types_ds_param_set {
749 u8 element_id;
750 u8 len;
751 u8 current_chan;
752} __packed;
753
754union ieee_types_phy_param_set {
755 struct ieee_types_fh_param_set fh_param_set;
756 struct ieee_types_ds_param_set ds_param_set;
757} __packed;
758
759struct host_cmd_ds_802_11_ad_hoc_start {
760 u8 ssid[IEEE80211_MAX_SSID_LEN];
761 u8 bss_mode;
762 __le16 beacon_period;
763 u8 dtim_period;
764 union ieee_types_ss_param_set ss_param_set;
765 union ieee_types_phy_param_set phy_param_set;
766 u16 reserved1;
767 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800768 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700769} __packed;
770
771struct host_cmd_ds_802_11_ad_hoc_result {
772 u8 pad[3];
773 u8 bssid[ETH_ALEN];
774} __packed;
775
776struct adhoc_bss_desc {
777 u8 bssid[ETH_ALEN];
778 u8 ssid[IEEE80211_MAX_SSID_LEN];
779 u8 bss_mode;
780 __le16 beacon_period;
781 u8 dtim_period;
782 u8 time_stamp[8];
783 u8 local_time[8];
784 union ieee_types_phy_param_set phy_param_set;
785 union ieee_types_ss_param_set ss_param_set;
786 __le16 cap_info_bitmap;
787 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
788
789 /*
790 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
791 * It is used in the Adhoc join command and will cause a
792 * binary layout mismatch with the firmware
793 */
794} __packed;
795
796struct host_cmd_ds_802_11_ad_hoc_join {
797 struct adhoc_bss_desc bss_descriptor;
798 u16 reserved1;
799 u16 reserved2;
800} __packed;
801
802struct host_cmd_ds_802_11_get_log {
803 __le32 mcast_tx_frame;
804 __le32 failed;
805 __le32 retry;
806 __le32 multi_retry;
807 __le32 frame_dup;
808 __le32 rts_success;
809 __le32 rts_failure;
810 __le32 ack_failure;
811 __le32 rx_frag;
812 __le32 mcast_rx_frame;
813 __le32 fcs_error;
814 __le32 tx_frame;
815 __le32 reserved;
816 __le32 wep_icv_err_cnt[4];
817};
818
819struct host_cmd_ds_tx_rate_query {
820 u8 tx_rate;
821 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
822 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
823 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
824 u8 ht_info;
825} __packed;
826
827enum Host_Sleep_Action {
828 HS_CONFIGURE = 0x0001,
829 HS_ACTIVATE = 0x0002,
830};
831
832struct mwifiex_hs_config_param {
833 __le32 conditions;
834 u8 gpio;
835 u8 gap;
836} __packed;
837
838struct hs_activate_param {
839 u16 resp_ctrl;
840} __packed;
841
842struct host_cmd_ds_802_11_hs_cfg_enh {
843 __le16 action;
844
845 union {
846 struct mwifiex_hs_config_param hs_config;
847 struct hs_activate_param hs_activate;
848 } params;
849} __packed;
850
851enum SNMP_MIB_INDEX {
852 OP_RATE_SET_I = 1,
853 DTIM_PERIOD_I = 3,
854 RTS_THRESH_I = 5,
855 SHORT_RETRY_LIM_I = 6,
856 LONG_RETRY_LIM_I = 7,
857 FRAG_THRESH_I = 8,
858 DOT11D_I = 9,
859};
860
861#define MAX_SNMP_BUF_SIZE 128
862
863struct host_cmd_ds_802_11_snmp_mib {
864 __le16 query_type;
865 __le16 oid;
866 __le16 buf_size;
867 u8 value[1];
868} __packed;
869
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700870struct mwifiex_rate_scope {
871 __le16 type;
872 __le16 length;
873 __le16 hr_dsss_rate_bitmap;
874 __le16 ofdm_rate_bitmap;
875 __le16 ht_mcs_rate_bitmap[8];
876} __packed;
877
878struct mwifiex_rate_drop_pattern {
879 __le16 type;
880 __le16 length;
881 __le32 rate_drop_mode;
882} __packed;
883
884struct host_cmd_ds_tx_rate_cfg {
885 __le16 action;
886 __le16 cfg_index;
887} __packed;
888
889struct mwifiex_power_group {
890 u8 modulation_class;
891 u8 first_rate_code;
892 u8 last_rate_code;
893 s8 power_step;
894 s8 power_min;
895 s8 power_max;
896 u8 ht_bandwidth;
897 u8 reserved;
898} __packed;
899
900struct mwifiex_types_power_group {
901 u16 type;
902 u16 length;
903} __packed;
904
905struct host_cmd_ds_txpwr_cfg {
906 __le16 action;
907 __le16 cfg_index;
908 __le32 mode;
909} __packed;
910
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700911struct host_cmd_ds_rf_tx_pwr {
912 __le16 action;
913 __le16 cur_level;
914 u8 max_power;
915 u8 min_power;
916} __packed;
917
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700918struct host_cmd_ds_rf_ant_mimo {
919 __le16 action_tx;
920 __le16 tx_ant_mode;
921 __le16 action_rx;
922 __le16 rx_ant_mode;
923};
924
925struct host_cmd_ds_rf_ant_siso {
926 __le16 action;
927 __le16 ant_mode;
928};
929
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700930struct mwifiex_bcn_param {
931 u8 bssid[ETH_ALEN];
932 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700933 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700934 __le16 beacon_period;
935 __le16 cap_info_bitmap;
936} __packed;
937
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700938#define MWIFIEX_USER_SCAN_CHAN_MAX 50
939
940#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
941
942struct mwifiex_scan_cmd_config {
943 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700944 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700945 */
946 u8 bss_mode;
947
948 /* Specific BSSID used to filter scan results in the firmware */
949 u8 specific_bssid[ETH_ALEN];
950
951 /* Length of TLVs sent in command starting at tlvBuffer */
952 u32 tlv_buf_len;
953
954 /*
955 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
956 *
957 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
958 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
959 */
960 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
961 here */
962} __packed;
963
964struct mwifiex_user_scan_chan {
965 u8 chan_number;
966 u8 radio_type;
967 u8 scan_type;
968 u8 reserved;
969 u32 scan_time;
970} __packed;
971
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700972struct mwifiex_user_scan_cfg {
973 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700974 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700975 */
976 u8 bss_mode;
977 /* Configure the number of probe requests for active chan scans */
978 u8 num_probes;
979 u8 reserved;
980 /* BSSID filter sent in the firmware command to limit the results */
981 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -0800982 /* SSID filter list used in the firmware to limit the scan results */
983 struct cfg80211_ssid *ssid_list;
984 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700985 /* Variable number (fixed maximum) of channels to scan up */
986 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
987} __packed;
988
989struct ie_body {
990 u8 grp_key_oui[4];
991 u8 ptk_cnt[2];
992 u8 ptk_body[4];
993} __packed;
994
995struct host_cmd_ds_802_11_scan {
996 u8 bss_mode;
997 u8 bssid[ETH_ALEN];
998 u8 tlv_buffer[1];
999} __packed;
1000
1001struct host_cmd_ds_802_11_scan_rsp {
1002 __le16 bss_descript_size;
1003 u8 number_of_sets;
1004 u8 bss_desc_and_tlv_buffer[1];
1005} __packed;
1006
1007struct host_cmd_ds_802_11_bg_scan_query {
1008 u8 flush;
1009} __packed;
1010
1011struct host_cmd_ds_802_11_bg_scan_query_rsp {
1012 u32 report_condition;
1013 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1014} __packed;
1015
1016struct mwifiex_ietypes_domain_param_set {
1017 struct mwifiex_ie_types_header header;
1018 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1019 struct ieee80211_country_ie_triplet triplet[1];
1020} __packed;
1021
1022struct host_cmd_ds_802_11d_domain_info {
1023 __le16 action;
1024 struct mwifiex_ietypes_domain_param_set domain;
1025} __packed;
1026
1027struct host_cmd_ds_802_11d_domain_info_rsp {
1028 __le16 action;
1029 struct mwifiex_ietypes_domain_param_set domain;
1030} __packed;
1031
1032struct host_cmd_ds_11n_addba_req {
1033 u8 add_req_result;
1034 u8 peer_mac_addr[ETH_ALEN];
1035 u8 dialog_token;
1036 __le16 block_ack_param_set;
1037 __le16 block_ack_tmo;
1038 __le16 ssn;
1039} __packed;
1040
1041struct host_cmd_ds_11n_addba_rsp {
1042 u8 add_rsp_result;
1043 u8 peer_mac_addr[ETH_ALEN];
1044 u8 dialog_token;
1045 __le16 status_code;
1046 __le16 block_ack_param_set;
1047 __le16 block_ack_tmo;
1048 __le16 ssn;
1049} __packed;
1050
1051struct host_cmd_ds_11n_delba {
1052 u8 del_result;
1053 u8 peer_mac_addr[ETH_ALEN];
1054 __le16 del_ba_param_set;
1055 __le16 reason_code;
1056 u8 reserved;
1057} __packed;
1058
1059struct host_cmd_ds_11n_batimeout {
1060 u8 tid;
1061 u8 peer_mac_addr[ETH_ALEN];
1062 u8 origninator;
1063} __packed;
1064
1065struct host_cmd_ds_11n_cfg {
1066 __le16 action;
1067 __le16 ht_tx_cap;
1068 __le16 ht_tx_info;
1069} __packed;
1070
1071struct host_cmd_ds_txbuf_cfg {
1072 __le16 action;
1073 __le16 buff_size;
1074 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1075 __le16 reserved3;
1076} __packed;
1077
1078struct host_cmd_ds_amsdu_aggr_ctrl {
1079 __le16 action;
1080 __le16 enable;
1081 __le16 curr_buf_size;
1082} __packed;
1083
1084struct mwifiex_ie_types_wmm_param_set {
1085 struct mwifiex_ie_types_header header;
1086 u8 wmm_ie[1];
1087};
1088
1089struct mwifiex_ie_types_wmm_queue_status {
1090 struct mwifiex_ie_types_header header;
1091 u8 queue_index;
1092 u8 disabled;
1093 u16 medium_time;
1094 u8 flow_required;
1095 u8 flow_created;
1096 u32 reserved;
1097};
1098
1099struct ieee_types_vendor_header {
1100 u8 element_id;
1101 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001102 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001103 u8 oui_subtype;
1104 u8 version;
1105} __packed;
1106
1107struct ieee_types_wmm_ac_parameters {
1108 u8 aci_aifsn_bitmap;
1109 u8 ecw_bitmap;
1110 __le16 tx_op_limit;
1111} __packed;
1112
1113struct ieee_types_wmm_parameter {
1114 /*
1115 * WMM Parameter IE - Vendor Specific Header:
1116 * element_id [221/0xdd]
1117 * Len [24]
1118 * Oui [00:50:f2]
1119 * OuiType [2]
1120 * OuiSubType [1]
1121 * Version [1]
1122 */
1123 struct ieee_types_vendor_header vend_hdr;
1124 u8 qos_info_bitmap;
1125 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001126 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001127} __packed;
1128
1129struct ieee_types_wmm_info {
1130
1131 /*
1132 * WMM Info IE - Vendor Specific Header:
1133 * element_id [221/0xdd]
1134 * Len [7]
1135 * Oui [00:50:f2]
1136 * OuiType [2]
1137 * OuiSubType [0]
1138 * Version [1]
1139 */
1140 struct ieee_types_vendor_header vend_hdr;
1141
1142 u8 qos_info_bitmap;
1143} __packed;
1144
1145struct host_cmd_ds_wmm_get_status {
1146 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001147 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001148 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1149} __packed;
1150
1151struct mwifiex_wmm_ac_status {
1152 u8 disabled;
1153 u8 flow_required;
1154 u8 flow_created;
1155};
1156
1157struct mwifiex_ie_types_htcap {
1158 struct mwifiex_ie_types_header header;
1159 struct ieee80211_ht_cap ht_cap;
1160} __packed;
1161
1162struct mwifiex_ie_types_htinfo {
1163 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001164 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001165} __packed;
1166
1167struct mwifiex_ie_types_2040bssco {
1168 struct mwifiex_ie_types_header header;
1169 u8 bss_co_2040;
1170} __packed;
1171
1172struct mwifiex_ie_types_extcap {
1173 struct mwifiex_ie_types_header header;
1174 u8 ext_cap;
1175} __packed;
1176
1177struct host_cmd_ds_mac_reg_access {
1178 __le16 action;
1179 __le16 offset;
1180 __le32 value;
1181} __packed;
1182
1183struct host_cmd_ds_bbp_reg_access {
1184 __le16 action;
1185 __le16 offset;
1186 u8 value;
1187 u8 reserved[3];
1188} __packed;
1189
1190struct host_cmd_ds_rf_reg_access {
1191 __le16 action;
1192 __le16 offset;
1193 u8 value;
1194 u8 reserved[3];
1195} __packed;
1196
1197struct host_cmd_ds_pmic_reg_access {
1198 __le16 action;
1199 __le16 offset;
1200 u8 value;
1201 u8 reserved[3];
1202} __packed;
1203
1204struct host_cmd_ds_802_11_eeprom_access {
1205 __le16 action;
1206
1207 __le16 offset;
1208 __le16 byte_count;
1209 u8 value;
1210} __packed;
1211
Avinash Patil75edd2c2012-05-08 18:30:18 -07001212struct host_cmd_tlv {
1213 __le16 type;
1214 __le16 len;
1215} __packed;
1216
Avinash Patile5686342012-05-08 18:30:25 -07001217struct mwifiex_assoc_event {
1218 u8 sta_addr[ETH_ALEN];
1219 __le16 type;
1220 __le16 len;
1221 __le16 frame_control;
1222 __le16 cap_info;
1223 __le16 listen_interval;
1224 u8 data[0];
1225} __packed;
1226
Avinash Patil4db16a12012-05-08 18:30:20 -07001227struct host_cmd_ds_sys_config {
1228 __le16 action;
1229 u8 tlv[0];
1230};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001231
1232struct host_cmd_tlv_akmp {
1233 struct host_cmd_tlv tlv;
1234 __le16 key_mgmt;
1235 __le16 key_mgmt_operation;
1236} __packed;
1237
1238struct host_cmd_tlv_pwk_cipher {
1239 struct host_cmd_tlv tlv;
1240 __le16 proto;
1241 u8 cipher;
1242 u8 reserved;
1243} __packed;
1244
1245struct host_cmd_tlv_gwk_cipher {
1246 struct host_cmd_tlv tlv;
1247 u8 cipher;
1248 u8 reserved;
1249} __packed;
1250
1251struct host_cmd_tlv_passphrase {
1252 struct host_cmd_tlv tlv;
1253 u8 passphrase[0];
1254} __packed;
1255
Avinash Patil96893532012-06-15 12:21:55 -07001256struct host_cmd_tlv_wep_key {
1257 struct host_cmd_tlv tlv;
1258 u8 key_index;
1259 u8 is_default;
1260 u8 key[1];
1261};
1262
Avinash Patilf752dcd2012-05-08 18:30:26 -07001263struct host_cmd_tlv_auth_type {
1264 struct host_cmd_tlv tlv;
1265 u8 auth_type;
1266} __packed;
1267
1268struct host_cmd_tlv_encrypt_protocol {
1269 struct host_cmd_tlv tlv;
1270 __le16 proto;
1271} __packed;
1272
Avinash Patil12190c52012-05-08 18:30:24 -07001273struct host_cmd_tlv_ssid {
1274 struct host_cmd_tlv tlv;
1275 u8 ssid[0];
1276} __packed;
1277
Avinash Patil605b73a2012-05-16 21:24:55 -07001278struct host_cmd_tlv_bcast_ssid {
1279 struct host_cmd_tlv tlv;
1280 u8 bcast_ctl;
1281} __packed;
1282
Avinash Patil12190c52012-05-08 18:30:24 -07001283struct host_cmd_tlv_beacon_period {
1284 struct host_cmd_tlv tlv;
1285 __le16 period;
1286} __packed;
1287
1288struct host_cmd_tlv_dtim_period {
1289 struct host_cmd_tlv tlv;
1290 u8 period;
1291} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001292
Avinash Patil9b930ea2012-05-08 18:30:23 -07001293struct host_cmd_tlv_frag_threshold {
1294 struct host_cmd_tlv tlv;
1295 __le16 frag_thr;
1296} __packed;
1297
1298struct host_cmd_tlv_rts_threshold {
1299 struct host_cmd_tlv tlv;
1300 __le16 rts_thr;
1301} __packed;
1302
1303struct host_cmd_tlv_retry_limit {
1304 struct host_cmd_tlv tlv;
1305 u8 limit;
1306} __packed;
1307
Avinash Patil75edd2c2012-05-08 18:30:18 -07001308struct host_cmd_tlv_mac_addr {
1309 struct host_cmd_tlv tlv;
1310 u8 mac_addr[ETH_ALEN];
1311} __packed;
1312
Avinash Patil4db16a12012-05-08 18:30:20 -07001313struct host_cmd_tlv_channel_band {
1314 struct host_cmd_tlv tlv;
1315 u8 band_config;
1316 u8 channel;
1317} __packed;
1318
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001319struct host_cmd_ds_version_ext {
1320 u8 version_str_sel;
1321 char version_str[128];
1322} __packed;
1323
1324struct host_cmd_ds_802_11_ibss_status {
1325 __le16 action;
1326 __le16 enable;
1327 u8 bssid[ETH_ALEN];
1328 __le16 beacon_interval;
1329 __le16 atim_window;
1330 __le16 use_g_rate_protect;
1331} __packed;
1332
1333#define CONNECTION_TYPE_INFRA 0
1334#define CONNECTION_TYPE_ADHOC 1
1335
1336struct host_cmd_ds_set_bss_mode {
1337 u8 con_type;
1338} __packed;
1339
Amitkumar Karward930fae2011-10-11 17:41:21 -07001340struct host_cmd_ds_pcie_details {
1341 /* TX buffer descriptor ring address */
1342 u32 txbd_addr_lo;
1343 u32 txbd_addr_hi;
1344 /* TX buffer descriptor ring count */
1345 u32 txbd_count;
1346
1347 /* RX buffer descriptor ring address */
1348 u32 rxbd_addr_lo;
1349 u32 rxbd_addr_hi;
1350 /* RX buffer descriptor ring count */
1351 u32 rxbd_count;
1352
1353 /* Event buffer descriptor ring address */
1354 u32 evtbd_addr_lo;
1355 u32 evtbd_addr_hi;
1356 /* Event buffer descriptor ring count */
1357 u32 evtbd_count;
1358
1359 /* Sleep cookie buffer physical address */
1360 u32 sleep_cookie_addr_lo;
1361 u32 sleep_cookie_addr_hi;
1362} __packed;
1363
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001364struct mwifiex_ie_types_rssi_threshold {
1365 struct mwifiex_ie_types_header header;
1366 u8 abs_value;
1367 u8 evt_freq;
1368} __packed;
1369
1370struct host_cmd_ds_802_11_subsc_evt {
1371 __le16 action;
1372 __le16 events;
1373} __packed;
1374
Avinash Patilede98bf2012-05-08 18:30:28 -07001375struct mwifiex_ie {
1376 __le16 ie_index;
1377 __le16 mgmt_subtype_mask;
1378 __le16 ie_length;
1379 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1380} __packed;
1381
1382#define MAX_MGMT_IE_INDEX 16
1383struct mwifiex_ie_list {
1384 __le16 type;
1385 __le16 len;
1386 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1387} __packed;
1388
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001389struct host_cmd_ds_command {
1390 __le16 command;
1391 __le16 size;
1392 __le16 seq_num;
1393 __le16 result;
1394 union {
1395 struct host_cmd_ds_get_hw_spec hw_spec;
1396 struct host_cmd_ds_mac_control mac_ctrl;
1397 struct host_cmd_ds_802_11_mac_address mac_addr;
1398 struct host_cmd_ds_mac_multicast_adr mc_addr;
1399 struct host_cmd_ds_802_11_get_log get_log;
1400 struct host_cmd_ds_802_11_rssi_info rssi_info;
1401 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1402 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001403 struct host_cmd_ds_tx_rate_query tx_rate;
1404 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1405 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001406 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001407 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1408 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001409 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1410 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1411 struct host_cmd_ds_802_11_scan scan;
1412 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1413 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1414 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1415 struct host_cmd_ds_802_11_associate associate;
1416 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1417 struct host_cmd_ds_802_11_deauthenticate deauth;
1418 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1419 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1420 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1421 struct host_cmd_ds_802_11d_domain_info domain_info;
1422 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1423 struct host_cmd_ds_11n_addba_req add_ba_req;
1424 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1425 struct host_cmd_ds_11n_delba del_ba;
1426 struct host_cmd_ds_txbuf_cfg tx_buf;
1427 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1428 struct host_cmd_ds_11n_cfg htcfg;
1429 struct host_cmd_ds_wmm_get_status get_wmm_status;
1430 struct host_cmd_ds_802_11_key_material key_material;
1431 struct host_cmd_ds_version_ext verext;
1432 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1433 struct host_cmd_ds_mac_reg_access mac_reg;
1434 struct host_cmd_ds_bbp_reg_access bbp_reg;
1435 struct host_cmd_ds_rf_reg_access rf_reg;
1436 struct host_cmd_ds_pmic_reg_access pmic_reg;
1437 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001438 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001439 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001440 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001441 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001442 } params;
1443} __packed;
1444
1445struct mwifiex_opt_sleep_confirm {
1446 __le16 command;
1447 __le16 size;
1448 __le16 seq_num;
1449 __le16 result;
1450 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001451 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001452} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001453#endif /* !_MWIFIEX_FW_H_ */