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