blob: 7887848448e995c4ac2c5f0b703d8383c7632e53 [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
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700264#define HostCmd_CMD_P2P_MODE_CFG 0x00eb
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700265#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
266#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700267#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Stone Piao3cec6872012-09-25 20:23:34 -0700268#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
Stone Piao7feb4c42012-09-25 20:23:36 -0700269#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700270
Avinash Patilf752dcd2012-05-08 18:30:26 -0700271#define PROTOCOL_NO_SECURITY 0x01
272#define PROTOCOL_STATIC_WEP 0x02
273#define PROTOCOL_WPA 0x08
274#define PROTOCOL_WPA2 0x20
275#define PROTOCOL_WPA2_MIXED 0x28
276#define PROTOCOL_EAP 0x40
277#define KEY_MGMT_NONE 0x04
278#define KEY_MGMT_PSK 0x02
279#define KEY_MGMT_EAP 0x01
280#define CIPHER_TKIP 0x04
281#define CIPHER_AES_CCMP 0x08
282#define VALID_CIPHER_BITMAP 0x0c
283
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700284enum ENH_PS_MODES {
285 EN_PS = 1,
286 DIS_PS = 2,
287 EN_AUTO_DS = 3,
288 DIS_AUTO_DS = 4,
289 SLEEP_CONFIRM = 5,
290 GET_PS = 0,
291 EN_AUTO_PS = 0xff,
292 DIS_AUTO_PS = 0xfe,
293};
294
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700295enum P2P_MODES {
296 P2P_MODE_DISABLE = 0,
297 P2P_MODE_DEVICE = 1,
298 P2P_MODE_GO = 2,
299 P2P_MODE_CLIENT = 3,
300};
301
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700302#define HostCmd_RET_BIT 0x8000
303#define HostCmd_ACT_GEN_GET 0x0000
304#define HostCmd_ACT_GEN_SET 0x0001
Stone Piao7feb4c42012-09-25 20:23:36 -0700305#define HostCmd_ACT_GEN_REMOVE 0x0004
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700306#define HostCmd_ACT_BITWISE_SET 0x0002
307#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700308#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700309
310#define HostCmd_ACT_MAC_RX_ON 0x0001
311#define HostCmd_ACT_MAC_TX_ON 0x0002
312#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
313#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
314#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
315#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700316#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
317
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700318#define HostCmd_BSS_MODE_IBSS 0x0002
319#define HostCmd_BSS_MODE_ANY 0x0003
320
321#define HostCmd_SCAN_RADIO_TYPE_BG 0
322#define HostCmd_SCAN_RADIO_TYPE_A 1
323
324#define HOST_SLEEP_CFG_CANCEL 0xffffffff
Bing Zhaofd4c4512012-09-10 18:30:48 -0700325#define HOST_SLEEP_CFG_COND_DEF 0x00000000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700326#define HOST_SLEEP_CFG_GPIO_DEF 0xff
327#define HOST_SLEEP_CFG_GAP_DEF 0
328
329#define CMD_F_HOSTCMD (1 << 0)
330#define CMD_F_CANCELED (1 << 1)
331
332#define HostCmd_CMD_ID_MASK 0x0fff
333
334#define HostCmd_SEQ_NUM_MASK 0x00ff
335
336#define HostCmd_BSS_NUM_MASK 0x0f00
337
338#define HostCmd_BSS_TYPE_MASK 0xf000
339
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700340#define HostCmd_ACT_SET_RX 0x0001
341#define HostCmd_ACT_SET_TX 0x0002
342#define HostCmd_ACT_SET_BOTH 0x0003
343
344#define RF_ANTENNA_AUTO 0xFFFF
345
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700346#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
347 (((seq) & 0x00ff) | \
348 (((num) & 0x000f) << 8)) | \
349 (((type) & 0x000f) << 12); }
350
351#define HostCmd_GET_SEQ_NO(seq) \
352 ((seq) & HostCmd_SEQ_NUM_MASK)
353
354#define HostCmd_GET_BSS_NO(seq) \
355 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
356
357#define HostCmd_GET_BSS_TYPE(seq) \
358 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
359
360#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
361#define EVENT_LINK_LOST 0x00000003
362#define EVENT_LINK_SENSED 0x00000004
363#define EVENT_MIB_CHANGED 0x00000006
364#define EVENT_INIT_DONE 0x00000007
365#define EVENT_DEAUTHENTICATED 0x00000008
366#define EVENT_DISASSOCIATED 0x00000009
367#define EVENT_PS_AWAKE 0x0000000a
368#define EVENT_PS_SLEEP 0x0000000b
369#define EVENT_MIC_ERR_MULTICAST 0x0000000d
370#define EVENT_MIC_ERR_UNICAST 0x0000000e
371#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
372#define EVENT_ADHOC_BCN_LOST 0x00000011
373
374#define EVENT_WMM_STATUS_CHANGE 0x00000017
375#define EVENT_BG_SCAN_REPORT 0x00000018
376#define EVENT_RSSI_LOW 0x00000019
377#define EVENT_SNR_LOW 0x0000001a
378#define EVENT_MAX_FAIL 0x0000001b
379#define EVENT_RSSI_HIGH 0x0000001c
380#define EVENT_SNR_HIGH 0x0000001d
381#define EVENT_IBSS_COALESCED 0x0000001e
382#define EVENT_DATA_RSSI_LOW 0x00000024
383#define EVENT_DATA_SNR_LOW 0x00000025
384#define EVENT_DATA_RSSI_HIGH 0x00000026
385#define EVENT_DATA_SNR_HIGH 0x00000027
386#define EVENT_LINK_QUALITY 0x00000028
387#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700388#define EVENT_UAP_STA_DEAUTH 0x0000002c
389#define EVENT_UAP_STA_ASSOC 0x0000002d
390#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700391#define EVENT_PRE_BEACON_LOST 0x00000031
392#define EVENT_ADDBA 0x00000033
393#define EVENT_DELBA 0x00000034
394#define EVENT_BA_STREAM_TIEMOUT 0x00000037
395#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700396#define EVENT_UAP_BSS_IDLE 0x00000043
397#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700398#define EVENT_WEP_ICV_ERR 0x00000046
399#define EVENT_HS_ACT_REQ 0x00000047
400#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700401#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700402#define EVENT_HOSTWAKE_STAIE 0x0000004d
Stone Piaoeab1c762012-09-25 20:23:37 -0700403#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700404
405#define EVENT_ID_MASK 0xffff
406#define BSS_NUM_MASK 0xf
407
408#define EVENT_GET_BSS_NUM(event_cause) \
409 (((event_cause) >> 16) & BSS_NUM_MASK)
410
411#define EVENT_GET_BSS_TYPE(event_cause) \
412 (((event_cause) >> 24) & 0x00ff)
413
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700414struct mwifiex_ie_types_header {
415 __le16 type;
416 __le16 len;
417} __packed;
418
419struct mwifiex_ie_types_data {
420 struct mwifiex_ie_types_header header;
421 u8 data[1];
422} __packed;
423
424#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
425#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
426
427struct txpd {
428 u8 bss_type;
429 u8 bss_num;
430 __le16 tx_pkt_length;
431 __le16 tx_pkt_offset;
432 __le16 tx_pkt_type;
433 __le32 tx_control;
434 u8 priority;
435 u8 flags;
436 u8 pkt_delay_2ms;
437 u8 reserved1;
438} __packed;
439
440struct rxpd {
441 u8 bss_type;
442 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700443 __le16 rx_pkt_length;
444 __le16 rx_pkt_offset;
445 __le16 rx_pkt_type;
446 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700447 u8 priority;
448 u8 rx_rate;
449 s8 snr;
450 s8 nf;
451 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
452 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
453 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
454 u8 ht_info;
455 u8 reserved;
456} __packed;
457
Avinash Patil838e4f42012-08-03 18:06:08 -0700458struct uap_txpd {
459 u8 bss_type;
460 u8 bss_num;
461 __le16 tx_pkt_length;
462 __le16 tx_pkt_offset;
463 __le16 tx_pkt_type;
464 __le32 tx_control;
465 u8 priority;
466 u8 flags;
467 u8 pkt_delay_2ms;
468 u8 reserved1;
469 __le32 reserved2;
470};
471
472struct uap_rxpd {
473 u8 bss_type;
474 u8 bss_num;
475 __le16 rx_pkt_length;
476 __le16 rx_pkt_offset;
477 __le16 rx_pkt_type;
478 __le16 seq_num;
479 u8 priority;
480 u8 reserved1;
481};
482
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700483enum mwifiex_chan_scan_mode_bitmasks {
484 MWIFIEX_PASSIVE_SCAN = BIT(0),
485 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
486};
487
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700488struct mwifiex_chan_scan_param_set {
489 u8 radio_type;
490 u8 chan_number;
491 u8 chan_scan_mode_bitmap;
492 __le16 min_scan_time;
493 __le16 max_scan_time;
494} __packed;
495
496struct mwifiex_ie_types_chan_list_param_set {
497 struct mwifiex_ie_types_header header;
498 struct mwifiex_chan_scan_param_set chan_scan_param[1];
499} __packed;
500
501struct chan_band_param_set {
502 u8 radio_type;
503 u8 chan_number;
504};
505
506struct mwifiex_ie_types_chan_band_list_param_set {
507 struct mwifiex_ie_types_header header;
508 struct chan_band_param_set chan_band_param[1];
509} __packed;
510
511struct mwifiex_ie_types_rates_param_set {
512 struct mwifiex_ie_types_header header;
513 u8 rates[1];
514} __packed;
515
516struct mwifiex_ie_types_ssid_param_set {
517 struct mwifiex_ie_types_header header;
518 u8 ssid[1];
519} __packed;
520
521struct mwifiex_ie_types_num_probes {
522 struct mwifiex_ie_types_header header;
523 __le16 num_probes;
524} __packed;
525
526struct mwifiex_ie_types_wildcard_ssid_params {
527 struct mwifiex_ie_types_header header;
528 u8 max_ssid_length;
529 u8 ssid[1];
530} __packed;
531
532#define TSF_DATA_SIZE 8
533struct mwifiex_ie_types_tsf_timestamp {
534 struct mwifiex_ie_types_header header;
535 u8 tsf_data[1];
536} __packed;
537
538struct mwifiex_cf_param_set {
539 u8 cfp_cnt;
540 u8 cfp_period;
541 u16 cfp_max_duration;
542 u16 cfp_duration_remaining;
543} __packed;
544
545struct mwifiex_ibss_param_set {
546 u16 atim_window;
547} __packed;
548
549struct mwifiex_ie_types_ss_param_set {
550 struct mwifiex_ie_types_header header;
551 union {
552 struct mwifiex_cf_param_set cf_param_set[1];
553 struct mwifiex_ibss_param_set ibss_param_set[1];
554 } cf_ibss;
555} __packed;
556
557struct mwifiex_fh_param_set {
558 u16 dwell_time;
559 u8 hop_set;
560 u8 hop_pattern;
561 u8 hop_index;
562} __packed;
563
564struct mwifiex_ds_param_set {
565 u8 current_chan;
566} __packed;
567
568struct mwifiex_ie_types_phy_param_set {
569 struct mwifiex_ie_types_header header;
570 union {
571 struct mwifiex_fh_param_set fh_param_set[1];
572 struct mwifiex_ds_param_set ds_param_set[1];
573 } fh_ds;
574} __packed;
575
576struct mwifiex_ie_types_auth_type {
577 struct mwifiex_ie_types_header header;
578 __le16 auth_type;
579} __packed;
580
581struct mwifiex_ie_types_vendor_param_set {
582 struct mwifiex_ie_types_header header;
583 u8 ie[MWIFIEX_MAX_VSIE_LEN];
584};
585
586struct mwifiex_ie_types_rsn_param_set {
587 struct mwifiex_ie_types_header header;
588 u8 rsn_ie[1];
589} __packed;
590
591#define KEYPARAMSET_FIXED_LEN 6
592
593struct mwifiex_ie_type_key_param_set {
594 __le16 type;
595 __le16 length;
596 __le16 key_type_id;
597 __le16 key_info;
598 __le16 key_len;
599 u8 key[50];
600} __packed;
601
Ying Luob877f4c2012-08-03 18:06:14 -0700602#define IGTK_PN_LEN 8
603
604struct mwifiex_cmac_param {
605 u8 ipn[IGTK_PN_LEN];
606 u8 key[WLAN_KEY_LEN_AES_CMAC];
607} __packed;
608
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700609struct host_cmd_ds_802_11_key_material {
610 __le16 action;
611 struct mwifiex_ie_type_key_param_set key_param_set;
612} __packed;
613
614struct host_cmd_ds_gen {
615 u16 command;
616 u16 size;
617 u16 seq_num;
618 u16 result;
619};
620
621#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
622
623enum sleep_resp_ctrl {
624 RESP_NOT_NEEDED = 0,
625 RESP_NEEDED,
626};
627
628struct mwifiex_ps_param {
629 __le16 null_pkt_interval;
630 __le16 multiple_dtims;
631 __le16 bcn_miss_timeout;
632 __le16 local_listen_interval;
633 __le16 adhoc_wake_period;
634 __le16 mode;
635 __le16 delay_to_ps;
636};
637
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700638#define BITMAP_AUTO_DS 0x01
639#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700640
641struct mwifiex_ie_types_auto_ds_param {
642 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700643 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700644} __packed;
645
646struct mwifiex_ie_types_ps_param {
647 struct mwifiex_ie_types_header header;
648 struct mwifiex_ps_param param;
649} __packed;
650
651struct host_cmd_ds_802_11_ps_mode_enh {
652 __le16 action;
653
654 union {
655 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700656 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700657 } params;
658} __packed;
659
660struct host_cmd_ds_get_hw_spec {
661 __le16 hw_if_version;
662 __le16 version;
663 __le16 reserved;
664 __le16 num_of_mcast_adr;
665 u8 permanent_addr[ETH_ALEN];
666 __le16 region_code;
667 __le16 number_of_antenna;
668 __le32 fw_release_number;
669 __le32 reserved_1;
670 __le32 reserved_2;
671 __le32 reserved_3;
672 __le32 fw_cap_info;
673 __le32 dot_11n_dev_cap;
674 u8 dev_mcs_support;
675 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
676 __le16 reserved_4;
677} __packed;
678
679struct host_cmd_ds_802_11_rssi_info {
680 __le16 action;
681 __le16 ndata;
682 __le16 nbcn;
683 __le16 reserved[9];
684 long long reserved_1;
685};
686
687struct host_cmd_ds_802_11_rssi_info_rsp {
688 __le16 action;
689 __le16 ndata;
690 __le16 nbcn;
691 __le16 data_rssi_last;
692 __le16 data_nf_last;
693 __le16 data_rssi_avg;
694 __le16 data_nf_avg;
695 __le16 bcn_rssi_last;
696 __le16 bcn_nf_last;
697 __le16 bcn_rssi_avg;
698 __le16 bcn_nf_avg;
699 long long tsf_bcn;
700};
701
702struct host_cmd_ds_802_11_mac_address {
703 __le16 action;
704 u8 mac_addr[ETH_ALEN];
705};
706
707struct host_cmd_ds_mac_control {
708 __le16 action;
709 __le16 reserved;
710};
711
712struct host_cmd_ds_mac_multicast_adr {
713 __le16 action;
714 __le16 num_of_adrs;
715 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
716} __packed;
717
718struct host_cmd_ds_802_11_deauthenticate {
719 u8 mac_addr[ETH_ALEN];
720 __le16 reason_code;
721} __packed;
722
723struct host_cmd_ds_802_11_associate {
724 u8 peer_sta_addr[ETH_ALEN];
725 __le16 cap_info_bitmap;
726 __le16 listen_interval;
727 __le16 beacon_period;
728 u8 dtim_period;
729} __packed;
730
731struct ieee_types_assoc_rsp {
732 __le16 cap_info_bitmap;
733 __le16 status_code;
734 __le16 a_id;
735 u8 ie_buffer[1];
736} __packed;
737
738struct host_cmd_ds_802_11_associate_rsp {
739 struct ieee_types_assoc_rsp assoc_rsp;
740} __packed;
741
742struct ieee_types_cf_param_set {
743 u8 element_id;
744 u8 len;
745 u8 cfp_cnt;
746 u8 cfp_period;
747 u16 cfp_max_duration;
748 u16 cfp_duration_remaining;
749} __packed;
750
751struct ieee_types_ibss_param_set {
752 u8 element_id;
753 u8 len;
754 __le16 atim_window;
755} __packed;
756
757union ieee_types_ss_param_set {
758 struct ieee_types_cf_param_set cf_param_set;
759 struct ieee_types_ibss_param_set ibss_param_set;
760} __packed;
761
762struct ieee_types_fh_param_set {
763 u8 element_id;
764 u8 len;
765 __le16 dwell_time;
766 u8 hop_set;
767 u8 hop_pattern;
768 u8 hop_index;
769} __packed;
770
771struct ieee_types_ds_param_set {
772 u8 element_id;
773 u8 len;
774 u8 current_chan;
775} __packed;
776
777union ieee_types_phy_param_set {
778 struct ieee_types_fh_param_set fh_param_set;
779 struct ieee_types_ds_param_set ds_param_set;
780} __packed;
781
782struct host_cmd_ds_802_11_ad_hoc_start {
783 u8 ssid[IEEE80211_MAX_SSID_LEN];
784 u8 bss_mode;
785 __le16 beacon_period;
786 u8 dtim_period;
787 union ieee_types_ss_param_set ss_param_set;
788 union ieee_types_phy_param_set phy_param_set;
789 u16 reserved1;
790 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800791 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700792} __packed;
793
794struct host_cmd_ds_802_11_ad_hoc_result {
795 u8 pad[3];
796 u8 bssid[ETH_ALEN];
797} __packed;
798
799struct adhoc_bss_desc {
800 u8 bssid[ETH_ALEN];
801 u8 ssid[IEEE80211_MAX_SSID_LEN];
802 u8 bss_mode;
803 __le16 beacon_period;
804 u8 dtim_period;
805 u8 time_stamp[8];
806 u8 local_time[8];
807 union ieee_types_phy_param_set phy_param_set;
808 union ieee_types_ss_param_set ss_param_set;
809 __le16 cap_info_bitmap;
810 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
811
812 /*
813 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
814 * It is used in the Adhoc join command and will cause a
815 * binary layout mismatch with the firmware
816 */
817} __packed;
818
819struct host_cmd_ds_802_11_ad_hoc_join {
820 struct adhoc_bss_desc bss_descriptor;
821 u16 reserved1;
822 u16 reserved2;
823} __packed;
824
825struct host_cmd_ds_802_11_get_log {
826 __le32 mcast_tx_frame;
827 __le32 failed;
828 __le32 retry;
829 __le32 multi_retry;
830 __le32 frame_dup;
831 __le32 rts_success;
832 __le32 rts_failure;
833 __le32 ack_failure;
834 __le32 rx_frag;
835 __le32 mcast_rx_frame;
836 __le32 fcs_error;
837 __le32 tx_frame;
838 __le32 reserved;
839 __le32 wep_icv_err_cnt[4];
840};
841
842struct host_cmd_ds_tx_rate_query {
843 u8 tx_rate;
844 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
845 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
846 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
847 u8 ht_info;
848} __packed;
849
850enum Host_Sleep_Action {
851 HS_CONFIGURE = 0x0001,
852 HS_ACTIVATE = 0x0002,
853};
854
855struct mwifiex_hs_config_param {
856 __le32 conditions;
857 u8 gpio;
858 u8 gap;
859} __packed;
860
861struct hs_activate_param {
862 u16 resp_ctrl;
863} __packed;
864
865struct host_cmd_ds_802_11_hs_cfg_enh {
866 __le16 action;
867
868 union {
869 struct mwifiex_hs_config_param hs_config;
870 struct hs_activate_param hs_activate;
871 } params;
872} __packed;
873
874enum SNMP_MIB_INDEX {
875 OP_RATE_SET_I = 1,
876 DTIM_PERIOD_I = 3,
877 RTS_THRESH_I = 5,
878 SHORT_RETRY_LIM_I = 6,
879 LONG_RETRY_LIM_I = 7,
880 FRAG_THRESH_I = 8,
881 DOT11D_I = 9,
882};
883
884#define MAX_SNMP_BUF_SIZE 128
885
886struct host_cmd_ds_802_11_snmp_mib {
887 __le16 query_type;
888 __le16 oid;
889 __le16 buf_size;
890 u8 value[1];
891} __packed;
892
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700893struct mwifiex_rate_scope {
894 __le16 type;
895 __le16 length;
896 __le16 hr_dsss_rate_bitmap;
897 __le16 ofdm_rate_bitmap;
898 __le16 ht_mcs_rate_bitmap[8];
899} __packed;
900
901struct mwifiex_rate_drop_pattern {
902 __le16 type;
903 __le16 length;
904 __le32 rate_drop_mode;
905} __packed;
906
907struct host_cmd_ds_tx_rate_cfg {
908 __le16 action;
909 __le16 cfg_index;
910} __packed;
911
912struct mwifiex_power_group {
913 u8 modulation_class;
914 u8 first_rate_code;
915 u8 last_rate_code;
916 s8 power_step;
917 s8 power_min;
918 s8 power_max;
919 u8 ht_bandwidth;
920 u8 reserved;
921} __packed;
922
923struct mwifiex_types_power_group {
924 u16 type;
925 u16 length;
926} __packed;
927
928struct host_cmd_ds_txpwr_cfg {
929 __le16 action;
930 __le16 cfg_index;
931 __le32 mode;
932} __packed;
933
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700934struct host_cmd_ds_rf_tx_pwr {
935 __le16 action;
936 __le16 cur_level;
937 u8 max_power;
938 u8 min_power;
939} __packed;
940
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700941struct host_cmd_ds_rf_ant_mimo {
942 __le16 action_tx;
943 __le16 tx_ant_mode;
944 __le16 action_rx;
945 __le16 rx_ant_mode;
946};
947
948struct host_cmd_ds_rf_ant_siso {
949 __le16 action;
950 __le16 ant_mode;
951};
952
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700953struct mwifiex_bcn_param {
954 u8 bssid[ETH_ALEN];
955 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700956 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700957 __le16 beacon_period;
958 __le16 cap_info_bitmap;
959} __packed;
960
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700961#define MWIFIEX_USER_SCAN_CHAN_MAX 50
962
963#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
964
965struct mwifiex_scan_cmd_config {
966 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700967 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700968 */
969 u8 bss_mode;
970
971 /* Specific BSSID used to filter scan results in the firmware */
972 u8 specific_bssid[ETH_ALEN];
973
974 /* Length of TLVs sent in command starting at tlvBuffer */
975 u32 tlv_buf_len;
976
977 /*
978 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
979 *
980 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
981 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
982 */
983 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
984 here */
985} __packed;
986
987struct mwifiex_user_scan_chan {
988 u8 chan_number;
989 u8 radio_type;
990 u8 scan_type;
991 u8 reserved;
992 u32 scan_time;
993} __packed;
994
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700995struct mwifiex_user_scan_cfg {
996 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700997 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700998 */
999 u8 bss_mode;
1000 /* Configure the number of probe requests for active chan scans */
1001 u8 num_probes;
1002 u8 reserved;
1003 /* BSSID filter sent in the firmware command to limit the results */
1004 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -08001005 /* SSID filter list used in the firmware to limit the scan results */
1006 struct cfg80211_ssid *ssid_list;
1007 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001008 /* Variable number (fixed maximum) of channels to scan up */
1009 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
1010} __packed;
1011
1012struct ie_body {
1013 u8 grp_key_oui[4];
1014 u8 ptk_cnt[2];
1015 u8 ptk_body[4];
1016} __packed;
1017
1018struct host_cmd_ds_802_11_scan {
1019 u8 bss_mode;
1020 u8 bssid[ETH_ALEN];
1021 u8 tlv_buffer[1];
1022} __packed;
1023
1024struct host_cmd_ds_802_11_scan_rsp {
1025 __le16 bss_descript_size;
1026 u8 number_of_sets;
1027 u8 bss_desc_and_tlv_buffer[1];
1028} __packed;
1029
1030struct host_cmd_ds_802_11_bg_scan_query {
1031 u8 flush;
1032} __packed;
1033
1034struct host_cmd_ds_802_11_bg_scan_query_rsp {
1035 u32 report_condition;
1036 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1037} __packed;
1038
1039struct mwifiex_ietypes_domain_param_set {
1040 struct mwifiex_ie_types_header header;
1041 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1042 struct ieee80211_country_ie_triplet triplet[1];
1043} __packed;
1044
1045struct host_cmd_ds_802_11d_domain_info {
1046 __le16 action;
1047 struct mwifiex_ietypes_domain_param_set domain;
1048} __packed;
1049
1050struct host_cmd_ds_802_11d_domain_info_rsp {
1051 __le16 action;
1052 struct mwifiex_ietypes_domain_param_set domain;
1053} __packed;
1054
1055struct host_cmd_ds_11n_addba_req {
1056 u8 add_req_result;
1057 u8 peer_mac_addr[ETH_ALEN];
1058 u8 dialog_token;
1059 __le16 block_ack_param_set;
1060 __le16 block_ack_tmo;
1061 __le16 ssn;
1062} __packed;
1063
1064struct host_cmd_ds_11n_addba_rsp {
1065 u8 add_rsp_result;
1066 u8 peer_mac_addr[ETH_ALEN];
1067 u8 dialog_token;
1068 __le16 status_code;
1069 __le16 block_ack_param_set;
1070 __le16 block_ack_tmo;
1071 __le16 ssn;
1072} __packed;
1073
1074struct host_cmd_ds_11n_delba {
1075 u8 del_result;
1076 u8 peer_mac_addr[ETH_ALEN];
1077 __le16 del_ba_param_set;
1078 __le16 reason_code;
1079 u8 reserved;
1080} __packed;
1081
1082struct host_cmd_ds_11n_batimeout {
1083 u8 tid;
1084 u8 peer_mac_addr[ETH_ALEN];
1085 u8 origninator;
1086} __packed;
1087
1088struct host_cmd_ds_11n_cfg {
1089 __le16 action;
1090 __le16 ht_tx_cap;
1091 __le16 ht_tx_info;
1092} __packed;
1093
1094struct host_cmd_ds_txbuf_cfg {
1095 __le16 action;
1096 __le16 buff_size;
1097 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1098 __le16 reserved3;
1099} __packed;
1100
1101struct host_cmd_ds_amsdu_aggr_ctrl {
1102 __le16 action;
1103 __le16 enable;
1104 __le16 curr_buf_size;
1105} __packed;
1106
1107struct mwifiex_ie_types_wmm_param_set {
1108 struct mwifiex_ie_types_header header;
1109 u8 wmm_ie[1];
1110};
1111
1112struct mwifiex_ie_types_wmm_queue_status {
1113 struct mwifiex_ie_types_header header;
1114 u8 queue_index;
1115 u8 disabled;
1116 u16 medium_time;
1117 u8 flow_required;
1118 u8 flow_created;
1119 u32 reserved;
1120};
1121
1122struct ieee_types_vendor_header {
1123 u8 element_id;
1124 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001125 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001126 u8 oui_subtype;
1127 u8 version;
1128} __packed;
1129
1130struct ieee_types_wmm_ac_parameters {
1131 u8 aci_aifsn_bitmap;
1132 u8 ecw_bitmap;
1133 __le16 tx_op_limit;
1134} __packed;
1135
1136struct ieee_types_wmm_parameter {
1137 /*
1138 * WMM Parameter IE - Vendor Specific Header:
1139 * element_id [221/0xdd]
1140 * Len [24]
1141 * Oui [00:50:f2]
1142 * OuiType [2]
1143 * OuiSubType [1]
1144 * Version [1]
1145 */
1146 struct ieee_types_vendor_header vend_hdr;
1147 u8 qos_info_bitmap;
1148 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001149 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001150} __packed;
1151
1152struct ieee_types_wmm_info {
1153
1154 /*
1155 * WMM Info IE - Vendor Specific Header:
1156 * element_id [221/0xdd]
1157 * Len [7]
1158 * Oui [00:50:f2]
1159 * OuiType [2]
1160 * OuiSubType [0]
1161 * Version [1]
1162 */
1163 struct ieee_types_vendor_header vend_hdr;
1164
1165 u8 qos_info_bitmap;
1166} __packed;
1167
1168struct host_cmd_ds_wmm_get_status {
1169 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001170 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001171 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1172} __packed;
1173
1174struct mwifiex_wmm_ac_status {
1175 u8 disabled;
1176 u8 flow_required;
1177 u8 flow_created;
1178};
1179
1180struct mwifiex_ie_types_htcap {
1181 struct mwifiex_ie_types_header header;
1182 struct ieee80211_ht_cap ht_cap;
1183} __packed;
1184
1185struct mwifiex_ie_types_htinfo {
1186 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001187 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001188} __packed;
1189
1190struct mwifiex_ie_types_2040bssco {
1191 struct mwifiex_ie_types_header header;
1192 u8 bss_co_2040;
1193} __packed;
1194
1195struct mwifiex_ie_types_extcap {
1196 struct mwifiex_ie_types_header header;
1197 u8 ext_cap;
1198} __packed;
1199
1200struct host_cmd_ds_mac_reg_access {
1201 __le16 action;
1202 __le16 offset;
1203 __le32 value;
1204} __packed;
1205
1206struct host_cmd_ds_bbp_reg_access {
1207 __le16 action;
1208 __le16 offset;
1209 u8 value;
1210 u8 reserved[3];
1211} __packed;
1212
1213struct host_cmd_ds_rf_reg_access {
1214 __le16 action;
1215 __le16 offset;
1216 u8 value;
1217 u8 reserved[3];
1218} __packed;
1219
1220struct host_cmd_ds_pmic_reg_access {
1221 __le16 action;
1222 __le16 offset;
1223 u8 value;
1224 u8 reserved[3];
1225} __packed;
1226
1227struct host_cmd_ds_802_11_eeprom_access {
1228 __le16 action;
1229
1230 __le16 offset;
1231 __le16 byte_count;
1232 u8 value;
1233} __packed;
1234
Avinash Patil75edd2c2012-05-08 18:30:18 -07001235struct host_cmd_tlv {
1236 __le16 type;
1237 __le16 len;
1238} __packed;
1239
Avinash Patile5686342012-05-08 18:30:25 -07001240struct mwifiex_assoc_event {
1241 u8 sta_addr[ETH_ALEN];
1242 __le16 type;
1243 __le16 len;
1244 __le16 frame_control;
1245 __le16 cap_info;
1246 __le16 listen_interval;
1247 u8 data[0];
1248} __packed;
1249
Avinash Patil4db16a12012-05-08 18:30:20 -07001250struct host_cmd_ds_sys_config {
1251 __le16 action;
1252 u8 tlv[0];
1253};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001254
1255struct host_cmd_tlv_akmp {
1256 struct host_cmd_tlv tlv;
1257 __le16 key_mgmt;
1258 __le16 key_mgmt_operation;
1259} __packed;
1260
1261struct host_cmd_tlv_pwk_cipher {
1262 struct host_cmd_tlv tlv;
1263 __le16 proto;
1264 u8 cipher;
1265 u8 reserved;
1266} __packed;
1267
1268struct host_cmd_tlv_gwk_cipher {
1269 struct host_cmd_tlv tlv;
1270 u8 cipher;
1271 u8 reserved;
1272} __packed;
1273
1274struct host_cmd_tlv_passphrase {
1275 struct host_cmd_tlv tlv;
1276 u8 passphrase[0];
1277} __packed;
1278
Avinash Patil96893532012-06-15 12:21:55 -07001279struct host_cmd_tlv_wep_key {
1280 struct host_cmd_tlv tlv;
1281 u8 key_index;
1282 u8 is_default;
1283 u8 key[1];
1284};
1285
Avinash Patilf752dcd2012-05-08 18:30:26 -07001286struct host_cmd_tlv_auth_type {
1287 struct host_cmd_tlv tlv;
1288 u8 auth_type;
1289} __packed;
1290
1291struct host_cmd_tlv_encrypt_protocol {
1292 struct host_cmd_tlv tlv;
1293 __le16 proto;
1294} __packed;
1295
Avinash Patil12190c52012-05-08 18:30:24 -07001296struct host_cmd_tlv_ssid {
1297 struct host_cmd_tlv tlv;
1298 u8 ssid[0];
1299} __packed;
1300
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001301struct host_cmd_tlv_rates {
1302 struct host_cmd_tlv tlv;
1303 u8 rates[0];
1304} __packed;
1305
Avinash Patil605b73a2012-05-16 21:24:55 -07001306struct host_cmd_tlv_bcast_ssid {
1307 struct host_cmd_tlv tlv;
1308 u8 bcast_ctl;
1309} __packed;
1310
Avinash Patil12190c52012-05-08 18:30:24 -07001311struct host_cmd_tlv_beacon_period {
1312 struct host_cmd_tlv tlv;
1313 __le16 period;
1314} __packed;
1315
1316struct host_cmd_tlv_dtim_period {
1317 struct host_cmd_tlv tlv;
1318 u8 period;
1319} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001320
Avinash Patil9b930ea2012-05-08 18:30:23 -07001321struct host_cmd_tlv_frag_threshold {
1322 struct host_cmd_tlv tlv;
1323 __le16 frag_thr;
1324} __packed;
1325
1326struct host_cmd_tlv_rts_threshold {
1327 struct host_cmd_tlv tlv;
1328 __le16 rts_thr;
1329} __packed;
1330
1331struct host_cmd_tlv_retry_limit {
1332 struct host_cmd_tlv tlv;
1333 u8 limit;
1334} __packed;
1335
Avinash Patil75edd2c2012-05-08 18:30:18 -07001336struct host_cmd_tlv_mac_addr {
1337 struct host_cmd_tlv tlv;
1338 u8 mac_addr[ETH_ALEN];
1339} __packed;
1340
Avinash Patil4db16a12012-05-08 18:30:20 -07001341struct host_cmd_tlv_channel_band {
1342 struct host_cmd_tlv tlv;
1343 u8 band_config;
1344 u8 channel;
1345} __packed;
1346
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001347struct host_cmd_ds_version_ext {
1348 u8 version_str_sel;
1349 char version_str[128];
1350} __packed;
1351
Stone Piao3cec6872012-09-25 20:23:34 -07001352struct host_cmd_ds_mgmt_frame_reg {
1353 __le16 action;
1354 __le32 mask;
1355} __packed;
1356
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001357struct host_cmd_ds_p2p_mode_cfg {
1358 __le16 action;
1359 __le16 mode;
1360} __packed;
1361
Stone Piao7feb4c42012-09-25 20:23:36 -07001362struct host_cmd_ds_remain_on_chan {
1363 __le16 action;
1364 u8 status;
1365 u8 reserved;
1366 u8 band_cfg;
1367 u8 channel;
1368 __le32 duration;
1369} __packed;
1370
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001371struct host_cmd_ds_802_11_ibss_status {
1372 __le16 action;
1373 __le16 enable;
1374 u8 bssid[ETH_ALEN];
1375 __le16 beacon_interval;
1376 __le16 atim_window;
1377 __le16 use_g_rate_protect;
1378} __packed;
1379
1380#define CONNECTION_TYPE_INFRA 0
1381#define CONNECTION_TYPE_ADHOC 1
1382
1383struct host_cmd_ds_set_bss_mode {
1384 u8 con_type;
1385} __packed;
1386
Amitkumar Karward930fae2011-10-11 17:41:21 -07001387struct host_cmd_ds_pcie_details {
1388 /* TX buffer descriptor ring address */
1389 u32 txbd_addr_lo;
1390 u32 txbd_addr_hi;
1391 /* TX buffer descriptor ring count */
1392 u32 txbd_count;
1393
1394 /* RX buffer descriptor ring address */
1395 u32 rxbd_addr_lo;
1396 u32 rxbd_addr_hi;
1397 /* RX buffer descriptor ring count */
1398 u32 rxbd_count;
1399
1400 /* Event buffer descriptor ring address */
1401 u32 evtbd_addr_lo;
1402 u32 evtbd_addr_hi;
1403 /* Event buffer descriptor ring count */
1404 u32 evtbd_count;
1405
1406 /* Sleep cookie buffer physical address */
1407 u32 sleep_cookie_addr_lo;
1408 u32 sleep_cookie_addr_hi;
1409} __packed;
1410
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001411struct mwifiex_ie_types_rssi_threshold {
1412 struct mwifiex_ie_types_header header;
1413 u8 abs_value;
1414 u8 evt_freq;
1415} __packed;
1416
1417struct host_cmd_ds_802_11_subsc_evt {
1418 __le16 action;
1419 __le16 events;
1420} __packed;
1421
Avinash Patilede98bf2012-05-08 18:30:28 -07001422struct mwifiex_ie {
1423 __le16 ie_index;
1424 __le16 mgmt_subtype_mask;
1425 __le16 ie_length;
1426 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1427} __packed;
1428
1429#define MAX_MGMT_IE_INDEX 16
1430struct mwifiex_ie_list {
1431 __le16 type;
1432 __le16 len;
1433 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1434} __packed;
1435
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001436struct host_cmd_ds_command {
1437 __le16 command;
1438 __le16 size;
1439 __le16 seq_num;
1440 __le16 result;
1441 union {
1442 struct host_cmd_ds_get_hw_spec hw_spec;
1443 struct host_cmd_ds_mac_control mac_ctrl;
1444 struct host_cmd_ds_802_11_mac_address mac_addr;
1445 struct host_cmd_ds_mac_multicast_adr mc_addr;
1446 struct host_cmd_ds_802_11_get_log get_log;
1447 struct host_cmd_ds_802_11_rssi_info rssi_info;
1448 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1449 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001450 struct host_cmd_ds_tx_rate_query tx_rate;
1451 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1452 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001453 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001454 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1455 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001456 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1457 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1458 struct host_cmd_ds_802_11_scan scan;
1459 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1460 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1461 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1462 struct host_cmd_ds_802_11_associate associate;
1463 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1464 struct host_cmd_ds_802_11_deauthenticate deauth;
1465 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1466 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1467 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1468 struct host_cmd_ds_802_11d_domain_info domain_info;
1469 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1470 struct host_cmd_ds_11n_addba_req add_ba_req;
1471 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1472 struct host_cmd_ds_11n_delba del_ba;
1473 struct host_cmd_ds_txbuf_cfg tx_buf;
1474 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1475 struct host_cmd_ds_11n_cfg htcfg;
1476 struct host_cmd_ds_wmm_get_status get_wmm_status;
1477 struct host_cmd_ds_802_11_key_material key_material;
1478 struct host_cmd_ds_version_ext verext;
Stone Piao3cec6872012-09-25 20:23:34 -07001479 struct host_cmd_ds_mgmt_frame_reg reg_mask;
Stone Piao7feb4c42012-09-25 20:23:36 -07001480 struct host_cmd_ds_remain_on_chan roc_cfg;
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001481 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001482 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1483 struct host_cmd_ds_mac_reg_access mac_reg;
1484 struct host_cmd_ds_bbp_reg_access bbp_reg;
1485 struct host_cmd_ds_rf_reg_access rf_reg;
1486 struct host_cmd_ds_pmic_reg_access pmic_reg;
1487 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001488 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001489 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001490 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001491 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001492 } params;
1493} __packed;
1494
1495struct mwifiex_opt_sleep_confirm {
1496 __le16 command;
1497 __le16 size;
1498 __le16 seq_num;
1499 __le16 result;
1500 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001501 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001502} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001503#endif /* !_MWIFIEX_FW_H_ */