blob: 4fd7a05fee18a3403453a6fc4f5631a9470d2155 [file] [log] [blame]
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001/*
2 * Marvell Wireless LAN device driver: Firmware specific macros & structures
3 *
4 * Copyright (C) 2011, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13 *
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
18 */
19
20#ifndef _MWIFIEX_FW_H_
21#define _MWIFIEX_FW_H_
22
23#include <linux/if_ether.h>
24
25
26#define INTF_HEADER_LEN 4
27
28struct rfc_1042_hdr {
29 u8 llc_dsap;
30 u8 llc_ssap;
31 u8 llc_ctrl;
32 u8 snap_oui[3];
33 u16 snap_type;
34};
35
36struct rx_packet_hdr {
37 struct ethhdr eth803_hdr;
38 struct rfc_1042_hdr rfc1042_hdr;
39};
40
41struct tx_packet_hdr {
42 struct ethhdr eth803_hdr;
43 struct rfc_1042_hdr rfc1042_hdr;
44};
45
46#define B_SUPPORTED_RATES 5
47#define G_SUPPORTED_RATES 9
48#define BG_SUPPORTED_RATES 13
49#define A_SUPPORTED_RATES 9
50#define HOSTCMD_SUPPORTED_RATES 14
51#define N_SUPPORTED_RATES 3
52#define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN)
53
54#define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11))
55#define IS_SUPPORT_MULTI_BANDS(adapter) \
56 (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
57#define GET_FW_DEFAULT_BANDS(adapter) \
58 ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
59
Bing Zhao5e6e3a92011-03-21 18:00:50 -070060#define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
61
62#define KEY_INFO_ENABLED 0x01
63enum KEY_TYPE_ID {
64 KEY_TYPE_ID_WEP = 0,
65 KEY_TYPE_ID_TKIP,
66 KEY_TYPE_ID_AES,
67 KEY_TYPE_ID_WAPI,
68};
Yogesh Ashok Powar6a35a0a2011-04-06 16:46:56 -070069#define KEY_MCAST BIT(0)
70#define KEY_UNICAST BIT(1)
71#define KEY_ENABLED BIT(2)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070072
73#define WAPI_KEY_LEN 50
74
Bing Zhao5e6e3a92011-03-21 18:00:50 -070075#define MAX_POLL_TRIES 100
76
77#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
78
79#define MAX_FIRMWARE_POLL_TRIES 100
80
Amitkumar Karward930fae2011-10-11 17:41:21 -070081#define FIRMWARE_READY_SDIO 0xfedc
82#define FIRMWARE_READY_PCIE 0xfedcba00
Bing Zhao5e6e3a92011-03-21 18:00:50 -070083
Amitkumar Karwar4daffe32012-04-18 20:08:28 -070084enum mwifiex_usb_ep {
85 MWIFIEX_USB_EP_CMD_EVENT = 1,
86 MWIFIEX_USB_EP_DATA = 2,
87};
88
Bing Zhao5e6e3a92011-03-21 18:00:50 -070089enum MWIFIEX_802_11_PRIVACY_FILTER {
90 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
91 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
92};
93
Bing Zhao5e6e3a92011-03-21 18:00:50 -070094#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
95
Avinash Patile76268d2012-05-08 18:30:27 -070096#define UAP_BSS_PARAMS_I 0
97
Avinash Patil12190c52012-05-08 18:30:24 -070098#define TLV_TYPE_UAP_SSID 0x0000
99
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700100#define PROPRIETARY_TLV_BASE_ID 0x0100
101#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
102#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
103#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700104#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700105#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700106#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
107#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
108#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700109#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700110#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700111#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700112#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700113#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
114#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700115#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700116#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
117#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
118#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700119#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700120#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
121#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
122#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700123#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700124#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700125#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700126#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700127#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
128#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700129#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
130#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700131
132#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
133
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700134#define SSN_MASK 0xfff0
135
136#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700137#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700138
139#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
140
141#define BA_STREAM_NOT_ALLOWED 0xff
142
143#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700144 priv->adapter->config_bands & BAND_AN) && \
145 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700146#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
147 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
148
149#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
150#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700151
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700152#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700153
154/* dev_cap bitmap
155 * BIT
156 * 0-16 reserved
157 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
158 * 18-22 reserved
159 * 23 IEEE80211_HT_CAP_SGI_20
160 * 24 IEEE80211_HT_CAP_SGI_40
161 * 25 IEEE80211_HT_CAP_TX_STBC
162 * 26 IEEE80211_HT_CAP_RX_STBC
163 * 27-28 reserved
164 * 29 IEEE80211_HT_CAP_GRN_FLD
165 * 30-31 reserved
166 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700167#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700168#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
169#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
170#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
171#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
172#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
173
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700174/* httxcfg bitmap
175 * 0 reserved
176 * 1 20/40 Mhz enable(1)/disable(0)
177 * 2-3 reserved
178 * 4 green field enable(1)/disable(0)
179 * 5 short GI in 20 Mhz enable(1)/disable(0)
180 * 6 short GI in 40 Mhz enable(1)/disable(0)
181 * 7-15 reserved
182 */
183#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
184
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700185#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700186#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800187#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700188
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700189#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
190
191#define LLC_SNAP_LEN 8
192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700193#define MOD_CLASS_HR_DSSS 0x03
194#define MOD_CLASS_OFDM 0x07
195#define MOD_CLASS_HT 0x08
196#define HT_BW_20 0
197#define HT_BW_40 1
198
199#define HostCmd_CMD_GET_HW_SPEC 0x0003
200#define HostCmd_CMD_802_11_SCAN 0x0006
201#define HostCmd_CMD_802_11_GET_LOG 0x000b
202#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
203#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
204#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
205#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
206#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
207#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
208#define HostCmd_CMD_RF_REG_ACCESS 0x001b
209#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
210#define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
211#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
212#define HostCmd_CMD_MAC_CONTROL 0x0028
213#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
214#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
215#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
216#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
217#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
218#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
219#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
220#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700221#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700222#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
223#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
224#define HostCmd_CMD_VERSION_EXT 0x0097
225#define HostCmd_CMD_RSSI_INFO 0x00a4
226#define HostCmd_CMD_FUNC_INIT 0x00a9
227#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700228#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
229#define HostCmd_CMD_UAP_BSS_START 0x00b1
230#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700231#define HostCmd_CMD_11N_CFG 0x00cd
232#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
233#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
234#define HostCmd_CMD_11N_DELBA 0x00d0
235#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
236#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
237#define HostCmd_CMD_TXPWR_CFG 0x00d1
238#define HostCmd_CMD_TX_RATE_CFG 0x00d6
239#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
240#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
241#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
242#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700243#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700244
Avinash Patilf752dcd2012-05-08 18:30:26 -0700245#define PROTOCOL_NO_SECURITY 0x01
246#define PROTOCOL_STATIC_WEP 0x02
247#define PROTOCOL_WPA 0x08
248#define PROTOCOL_WPA2 0x20
249#define PROTOCOL_WPA2_MIXED 0x28
250#define PROTOCOL_EAP 0x40
251#define KEY_MGMT_NONE 0x04
252#define KEY_MGMT_PSK 0x02
253#define KEY_MGMT_EAP 0x01
254#define CIPHER_TKIP 0x04
255#define CIPHER_AES_CCMP 0x08
256#define VALID_CIPHER_BITMAP 0x0c
257
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700258enum ENH_PS_MODES {
259 EN_PS = 1,
260 DIS_PS = 2,
261 EN_AUTO_DS = 3,
262 DIS_AUTO_DS = 4,
263 SLEEP_CONFIRM = 5,
264 GET_PS = 0,
265 EN_AUTO_PS = 0xff,
266 DIS_AUTO_PS = 0xfe,
267};
268
269#define HostCmd_RET_BIT 0x8000
270#define HostCmd_ACT_GEN_GET 0x0000
271#define HostCmd_ACT_GEN_SET 0x0001
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700272#define HostCmd_ACT_BITWISE_SET 0x0002
273#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700274#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700275
276#define HostCmd_ACT_MAC_RX_ON 0x0001
277#define HostCmd_ACT_MAC_TX_ON 0x0002
278#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
279#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
280#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
281#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700282#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
283
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700284#define HostCmd_BSS_MODE_IBSS 0x0002
285#define HostCmd_BSS_MODE_ANY 0x0003
286
287#define HostCmd_SCAN_RADIO_TYPE_BG 0
288#define HostCmd_SCAN_RADIO_TYPE_A 1
289
290#define HOST_SLEEP_CFG_CANCEL 0xffffffff
291#define HOST_SLEEP_CFG_COND_DEF 0x0000000f
292#define HOST_SLEEP_CFG_GPIO_DEF 0xff
293#define HOST_SLEEP_CFG_GAP_DEF 0
294
295#define CMD_F_HOSTCMD (1 << 0)
296#define CMD_F_CANCELED (1 << 1)
297
298#define HostCmd_CMD_ID_MASK 0x0fff
299
300#define HostCmd_SEQ_NUM_MASK 0x00ff
301
302#define HostCmd_BSS_NUM_MASK 0x0f00
303
304#define HostCmd_BSS_TYPE_MASK 0xf000
305
306#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
307 (((seq) & 0x00ff) | \
308 (((num) & 0x000f) << 8)) | \
309 (((type) & 0x000f) << 12); }
310
311#define HostCmd_GET_SEQ_NO(seq) \
312 ((seq) & HostCmd_SEQ_NUM_MASK)
313
314#define HostCmd_GET_BSS_NO(seq) \
315 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
316
317#define HostCmd_GET_BSS_TYPE(seq) \
318 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
319
320#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
321#define EVENT_LINK_LOST 0x00000003
322#define EVENT_LINK_SENSED 0x00000004
323#define EVENT_MIB_CHANGED 0x00000006
324#define EVENT_INIT_DONE 0x00000007
325#define EVENT_DEAUTHENTICATED 0x00000008
326#define EVENT_DISASSOCIATED 0x00000009
327#define EVENT_PS_AWAKE 0x0000000a
328#define EVENT_PS_SLEEP 0x0000000b
329#define EVENT_MIC_ERR_MULTICAST 0x0000000d
330#define EVENT_MIC_ERR_UNICAST 0x0000000e
331#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
332#define EVENT_ADHOC_BCN_LOST 0x00000011
333
334#define EVENT_WMM_STATUS_CHANGE 0x00000017
335#define EVENT_BG_SCAN_REPORT 0x00000018
336#define EVENT_RSSI_LOW 0x00000019
337#define EVENT_SNR_LOW 0x0000001a
338#define EVENT_MAX_FAIL 0x0000001b
339#define EVENT_RSSI_HIGH 0x0000001c
340#define EVENT_SNR_HIGH 0x0000001d
341#define EVENT_IBSS_COALESCED 0x0000001e
342#define EVENT_DATA_RSSI_LOW 0x00000024
343#define EVENT_DATA_SNR_LOW 0x00000025
344#define EVENT_DATA_RSSI_HIGH 0x00000026
345#define EVENT_DATA_SNR_HIGH 0x00000027
346#define EVENT_LINK_QUALITY 0x00000028
347#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700348#define EVENT_UAP_STA_DEAUTH 0x0000002c
349#define EVENT_UAP_STA_ASSOC 0x0000002d
350#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700351#define EVENT_PRE_BEACON_LOST 0x00000031
352#define EVENT_ADDBA 0x00000033
353#define EVENT_DELBA 0x00000034
354#define EVENT_BA_STREAM_TIEMOUT 0x00000037
355#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700356#define EVENT_UAP_BSS_IDLE 0x00000043
357#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700358#define EVENT_WEP_ICV_ERR 0x00000046
359#define EVENT_HS_ACT_REQ 0x00000047
360#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700361#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700362#define EVENT_HOSTWAKE_STAIE 0x0000004d
363
364#define EVENT_ID_MASK 0xffff
365#define BSS_NUM_MASK 0xf
366
367#define EVENT_GET_BSS_NUM(event_cause) \
368 (((event_cause) >> 16) & BSS_NUM_MASK)
369
370#define EVENT_GET_BSS_TYPE(event_cause) \
371 (((event_cause) >> 24) & 0x00ff)
372
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700373struct mwifiex_ie_types_header {
374 __le16 type;
375 __le16 len;
376} __packed;
377
378struct mwifiex_ie_types_data {
379 struct mwifiex_ie_types_header header;
380 u8 data[1];
381} __packed;
382
383#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
384#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
385
386struct txpd {
387 u8 bss_type;
388 u8 bss_num;
389 __le16 tx_pkt_length;
390 __le16 tx_pkt_offset;
391 __le16 tx_pkt_type;
392 __le32 tx_control;
393 u8 priority;
394 u8 flags;
395 u8 pkt_delay_2ms;
396 u8 reserved1;
397} __packed;
398
399struct rxpd {
400 u8 bss_type;
401 u8 bss_num;
402 u16 rx_pkt_length;
403 u16 rx_pkt_offset;
404 u16 rx_pkt_type;
405 u16 seq_num;
406 u8 priority;
407 u8 rx_rate;
408 s8 snr;
409 s8 nf;
410 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
411 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
412 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
413 u8 ht_info;
414 u8 reserved;
415} __packed;
416
417enum mwifiex_chan_scan_mode_bitmasks {
418 MWIFIEX_PASSIVE_SCAN = BIT(0),
419 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
420};
421
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700422struct mwifiex_chan_scan_param_set {
423 u8 radio_type;
424 u8 chan_number;
425 u8 chan_scan_mode_bitmap;
426 __le16 min_scan_time;
427 __le16 max_scan_time;
428} __packed;
429
430struct mwifiex_ie_types_chan_list_param_set {
431 struct mwifiex_ie_types_header header;
432 struct mwifiex_chan_scan_param_set chan_scan_param[1];
433} __packed;
434
435struct chan_band_param_set {
436 u8 radio_type;
437 u8 chan_number;
438};
439
440struct mwifiex_ie_types_chan_band_list_param_set {
441 struct mwifiex_ie_types_header header;
442 struct chan_band_param_set chan_band_param[1];
443} __packed;
444
445struct mwifiex_ie_types_rates_param_set {
446 struct mwifiex_ie_types_header header;
447 u8 rates[1];
448} __packed;
449
450struct mwifiex_ie_types_ssid_param_set {
451 struct mwifiex_ie_types_header header;
452 u8 ssid[1];
453} __packed;
454
455struct mwifiex_ie_types_num_probes {
456 struct mwifiex_ie_types_header header;
457 __le16 num_probes;
458} __packed;
459
460struct mwifiex_ie_types_wildcard_ssid_params {
461 struct mwifiex_ie_types_header header;
462 u8 max_ssid_length;
463 u8 ssid[1];
464} __packed;
465
466#define TSF_DATA_SIZE 8
467struct mwifiex_ie_types_tsf_timestamp {
468 struct mwifiex_ie_types_header header;
469 u8 tsf_data[1];
470} __packed;
471
472struct mwifiex_cf_param_set {
473 u8 cfp_cnt;
474 u8 cfp_period;
475 u16 cfp_max_duration;
476 u16 cfp_duration_remaining;
477} __packed;
478
479struct mwifiex_ibss_param_set {
480 u16 atim_window;
481} __packed;
482
483struct mwifiex_ie_types_ss_param_set {
484 struct mwifiex_ie_types_header header;
485 union {
486 struct mwifiex_cf_param_set cf_param_set[1];
487 struct mwifiex_ibss_param_set ibss_param_set[1];
488 } cf_ibss;
489} __packed;
490
491struct mwifiex_fh_param_set {
492 u16 dwell_time;
493 u8 hop_set;
494 u8 hop_pattern;
495 u8 hop_index;
496} __packed;
497
498struct mwifiex_ds_param_set {
499 u8 current_chan;
500} __packed;
501
502struct mwifiex_ie_types_phy_param_set {
503 struct mwifiex_ie_types_header header;
504 union {
505 struct mwifiex_fh_param_set fh_param_set[1];
506 struct mwifiex_ds_param_set ds_param_set[1];
507 } fh_ds;
508} __packed;
509
510struct mwifiex_ie_types_auth_type {
511 struct mwifiex_ie_types_header header;
512 __le16 auth_type;
513} __packed;
514
515struct mwifiex_ie_types_vendor_param_set {
516 struct mwifiex_ie_types_header header;
517 u8 ie[MWIFIEX_MAX_VSIE_LEN];
518};
519
520struct mwifiex_ie_types_rsn_param_set {
521 struct mwifiex_ie_types_header header;
522 u8 rsn_ie[1];
523} __packed;
524
525#define KEYPARAMSET_FIXED_LEN 6
526
527struct mwifiex_ie_type_key_param_set {
528 __le16 type;
529 __le16 length;
530 __le16 key_type_id;
531 __le16 key_info;
532 __le16 key_len;
533 u8 key[50];
534} __packed;
535
536struct host_cmd_ds_802_11_key_material {
537 __le16 action;
538 struct mwifiex_ie_type_key_param_set key_param_set;
539} __packed;
540
541struct host_cmd_ds_gen {
542 u16 command;
543 u16 size;
544 u16 seq_num;
545 u16 result;
546};
547
548#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
549
550enum sleep_resp_ctrl {
551 RESP_NOT_NEEDED = 0,
552 RESP_NEEDED,
553};
554
555struct mwifiex_ps_param {
556 __le16 null_pkt_interval;
557 __le16 multiple_dtims;
558 __le16 bcn_miss_timeout;
559 __le16 local_listen_interval;
560 __le16 adhoc_wake_period;
561 __le16 mode;
562 __le16 delay_to_ps;
563};
564
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700565#define BITMAP_AUTO_DS 0x01
566#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700567
568struct mwifiex_ie_types_auto_ds_param {
569 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700570 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700571} __packed;
572
573struct mwifiex_ie_types_ps_param {
574 struct mwifiex_ie_types_header header;
575 struct mwifiex_ps_param param;
576} __packed;
577
578struct host_cmd_ds_802_11_ps_mode_enh {
579 __le16 action;
580
581 union {
582 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700583 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700584 } params;
585} __packed;
586
587struct host_cmd_ds_get_hw_spec {
588 __le16 hw_if_version;
589 __le16 version;
590 __le16 reserved;
591 __le16 num_of_mcast_adr;
592 u8 permanent_addr[ETH_ALEN];
593 __le16 region_code;
594 __le16 number_of_antenna;
595 __le32 fw_release_number;
596 __le32 reserved_1;
597 __le32 reserved_2;
598 __le32 reserved_3;
599 __le32 fw_cap_info;
600 __le32 dot_11n_dev_cap;
601 u8 dev_mcs_support;
602 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
603 __le16 reserved_4;
604} __packed;
605
606struct host_cmd_ds_802_11_rssi_info {
607 __le16 action;
608 __le16 ndata;
609 __le16 nbcn;
610 __le16 reserved[9];
611 long long reserved_1;
612};
613
614struct host_cmd_ds_802_11_rssi_info_rsp {
615 __le16 action;
616 __le16 ndata;
617 __le16 nbcn;
618 __le16 data_rssi_last;
619 __le16 data_nf_last;
620 __le16 data_rssi_avg;
621 __le16 data_nf_avg;
622 __le16 bcn_rssi_last;
623 __le16 bcn_nf_last;
624 __le16 bcn_rssi_avg;
625 __le16 bcn_nf_avg;
626 long long tsf_bcn;
627};
628
629struct host_cmd_ds_802_11_mac_address {
630 __le16 action;
631 u8 mac_addr[ETH_ALEN];
632};
633
634struct host_cmd_ds_mac_control {
635 __le16 action;
636 __le16 reserved;
637};
638
639struct host_cmd_ds_mac_multicast_adr {
640 __le16 action;
641 __le16 num_of_adrs;
642 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
643} __packed;
644
645struct host_cmd_ds_802_11_deauthenticate {
646 u8 mac_addr[ETH_ALEN];
647 __le16 reason_code;
648} __packed;
649
650struct host_cmd_ds_802_11_associate {
651 u8 peer_sta_addr[ETH_ALEN];
652 __le16 cap_info_bitmap;
653 __le16 listen_interval;
654 __le16 beacon_period;
655 u8 dtim_period;
656} __packed;
657
658struct ieee_types_assoc_rsp {
659 __le16 cap_info_bitmap;
660 __le16 status_code;
661 __le16 a_id;
662 u8 ie_buffer[1];
663} __packed;
664
665struct host_cmd_ds_802_11_associate_rsp {
666 struct ieee_types_assoc_rsp assoc_rsp;
667} __packed;
668
669struct ieee_types_cf_param_set {
670 u8 element_id;
671 u8 len;
672 u8 cfp_cnt;
673 u8 cfp_period;
674 u16 cfp_max_duration;
675 u16 cfp_duration_remaining;
676} __packed;
677
678struct ieee_types_ibss_param_set {
679 u8 element_id;
680 u8 len;
681 __le16 atim_window;
682} __packed;
683
684union ieee_types_ss_param_set {
685 struct ieee_types_cf_param_set cf_param_set;
686 struct ieee_types_ibss_param_set ibss_param_set;
687} __packed;
688
689struct ieee_types_fh_param_set {
690 u8 element_id;
691 u8 len;
692 __le16 dwell_time;
693 u8 hop_set;
694 u8 hop_pattern;
695 u8 hop_index;
696} __packed;
697
698struct ieee_types_ds_param_set {
699 u8 element_id;
700 u8 len;
701 u8 current_chan;
702} __packed;
703
704union ieee_types_phy_param_set {
705 struct ieee_types_fh_param_set fh_param_set;
706 struct ieee_types_ds_param_set ds_param_set;
707} __packed;
708
709struct host_cmd_ds_802_11_ad_hoc_start {
710 u8 ssid[IEEE80211_MAX_SSID_LEN];
711 u8 bss_mode;
712 __le16 beacon_period;
713 u8 dtim_period;
714 union ieee_types_ss_param_set ss_param_set;
715 union ieee_types_phy_param_set phy_param_set;
716 u16 reserved1;
717 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800718 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700719} __packed;
720
721struct host_cmd_ds_802_11_ad_hoc_result {
722 u8 pad[3];
723 u8 bssid[ETH_ALEN];
724} __packed;
725
726struct adhoc_bss_desc {
727 u8 bssid[ETH_ALEN];
728 u8 ssid[IEEE80211_MAX_SSID_LEN];
729 u8 bss_mode;
730 __le16 beacon_period;
731 u8 dtim_period;
732 u8 time_stamp[8];
733 u8 local_time[8];
734 union ieee_types_phy_param_set phy_param_set;
735 union ieee_types_ss_param_set ss_param_set;
736 __le16 cap_info_bitmap;
737 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
738
739 /*
740 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
741 * It is used in the Adhoc join command and will cause a
742 * binary layout mismatch with the firmware
743 */
744} __packed;
745
746struct host_cmd_ds_802_11_ad_hoc_join {
747 struct adhoc_bss_desc bss_descriptor;
748 u16 reserved1;
749 u16 reserved2;
750} __packed;
751
752struct host_cmd_ds_802_11_get_log {
753 __le32 mcast_tx_frame;
754 __le32 failed;
755 __le32 retry;
756 __le32 multi_retry;
757 __le32 frame_dup;
758 __le32 rts_success;
759 __le32 rts_failure;
760 __le32 ack_failure;
761 __le32 rx_frag;
762 __le32 mcast_rx_frame;
763 __le32 fcs_error;
764 __le32 tx_frame;
765 __le32 reserved;
766 __le32 wep_icv_err_cnt[4];
767};
768
769struct host_cmd_ds_tx_rate_query {
770 u8 tx_rate;
771 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
772 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
773 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
774 u8 ht_info;
775} __packed;
776
777enum Host_Sleep_Action {
778 HS_CONFIGURE = 0x0001,
779 HS_ACTIVATE = 0x0002,
780};
781
782struct mwifiex_hs_config_param {
783 __le32 conditions;
784 u8 gpio;
785 u8 gap;
786} __packed;
787
788struct hs_activate_param {
789 u16 resp_ctrl;
790} __packed;
791
792struct host_cmd_ds_802_11_hs_cfg_enh {
793 __le16 action;
794
795 union {
796 struct mwifiex_hs_config_param hs_config;
797 struct hs_activate_param hs_activate;
798 } params;
799} __packed;
800
801enum SNMP_MIB_INDEX {
802 OP_RATE_SET_I = 1,
803 DTIM_PERIOD_I = 3,
804 RTS_THRESH_I = 5,
805 SHORT_RETRY_LIM_I = 6,
806 LONG_RETRY_LIM_I = 7,
807 FRAG_THRESH_I = 8,
808 DOT11D_I = 9,
809};
810
811#define MAX_SNMP_BUF_SIZE 128
812
813struct host_cmd_ds_802_11_snmp_mib {
814 __le16 query_type;
815 __le16 oid;
816 __le16 buf_size;
817 u8 value[1];
818} __packed;
819
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700820struct mwifiex_rate_scope {
821 __le16 type;
822 __le16 length;
823 __le16 hr_dsss_rate_bitmap;
824 __le16 ofdm_rate_bitmap;
825 __le16 ht_mcs_rate_bitmap[8];
826} __packed;
827
828struct mwifiex_rate_drop_pattern {
829 __le16 type;
830 __le16 length;
831 __le32 rate_drop_mode;
832} __packed;
833
834struct host_cmd_ds_tx_rate_cfg {
835 __le16 action;
836 __le16 cfg_index;
837} __packed;
838
839struct mwifiex_power_group {
840 u8 modulation_class;
841 u8 first_rate_code;
842 u8 last_rate_code;
843 s8 power_step;
844 s8 power_min;
845 s8 power_max;
846 u8 ht_bandwidth;
847 u8 reserved;
848} __packed;
849
850struct mwifiex_types_power_group {
851 u16 type;
852 u16 length;
853} __packed;
854
855struct host_cmd_ds_txpwr_cfg {
856 __le16 action;
857 __le16 cfg_index;
858 __le32 mode;
859} __packed;
860
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700861struct mwifiex_bcn_param {
862 u8 bssid[ETH_ALEN];
863 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700864 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700865 __le16 beacon_period;
866 __le16 cap_info_bitmap;
867} __packed;
868
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700869#define MWIFIEX_USER_SCAN_CHAN_MAX 50
870
871#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
872
873struct mwifiex_scan_cmd_config {
874 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700875 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700876 */
877 u8 bss_mode;
878
879 /* Specific BSSID used to filter scan results in the firmware */
880 u8 specific_bssid[ETH_ALEN];
881
882 /* Length of TLVs sent in command starting at tlvBuffer */
883 u32 tlv_buf_len;
884
885 /*
886 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
887 *
888 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
889 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
890 */
891 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
892 here */
893} __packed;
894
895struct mwifiex_user_scan_chan {
896 u8 chan_number;
897 u8 radio_type;
898 u8 scan_type;
899 u8 reserved;
900 u32 scan_time;
901} __packed;
902
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700903struct mwifiex_user_scan_cfg {
904 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700905 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700906 */
907 u8 bss_mode;
908 /* Configure the number of probe requests for active chan scans */
909 u8 num_probes;
910 u8 reserved;
911 /* BSSID filter sent in the firmware command to limit the results */
912 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -0800913 /* SSID filter list used in the firmware to limit the scan results */
914 struct cfg80211_ssid *ssid_list;
915 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700916 /* Variable number (fixed maximum) of channels to scan up */
917 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
918} __packed;
919
920struct ie_body {
921 u8 grp_key_oui[4];
922 u8 ptk_cnt[2];
923 u8 ptk_body[4];
924} __packed;
925
926struct host_cmd_ds_802_11_scan {
927 u8 bss_mode;
928 u8 bssid[ETH_ALEN];
929 u8 tlv_buffer[1];
930} __packed;
931
932struct host_cmd_ds_802_11_scan_rsp {
933 __le16 bss_descript_size;
934 u8 number_of_sets;
935 u8 bss_desc_and_tlv_buffer[1];
936} __packed;
937
938struct host_cmd_ds_802_11_bg_scan_query {
939 u8 flush;
940} __packed;
941
942struct host_cmd_ds_802_11_bg_scan_query_rsp {
943 u32 report_condition;
944 struct host_cmd_ds_802_11_scan_rsp scan_resp;
945} __packed;
946
947struct mwifiex_ietypes_domain_param_set {
948 struct mwifiex_ie_types_header header;
949 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
950 struct ieee80211_country_ie_triplet triplet[1];
951} __packed;
952
953struct host_cmd_ds_802_11d_domain_info {
954 __le16 action;
955 struct mwifiex_ietypes_domain_param_set domain;
956} __packed;
957
958struct host_cmd_ds_802_11d_domain_info_rsp {
959 __le16 action;
960 struct mwifiex_ietypes_domain_param_set domain;
961} __packed;
962
963struct host_cmd_ds_11n_addba_req {
964 u8 add_req_result;
965 u8 peer_mac_addr[ETH_ALEN];
966 u8 dialog_token;
967 __le16 block_ack_param_set;
968 __le16 block_ack_tmo;
969 __le16 ssn;
970} __packed;
971
972struct host_cmd_ds_11n_addba_rsp {
973 u8 add_rsp_result;
974 u8 peer_mac_addr[ETH_ALEN];
975 u8 dialog_token;
976 __le16 status_code;
977 __le16 block_ack_param_set;
978 __le16 block_ack_tmo;
979 __le16 ssn;
980} __packed;
981
982struct host_cmd_ds_11n_delba {
983 u8 del_result;
984 u8 peer_mac_addr[ETH_ALEN];
985 __le16 del_ba_param_set;
986 __le16 reason_code;
987 u8 reserved;
988} __packed;
989
990struct host_cmd_ds_11n_batimeout {
991 u8 tid;
992 u8 peer_mac_addr[ETH_ALEN];
993 u8 origninator;
994} __packed;
995
996struct host_cmd_ds_11n_cfg {
997 __le16 action;
998 __le16 ht_tx_cap;
999 __le16 ht_tx_info;
1000} __packed;
1001
1002struct host_cmd_ds_txbuf_cfg {
1003 __le16 action;
1004 __le16 buff_size;
1005 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1006 __le16 reserved3;
1007} __packed;
1008
1009struct host_cmd_ds_amsdu_aggr_ctrl {
1010 __le16 action;
1011 __le16 enable;
1012 __le16 curr_buf_size;
1013} __packed;
1014
1015struct mwifiex_ie_types_wmm_param_set {
1016 struct mwifiex_ie_types_header header;
1017 u8 wmm_ie[1];
1018};
1019
1020struct mwifiex_ie_types_wmm_queue_status {
1021 struct mwifiex_ie_types_header header;
1022 u8 queue_index;
1023 u8 disabled;
1024 u16 medium_time;
1025 u8 flow_required;
1026 u8 flow_created;
1027 u32 reserved;
1028};
1029
1030struct ieee_types_vendor_header {
1031 u8 element_id;
1032 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001033 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001034 u8 oui_subtype;
1035 u8 version;
1036} __packed;
1037
1038struct ieee_types_wmm_ac_parameters {
1039 u8 aci_aifsn_bitmap;
1040 u8 ecw_bitmap;
1041 __le16 tx_op_limit;
1042} __packed;
1043
1044struct ieee_types_wmm_parameter {
1045 /*
1046 * WMM Parameter IE - Vendor Specific Header:
1047 * element_id [221/0xdd]
1048 * Len [24]
1049 * Oui [00:50:f2]
1050 * OuiType [2]
1051 * OuiSubType [1]
1052 * Version [1]
1053 */
1054 struct ieee_types_vendor_header vend_hdr;
1055 u8 qos_info_bitmap;
1056 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001057 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001058} __packed;
1059
1060struct ieee_types_wmm_info {
1061
1062 /*
1063 * WMM Info IE - Vendor Specific Header:
1064 * element_id [221/0xdd]
1065 * Len [7]
1066 * Oui [00:50:f2]
1067 * OuiType [2]
1068 * OuiSubType [0]
1069 * Version [1]
1070 */
1071 struct ieee_types_vendor_header vend_hdr;
1072
1073 u8 qos_info_bitmap;
1074} __packed;
1075
1076struct host_cmd_ds_wmm_get_status {
1077 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001078 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001079 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1080} __packed;
1081
1082struct mwifiex_wmm_ac_status {
1083 u8 disabled;
1084 u8 flow_required;
1085 u8 flow_created;
1086};
1087
1088struct mwifiex_ie_types_htcap {
1089 struct mwifiex_ie_types_header header;
1090 struct ieee80211_ht_cap ht_cap;
1091} __packed;
1092
1093struct mwifiex_ie_types_htinfo {
1094 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001095 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001096} __packed;
1097
1098struct mwifiex_ie_types_2040bssco {
1099 struct mwifiex_ie_types_header header;
1100 u8 bss_co_2040;
1101} __packed;
1102
1103struct mwifiex_ie_types_extcap {
1104 struct mwifiex_ie_types_header header;
1105 u8 ext_cap;
1106} __packed;
1107
1108struct host_cmd_ds_mac_reg_access {
1109 __le16 action;
1110 __le16 offset;
1111 __le32 value;
1112} __packed;
1113
1114struct host_cmd_ds_bbp_reg_access {
1115 __le16 action;
1116 __le16 offset;
1117 u8 value;
1118 u8 reserved[3];
1119} __packed;
1120
1121struct host_cmd_ds_rf_reg_access {
1122 __le16 action;
1123 __le16 offset;
1124 u8 value;
1125 u8 reserved[3];
1126} __packed;
1127
1128struct host_cmd_ds_pmic_reg_access {
1129 __le16 action;
1130 __le16 offset;
1131 u8 value;
1132 u8 reserved[3];
1133} __packed;
1134
1135struct host_cmd_ds_802_11_eeprom_access {
1136 __le16 action;
1137
1138 __le16 offset;
1139 __le16 byte_count;
1140 u8 value;
1141} __packed;
1142
Avinash Patil75edd2c2012-05-08 18:30:18 -07001143struct host_cmd_tlv {
1144 __le16 type;
1145 __le16 len;
1146} __packed;
1147
Avinash Patile5686342012-05-08 18:30:25 -07001148struct mwifiex_assoc_event {
1149 u8 sta_addr[ETH_ALEN];
1150 __le16 type;
1151 __le16 len;
1152 __le16 frame_control;
1153 __le16 cap_info;
1154 __le16 listen_interval;
1155 u8 data[0];
1156} __packed;
1157
Avinash Patil4db16a12012-05-08 18:30:20 -07001158struct host_cmd_ds_sys_config {
1159 __le16 action;
1160 u8 tlv[0];
1161};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001162
1163struct host_cmd_tlv_akmp {
1164 struct host_cmd_tlv tlv;
1165 __le16 key_mgmt;
1166 __le16 key_mgmt_operation;
1167} __packed;
1168
1169struct host_cmd_tlv_pwk_cipher {
1170 struct host_cmd_tlv tlv;
1171 __le16 proto;
1172 u8 cipher;
1173 u8 reserved;
1174} __packed;
1175
1176struct host_cmd_tlv_gwk_cipher {
1177 struct host_cmd_tlv tlv;
1178 u8 cipher;
1179 u8 reserved;
1180} __packed;
1181
1182struct host_cmd_tlv_passphrase {
1183 struct host_cmd_tlv tlv;
1184 u8 passphrase[0];
1185} __packed;
1186
1187struct host_cmd_tlv_auth_type {
1188 struct host_cmd_tlv tlv;
1189 u8 auth_type;
1190} __packed;
1191
1192struct host_cmd_tlv_encrypt_protocol {
1193 struct host_cmd_tlv tlv;
1194 __le16 proto;
1195} __packed;
1196
Avinash Patil12190c52012-05-08 18:30:24 -07001197struct host_cmd_tlv_ssid {
1198 struct host_cmd_tlv tlv;
1199 u8 ssid[0];
1200} __packed;
1201
1202struct host_cmd_tlv_beacon_period {
1203 struct host_cmd_tlv tlv;
1204 __le16 period;
1205} __packed;
1206
1207struct host_cmd_tlv_dtim_period {
1208 struct host_cmd_tlv tlv;
1209 u8 period;
1210} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001211
Avinash Patil9b930ea2012-05-08 18:30:23 -07001212struct host_cmd_tlv_frag_threshold {
1213 struct host_cmd_tlv tlv;
1214 __le16 frag_thr;
1215} __packed;
1216
1217struct host_cmd_tlv_rts_threshold {
1218 struct host_cmd_tlv tlv;
1219 __le16 rts_thr;
1220} __packed;
1221
1222struct host_cmd_tlv_retry_limit {
1223 struct host_cmd_tlv tlv;
1224 u8 limit;
1225} __packed;
1226
Avinash Patil75edd2c2012-05-08 18:30:18 -07001227struct host_cmd_tlv_mac_addr {
1228 struct host_cmd_tlv tlv;
1229 u8 mac_addr[ETH_ALEN];
1230} __packed;
1231
Avinash Patil4db16a12012-05-08 18:30:20 -07001232struct host_cmd_tlv_channel_band {
1233 struct host_cmd_tlv tlv;
1234 u8 band_config;
1235 u8 channel;
1236} __packed;
1237
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001238struct host_cmd_ds_802_11_rf_channel {
1239 __le16 action;
1240 __le16 current_channel;
1241 __le16 rf_type;
1242 __le16 reserved;
1243 u8 reserved_1[32];
1244} __packed;
1245
1246struct host_cmd_ds_version_ext {
1247 u8 version_str_sel;
1248 char version_str[128];
1249} __packed;
1250
1251struct host_cmd_ds_802_11_ibss_status {
1252 __le16 action;
1253 __le16 enable;
1254 u8 bssid[ETH_ALEN];
1255 __le16 beacon_interval;
1256 __le16 atim_window;
1257 __le16 use_g_rate_protect;
1258} __packed;
1259
1260#define CONNECTION_TYPE_INFRA 0
1261#define CONNECTION_TYPE_ADHOC 1
1262
1263struct host_cmd_ds_set_bss_mode {
1264 u8 con_type;
1265} __packed;
1266
Amitkumar Karward930fae2011-10-11 17:41:21 -07001267struct host_cmd_ds_pcie_details {
1268 /* TX buffer descriptor ring address */
1269 u32 txbd_addr_lo;
1270 u32 txbd_addr_hi;
1271 /* TX buffer descriptor ring count */
1272 u32 txbd_count;
1273
1274 /* RX buffer descriptor ring address */
1275 u32 rxbd_addr_lo;
1276 u32 rxbd_addr_hi;
1277 /* RX buffer descriptor ring count */
1278 u32 rxbd_count;
1279
1280 /* Event buffer descriptor ring address */
1281 u32 evtbd_addr_lo;
1282 u32 evtbd_addr_hi;
1283 /* Event buffer descriptor ring count */
1284 u32 evtbd_count;
1285
1286 /* Sleep cookie buffer physical address */
1287 u32 sleep_cookie_addr_lo;
1288 u32 sleep_cookie_addr_hi;
1289} __packed;
1290
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001291struct mwifiex_ie_types_rssi_threshold {
1292 struct mwifiex_ie_types_header header;
1293 u8 abs_value;
1294 u8 evt_freq;
1295} __packed;
1296
1297struct host_cmd_ds_802_11_subsc_evt {
1298 __le16 action;
1299 __le16 events;
1300} __packed;
1301
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001302struct host_cmd_ds_command {
1303 __le16 command;
1304 __le16 size;
1305 __le16 seq_num;
1306 __le16 result;
1307 union {
1308 struct host_cmd_ds_get_hw_spec hw_spec;
1309 struct host_cmd_ds_mac_control mac_ctrl;
1310 struct host_cmd_ds_802_11_mac_address mac_addr;
1311 struct host_cmd_ds_mac_multicast_adr mc_addr;
1312 struct host_cmd_ds_802_11_get_log get_log;
1313 struct host_cmd_ds_802_11_rssi_info rssi_info;
1314 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1315 struct host_cmd_ds_802_11_snmp_mib smib;
1316 struct host_cmd_ds_802_11_rf_channel rf_channel;
1317 struct host_cmd_ds_tx_rate_query tx_rate;
1318 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1319 struct host_cmd_ds_txpwr_cfg txp_cfg;
1320 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1321 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1322 struct host_cmd_ds_802_11_scan scan;
1323 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1324 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1325 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1326 struct host_cmd_ds_802_11_associate associate;
1327 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1328 struct host_cmd_ds_802_11_deauthenticate deauth;
1329 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1330 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1331 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1332 struct host_cmd_ds_802_11d_domain_info domain_info;
1333 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1334 struct host_cmd_ds_11n_addba_req add_ba_req;
1335 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1336 struct host_cmd_ds_11n_delba del_ba;
1337 struct host_cmd_ds_txbuf_cfg tx_buf;
1338 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1339 struct host_cmd_ds_11n_cfg htcfg;
1340 struct host_cmd_ds_wmm_get_status get_wmm_status;
1341 struct host_cmd_ds_802_11_key_material key_material;
1342 struct host_cmd_ds_version_ext verext;
1343 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1344 struct host_cmd_ds_mac_reg_access mac_reg;
1345 struct host_cmd_ds_bbp_reg_access bbp_reg;
1346 struct host_cmd_ds_rf_reg_access rf_reg;
1347 struct host_cmd_ds_pmic_reg_access pmic_reg;
1348 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001349 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001350 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001351 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001352 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001353 } params;
1354} __packed;
1355
1356struct mwifiex_opt_sleep_confirm {
1357 __le16 command;
1358 __le16 size;
1359 __le16 seq_num;
1360 __le16 result;
1361 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001362 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001363} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001364#endif /* !_MWIFIEX_FW_H_ */