blob: ebe2f6a7984ce927ab75c689c52d50ba7842bf22 [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)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700131#define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
Avinash Patil96893532012-06-15 12:21:55 -0700132#define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700133#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
134#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
135#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700136#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700137#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
138#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
139#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700140#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700141#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700142#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700143#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700144#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
145#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700146#define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700147#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
148#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700149
150#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
151
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700152#define SSN_MASK 0xfff0
153
154#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700155#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700156
157#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
158
159#define BA_STREAM_NOT_ALLOWED 0xff
160
161#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700162 priv->adapter->config_bands & BAND_AN) && \
163 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700164#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
165 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
166
167#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
168#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700169
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700170#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700171
Avinash Patil22281252012-06-15 12:21:53 -0700172#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
173 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
174 IEEE80211_HT_CAP_SM_PS)
175
176#define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
177
Marc Yang6d2bd912011-03-25 19:47:02 -0700178/* dev_cap bitmap
179 * BIT
180 * 0-16 reserved
181 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
182 * 18-22 reserved
183 * 23 IEEE80211_HT_CAP_SGI_20
184 * 24 IEEE80211_HT_CAP_SGI_40
185 * 25 IEEE80211_HT_CAP_TX_STBC
186 * 26 IEEE80211_HT_CAP_RX_STBC
187 * 27-28 reserved
188 * 29 IEEE80211_HT_CAP_GRN_FLD
189 * 30-31 reserved
190 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700191#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700192#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
193#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
194#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
195#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
196#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
Avinash Patildd0d83c2012-11-27 12:09:20 -0800197#define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
198#define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
Marc Yang6d2bd912011-03-25 19:47:02 -0700199
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700200/* httxcfg bitmap
201 * 0 reserved
202 * 1 20/40 Mhz enable(1)/disable(0)
203 * 2-3 reserved
204 * 4 green field enable(1)/disable(0)
205 * 5 short GI in 20 Mhz enable(1)/disable(0)
206 * 6 short GI in 40 Mhz enable(1)/disable(0)
207 * 7-15 reserved
208 */
209#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
210
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700211#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700212#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800213#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700214
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700215#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
216
217#define LLC_SNAP_LEN 8
218
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700219#define MOD_CLASS_HR_DSSS 0x03
220#define MOD_CLASS_OFDM 0x07
221#define MOD_CLASS_HT 0x08
222#define HT_BW_20 0
223#define HT_BW_40 1
224
225#define HostCmd_CMD_GET_HW_SPEC 0x0003
226#define HostCmd_CMD_802_11_SCAN 0x0006
227#define HostCmd_CMD_802_11_GET_LOG 0x000b
228#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
229#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
230#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
231#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
232#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
233#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
234#define HostCmd_CMD_RF_REG_ACCESS 0x001b
235#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700236#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700237#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700238#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
239#define HostCmd_CMD_MAC_CONTROL 0x0028
240#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
241#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
242#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
243#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
244#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
245#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
246#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
247#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700248#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700249#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
250#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
251#define HostCmd_CMD_VERSION_EXT 0x0097
252#define HostCmd_CMD_RSSI_INFO 0x00a4
253#define HostCmd_CMD_FUNC_INIT 0x00a9
254#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700255#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
256#define HostCmd_CMD_UAP_BSS_START 0x00b1
257#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700258#define HostCmd_CMD_11N_CFG 0x00cd
259#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
260#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
261#define HostCmd_CMD_11N_DELBA 0x00d0
262#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
263#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
264#define HostCmd_CMD_TXPWR_CFG 0x00d1
265#define HostCmd_CMD_TX_RATE_CFG 0x00d6
266#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
267#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700268#define HostCmd_CMD_P2P_MODE_CFG 0x00eb
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700269#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
270#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700271#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Stone Piao3cec6872012-09-25 20:23:34 -0700272#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
Stone Piao7feb4c42012-09-25 20:23:36 -0700273#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700274
Avinash Patilf752dcd2012-05-08 18:30:26 -0700275#define PROTOCOL_NO_SECURITY 0x01
276#define PROTOCOL_STATIC_WEP 0x02
277#define PROTOCOL_WPA 0x08
278#define PROTOCOL_WPA2 0x20
279#define PROTOCOL_WPA2_MIXED 0x28
280#define PROTOCOL_EAP 0x40
281#define KEY_MGMT_NONE 0x04
282#define KEY_MGMT_PSK 0x02
283#define KEY_MGMT_EAP 0x01
284#define CIPHER_TKIP 0x04
285#define CIPHER_AES_CCMP 0x08
286#define VALID_CIPHER_BITMAP 0x0c
287
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700288enum ENH_PS_MODES {
289 EN_PS = 1,
290 DIS_PS = 2,
291 EN_AUTO_DS = 3,
292 DIS_AUTO_DS = 4,
293 SLEEP_CONFIRM = 5,
294 GET_PS = 0,
295 EN_AUTO_PS = 0xff,
296 DIS_AUTO_PS = 0xfe,
297};
298
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700299enum P2P_MODES {
300 P2P_MODE_DISABLE = 0,
301 P2P_MODE_DEVICE = 1,
302 P2P_MODE_GO = 2,
303 P2P_MODE_CLIENT = 3,
304};
305
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700306#define HostCmd_RET_BIT 0x8000
307#define HostCmd_ACT_GEN_GET 0x0000
308#define HostCmd_ACT_GEN_SET 0x0001
Stone Piao7feb4c42012-09-25 20:23:36 -0700309#define HostCmd_ACT_GEN_REMOVE 0x0004
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700310#define HostCmd_ACT_BITWISE_SET 0x0002
311#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700312#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700313
314#define HostCmd_ACT_MAC_RX_ON 0x0001
315#define HostCmd_ACT_MAC_TX_ON 0x0002
316#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
317#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
318#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
319#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700320#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
321
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700322#define HostCmd_BSS_MODE_IBSS 0x0002
323#define HostCmd_BSS_MODE_ANY 0x0003
324
325#define HostCmd_SCAN_RADIO_TYPE_BG 0
326#define HostCmd_SCAN_RADIO_TYPE_A 1
327
328#define HOST_SLEEP_CFG_CANCEL 0xffffffff
Bing Zhaofd4c4512012-09-10 18:30:48 -0700329#define HOST_SLEEP_CFG_COND_DEF 0x00000000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700330#define HOST_SLEEP_CFG_GPIO_DEF 0xff
331#define HOST_SLEEP_CFG_GAP_DEF 0
332
Amitkumar Karwar7532c7d2013-01-17 17:41:57 -0800333#define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
334#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
335
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700336#define CMD_F_HOSTCMD (1 << 0)
337#define CMD_F_CANCELED (1 << 1)
338
339#define HostCmd_CMD_ID_MASK 0x0fff
340
341#define HostCmd_SEQ_NUM_MASK 0x00ff
342
343#define HostCmd_BSS_NUM_MASK 0x0f00
344
345#define HostCmd_BSS_TYPE_MASK 0xf000
346
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700347#define HostCmd_ACT_SET_RX 0x0001
348#define HostCmd_ACT_SET_TX 0x0002
349#define HostCmd_ACT_SET_BOTH 0x0003
350
351#define RF_ANTENNA_AUTO 0xFFFF
352
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700353#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
354 (((seq) & 0x00ff) | \
355 (((num) & 0x000f) << 8)) | \
356 (((type) & 0x000f) << 12); }
357
358#define HostCmd_GET_SEQ_NO(seq) \
359 ((seq) & HostCmd_SEQ_NUM_MASK)
360
361#define HostCmd_GET_BSS_NO(seq) \
362 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
363
364#define HostCmd_GET_BSS_TYPE(seq) \
365 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
366
367#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
368#define EVENT_LINK_LOST 0x00000003
369#define EVENT_LINK_SENSED 0x00000004
370#define EVENT_MIB_CHANGED 0x00000006
371#define EVENT_INIT_DONE 0x00000007
372#define EVENT_DEAUTHENTICATED 0x00000008
373#define EVENT_DISASSOCIATED 0x00000009
374#define EVENT_PS_AWAKE 0x0000000a
375#define EVENT_PS_SLEEP 0x0000000b
376#define EVENT_MIC_ERR_MULTICAST 0x0000000d
377#define EVENT_MIC_ERR_UNICAST 0x0000000e
378#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
379#define EVENT_ADHOC_BCN_LOST 0x00000011
380
381#define EVENT_WMM_STATUS_CHANGE 0x00000017
382#define EVENT_BG_SCAN_REPORT 0x00000018
383#define EVENT_RSSI_LOW 0x00000019
384#define EVENT_SNR_LOW 0x0000001a
385#define EVENT_MAX_FAIL 0x0000001b
386#define EVENT_RSSI_HIGH 0x0000001c
387#define EVENT_SNR_HIGH 0x0000001d
388#define EVENT_IBSS_COALESCED 0x0000001e
389#define EVENT_DATA_RSSI_LOW 0x00000024
390#define EVENT_DATA_SNR_LOW 0x00000025
391#define EVENT_DATA_RSSI_HIGH 0x00000026
392#define EVENT_DATA_SNR_HIGH 0x00000027
393#define EVENT_LINK_QUALITY 0x00000028
394#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700395#define EVENT_UAP_STA_DEAUTH 0x0000002c
396#define EVENT_UAP_STA_ASSOC 0x0000002d
397#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700398#define EVENT_PRE_BEACON_LOST 0x00000031
399#define EVENT_ADDBA 0x00000033
400#define EVENT_DELBA 0x00000034
401#define EVENT_BA_STREAM_TIEMOUT 0x00000037
402#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700403#define EVENT_UAP_BSS_IDLE 0x00000043
404#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700405#define EVENT_WEP_ICV_ERR 0x00000046
406#define EVENT_HS_ACT_REQ 0x00000047
407#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700408#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700409#define EVENT_HOSTWAKE_STAIE 0x0000004d
Stone Piaoeab1c762012-09-25 20:23:37 -0700410#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700411
412#define EVENT_ID_MASK 0xffff
413#define BSS_NUM_MASK 0xf
414
415#define EVENT_GET_BSS_NUM(event_cause) \
416 (((event_cause) >> 16) & BSS_NUM_MASK)
417
418#define EVENT_GET_BSS_TYPE(event_cause) \
419 (((event_cause) >> 24) & 0x00ff)
420
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700421struct mwifiex_ie_types_header {
422 __le16 type;
423 __le16 len;
424} __packed;
425
426struct mwifiex_ie_types_data {
427 struct mwifiex_ie_types_header header;
428 u8 data[1];
429} __packed;
430
431#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
432#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
433
434struct txpd {
435 u8 bss_type;
436 u8 bss_num;
437 __le16 tx_pkt_length;
438 __le16 tx_pkt_offset;
439 __le16 tx_pkt_type;
440 __le32 tx_control;
441 u8 priority;
442 u8 flags;
443 u8 pkt_delay_2ms;
444 u8 reserved1;
445} __packed;
446
447struct rxpd {
448 u8 bss_type;
449 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700450 __le16 rx_pkt_length;
451 __le16 rx_pkt_offset;
452 __le16 rx_pkt_type;
453 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700454 u8 priority;
455 u8 rx_rate;
456 s8 snr;
457 s8 nf;
458 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
459 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
460 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
461 u8 ht_info;
462 u8 reserved;
463} __packed;
464
Avinash Patil838e4f42012-08-03 18:06:08 -0700465struct uap_txpd {
466 u8 bss_type;
467 u8 bss_num;
468 __le16 tx_pkt_length;
469 __le16 tx_pkt_offset;
470 __le16 tx_pkt_type;
471 __le32 tx_control;
472 u8 priority;
473 u8 flags;
474 u8 pkt_delay_2ms;
475 u8 reserved1;
476 __le32 reserved2;
477};
478
479struct uap_rxpd {
480 u8 bss_type;
481 u8 bss_num;
482 __le16 rx_pkt_length;
483 __le16 rx_pkt_offset;
484 __le16 rx_pkt_type;
485 __le16 seq_num;
486 u8 priority;
487 u8 reserved1;
488};
489
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700490enum mwifiex_chan_scan_mode_bitmasks {
491 MWIFIEX_PASSIVE_SCAN = BIT(0),
492 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
493};
494
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700495struct mwifiex_chan_scan_param_set {
496 u8 radio_type;
497 u8 chan_number;
498 u8 chan_scan_mode_bitmap;
499 __le16 min_scan_time;
500 __le16 max_scan_time;
501} __packed;
502
503struct mwifiex_ie_types_chan_list_param_set {
504 struct mwifiex_ie_types_header header;
505 struct mwifiex_chan_scan_param_set chan_scan_param[1];
506} __packed;
507
508struct chan_band_param_set {
509 u8 radio_type;
510 u8 chan_number;
511};
512
513struct mwifiex_ie_types_chan_band_list_param_set {
514 struct mwifiex_ie_types_header header;
515 struct chan_band_param_set chan_band_param[1];
516} __packed;
517
518struct mwifiex_ie_types_rates_param_set {
519 struct mwifiex_ie_types_header header;
520 u8 rates[1];
521} __packed;
522
523struct mwifiex_ie_types_ssid_param_set {
524 struct mwifiex_ie_types_header header;
525 u8 ssid[1];
526} __packed;
527
528struct mwifiex_ie_types_num_probes {
529 struct mwifiex_ie_types_header header;
530 __le16 num_probes;
531} __packed;
532
533struct mwifiex_ie_types_wildcard_ssid_params {
534 struct mwifiex_ie_types_header header;
535 u8 max_ssid_length;
536 u8 ssid[1];
537} __packed;
538
539#define TSF_DATA_SIZE 8
540struct mwifiex_ie_types_tsf_timestamp {
541 struct mwifiex_ie_types_header header;
542 u8 tsf_data[1];
543} __packed;
544
545struct mwifiex_cf_param_set {
546 u8 cfp_cnt;
547 u8 cfp_period;
548 u16 cfp_max_duration;
549 u16 cfp_duration_remaining;
550} __packed;
551
552struct mwifiex_ibss_param_set {
553 u16 atim_window;
554} __packed;
555
556struct mwifiex_ie_types_ss_param_set {
557 struct mwifiex_ie_types_header header;
558 union {
559 struct mwifiex_cf_param_set cf_param_set[1];
560 struct mwifiex_ibss_param_set ibss_param_set[1];
561 } cf_ibss;
562} __packed;
563
564struct mwifiex_fh_param_set {
565 u16 dwell_time;
566 u8 hop_set;
567 u8 hop_pattern;
568 u8 hop_index;
569} __packed;
570
571struct mwifiex_ds_param_set {
572 u8 current_chan;
573} __packed;
574
575struct mwifiex_ie_types_phy_param_set {
576 struct mwifiex_ie_types_header header;
577 union {
578 struct mwifiex_fh_param_set fh_param_set[1];
579 struct mwifiex_ds_param_set ds_param_set[1];
580 } fh_ds;
581} __packed;
582
583struct mwifiex_ie_types_auth_type {
584 struct mwifiex_ie_types_header header;
585 __le16 auth_type;
586} __packed;
587
588struct mwifiex_ie_types_vendor_param_set {
589 struct mwifiex_ie_types_header header;
590 u8 ie[MWIFIEX_MAX_VSIE_LEN];
591};
592
593struct mwifiex_ie_types_rsn_param_set {
594 struct mwifiex_ie_types_header header;
595 u8 rsn_ie[1];
596} __packed;
597
598#define KEYPARAMSET_FIXED_LEN 6
599
600struct mwifiex_ie_type_key_param_set {
601 __le16 type;
602 __le16 length;
603 __le16 key_type_id;
604 __le16 key_info;
605 __le16 key_len;
606 u8 key[50];
607} __packed;
608
Ying Luob877f4c2012-08-03 18:06:14 -0700609#define IGTK_PN_LEN 8
610
611struct mwifiex_cmac_param {
612 u8 ipn[IGTK_PN_LEN];
613 u8 key[WLAN_KEY_LEN_AES_CMAC];
614} __packed;
615
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700616struct host_cmd_ds_802_11_key_material {
617 __le16 action;
618 struct mwifiex_ie_type_key_param_set key_param_set;
619} __packed;
620
621struct host_cmd_ds_gen {
622 u16 command;
623 u16 size;
624 u16 seq_num;
625 u16 result;
626};
627
628#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
629
630enum sleep_resp_ctrl {
631 RESP_NOT_NEEDED = 0,
632 RESP_NEEDED,
633};
634
635struct mwifiex_ps_param {
636 __le16 null_pkt_interval;
637 __le16 multiple_dtims;
638 __le16 bcn_miss_timeout;
639 __le16 local_listen_interval;
640 __le16 adhoc_wake_period;
641 __le16 mode;
642 __le16 delay_to_ps;
643};
644
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700645#define BITMAP_AUTO_DS 0x01
646#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700647
648struct mwifiex_ie_types_auto_ds_param {
649 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700650 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700651} __packed;
652
653struct mwifiex_ie_types_ps_param {
654 struct mwifiex_ie_types_header header;
655 struct mwifiex_ps_param param;
656} __packed;
657
658struct host_cmd_ds_802_11_ps_mode_enh {
659 __le16 action;
660
661 union {
662 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700663 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700664 } params;
665} __packed;
666
667struct host_cmd_ds_get_hw_spec {
668 __le16 hw_if_version;
669 __le16 version;
670 __le16 reserved;
671 __le16 num_of_mcast_adr;
672 u8 permanent_addr[ETH_ALEN];
673 __le16 region_code;
674 __le16 number_of_antenna;
675 __le32 fw_release_number;
676 __le32 reserved_1;
677 __le32 reserved_2;
678 __le32 reserved_3;
679 __le32 fw_cap_info;
680 __le32 dot_11n_dev_cap;
681 u8 dev_mcs_support;
682 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
683 __le16 reserved_4;
684} __packed;
685
686struct host_cmd_ds_802_11_rssi_info {
687 __le16 action;
688 __le16 ndata;
689 __le16 nbcn;
690 __le16 reserved[9];
691 long long reserved_1;
692};
693
694struct host_cmd_ds_802_11_rssi_info_rsp {
695 __le16 action;
696 __le16 ndata;
697 __le16 nbcn;
698 __le16 data_rssi_last;
699 __le16 data_nf_last;
700 __le16 data_rssi_avg;
701 __le16 data_nf_avg;
702 __le16 bcn_rssi_last;
703 __le16 bcn_nf_last;
704 __le16 bcn_rssi_avg;
705 __le16 bcn_nf_avg;
706 long long tsf_bcn;
707};
708
709struct host_cmd_ds_802_11_mac_address {
710 __le16 action;
711 u8 mac_addr[ETH_ALEN];
712};
713
714struct host_cmd_ds_mac_control {
715 __le16 action;
716 __le16 reserved;
717};
718
719struct host_cmd_ds_mac_multicast_adr {
720 __le16 action;
721 __le16 num_of_adrs;
722 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
723} __packed;
724
725struct host_cmd_ds_802_11_deauthenticate {
726 u8 mac_addr[ETH_ALEN];
727 __le16 reason_code;
728} __packed;
729
730struct host_cmd_ds_802_11_associate {
731 u8 peer_sta_addr[ETH_ALEN];
732 __le16 cap_info_bitmap;
733 __le16 listen_interval;
734 __le16 beacon_period;
735 u8 dtim_period;
736} __packed;
737
738struct ieee_types_assoc_rsp {
739 __le16 cap_info_bitmap;
740 __le16 status_code;
741 __le16 a_id;
742 u8 ie_buffer[1];
743} __packed;
744
745struct host_cmd_ds_802_11_associate_rsp {
746 struct ieee_types_assoc_rsp assoc_rsp;
747} __packed;
748
749struct ieee_types_cf_param_set {
750 u8 element_id;
751 u8 len;
752 u8 cfp_cnt;
753 u8 cfp_period;
754 u16 cfp_max_duration;
755 u16 cfp_duration_remaining;
756} __packed;
757
758struct ieee_types_ibss_param_set {
759 u8 element_id;
760 u8 len;
761 __le16 atim_window;
762} __packed;
763
764union ieee_types_ss_param_set {
765 struct ieee_types_cf_param_set cf_param_set;
766 struct ieee_types_ibss_param_set ibss_param_set;
767} __packed;
768
769struct ieee_types_fh_param_set {
770 u8 element_id;
771 u8 len;
772 __le16 dwell_time;
773 u8 hop_set;
774 u8 hop_pattern;
775 u8 hop_index;
776} __packed;
777
778struct ieee_types_ds_param_set {
779 u8 element_id;
780 u8 len;
781 u8 current_chan;
782} __packed;
783
784union ieee_types_phy_param_set {
785 struct ieee_types_fh_param_set fh_param_set;
786 struct ieee_types_ds_param_set ds_param_set;
787} __packed;
788
789struct host_cmd_ds_802_11_ad_hoc_start {
790 u8 ssid[IEEE80211_MAX_SSID_LEN];
791 u8 bss_mode;
792 __le16 beacon_period;
793 u8 dtim_period;
794 union ieee_types_ss_param_set ss_param_set;
795 union ieee_types_phy_param_set phy_param_set;
796 u16 reserved1;
797 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800798 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700799} __packed;
800
801struct host_cmd_ds_802_11_ad_hoc_result {
802 u8 pad[3];
803 u8 bssid[ETH_ALEN];
804} __packed;
805
806struct adhoc_bss_desc {
807 u8 bssid[ETH_ALEN];
808 u8 ssid[IEEE80211_MAX_SSID_LEN];
809 u8 bss_mode;
810 __le16 beacon_period;
811 u8 dtim_period;
812 u8 time_stamp[8];
813 u8 local_time[8];
814 union ieee_types_phy_param_set phy_param_set;
815 union ieee_types_ss_param_set ss_param_set;
816 __le16 cap_info_bitmap;
817 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
818
819 /*
820 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
821 * It is used in the Adhoc join command and will cause a
822 * binary layout mismatch with the firmware
823 */
824} __packed;
825
826struct host_cmd_ds_802_11_ad_hoc_join {
827 struct adhoc_bss_desc bss_descriptor;
828 u16 reserved1;
829 u16 reserved2;
830} __packed;
831
832struct host_cmd_ds_802_11_get_log {
833 __le32 mcast_tx_frame;
834 __le32 failed;
835 __le32 retry;
836 __le32 multi_retry;
837 __le32 frame_dup;
838 __le32 rts_success;
839 __le32 rts_failure;
840 __le32 ack_failure;
841 __le32 rx_frag;
842 __le32 mcast_rx_frame;
843 __le32 fcs_error;
844 __le32 tx_frame;
845 __le32 reserved;
846 __le32 wep_icv_err_cnt[4];
847};
848
849struct host_cmd_ds_tx_rate_query {
850 u8 tx_rate;
851 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
852 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
853 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
854 u8 ht_info;
855} __packed;
856
857enum Host_Sleep_Action {
858 HS_CONFIGURE = 0x0001,
859 HS_ACTIVATE = 0x0002,
860};
861
862struct mwifiex_hs_config_param {
863 __le32 conditions;
864 u8 gpio;
865 u8 gap;
866} __packed;
867
868struct hs_activate_param {
869 u16 resp_ctrl;
870} __packed;
871
872struct host_cmd_ds_802_11_hs_cfg_enh {
873 __le16 action;
874
875 union {
876 struct mwifiex_hs_config_param hs_config;
877 struct hs_activate_param hs_activate;
878 } params;
879} __packed;
880
881enum SNMP_MIB_INDEX {
882 OP_RATE_SET_I = 1,
883 DTIM_PERIOD_I = 3,
884 RTS_THRESH_I = 5,
885 SHORT_RETRY_LIM_I = 6,
886 LONG_RETRY_LIM_I = 7,
887 FRAG_THRESH_I = 8,
888 DOT11D_I = 9,
889};
890
891#define MAX_SNMP_BUF_SIZE 128
892
893struct host_cmd_ds_802_11_snmp_mib {
894 __le16 query_type;
895 __le16 oid;
896 __le16 buf_size;
897 u8 value[1];
898} __packed;
899
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700900struct mwifiex_rate_scope {
901 __le16 type;
902 __le16 length;
903 __le16 hr_dsss_rate_bitmap;
904 __le16 ofdm_rate_bitmap;
905 __le16 ht_mcs_rate_bitmap[8];
906} __packed;
907
908struct mwifiex_rate_drop_pattern {
909 __le16 type;
910 __le16 length;
911 __le32 rate_drop_mode;
912} __packed;
913
914struct host_cmd_ds_tx_rate_cfg {
915 __le16 action;
916 __le16 cfg_index;
917} __packed;
918
919struct mwifiex_power_group {
920 u8 modulation_class;
921 u8 first_rate_code;
922 u8 last_rate_code;
923 s8 power_step;
924 s8 power_min;
925 s8 power_max;
926 u8 ht_bandwidth;
927 u8 reserved;
928} __packed;
929
930struct mwifiex_types_power_group {
931 u16 type;
932 u16 length;
933} __packed;
934
935struct host_cmd_ds_txpwr_cfg {
936 __le16 action;
937 __le16 cfg_index;
938 __le32 mode;
939} __packed;
940
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700941struct host_cmd_ds_rf_tx_pwr {
942 __le16 action;
943 __le16 cur_level;
944 u8 max_power;
945 u8 min_power;
946} __packed;
947
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700948struct host_cmd_ds_rf_ant_mimo {
949 __le16 action_tx;
950 __le16 tx_ant_mode;
951 __le16 action_rx;
952 __le16 rx_ant_mode;
953};
954
955struct host_cmd_ds_rf_ant_siso {
956 __le16 action;
957 __le16 ant_mode;
958};
959
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700960struct mwifiex_bcn_param {
961 u8 bssid[ETH_ALEN];
962 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700963 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700964 __le16 beacon_period;
965 __le16 cap_info_bitmap;
966} __packed;
967
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700968#define MWIFIEX_USER_SCAN_CHAN_MAX 50
969
970#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
971
972struct mwifiex_scan_cmd_config {
973 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700974 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700975 */
976 u8 bss_mode;
977
978 /* Specific BSSID used to filter scan results in the firmware */
979 u8 specific_bssid[ETH_ALEN];
980
981 /* Length of TLVs sent in command starting at tlvBuffer */
982 u32 tlv_buf_len;
983
984 /*
985 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
986 *
987 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
988 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
989 */
990 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
991 here */
992} __packed;
993
994struct mwifiex_user_scan_chan {
995 u8 chan_number;
996 u8 radio_type;
997 u8 scan_type;
998 u8 reserved;
999 u32 scan_time;
1000} __packed;
1001
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001002struct mwifiex_user_scan_cfg {
1003 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001004 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001005 */
1006 u8 bss_mode;
1007 /* Configure the number of probe requests for active chan scans */
1008 u8 num_probes;
1009 u8 reserved;
1010 /* BSSID filter sent in the firmware command to limit the results */
1011 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -08001012 /* SSID filter list used in the firmware to limit the scan results */
1013 struct cfg80211_ssid *ssid_list;
1014 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001015 /* Variable number (fixed maximum) of channels to scan up */
1016 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
1017} __packed;
1018
1019struct ie_body {
1020 u8 grp_key_oui[4];
1021 u8 ptk_cnt[2];
1022 u8 ptk_body[4];
1023} __packed;
1024
1025struct host_cmd_ds_802_11_scan {
1026 u8 bss_mode;
1027 u8 bssid[ETH_ALEN];
1028 u8 tlv_buffer[1];
1029} __packed;
1030
1031struct host_cmd_ds_802_11_scan_rsp {
1032 __le16 bss_descript_size;
1033 u8 number_of_sets;
1034 u8 bss_desc_and_tlv_buffer[1];
1035} __packed;
1036
1037struct host_cmd_ds_802_11_bg_scan_query {
1038 u8 flush;
1039} __packed;
1040
1041struct host_cmd_ds_802_11_bg_scan_query_rsp {
1042 u32 report_condition;
1043 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1044} __packed;
1045
1046struct mwifiex_ietypes_domain_param_set {
1047 struct mwifiex_ie_types_header header;
1048 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1049 struct ieee80211_country_ie_triplet triplet[1];
1050} __packed;
1051
1052struct host_cmd_ds_802_11d_domain_info {
1053 __le16 action;
1054 struct mwifiex_ietypes_domain_param_set domain;
1055} __packed;
1056
1057struct host_cmd_ds_802_11d_domain_info_rsp {
1058 __le16 action;
1059 struct mwifiex_ietypes_domain_param_set domain;
1060} __packed;
1061
1062struct host_cmd_ds_11n_addba_req {
1063 u8 add_req_result;
1064 u8 peer_mac_addr[ETH_ALEN];
1065 u8 dialog_token;
1066 __le16 block_ack_param_set;
1067 __le16 block_ack_tmo;
1068 __le16 ssn;
1069} __packed;
1070
1071struct host_cmd_ds_11n_addba_rsp {
1072 u8 add_rsp_result;
1073 u8 peer_mac_addr[ETH_ALEN];
1074 u8 dialog_token;
1075 __le16 status_code;
1076 __le16 block_ack_param_set;
1077 __le16 block_ack_tmo;
1078 __le16 ssn;
1079} __packed;
1080
1081struct host_cmd_ds_11n_delba {
1082 u8 del_result;
1083 u8 peer_mac_addr[ETH_ALEN];
1084 __le16 del_ba_param_set;
1085 __le16 reason_code;
1086 u8 reserved;
1087} __packed;
1088
1089struct host_cmd_ds_11n_batimeout {
1090 u8 tid;
1091 u8 peer_mac_addr[ETH_ALEN];
1092 u8 origninator;
1093} __packed;
1094
1095struct host_cmd_ds_11n_cfg {
1096 __le16 action;
1097 __le16 ht_tx_cap;
1098 __le16 ht_tx_info;
1099} __packed;
1100
1101struct host_cmd_ds_txbuf_cfg {
1102 __le16 action;
1103 __le16 buff_size;
1104 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1105 __le16 reserved3;
1106} __packed;
1107
1108struct host_cmd_ds_amsdu_aggr_ctrl {
1109 __le16 action;
1110 __le16 enable;
1111 __le16 curr_buf_size;
1112} __packed;
1113
1114struct mwifiex_ie_types_wmm_param_set {
1115 struct mwifiex_ie_types_header header;
1116 u8 wmm_ie[1];
1117};
1118
1119struct mwifiex_ie_types_wmm_queue_status {
1120 struct mwifiex_ie_types_header header;
1121 u8 queue_index;
1122 u8 disabled;
1123 u16 medium_time;
1124 u8 flow_required;
1125 u8 flow_created;
1126 u32 reserved;
1127};
1128
1129struct ieee_types_vendor_header {
1130 u8 element_id;
1131 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001132 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001133 u8 oui_subtype;
1134 u8 version;
1135} __packed;
1136
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001137struct ieee_types_wmm_parameter {
1138 /*
1139 * WMM Parameter IE - Vendor Specific Header:
1140 * element_id [221/0xdd]
1141 * Len [24]
1142 * Oui [00:50:f2]
1143 * OuiType [2]
1144 * OuiSubType [1]
1145 * Version [1]
1146 */
1147 struct ieee_types_vendor_header vend_hdr;
1148 u8 qos_info_bitmap;
1149 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001150 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001151} __packed;
1152
1153struct ieee_types_wmm_info {
1154
1155 /*
1156 * WMM Info IE - Vendor Specific Header:
1157 * element_id [221/0xdd]
1158 * Len [7]
1159 * Oui [00:50:f2]
1160 * OuiType [2]
1161 * OuiSubType [0]
1162 * Version [1]
1163 */
1164 struct ieee_types_vendor_header vend_hdr;
1165
1166 u8 qos_info_bitmap;
1167} __packed;
1168
1169struct host_cmd_ds_wmm_get_status {
1170 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001171 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001172 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1173} __packed;
1174
1175struct mwifiex_wmm_ac_status {
1176 u8 disabled;
1177 u8 flow_required;
1178 u8 flow_created;
1179};
1180
1181struct mwifiex_ie_types_htcap {
1182 struct mwifiex_ie_types_header header;
1183 struct ieee80211_ht_cap ht_cap;
1184} __packed;
1185
Avinash Patil54428c52013-01-02 16:56:01 -08001186struct mwifiex_ie_types_wmmcap {
1187 struct mwifiex_ie_types_header header;
1188 struct mwifiex_types_wmm_info wmm_info;
1189} __packed;
1190
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001191struct mwifiex_ie_types_htinfo {
1192 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001193 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001194} __packed;
1195
1196struct mwifiex_ie_types_2040bssco {
1197 struct mwifiex_ie_types_header header;
1198 u8 bss_co_2040;
1199} __packed;
1200
1201struct mwifiex_ie_types_extcap {
1202 struct mwifiex_ie_types_header header;
1203 u8 ext_cap;
1204} __packed;
1205
1206struct host_cmd_ds_mac_reg_access {
1207 __le16 action;
1208 __le16 offset;
1209 __le32 value;
1210} __packed;
1211
1212struct host_cmd_ds_bbp_reg_access {
1213 __le16 action;
1214 __le16 offset;
1215 u8 value;
1216 u8 reserved[3];
1217} __packed;
1218
1219struct host_cmd_ds_rf_reg_access {
1220 __le16 action;
1221 __le16 offset;
1222 u8 value;
1223 u8 reserved[3];
1224} __packed;
1225
1226struct host_cmd_ds_pmic_reg_access {
1227 __le16 action;
1228 __le16 offset;
1229 u8 value;
1230 u8 reserved[3];
1231} __packed;
1232
1233struct host_cmd_ds_802_11_eeprom_access {
1234 __le16 action;
1235
1236 __le16 offset;
1237 __le16 byte_count;
1238 u8 value;
1239} __packed;
1240
Avinash Patil75edd2c2012-05-08 18:30:18 -07001241struct host_cmd_tlv {
1242 __le16 type;
1243 __le16 len;
1244} __packed;
1245
Avinash Patile5686342012-05-08 18:30:25 -07001246struct mwifiex_assoc_event {
1247 u8 sta_addr[ETH_ALEN];
1248 __le16 type;
1249 __le16 len;
1250 __le16 frame_control;
1251 __le16 cap_info;
1252 __le16 listen_interval;
1253 u8 data[0];
1254} __packed;
1255
Avinash Patil4db16a12012-05-08 18:30:20 -07001256struct host_cmd_ds_sys_config {
1257 __le16 action;
1258 u8 tlv[0];
1259};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001260
1261struct host_cmd_tlv_akmp {
1262 struct host_cmd_tlv tlv;
1263 __le16 key_mgmt;
1264 __le16 key_mgmt_operation;
1265} __packed;
1266
1267struct host_cmd_tlv_pwk_cipher {
1268 struct host_cmd_tlv tlv;
1269 __le16 proto;
1270 u8 cipher;
1271 u8 reserved;
1272} __packed;
1273
1274struct host_cmd_tlv_gwk_cipher {
1275 struct host_cmd_tlv tlv;
1276 u8 cipher;
1277 u8 reserved;
1278} __packed;
1279
1280struct host_cmd_tlv_passphrase {
1281 struct host_cmd_tlv tlv;
1282 u8 passphrase[0];
1283} __packed;
1284
Avinash Patil96893532012-06-15 12:21:55 -07001285struct host_cmd_tlv_wep_key {
1286 struct host_cmd_tlv tlv;
1287 u8 key_index;
1288 u8 is_default;
1289 u8 key[1];
1290};
1291
Avinash Patilf752dcd2012-05-08 18:30:26 -07001292struct host_cmd_tlv_auth_type {
1293 struct host_cmd_tlv tlv;
1294 u8 auth_type;
1295} __packed;
1296
1297struct host_cmd_tlv_encrypt_protocol {
1298 struct host_cmd_tlv tlv;
1299 __le16 proto;
1300} __packed;
1301
Avinash Patil12190c52012-05-08 18:30:24 -07001302struct host_cmd_tlv_ssid {
1303 struct host_cmd_tlv tlv;
1304 u8 ssid[0];
1305} __packed;
1306
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001307struct host_cmd_tlv_rates {
1308 struct host_cmd_tlv tlv;
1309 u8 rates[0];
1310} __packed;
1311
Avinash Patil605b73a2012-05-16 21:24:55 -07001312struct host_cmd_tlv_bcast_ssid {
1313 struct host_cmd_tlv tlv;
1314 u8 bcast_ctl;
1315} __packed;
1316
Avinash Patil12190c52012-05-08 18:30:24 -07001317struct host_cmd_tlv_beacon_period {
1318 struct host_cmd_tlv tlv;
1319 __le16 period;
1320} __packed;
1321
1322struct host_cmd_tlv_dtim_period {
1323 struct host_cmd_tlv tlv;
1324 u8 period;
1325} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001326
Avinash Patil9b930ea2012-05-08 18:30:23 -07001327struct host_cmd_tlv_frag_threshold {
1328 struct host_cmd_tlv tlv;
1329 __le16 frag_thr;
1330} __packed;
1331
1332struct host_cmd_tlv_rts_threshold {
1333 struct host_cmd_tlv tlv;
1334 __le16 rts_thr;
1335} __packed;
1336
1337struct host_cmd_tlv_retry_limit {
1338 struct host_cmd_tlv tlv;
1339 u8 limit;
1340} __packed;
1341
Avinash Patil75edd2c2012-05-08 18:30:18 -07001342struct host_cmd_tlv_mac_addr {
1343 struct host_cmd_tlv tlv;
1344 u8 mac_addr[ETH_ALEN];
1345} __packed;
1346
Avinash Patil4db16a12012-05-08 18:30:20 -07001347struct host_cmd_tlv_channel_band {
1348 struct host_cmd_tlv tlv;
1349 u8 band_config;
1350 u8 channel;
1351} __packed;
1352
Kevin Gan8b4509f2012-09-25 20:23:45 -07001353struct host_cmd_tlv_ageout_timer {
1354 struct host_cmd_tlv tlv;
1355 __le32 sta_ao_timer;
1356} __packed;
1357
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001358struct host_cmd_ds_version_ext {
1359 u8 version_str_sel;
1360 char version_str[128];
1361} __packed;
1362
Stone Piao3cec6872012-09-25 20:23:34 -07001363struct host_cmd_ds_mgmt_frame_reg {
1364 __le16 action;
1365 __le32 mask;
1366} __packed;
1367
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001368struct host_cmd_ds_p2p_mode_cfg {
1369 __le16 action;
1370 __le16 mode;
1371} __packed;
1372
Stone Piao7feb4c42012-09-25 20:23:36 -07001373struct host_cmd_ds_remain_on_chan {
1374 __le16 action;
1375 u8 status;
1376 u8 reserved;
1377 u8 band_cfg;
1378 u8 channel;
1379 __le32 duration;
1380} __packed;
1381
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001382struct host_cmd_ds_802_11_ibss_status {
1383 __le16 action;
1384 __le16 enable;
1385 u8 bssid[ETH_ALEN];
1386 __le16 beacon_interval;
1387 __le16 atim_window;
1388 __le16 use_g_rate_protect;
1389} __packed;
1390
1391#define CONNECTION_TYPE_INFRA 0
1392#define CONNECTION_TYPE_ADHOC 1
Stone Piao9197ab92012-09-25 20:23:42 -07001393#define CONNECTION_TYPE_AP 2
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001394
1395struct host_cmd_ds_set_bss_mode {
1396 u8 con_type;
1397} __packed;
1398
Amitkumar Karward930fae2011-10-11 17:41:21 -07001399struct host_cmd_ds_pcie_details {
1400 /* TX buffer descriptor ring address */
1401 u32 txbd_addr_lo;
1402 u32 txbd_addr_hi;
1403 /* TX buffer descriptor ring count */
1404 u32 txbd_count;
1405
1406 /* RX buffer descriptor ring address */
1407 u32 rxbd_addr_lo;
1408 u32 rxbd_addr_hi;
1409 /* RX buffer descriptor ring count */
1410 u32 rxbd_count;
1411
1412 /* Event buffer descriptor ring address */
1413 u32 evtbd_addr_lo;
1414 u32 evtbd_addr_hi;
1415 /* Event buffer descriptor ring count */
1416 u32 evtbd_count;
1417
1418 /* Sleep cookie buffer physical address */
1419 u32 sleep_cookie_addr_lo;
1420 u32 sleep_cookie_addr_hi;
1421} __packed;
1422
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001423struct mwifiex_ie_types_rssi_threshold {
1424 struct mwifiex_ie_types_header header;
1425 u8 abs_value;
1426 u8 evt_freq;
1427} __packed;
1428
1429struct host_cmd_ds_802_11_subsc_evt {
1430 __le16 action;
1431 __le16 events;
1432} __packed;
1433
Avinash Patilede98bf2012-05-08 18:30:28 -07001434struct mwifiex_ie {
1435 __le16 ie_index;
1436 __le16 mgmt_subtype_mask;
1437 __le16 ie_length;
1438 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1439} __packed;
1440
1441#define MAX_MGMT_IE_INDEX 16
1442struct mwifiex_ie_list {
1443 __le16 type;
1444 __le16 len;
1445 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1446} __packed;
1447
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001448struct host_cmd_ds_command {
1449 __le16 command;
1450 __le16 size;
1451 __le16 seq_num;
1452 __le16 result;
1453 union {
1454 struct host_cmd_ds_get_hw_spec hw_spec;
1455 struct host_cmd_ds_mac_control mac_ctrl;
1456 struct host_cmd_ds_802_11_mac_address mac_addr;
1457 struct host_cmd_ds_mac_multicast_adr mc_addr;
1458 struct host_cmd_ds_802_11_get_log get_log;
1459 struct host_cmd_ds_802_11_rssi_info rssi_info;
1460 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1461 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001462 struct host_cmd_ds_tx_rate_query tx_rate;
1463 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1464 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001465 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001466 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1467 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001468 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1469 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1470 struct host_cmd_ds_802_11_scan scan;
1471 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1472 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1473 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1474 struct host_cmd_ds_802_11_associate associate;
1475 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1476 struct host_cmd_ds_802_11_deauthenticate deauth;
1477 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1478 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1479 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1480 struct host_cmd_ds_802_11d_domain_info domain_info;
1481 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1482 struct host_cmd_ds_11n_addba_req add_ba_req;
1483 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1484 struct host_cmd_ds_11n_delba del_ba;
1485 struct host_cmd_ds_txbuf_cfg tx_buf;
1486 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1487 struct host_cmd_ds_11n_cfg htcfg;
1488 struct host_cmd_ds_wmm_get_status get_wmm_status;
1489 struct host_cmd_ds_802_11_key_material key_material;
1490 struct host_cmd_ds_version_ext verext;
Stone Piao3cec6872012-09-25 20:23:34 -07001491 struct host_cmd_ds_mgmt_frame_reg reg_mask;
Stone Piao7feb4c42012-09-25 20:23:36 -07001492 struct host_cmd_ds_remain_on_chan roc_cfg;
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001493 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001494 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1495 struct host_cmd_ds_mac_reg_access mac_reg;
1496 struct host_cmd_ds_bbp_reg_access bbp_reg;
1497 struct host_cmd_ds_rf_reg_access rf_reg;
1498 struct host_cmd_ds_pmic_reg_access pmic_reg;
1499 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001500 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001501 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001502 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001503 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001504 } params;
1505} __packed;
1506
1507struct mwifiex_opt_sleep_confirm {
1508 __le16 command;
1509 __le16 size;
1510 __le16 seq_num;
1511 __le16 result;
1512 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001513 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001514} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001515#endif /* !_MWIFIEX_FW_H_ */