blob: 14e985d01dee73b3ed1f6e02b6ef74764ced919a [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
228#define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700229#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700230#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700231#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
232#define HostCmd_CMD_MAC_CONTROL 0x0028
233#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
234#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
235#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
236#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
237#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
238#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
239#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
240#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700241#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700242#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
243#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
244#define HostCmd_CMD_VERSION_EXT 0x0097
245#define HostCmd_CMD_RSSI_INFO 0x00a4
246#define HostCmd_CMD_FUNC_INIT 0x00a9
247#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700248#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
249#define HostCmd_CMD_UAP_BSS_START 0x00b1
250#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700251#define HostCmd_CMD_11N_CFG 0x00cd
252#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
253#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
254#define HostCmd_CMD_11N_DELBA 0x00d0
255#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
256#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
257#define HostCmd_CMD_TXPWR_CFG 0x00d1
258#define HostCmd_CMD_TX_RATE_CFG 0x00d6
259#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
260#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
261#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
262#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700263#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700264
Avinash Patilf752dcd2012-05-08 18:30:26 -0700265#define PROTOCOL_NO_SECURITY 0x01
266#define PROTOCOL_STATIC_WEP 0x02
267#define PROTOCOL_WPA 0x08
268#define PROTOCOL_WPA2 0x20
269#define PROTOCOL_WPA2_MIXED 0x28
270#define PROTOCOL_EAP 0x40
271#define KEY_MGMT_NONE 0x04
272#define KEY_MGMT_PSK 0x02
273#define KEY_MGMT_EAP 0x01
274#define CIPHER_TKIP 0x04
275#define CIPHER_AES_CCMP 0x08
276#define VALID_CIPHER_BITMAP 0x0c
277
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700278enum ENH_PS_MODES {
279 EN_PS = 1,
280 DIS_PS = 2,
281 EN_AUTO_DS = 3,
282 DIS_AUTO_DS = 4,
283 SLEEP_CONFIRM = 5,
284 GET_PS = 0,
285 EN_AUTO_PS = 0xff,
286 DIS_AUTO_PS = 0xfe,
287};
288
289#define HostCmd_RET_BIT 0x8000
290#define HostCmd_ACT_GEN_GET 0x0000
291#define HostCmd_ACT_GEN_SET 0x0001
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700292#define HostCmd_ACT_BITWISE_SET 0x0002
293#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700294#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700295
296#define HostCmd_ACT_MAC_RX_ON 0x0001
297#define HostCmd_ACT_MAC_TX_ON 0x0002
298#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
299#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
300#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
301#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700302#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
303
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700304#define HostCmd_BSS_MODE_IBSS 0x0002
305#define HostCmd_BSS_MODE_ANY 0x0003
306
307#define HostCmd_SCAN_RADIO_TYPE_BG 0
308#define HostCmd_SCAN_RADIO_TYPE_A 1
309
310#define HOST_SLEEP_CFG_CANCEL 0xffffffff
311#define HOST_SLEEP_CFG_COND_DEF 0x0000000f
312#define HOST_SLEEP_CFG_GPIO_DEF 0xff
313#define HOST_SLEEP_CFG_GAP_DEF 0
314
315#define CMD_F_HOSTCMD (1 << 0)
316#define CMD_F_CANCELED (1 << 1)
317
318#define HostCmd_CMD_ID_MASK 0x0fff
319
320#define HostCmd_SEQ_NUM_MASK 0x00ff
321
322#define HostCmd_BSS_NUM_MASK 0x0f00
323
324#define HostCmd_BSS_TYPE_MASK 0xf000
325
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700326#define HostCmd_ACT_SET_RX 0x0001
327#define HostCmd_ACT_SET_TX 0x0002
328#define HostCmd_ACT_SET_BOTH 0x0003
329
330#define RF_ANTENNA_AUTO 0xFFFF
331
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700332#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
333 (((seq) & 0x00ff) | \
334 (((num) & 0x000f) << 8)) | \
335 (((type) & 0x000f) << 12); }
336
337#define HostCmd_GET_SEQ_NO(seq) \
338 ((seq) & HostCmd_SEQ_NUM_MASK)
339
340#define HostCmd_GET_BSS_NO(seq) \
341 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
342
343#define HostCmd_GET_BSS_TYPE(seq) \
344 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
345
346#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
347#define EVENT_LINK_LOST 0x00000003
348#define EVENT_LINK_SENSED 0x00000004
349#define EVENT_MIB_CHANGED 0x00000006
350#define EVENT_INIT_DONE 0x00000007
351#define EVENT_DEAUTHENTICATED 0x00000008
352#define EVENT_DISASSOCIATED 0x00000009
353#define EVENT_PS_AWAKE 0x0000000a
354#define EVENT_PS_SLEEP 0x0000000b
355#define EVENT_MIC_ERR_MULTICAST 0x0000000d
356#define EVENT_MIC_ERR_UNICAST 0x0000000e
357#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
358#define EVENT_ADHOC_BCN_LOST 0x00000011
359
360#define EVENT_WMM_STATUS_CHANGE 0x00000017
361#define EVENT_BG_SCAN_REPORT 0x00000018
362#define EVENT_RSSI_LOW 0x00000019
363#define EVENT_SNR_LOW 0x0000001a
364#define EVENT_MAX_FAIL 0x0000001b
365#define EVENT_RSSI_HIGH 0x0000001c
366#define EVENT_SNR_HIGH 0x0000001d
367#define EVENT_IBSS_COALESCED 0x0000001e
368#define EVENT_DATA_RSSI_LOW 0x00000024
369#define EVENT_DATA_SNR_LOW 0x00000025
370#define EVENT_DATA_RSSI_HIGH 0x00000026
371#define EVENT_DATA_SNR_HIGH 0x00000027
372#define EVENT_LINK_QUALITY 0x00000028
373#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700374#define EVENT_UAP_STA_DEAUTH 0x0000002c
375#define EVENT_UAP_STA_ASSOC 0x0000002d
376#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700377#define EVENT_PRE_BEACON_LOST 0x00000031
378#define EVENT_ADDBA 0x00000033
379#define EVENT_DELBA 0x00000034
380#define EVENT_BA_STREAM_TIEMOUT 0x00000037
381#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700382#define EVENT_UAP_BSS_IDLE 0x00000043
383#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700384#define EVENT_WEP_ICV_ERR 0x00000046
385#define EVENT_HS_ACT_REQ 0x00000047
386#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700387#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700388#define EVENT_HOSTWAKE_STAIE 0x0000004d
389
390#define EVENT_ID_MASK 0xffff
391#define BSS_NUM_MASK 0xf
392
393#define EVENT_GET_BSS_NUM(event_cause) \
394 (((event_cause) >> 16) & BSS_NUM_MASK)
395
396#define EVENT_GET_BSS_TYPE(event_cause) \
397 (((event_cause) >> 24) & 0x00ff)
398
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700399struct mwifiex_ie_types_header {
400 __le16 type;
401 __le16 len;
402} __packed;
403
404struct mwifiex_ie_types_data {
405 struct mwifiex_ie_types_header header;
406 u8 data[1];
407} __packed;
408
409#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
410#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
411
412struct txpd {
413 u8 bss_type;
414 u8 bss_num;
415 __le16 tx_pkt_length;
416 __le16 tx_pkt_offset;
417 __le16 tx_pkt_type;
418 __le32 tx_control;
419 u8 priority;
420 u8 flags;
421 u8 pkt_delay_2ms;
422 u8 reserved1;
423} __packed;
424
425struct rxpd {
426 u8 bss_type;
427 u8 bss_num;
428 u16 rx_pkt_length;
429 u16 rx_pkt_offset;
430 u16 rx_pkt_type;
431 u16 seq_num;
432 u8 priority;
433 u8 rx_rate;
434 s8 snr;
435 s8 nf;
436 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
437 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
438 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
439 u8 ht_info;
440 u8 reserved;
441} __packed;
442
443enum mwifiex_chan_scan_mode_bitmasks {
444 MWIFIEX_PASSIVE_SCAN = BIT(0),
445 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
446};
447
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700448struct mwifiex_chan_scan_param_set {
449 u8 radio_type;
450 u8 chan_number;
451 u8 chan_scan_mode_bitmap;
452 __le16 min_scan_time;
453 __le16 max_scan_time;
454} __packed;
455
456struct mwifiex_ie_types_chan_list_param_set {
457 struct mwifiex_ie_types_header header;
458 struct mwifiex_chan_scan_param_set chan_scan_param[1];
459} __packed;
460
461struct chan_band_param_set {
462 u8 radio_type;
463 u8 chan_number;
464};
465
466struct mwifiex_ie_types_chan_band_list_param_set {
467 struct mwifiex_ie_types_header header;
468 struct chan_band_param_set chan_band_param[1];
469} __packed;
470
471struct mwifiex_ie_types_rates_param_set {
472 struct mwifiex_ie_types_header header;
473 u8 rates[1];
474} __packed;
475
476struct mwifiex_ie_types_ssid_param_set {
477 struct mwifiex_ie_types_header header;
478 u8 ssid[1];
479} __packed;
480
481struct mwifiex_ie_types_num_probes {
482 struct mwifiex_ie_types_header header;
483 __le16 num_probes;
484} __packed;
485
486struct mwifiex_ie_types_wildcard_ssid_params {
487 struct mwifiex_ie_types_header header;
488 u8 max_ssid_length;
489 u8 ssid[1];
490} __packed;
491
492#define TSF_DATA_SIZE 8
493struct mwifiex_ie_types_tsf_timestamp {
494 struct mwifiex_ie_types_header header;
495 u8 tsf_data[1];
496} __packed;
497
498struct mwifiex_cf_param_set {
499 u8 cfp_cnt;
500 u8 cfp_period;
501 u16 cfp_max_duration;
502 u16 cfp_duration_remaining;
503} __packed;
504
505struct mwifiex_ibss_param_set {
506 u16 atim_window;
507} __packed;
508
509struct mwifiex_ie_types_ss_param_set {
510 struct mwifiex_ie_types_header header;
511 union {
512 struct mwifiex_cf_param_set cf_param_set[1];
513 struct mwifiex_ibss_param_set ibss_param_set[1];
514 } cf_ibss;
515} __packed;
516
517struct mwifiex_fh_param_set {
518 u16 dwell_time;
519 u8 hop_set;
520 u8 hop_pattern;
521 u8 hop_index;
522} __packed;
523
524struct mwifiex_ds_param_set {
525 u8 current_chan;
526} __packed;
527
528struct mwifiex_ie_types_phy_param_set {
529 struct mwifiex_ie_types_header header;
530 union {
531 struct mwifiex_fh_param_set fh_param_set[1];
532 struct mwifiex_ds_param_set ds_param_set[1];
533 } fh_ds;
534} __packed;
535
536struct mwifiex_ie_types_auth_type {
537 struct mwifiex_ie_types_header header;
538 __le16 auth_type;
539} __packed;
540
541struct mwifiex_ie_types_vendor_param_set {
542 struct mwifiex_ie_types_header header;
543 u8 ie[MWIFIEX_MAX_VSIE_LEN];
544};
545
546struct mwifiex_ie_types_rsn_param_set {
547 struct mwifiex_ie_types_header header;
548 u8 rsn_ie[1];
549} __packed;
550
551#define KEYPARAMSET_FIXED_LEN 6
552
553struct mwifiex_ie_type_key_param_set {
554 __le16 type;
555 __le16 length;
556 __le16 key_type_id;
557 __le16 key_info;
558 __le16 key_len;
559 u8 key[50];
560} __packed;
561
562struct host_cmd_ds_802_11_key_material {
563 __le16 action;
564 struct mwifiex_ie_type_key_param_set key_param_set;
565} __packed;
566
567struct host_cmd_ds_gen {
568 u16 command;
569 u16 size;
570 u16 seq_num;
571 u16 result;
572};
573
574#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
575
576enum sleep_resp_ctrl {
577 RESP_NOT_NEEDED = 0,
578 RESP_NEEDED,
579};
580
581struct mwifiex_ps_param {
582 __le16 null_pkt_interval;
583 __le16 multiple_dtims;
584 __le16 bcn_miss_timeout;
585 __le16 local_listen_interval;
586 __le16 adhoc_wake_period;
587 __le16 mode;
588 __le16 delay_to_ps;
589};
590
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700591#define BITMAP_AUTO_DS 0x01
592#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700593
594struct mwifiex_ie_types_auto_ds_param {
595 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700596 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700597} __packed;
598
599struct mwifiex_ie_types_ps_param {
600 struct mwifiex_ie_types_header header;
601 struct mwifiex_ps_param param;
602} __packed;
603
604struct host_cmd_ds_802_11_ps_mode_enh {
605 __le16 action;
606
607 union {
608 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700609 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700610 } params;
611} __packed;
612
613struct host_cmd_ds_get_hw_spec {
614 __le16 hw_if_version;
615 __le16 version;
616 __le16 reserved;
617 __le16 num_of_mcast_adr;
618 u8 permanent_addr[ETH_ALEN];
619 __le16 region_code;
620 __le16 number_of_antenna;
621 __le32 fw_release_number;
622 __le32 reserved_1;
623 __le32 reserved_2;
624 __le32 reserved_3;
625 __le32 fw_cap_info;
626 __le32 dot_11n_dev_cap;
627 u8 dev_mcs_support;
628 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
629 __le16 reserved_4;
630} __packed;
631
632struct host_cmd_ds_802_11_rssi_info {
633 __le16 action;
634 __le16 ndata;
635 __le16 nbcn;
636 __le16 reserved[9];
637 long long reserved_1;
638};
639
640struct host_cmd_ds_802_11_rssi_info_rsp {
641 __le16 action;
642 __le16 ndata;
643 __le16 nbcn;
644 __le16 data_rssi_last;
645 __le16 data_nf_last;
646 __le16 data_rssi_avg;
647 __le16 data_nf_avg;
648 __le16 bcn_rssi_last;
649 __le16 bcn_nf_last;
650 __le16 bcn_rssi_avg;
651 __le16 bcn_nf_avg;
652 long long tsf_bcn;
653};
654
655struct host_cmd_ds_802_11_mac_address {
656 __le16 action;
657 u8 mac_addr[ETH_ALEN];
658};
659
660struct host_cmd_ds_mac_control {
661 __le16 action;
662 __le16 reserved;
663};
664
665struct host_cmd_ds_mac_multicast_adr {
666 __le16 action;
667 __le16 num_of_adrs;
668 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
669} __packed;
670
671struct host_cmd_ds_802_11_deauthenticate {
672 u8 mac_addr[ETH_ALEN];
673 __le16 reason_code;
674} __packed;
675
676struct host_cmd_ds_802_11_associate {
677 u8 peer_sta_addr[ETH_ALEN];
678 __le16 cap_info_bitmap;
679 __le16 listen_interval;
680 __le16 beacon_period;
681 u8 dtim_period;
682} __packed;
683
684struct ieee_types_assoc_rsp {
685 __le16 cap_info_bitmap;
686 __le16 status_code;
687 __le16 a_id;
688 u8 ie_buffer[1];
689} __packed;
690
691struct host_cmd_ds_802_11_associate_rsp {
692 struct ieee_types_assoc_rsp assoc_rsp;
693} __packed;
694
695struct ieee_types_cf_param_set {
696 u8 element_id;
697 u8 len;
698 u8 cfp_cnt;
699 u8 cfp_period;
700 u16 cfp_max_duration;
701 u16 cfp_duration_remaining;
702} __packed;
703
704struct ieee_types_ibss_param_set {
705 u8 element_id;
706 u8 len;
707 __le16 atim_window;
708} __packed;
709
710union ieee_types_ss_param_set {
711 struct ieee_types_cf_param_set cf_param_set;
712 struct ieee_types_ibss_param_set ibss_param_set;
713} __packed;
714
715struct ieee_types_fh_param_set {
716 u8 element_id;
717 u8 len;
718 __le16 dwell_time;
719 u8 hop_set;
720 u8 hop_pattern;
721 u8 hop_index;
722} __packed;
723
724struct ieee_types_ds_param_set {
725 u8 element_id;
726 u8 len;
727 u8 current_chan;
728} __packed;
729
730union ieee_types_phy_param_set {
731 struct ieee_types_fh_param_set fh_param_set;
732 struct ieee_types_ds_param_set ds_param_set;
733} __packed;
734
735struct host_cmd_ds_802_11_ad_hoc_start {
736 u8 ssid[IEEE80211_MAX_SSID_LEN];
737 u8 bss_mode;
738 __le16 beacon_period;
739 u8 dtim_period;
740 union ieee_types_ss_param_set ss_param_set;
741 union ieee_types_phy_param_set phy_param_set;
742 u16 reserved1;
743 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800744 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700745} __packed;
746
747struct host_cmd_ds_802_11_ad_hoc_result {
748 u8 pad[3];
749 u8 bssid[ETH_ALEN];
750} __packed;
751
752struct adhoc_bss_desc {
753 u8 bssid[ETH_ALEN];
754 u8 ssid[IEEE80211_MAX_SSID_LEN];
755 u8 bss_mode;
756 __le16 beacon_period;
757 u8 dtim_period;
758 u8 time_stamp[8];
759 u8 local_time[8];
760 union ieee_types_phy_param_set phy_param_set;
761 union ieee_types_ss_param_set ss_param_set;
762 __le16 cap_info_bitmap;
763 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
764
765 /*
766 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
767 * It is used in the Adhoc join command and will cause a
768 * binary layout mismatch with the firmware
769 */
770} __packed;
771
772struct host_cmd_ds_802_11_ad_hoc_join {
773 struct adhoc_bss_desc bss_descriptor;
774 u16 reserved1;
775 u16 reserved2;
776} __packed;
777
778struct host_cmd_ds_802_11_get_log {
779 __le32 mcast_tx_frame;
780 __le32 failed;
781 __le32 retry;
782 __le32 multi_retry;
783 __le32 frame_dup;
784 __le32 rts_success;
785 __le32 rts_failure;
786 __le32 ack_failure;
787 __le32 rx_frag;
788 __le32 mcast_rx_frame;
789 __le32 fcs_error;
790 __le32 tx_frame;
791 __le32 reserved;
792 __le32 wep_icv_err_cnt[4];
793};
794
795struct host_cmd_ds_tx_rate_query {
796 u8 tx_rate;
797 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
798 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
799 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
800 u8 ht_info;
801} __packed;
802
803enum Host_Sleep_Action {
804 HS_CONFIGURE = 0x0001,
805 HS_ACTIVATE = 0x0002,
806};
807
808struct mwifiex_hs_config_param {
809 __le32 conditions;
810 u8 gpio;
811 u8 gap;
812} __packed;
813
814struct hs_activate_param {
815 u16 resp_ctrl;
816} __packed;
817
818struct host_cmd_ds_802_11_hs_cfg_enh {
819 __le16 action;
820
821 union {
822 struct mwifiex_hs_config_param hs_config;
823 struct hs_activate_param hs_activate;
824 } params;
825} __packed;
826
827enum SNMP_MIB_INDEX {
828 OP_RATE_SET_I = 1,
829 DTIM_PERIOD_I = 3,
830 RTS_THRESH_I = 5,
831 SHORT_RETRY_LIM_I = 6,
832 LONG_RETRY_LIM_I = 7,
833 FRAG_THRESH_I = 8,
834 DOT11D_I = 9,
835};
836
837#define MAX_SNMP_BUF_SIZE 128
838
839struct host_cmd_ds_802_11_snmp_mib {
840 __le16 query_type;
841 __le16 oid;
842 __le16 buf_size;
843 u8 value[1];
844} __packed;
845
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700846struct mwifiex_rate_scope {
847 __le16 type;
848 __le16 length;
849 __le16 hr_dsss_rate_bitmap;
850 __le16 ofdm_rate_bitmap;
851 __le16 ht_mcs_rate_bitmap[8];
852} __packed;
853
854struct mwifiex_rate_drop_pattern {
855 __le16 type;
856 __le16 length;
857 __le32 rate_drop_mode;
858} __packed;
859
860struct host_cmd_ds_tx_rate_cfg {
861 __le16 action;
862 __le16 cfg_index;
863} __packed;
864
865struct mwifiex_power_group {
866 u8 modulation_class;
867 u8 first_rate_code;
868 u8 last_rate_code;
869 s8 power_step;
870 s8 power_min;
871 s8 power_max;
872 u8 ht_bandwidth;
873 u8 reserved;
874} __packed;
875
876struct mwifiex_types_power_group {
877 u16 type;
878 u16 length;
879} __packed;
880
881struct host_cmd_ds_txpwr_cfg {
882 __le16 action;
883 __le16 cfg_index;
884 __le32 mode;
885} __packed;
886
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700887struct host_cmd_ds_rf_tx_pwr {
888 __le16 action;
889 __le16 cur_level;
890 u8 max_power;
891 u8 min_power;
892} __packed;
893
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700894struct host_cmd_ds_rf_ant_mimo {
895 __le16 action_tx;
896 __le16 tx_ant_mode;
897 __le16 action_rx;
898 __le16 rx_ant_mode;
899};
900
901struct host_cmd_ds_rf_ant_siso {
902 __le16 action;
903 __le16 ant_mode;
904};
905
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700906struct mwifiex_bcn_param {
907 u8 bssid[ETH_ALEN];
908 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700909 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700910 __le16 beacon_period;
911 __le16 cap_info_bitmap;
912} __packed;
913
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700914#define MWIFIEX_USER_SCAN_CHAN_MAX 50
915
916#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
917
918struct mwifiex_scan_cmd_config {
919 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700920 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700921 */
922 u8 bss_mode;
923
924 /* Specific BSSID used to filter scan results in the firmware */
925 u8 specific_bssid[ETH_ALEN];
926
927 /* Length of TLVs sent in command starting at tlvBuffer */
928 u32 tlv_buf_len;
929
930 /*
931 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
932 *
933 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
934 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
935 */
936 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
937 here */
938} __packed;
939
940struct mwifiex_user_scan_chan {
941 u8 chan_number;
942 u8 radio_type;
943 u8 scan_type;
944 u8 reserved;
945 u32 scan_time;
946} __packed;
947
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700948struct mwifiex_user_scan_cfg {
949 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700950 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700951 */
952 u8 bss_mode;
953 /* Configure the number of probe requests for active chan scans */
954 u8 num_probes;
955 u8 reserved;
956 /* BSSID filter sent in the firmware command to limit the results */
957 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -0800958 /* SSID filter list used in the firmware to limit the scan results */
959 struct cfg80211_ssid *ssid_list;
960 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700961 /* Variable number (fixed maximum) of channels to scan up */
962 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
963} __packed;
964
965struct ie_body {
966 u8 grp_key_oui[4];
967 u8 ptk_cnt[2];
968 u8 ptk_body[4];
969} __packed;
970
971struct host_cmd_ds_802_11_scan {
972 u8 bss_mode;
973 u8 bssid[ETH_ALEN];
974 u8 tlv_buffer[1];
975} __packed;
976
977struct host_cmd_ds_802_11_scan_rsp {
978 __le16 bss_descript_size;
979 u8 number_of_sets;
980 u8 bss_desc_and_tlv_buffer[1];
981} __packed;
982
983struct host_cmd_ds_802_11_bg_scan_query {
984 u8 flush;
985} __packed;
986
987struct host_cmd_ds_802_11_bg_scan_query_rsp {
988 u32 report_condition;
989 struct host_cmd_ds_802_11_scan_rsp scan_resp;
990} __packed;
991
992struct mwifiex_ietypes_domain_param_set {
993 struct mwifiex_ie_types_header header;
994 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
995 struct ieee80211_country_ie_triplet triplet[1];
996} __packed;
997
998struct host_cmd_ds_802_11d_domain_info {
999 __le16 action;
1000 struct mwifiex_ietypes_domain_param_set domain;
1001} __packed;
1002
1003struct host_cmd_ds_802_11d_domain_info_rsp {
1004 __le16 action;
1005 struct mwifiex_ietypes_domain_param_set domain;
1006} __packed;
1007
1008struct host_cmd_ds_11n_addba_req {
1009 u8 add_req_result;
1010 u8 peer_mac_addr[ETH_ALEN];
1011 u8 dialog_token;
1012 __le16 block_ack_param_set;
1013 __le16 block_ack_tmo;
1014 __le16 ssn;
1015} __packed;
1016
1017struct host_cmd_ds_11n_addba_rsp {
1018 u8 add_rsp_result;
1019 u8 peer_mac_addr[ETH_ALEN];
1020 u8 dialog_token;
1021 __le16 status_code;
1022 __le16 block_ack_param_set;
1023 __le16 block_ack_tmo;
1024 __le16 ssn;
1025} __packed;
1026
1027struct host_cmd_ds_11n_delba {
1028 u8 del_result;
1029 u8 peer_mac_addr[ETH_ALEN];
1030 __le16 del_ba_param_set;
1031 __le16 reason_code;
1032 u8 reserved;
1033} __packed;
1034
1035struct host_cmd_ds_11n_batimeout {
1036 u8 tid;
1037 u8 peer_mac_addr[ETH_ALEN];
1038 u8 origninator;
1039} __packed;
1040
1041struct host_cmd_ds_11n_cfg {
1042 __le16 action;
1043 __le16 ht_tx_cap;
1044 __le16 ht_tx_info;
1045} __packed;
1046
1047struct host_cmd_ds_txbuf_cfg {
1048 __le16 action;
1049 __le16 buff_size;
1050 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1051 __le16 reserved3;
1052} __packed;
1053
1054struct host_cmd_ds_amsdu_aggr_ctrl {
1055 __le16 action;
1056 __le16 enable;
1057 __le16 curr_buf_size;
1058} __packed;
1059
1060struct mwifiex_ie_types_wmm_param_set {
1061 struct mwifiex_ie_types_header header;
1062 u8 wmm_ie[1];
1063};
1064
1065struct mwifiex_ie_types_wmm_queue_status {
1066 struct mwifiex_ie_types_header header;
1067 u8 queue_index;
1068 u8 disabled;
1069 u16 medium_time;
1070 u8 flow_required;
1071 u8 flow_created;
1072 u32 reserved;
1073};
1074
1075struct ieee_types_vendor_header {
1076 u8 element_id;
1077 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001078 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001079 u8 oui_subtype;
1080 u8 version;
1081} __packed;
1082
1083struct ieee_types_wmm_ac_parameters {
1084 u8 aci_aifsn_bitmap;
1085 u8 ecw_bitmap;
1086 __le16 tx_op_limit;
1087} __packed;
1088
1089struct ieee_types_wmm_parameter {
1090 /*
1091 * WMM Parameter IE - Vendor Specific Header:
1092 * element_id [221/0xdd]
1093 * Len [24]
1094 * Oui [00:50:f2]
1095 * OuiType [2]
1096 * OuiSubType [1]
1097 * Version [1]
1098 */
1099 struct ieee_types_vendor_header vend_hdr;
1100 u8 qos_info_bitmap;
1101 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001102 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001103} __packed;
1104
1105struct ieee_types_wmm_info {
1106
1107 /*
1108 * WMM Info IE - Vendor Specific Header:
1109 * element_id [221/0xdd]
1110 * Len [7]
1111 * Oui [00:50:f2]
1112 * OuiType [2]
1113 * OuiSubType [0]
1114 * Version [1]
1115 */
1116 struct ieee_types_vendor_header vend_hdr;
1117
1118 u8 qos_info_bitmap;
1119} __packed;
1120
1121struct host_cmd_ds_wmm_get_status {
1122 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001123 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001124 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1125} __packed;
1126
1127struct mwifiex_wmm_ac_status {
1128 u8 disabled;
1129 u8 flow_required;
1130 u8 flow_created;
1131};
1132
1133struct mwifiex_ie_types_htcap {
1134 struct mwifiex_ie_types_header header;
1135 struct ieee80211_ht_cap ht_cap;
1136} __packed;
1137
1138struct mwifiex_ie_types_htinfo {
1139 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001140 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001141} __packed;
1142
1143struct mwifiex_ie_types_2040bssco {
1144 struct mwifiex_ie_types_header header;
1145 u8 bss_co_2040;
1146} __packed;
1147
1148struct mwifiex_ie_types_extcap {
1149 struct mwifiex_ie_types_header header;
1150 u8 ext_cap;
1151} __packed;
1152
1153struct host_cmd_ds_mac_reg_access {
1154 __le16 action;
1155 __le16 offset;
1156 __le32 value;
1157} __packed;
1158
1159struct host_cmd_ds_bbp_reg_access {
1160 __le16 action;
1161 __le16 offset;
1162 u8 value;
1163 u8 reserved[3];
1164} __packed;
1165
1166struct host_cmd_ds_rf_reg_access {
1167 __le16 action;
1168 __le16 offset;
1169 u8 value;
1170 u8 reserved[3];
1171} __packed;
1172
1173struct host_cmd_ds_pmic_reg_access {
1174 __le16 action;
1175 __le16 offset;
1176 u8 value;
1177 u8 reserved[3];
1178} __packed;
1179
1180struct host_cmd_ds_802_11_eeprom_access {
1181 __le16 action;
1182
1183 __le16 offset;
1184 __le16 byte_count;
1185 u8 value;
1186} __packed;
1187
Avinash Patil75edd2c2012-05-08 18:30:18 -07001188struct host_cmd_tlv {
1189 __le16 type;
1190 __le16 len;
1191} __packed;
1192
Avinash Patile5686342012-05-08 18:30:25 -07001193struct mwifiex_assoc_event {
1194 u8 sta_addr[ETH_ALEN];
1195 __le16 type;
1196 __le16 len;
1197 __le16 frame_control;
1198 __le16 cap_info;
1199 __le16 listen_interval;
1200 u8 data[0];
1201} __packed;
1202
Avinash Patil4db16a12012-05-08 18:30:20 -07001203struct host_cmd_ds_sys_config {
1204 __le16 action;
1205 u8 tlv[0];
1206};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001207
1208struct host_cmd_tlv_akmp {
1209 struct host_cmd_tlv tlv;
1210 __le16 key_mgmt;
1211 __le16 key_mgmt_operation;
1212} __packed;
1213
1214struct host_cmd_tlv_pwk_cipher {
1215 struct host_cmd_tlv tlv;
1216 __le16 proto;
1217 u8 cipher;
1218 u8 reserved;
1219} __packed;
1220
1221struct host_cmd_tlv_gwk_cipher {
1222 struct host_cmd_tlv tlv;
1223 u8 cipher;
1224 u8 reserved;
1225} __packed;
1226
1227struct host_cmd_tlv_passphrase {
1228 struct host_cmd_tlv tlv;
1229 u8 passphrase[0];
1230} __packed;
1231
Avinash Patil96893532012-06-15 12:21:55 -07001232struct host_cmd_tlv_wep_key {
1233 struct host_cmd_tlv tlv;
1234 u8 key_index;
1235 u8 is_default;
1236 u8 key[1];
1237};
1238
Avinash Patilf752dcd2012-05-08 18:30:26 -07001239struct host_cmd_tlv_auth_type {
1240 struct host_cmd_tlv tlv;
1241 u8 auth_type;
1242} __packed;
1243
1244struct host_cmd_tlv_encrypt_protocol {
1245 struct host_cmd_tlv tlv;
1246 __le16 proto;
1247} __packed;
1248
Avinash Patil12190c52012-05-08 18:30:24 -07001249struct host_cmd_tlv_ssid {
1250 struct host_cmd_tlv tlv;
1251 u8 ssid[0];
1252} __packed;
1253
Avinash Patil605b73a2012-05-16 21:24:55 -07001254struct host_cmd_tlv_bcast_ssid {
1255 struct host_cmd_tlv tlv;
1256 u8 bcast_ctl;
1257} __packed;
1258
Avinash Patil12190c52012-05-08 18:30:24 -07001259struct host_cmd_tlv_beacon_period {
1260 struct host_cmd_tlv tlv;
1261 __le16 period;
1262} __packed;
1263
1264struct host_cmd_tlv_dtim_period {
1265 struct host_cmd_tlv tlv;
1266 u8 period;
1267} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001268
Avinash Patil9b930ea2012-05-08 18:30:23 -07001269struct host_cmd_tlv_frag_threshold {
1270 struct host_cmd_tlv tlv;
1271 __le16 frag_thr;
1272} __packed;
1273
1274struct host_cmd_tlv_rts_threshold {
1275 struct host_cmd_tlv tlv;
1276 __le16 rts_thr;
1277} __packed;
1278
1279struct host_cmd_tlv_retry_limit {
1280 struct host_cmd_tlv tlv;
1281 u8 limit;
1282} __packed;
1283
Avinash Patil75edd2c2012-05-08 18:30:18 -07001284struct host_cmd_tlv_mac_addr {
1285 struct host_cmd_tlv tlv;
1286 u8 mac_addr[ETH_ALEN];
1287} __packed;
1288
Avinash Patil4db16a12012-05-08 18:30:20 -07001289struct host_cmd_tlv_channel_band {
1290 struct host_cmd_tlv tlv;
1291 u8 band_config;
1292 u8 channel;
1293} __packed;
1294
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001295struct host_cmd_ds_802_11_rf_channel {
1296 __le16 action;
1297 __le16 current_channel;
1298 __le16 rf_type;
1299 __le16 reserved;
1300 u8 reserved_1[32];
1301} __packed;
1302
1303struct host_cmd_ds_version_ext {
1304 u8 version_str_sel;
1305 char version_str[128];
1306} __packed;
1307
1308struct host_cmd_ds_802_11_ibss_status {
1309 __le16 action;
1310 __le16 enable;
1311 u8 bssid[ETH_ALEN];
1312 __le16 beacon_interval;
1313 __le16 atim_window;
1314 __le16 use_g_rate_protect;
1315} __packed;
1316
1317#define CONNECTION_TYPE_INFRA 0
1318#define CONNECTION_TYPE_ADHOC 1
1319
1320struct host_cmd_ds_set_bss_mode {
1321 u8 con_type;
1322} __packed;
1323
Amitkumar Karward930fae2011-10-11 17:41:21 -07001324struct host_cmd_ds_pcie_details {
1325 /* TX buffer descriptor ring address */
1326 u32 txbd_addr_lo;
1327 u32 txbd_addr_hi;
1328 /* TX buffer descriptor ring count */
1329 u32 txbd_count;
1330
1331 /* RX buffer descriptor ring address */
1332 u32 rxbd_addr_lo;
1333 u32 rxbd_addr_hi;
1334 /* RX buffer descriptor ring count */
1335 u32 rxbd_count;
1336
1337 /* Event buffer descriptor ring address */
1338 u32 evtbd_addr_lo;
1339 u32 evtbd_addr_hi;
1340 /* Event buffer descriptor ring count */
1341 u32 evtbd_count;
1342
1343 /* Sleep cookie buffer physical address */
1344 u32 sleep_cookie_addr_lo;
1345 u32 sleep_cookie_addr_hi;
1346} __packed;
1347
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001348struct mwifiex_ie_types_rssi_threshold {
1349 struct mwifiex_ie_types_header header;
1350 u8 abs_value;
1351 u8 evt_freq;
1352} __packed;
1353
1354struct host_cmd_ds_802_11_subsc_evt {
1355 __le16 action;
1356 __le16 events;
1357} __packed;
1358
Avinash Patilede98bf2012-05-08 18:30:28 -07001359struct mwifiex_ie {
1360 __le16 ie_index;
1361 __le16 mgmt_subtype_mask;
1362 __le16 ie_length;
1363 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1364} __packed;
1365
1366#define MAX_MGMT_IE_INDEX 16
1367struct mwifiex_ie_list {
1368 __le16 type;
1369 __le16 len;
1370 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1371} __packed;
1372
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001373struct host_cmd_ds_command {
1374 __le16 command;
1375 __le16 size;
1376 __le16 seq_num;
1377 __le16 result;
1378 union {
1379 struct host_cmd_ds_get_hw_spec hw_spec;
1380 struct host_cmd_ds_mac_control mac_ctrl;
1381 struct host_cmd_ds_802_11_mac_address mac_addr;
1382 struct host_cmd_ds_mac_multicast_adr mc_addr;
1383 struct host_cmd_ds_802_11_get_log get_log;
1384 struct host_cmd_ds_802_11_rssi_info rssi_info;
1385 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1386 struct host_cmd_ds_802_11_snmp_mib smib;
1387 struct host_cmd_ds_802_11_rf_channel rf_channel;
1388 struct host_cmd_ds_tx_rate_query tx_rate;
1389 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1390 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001391 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001392 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1393 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001394 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1395 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1396 struct host_cmd_ds_802_11_scan scan;
1397 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1398 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1399 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1400 struct host_cmd_ds_802_11_associate associate;
1401 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1402 struct host_cmd_ds_802_11_deauthenticate deauth;
1403 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1404 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1405 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1406 struct host_cmd_ds_802_11d_domain_info domain_info;
1407 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1408 struct host_cmd_ds_11n_addba_req add_ba_req;
1409 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1410 struct host_cmd_ds_11n_delba del_ba;
1411 struct host_cmd_ds_txbuf_cfg tx_buf;
1412 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1413 struct host_cmd_ds_11n_cfg htcfg;
1414 struct host_cmd_ds_wmm_get_status get_wmm_status;
1415 struct host_cmd_ds_802_11_key_material key_material;
1416 struct host_cmd_ds_version_ext verext;
1417 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1418 struct host_cmd_ds_mac_reg_access mac_reg;
1419 struct host_cmd_ds_bbp_reg_access bbp_reg;
1420 struct host_cmd_ds_rf_reg_access rf_reg;
1421 struct host_cmd_ds_pmic_reg_access pmic_reg;
1422 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001423 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001424 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001425 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001426 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001427 } params;
1428} __packed;
1429
1430struct mwifiex_opt_sleep_confirm {
1431 __le16 command;
1432 __le16 size;
1433 __le16 seq_num;
1434 __le16 result;
1435 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001436 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001437} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001438#endif /* !_MWIFIEX_FW_H_ */