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