blob: 0cb2b0cc3ee82f7523b048e97310ab1415c4d5c8 [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
Avinash Patilede98bf2012-05-08 18:30:28 -070097#define UAP_CUSTOM_IE_I 1
98#define MWIFIEX_AUTO_IDX_MASK 0xffff
99#define MWIFIEX_DELETE_MASK 0x0000
Avinash Patile76268d2012-05-08 18:30:27 -0700100
Avinash Patil12190c52012-05-08 18:30:24 -0700101#define TLV_TYPE_UAP_SSID 0x0000
102
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700103#define PROPRIETARY_TLV_BASE_ID 0x0100
104#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
105#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
106#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700107#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700108#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700109#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
110#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
111#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700112#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700113#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700114#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700115#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700116#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
117#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700118#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700119#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
120#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
121#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700122#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700123#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
124#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
125#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700126#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700127#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700128#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700129#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700130#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
131#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700132#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
133#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700134
135#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
136
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700137#define SSN_MASK 0xfff0
138
139#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700140#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700141
142#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
143
144#define BA_STREAM_NOT_ALLOWED 0xff
145
146#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700147 priv->adapter->config_bands & BAND_AN) && \
148 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700149#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
150 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
151
152#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
153#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700154
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700155#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700156
157/* dev_cap bitmap
158 * BIT
159 * 0-16 reserved
160 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
161 * 18-22 reserved
162 * 23 IEEE80211_HT_CAP_SGI_20
163 * 24 IEEE80211_HT_CAP_SGI_40
164 * 25 IEEE80211_HT_CAP_TX_STBC
165 * 26 IEEE80211_HT_CAP_RX_STBC
166 * 27-28 reserved
167 * 29 IEEE80211_HT_CAP_GRN_FLD
168 * 30-31 reserved
169 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700170#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700171#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
172#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
173#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
174#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
175#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
176
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700177/* httxcfg bitmap
178 * 0 reserved
179 * 1 20/40 Mhz enable(1)/disable(0)
180 * 2-3 reserved
181 * 4 green field enable(1)/disable(0)
182 * 5 short GI in 20 Mhz enable(1)/disable(0)
183 * 6 short GI in 40 Mhz enable(1)/disable(0)
184 * 7-15 reserved
185 */
186#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
187
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700188#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700189#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800190#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700191
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700192#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
193
194#define LLC_SNAP_LEN 8
195
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700196#define MOD_CLASS_HR_DSSS 0x03
197#define MOD_CLASS_OFDM 0x07
198#define MOD_CLASS_HT 0x08
199#define HT_BW_20 0
200#define HT_BW_40 1
201
202#define HostCmd_CMD_GET_HW_SPEC 0x0003
203#define HostCmd_CMD_802_11_SCAN 0x0006
204#define HostCmd_CMD_802_11_GET_LOG 0x000b
205#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
206#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
207#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
208#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
209#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
210#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
211#define HostCmd_CMD_RF_REG_ACCESS 0x001b
212#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
213#define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
214#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
215#define HostCmd_CMD_MAC_CONTROL 0x0028
216#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
217#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
218#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
219#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
220#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
221#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
222#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
223#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700224#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700225#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
226#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
227#define HostCmd_CMD_VERSION_EXT 0x0097
228#define HostCmd_CMD_RSSI_INFO 0x00a4
229#define HostCmd_CMD_FUNC_INIT 0x00a9
230#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700231#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
232#define HostCmd_CMD_UAP_BSS_START 0x00b1
233#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700234#define HostCmd_CMD_11N_CFG 0x00cd
235#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
236#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
237#define HostCmd_CMD_11N_DELBA 0x00d0
238#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
239#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
240#define HostCmd_CMD_TXPWR_CFG 0x00d1
241#define HostCmd_CMD_TX_RATE_CFG 0x00d6
242#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
243#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
244#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
245#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700246#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700247
Avinash Patilf752dcd2012-05-08 18:30:26 -0700248#define PROTOCOL_NO_SECURITY 0x01
249#define PROTOCOL_STATIC_WEP 0x02
250#define PROTOCOL_WPA 0x08
251#define PROTOCOL_WPA2 0x20
252#define PROTOCOL_WPA2_MIXED 0x28
253#define PROTOCOL_EAP 0x40
254#define KEY_MGMT_NONE 0x04
255#define KEY_MGMT_PSK 0x02
256#define KEY_MGMT_EAP 0x01
257#define CIPHER_TKIP 0x04
258#define CIPHER_AES_CCMP 0x08
259#define VALID_CIPHER_BITMAP 0x0c
260
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700261enum ENH_PS_MODES {
262 EN_PS = 1,
263 DIS_PS = 2,
264 EN_AUTO_DS = 3,
265 DIS_AUTO_DS = 4,
266 SLEEP_CONFIRM = 5,
267 GET_PS = 0,
268 EN_AUTO_PS = 0xff,
269 DIS_AUTO_PS = 0xfe,
270};
271
272#define HostCmd_RET_BIT 0x8000
273#define HostCmd_ACT_GEN_GET 0x0000
274#define HostCmd_ACT_GEN_SET 0x0001
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700275#define HostCmd_ACT_BITWISE_SET 0x0002
276#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700277#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700278
279#define HostCmd_ACT_MAC_RX_ON 0x0001
280#define HostCmd_ACT_MAC_TX_ON 0x0002
281#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
282#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
283#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
284#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700285#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
286
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700287#define HostCmd_BSS_MODE_IBSS 0x0002
288#define HostCmd_BSS_MODE_ANY 0x0003
289
290#define HostCmd_SCAN_RADIO_TYPE_BG 0
291#define HostCmd_SCAN_RADIO_TYPE_A 1
292
293#define HOST_SLEEP_CFG_CANCEL 0xffffffff
294#define HOST_SLEEP_CFG_COND_DEF 0x0000000f
295#define HOST_SLEEP_CFG_GPIO_DEF 0xff
296#define HOST_SLEEP_CFG_GAP_DEF 0
297
298#define CMD_F_HOSTCMD (1 << 0)
299#define CMD_F_CANCELED (1 << 1)
300
301#define HostCmd_CMD_ID_MASK 0x0fff
302
303#define HostCmd_SEQ_NUM_MASK 0x00ff
304
305#define HostCmd_BSS_NUM_MASK 0x0f00
306
307#define HostCmd_BSS_TYPE_MASK 0xf000
308
309#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
310 (((seq) & 0x00ff) | \
311 (((num) & 0x000f) << 8)) | \
312 (((type) & 0x000f) << 12); }
313
314#define HostCmd_GET_SEQ_NO(seq) \
315 ((seq) & HostCmd_SEQ_NUM_MASK)
316
317#define HostCmd_GET_BSS_NO(seq) \
318 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
319
320#define HostCmd_GET_BSS_TYPE(seq) \
321 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
322
323#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
324#define EVENT_LINK_LOST 0x00000003
325#define EVENT_LINK_SENSED 0x00000004
326#define EVENT_MIB_CHANGED 0x00000006
327#define EVENT_INIT_DONE 0x00000007
328#define EVENT_DEAUTHENTICATED 0x00000008
329#define EVENT_DISASSOCIATED 0x00000009
330#define EVENT_PS_AWAKE 0x0000000a
331#define EVENT_PS_SLEEP 0x0000000b
332#define EVENT_MIC_ERR_MULTICAST 0x0000000d
333#define EVENT_MIC_ERR_UNICAST 0x0000000e
334#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
335#define EVENT_ADHOC_BCN_LOST 0x00000011
336
337#define EVENT_WMM_STATUS_CHANGE 0x00000017
338#define EVENT_BG_SCAN_REPORT 0x00000018
339#define EVENT_RSSI_LOW 0x00000019
340#define EVENT_SNR_LOW 0x0000001a
341#define EVENT_MAX_FAIL 0x0000001b
342#define EVENT_RSSI_HIGH 0x0000001c
343#define EVENT_SNR_HIGH 0x0000001d
344#define EVENT_IBSS_COALESCED 0x0000001e
345#define EVENT_DATA_RSSI_LOW 0x00000024
346#define EVENT_DATA_SNR_LOW 0x00000025
347#define EVENT_DATA_RSSI_HIGH 0x00000026
348#define EVENT_DATA_SNR_HIGH 0x00000027
349#define EVENT_LINK_QUALITY 0x00000028
350#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700351#define EVENT_UAP_STA_DEAUTH 0x0000002c
352#define EVENT_UAP_STA_ASSOC 0x0000002d
353#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700354#define EVENT_PRE_BEACON_LOST 0x00000031
355#define EVENT_ADDBA 0x00000033
356#define EVENT_DELBA 0x00000034
357#define EVENT_BA_STREAM_TIEMOUT 0x00000037
358#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700359#define EVENT_UAP_BSS_IDLE 0x00000043
360#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700361#define EVENT_WEP_ICV_ERR 0x00000046
362#define EVENT_HS_ACT_REQ 0x00000047
363#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700364#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700365#define EVENT_HOSTWAKE_STAIE 0x0000004d
366
367#define EVENT_ID_MASK 0xffff
368#define BSS_NUM_MASK 0xf
369
370#define EVENT_GET_BSS_NUM(event_cause) \
371 (((event_cause) >> 16) & BSS_NUM_MASK)
372
373#define EVENT_GET_BSS_TYPE(event_cause) \
374 (((event_cause) >> 24) & 0x00ff)
375
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700376struct mwifiex_ie_types_header {
377 __le16 type;
378 __le16 len;
379} __packed;
380
381struct mwifiex_ie_types_data {
382 struct mwifiex_ie_types_header header;
383 u8 data[1];
384} __packed;
385
386#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
387#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
388
389struct txpd {
390 u8 bss_type;
391 u8 bss_num;
392 __le16 tx_pkt_length;
393 __le16 tx_pkt_offset;
394 __le16 tx_pkt_type;
395 __le32 tx_control;
396 u8 priority;
397 u8 flags;
398 u8 pkt_delay_2ms;
399 u8 reserved1;
400} __packed;
401
402struct rxpd {
403 u8 bss_type;
404 u8 bss_num;
405 u16 rx_pkt_length;
406 u16 rx_pkt_offset;
407 u16 rx_pkt_type;
408 u16 seq_num;
409 u8 priority;
410 u8 rx_rate;
411 s8 snr;
412 s8 nf;
413 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
414 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
415 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
416 u8 ht_info;
417 u8 reserved;
418} __packed;
419
420enum mwifiex_chan_scan_mode_bitmasks {
421 MWIFIEX_PASSIVE_SCAN = BIT(0),
422 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
423};
424
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700425struct mwifiex_chan_scan_param_set {
426 u8 radio_type;
427 u8 chan_number;
428 u8 chan_scan_mode_bitmap;
429 __le16 min_scan_time;
430 __le16 max_scan_time;
431} __packed;
432
433struct mwifiex_ie_types_chan_list_param_set {
434 struct mwifiex_ie_types_header header;
435 struct mwifiex_chan_scan_param_set chan_scan_param[1];
436} __packed;
437
438struct chan_band_param_set {
439 u8 radio_type;
440 u8 chan_number;
441};
442
443struct mwifiex_ie_types_chan_band_list_param_set {
444 struct mwifiex_ie_types_header header;
445 struct chan_band_param_set chan_band_param[1];
446} __packed;
447
448struct mwifiex_ie_types_rates_param_set {
449 struct mwifiex_ie_types_header header;
450 u8 rates[1];
451} __packed;
452
453struct mwifiex_ie_types_ssid_param_set {
454 struct mwifiex_ie_types_header header;
455 u8 ssid[1];
456} __packed;
457
458struct mwifiex_ie_types_num_probes {
459 struct mwifiex_ie_types_header header;
460 __le16 num_probes;
461} __packed;
462
463struct mwifiex_ie_types_wildcard_ssid_params {
464 struct mwifiex_ie_types_header header;
465 u8 max_ssid_length;
466 u8 ssid[1];
467} __packed;
468
469#define TSF_DATA_SIZE 8
470struct mwifiex_ie_types_tsf_timestamp {
471 struct mwifiex_ie_types_header header;
472 u8 tsf_data[1];
473} __packed;
474
475struct mwifiex_cf_param_set {
476 u8 cfp_cnt;
477 u8 cfp_period;
478 u16 cfp_max_duration;
479 u16 cfp_duration_remaining;
480} __packed;
481
482struct mwifiex_ibss_param_set {
483 u16 atim_window;
484} __packed;
485
486struct mwifiex_ie_types_ss_param_set {
487 struct mwifiex_ie_types_header header;
488 union {
489 struct mwifiex_cf_param_set cf_param_set[1];
490 struct mwifiex_ibss_param_set ibss_param_set[1];
491 } cf_ibss;
492} __packed;
493
494struct mwifiex_fh_param_set {
495 u16 dwell_time;
496 u8 hop_set;
497 u8 hop_pattern;
498 u8 hop_index;
499} __packed;
500
501struct mwifiex_ds_param_set {
502 u8 current_chan;
503} __packed;
504
505struct mwifiex_ie_types_phy_param_set {
506 struct mwifiex_ie_types_header header;
507 union {
508 struct mwifiex_fh_param_set fh_param_set[1];
509 struct mwifiex_ds_param_set ds_param_set[1];
510 } fh_ds;
511} __packed;
512
513struct mwifiex_ie_types_auth_type {
514 struct mwifiex_ie_types_header header;
515 __le16 auth_type;
516} __packed;
517
518struct mwifiex_ie_types_vendor_param_set {
519 struct mwifiex_ie_types_header header;
520 u8 ie[MWIFIEX_MAX_VSIE_LEN];
521};
522
523struct mwifiex_ie_types_rsn_param_set {
524 struct mwifiex_ie_types_header header;
525 u8 rsn_ie[1];
526} __packed;
527
528#define KEYPARAMSET_FIXED_LEN 6
529
530struct mwifiex_ie_type_key_param_set {
531 __le16 type;
532 __le16 length;
533 __le16 key_type_id;
534 __le16 key_info;
535 __le16 key_len;
536 u8 key[50];
537} __packed;
538
539struct host_cmd_ds_802_11_key_material {
540 __le16 action;
541 struct mwifiex_ie_type_key_param_set key_param_set;
542} __packed;
543
544struct host_cmd_ds_gen {
545 u16 command;
546 u16 size;
547 u16 seq_num;
548 u16 result;
549};
550
551#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
552
553enum sleep_resp_ctrl {
554 RESP_NOT_NEEDED = 0,
555 RESP_NEEDED,
556};
557
558struct mwifiex_ps_param {
559 __le16 null_pkt_interval;
560 __le16 multiple_dtims;
561 __le16 bcn_miss_timeout;
562 __le16 local_listen_interval;
563 __le16 adhoc_wake_period;
564 __le16 mode;
565 __le16 delay_to_ps;
566};
567
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700568#define BITMAP_AUTO_DS 0x01
569#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700570
571struct mwifiex_ie_types_auto_ds_param {
572 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700573 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700574} __packed;
575
576struct mwifiex_ie_types_ps_param {
577 struct mwifiex_ie_types_header header;
578 struct mwifiex_ps_param param;
579} __packed;
580
581struct host_cmd_ds_802_11_ps_mode_enh {
582 __le16 action;
583
584 union {
585 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700586 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700587 } params;
588} __packed;
589
590struct host_cmd_ds_get_hw_spec {
591 __le16 hw_if_version;
592 __le16 version;
593 __le16 reserved;
594 __le16 num_of_mcast_adr;
595 u8 permanent_addr[ETH_ALEN];
596 __le16 region_code;
597 __le16 number_of_antenna;
598 __le32 fw_release_number;
599 __le32 reserved_1;
600 __le32 reserved_2;
601 __le32 reserved_3;
602 __le32 fw_cap_info;
603 __le32 dot_11n_dev_cap;
604 u8 dev_mcs_support;
605 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
606 __le16 reserved_4;
607} __packed;
608
609struct host_cmd_ds_802_11_rssi_info {
610 __le16 action;
611 __le16 ndata;
612 __le16 nbcn;
613 __le16 reserved[9];
614 long long reserved_1;
615};
616
617struct host_cmd_ds_802_11_rssi_info_rsp {
618 __le16 action;
619 __le16 ndata;
620 __le16 nbcn;
621 __le16 data_rssi_last;
622 __le16 data_nf_last;
623 __le16 data_rssi_avg;
624 __le16 data_nf_avg;
625 __le16 bcn_rssi_last;
626 __le16 bcn_nf_last;
627 __le16 bcn_rssi_avg;
628 __le16 bcn_nf_avg;
629 long long tsf_bcn;
630};
631
632struct host_cmd_ds_802_11_mac_address {
633 __le16 action;
634 u8 mac_addr[ETH_ALEN];
635};
636
637struct host_cmd_ds_mac_control {
638 __le16 action;
639 __le16 reserved;
640};
641
642struct host_cmd_ds_mac_multicast_adr {
643 __le16 action;
644 __le16 num_of_adrs;
645 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
646} __packed;
647
648struct host_cmd_ds_802_11_deauthenticate {
649 u8 mac_addr[ETH_ALEN];
650 __le16 reason_code;
651} __packed;
652
653struct host_cmd_ds_802_11_associate {
654 u8 peer_sta_addr[ETH_ALEN];
655 __le16 cap_info_bitmap;
656 __le16 listen_interval;
657 __le16 beacon_period;
658 u8 dtim_period;
659} __packed;
660
661struct ieee_types_assoc_rsp {
662 __le16 cap_info_bitmap;
663 __le16 status_code;
664 __le16 a_id;
665 u8 ie_buffer[1];
666} __packed;
667
668struct host_cmd_ds_802_11_associate_rsp {
669 struct ieee_types_assoc_rsp assoc_rsp;
670} __packed;
671
672struct ieee_types_cf_param_set {
673 u8 element_id;
674 u8 len;
675 u8 cfp_cnt;
676 u8 cfp_period;
677 u16 cfp_max_duration;
678 u16 cfp_duration_remaining;
679} __packed;
680
681struct ieee_types_ibss_param_set {
682 u8 element_id;
683 u8 len;
684 __le16 atim_window;
685} __packed;
686
687union ieee_types_ss_param_set {
688 struct ieee_types_cf_param_set cf_param_set;
689 struct ieee_types_ibss_param_set ibss_param_set;
690} __packed;
691
692struct ieee_types_fh_param_set {
693 u8 element_id;
694 u8 len;
695 __le16 dwell_time;
696 u8 hop_set;
697 u8 hop_pattern;
698 u8 hop_index;
699} __packed;
700
701struct ieee_types_ds_param_set {
702 u8 element_id;
703 u8 len;
704 u8 current_chan;
705} __packed;
706
707union ieee_types_phy_param_set {
708 struct ieee_types_fh_param_set fh_param_set;
709 struct ieee_types_ds_param_set ds_param_set;
710} __packed;
711
712struct host_cmd_ds_802_11_ad_hoc_start {
713 u8 ssid[IEEE80211_MAX_SSID_LEN];
714 u8 bss_mode;
715 __le16 beacon_period;
716 u8 dtim_period;
717 union ieee_types_ss_param_set ss_param_set;
718 union ieee_types_phy_param_set phy_param_set;
719 u16 reserved1;
720 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800721 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700722} __packed;
723
724struct host_cmd_ds_802_11_ad_hoc_result {
725 u8 pad[3];
726 u8 bssid[ETH_ALEN];
727} __packed;
728
729struct adhoc_bss_desc {
730 u8 bssid[ETH_ALEN];
731 u8 ssid[IEEE80211_MAX_SSID_LEN];
732 u8 bss_mode;
733 __le16 beacon_period;
734 u8 dtim_period;
735 u8 time_stamp[8];
736 u8 local_time[8];
737 union ieee_types_phy_param_set phy_param_set;
738 union ieee_types_ss_param_set ss_param_set;
739 __le16 cap_info_bitmap;
740 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
741
742 /*
743 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
744 * It is used in the Adhoc join command and will cause a
745 * binary layout mismatch with the firmware
746 */
747} __packed;
748
749struct host_cmd_ds_802_11_ad_hoc_join {
750 struct adhoc_bss_desc bss_descriptor;
751 u16 reserved1;
752 u16 reserved2;
753} __packed;
754
755struct host_cmd_ds_802_11_get_log {
756 __le32 mcast_tx_frame;
757 __le32 failed;
758 __le32 retry;
759 __le32 multi_retry;
760 __le32 frame_dup;
761 __le32 rts_success;
762 __le32 rts_failure;
763 __le32 ack_failure;
764 __le32 rx_frag;
765 __le32 mcast_rx_frame;
766 __le32 fcs_error;
767 __le32 tx_frame;
768 __le32 reserved;
769 __le32 wep_icv_err_cnt[4];
770};
771
772struct host_cmd_ds_tx_rate_query {
773 u8 tx_rate;
774 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
775 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
776 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
777 u8 ht_info;
778} __packed;
779
780enum Host_Sleep_Action {
781 HS_CONFIGURE = 0x0001,
782 HS_ACTIVATE = 0x0002,
783};
784
785struct mwifiex_hs_config_param {
786 __le32 conditions;
787 u8 gpio;
788 u8 gap;
789} __packed;
790
791struct hs_activate_param {
792 u16 resp_ctrl;
793} __packed;
794
795struct host_cmd_ds_802_11_hs_cfg_enh {
796 __le16 action;
797
798 union {
799 struct mwifiex_hs_config_param hs_config;
800 struct hs_activate_param hs_activate;
801 } params;
802} __packed;
803
804enum SNMP_MIB_INDEX {
805 OP_RATE_SET_I = 1,
806 DTIM_PERIOD_I = 3,
807 RTS_THRESH_I = 5,
808 SHORT_RETRY_LIM_I = 6,
809 LONG_RETRY_LIM_I = 7,
810 FRAG_THRESH_I = 8,
811 DOT11D_I = 9,
812};
813
814#define MAX_SNMP_BUF_SIZE 128
815
816struct host_cmd_ds_802_11_snmp_mib {
817 __le16 query_type;
818 __le16 oid;
819 __le16 buf_size;
820 u8 value[1];
821} __packed;
822
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700823struct mwifiex_rate_scope {
824 __le16 type;
825 __le16 length;
826 __le16 hr_dsss_rate_bitmap;
827 __le16 ofdm_rate_bitmap;
828 __le16 ht_mcs_rate_bitmap[8];
829} __packed;
830
831struct mwifiex_rate_drop_pattern {
832 __le16 type;
833 __le16 length;
834 __le32 rate_drop_mode;
835} __packed;
836
837struct host_cmd_ds_tx_rate_cfg {
838 __le16 action;
839 __le16 cfg_index;
840} __packed;
841
842struct mwifiex_power_group {
843 u8 modulation_class;
844 u8 first_rate_code;
845 u8 last_rate_code;
846 s8 power_step;
847 s8 power_min;
848 s8 power_max;
849 u8 ht_bandwidth;
850 u8 reserved;
851} __packed;
852
853struct mwifiex_types_power_group {
854 u16 type;
855 u16 length;
856} __packed;
857
858struct host_cmd_ds_txpwr_cfg {
859 __le16 action;
860 __le16 cfg_index;
861 __le32 mode;
862} __packed;
863
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700864struct mwifiex_bcn_param {
865 u8 bssid[ETH_ALEN];
866 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700867 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700868 __le16 beacon_period;
869 __le16 cap_info_bitmap;
870} __packed;
871
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700872#define MWIFIEX_USER_SCAN_CHAN_MAX 50
873
874#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
875
876struct mwifiex_scan_cmd_config {
877 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700878 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700879 */
880 u8 bss_mode;
881
882 /* Specific BSSID used to filter scan results in the firmware */
883 u8 specific_bssid[ETH_ALEN];
884
885 /* Length of TLVs sent in command starting at tlvBuffer */
886 u32 tlv_buf_len;
887
888 /*
889 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
890 *
891 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
892 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
893 */
894 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
895 here */
896} __packed;
897
898struct mwifiex_user_scan_chan {
899 u8 chan_number;
900 u8 radio_type;
901 u8 scan_type;
902 u8 reserved;
903 u32 scan_time;
904} __packed;
905
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700906struct mwifiex_user_scan_cfg {
907 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700908 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700909 */
910 u8 bss_mode;
911 /* Configure the number of probe requests for active chan scans */
912 u8 num_probes;
913 u8 reserved;
914 /* BSSID filter sent in the firmware command to limit the results */
915 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -0800916 /* SSID filter list used in the firmware to limit the scan results */
917 struct cfg80211_ssid *ssid_list;
918 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700919 /* Variable number (fixed maximum) of channels to scan up */
920 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
921} __packed;
922
923struct ie_body {
924 u8 grp_key_oui[4];
925 u8 ptk_cnt[2];
926 u8 ptk_body[4];
927} __packed;
928
929struct host_cmd_ds_802_11_scan {
930 u8 bss_mode;
931 u8 bssid[ETH_ALEN];
932 u8 tlv_buffer[1];
933} __packed;
934
935struct host_cmd_ds_802_11_scan_rsp {
936 __le16 bss_descript_size;
937 u8 number_of_sets;
938 u8 bss_desc_and_tlv_buffer[1];
939} __packed;
940
941struct host_cmd_ds_802_11_bg_scan_query {
942 u8 flush;
943} __packed;
944
945struct host_cmd_ds_802_11_bg_scan_query_rsp {
946 u32 report_condition;
947 struct host_cmd_ds_802_11_scan_rsp scan_resp;
948} __packed;
949
950struct mwifiex_ietypes_domain_param_set {
951 struct mwifiex_ie_types_header header;
952 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
953 struct ieee80211_country_ie_triplet triplet[1];
954} __packed;
955
956struct host_cmd_ds_802_11d_domain_info {
957 __le16 action;
958 struct mwifiex_ietypes_domain_param_set domain;
959} __packed;
960
961struct host_cmd_ds_802_11d_domain_info_rsp {
962 __le16 action;
963 struct mwifiex_ietypes_domain_param_set domain;
964} __packed;
965
966struct host_cmd_ds_11n_addba_req {
967 u8 add_req_result;
968 u8 peer_mac_addr[ETH_ALEN];
969 u8 dialog_token;
970 __le16 block_ack_param_set;
971 __le16 block_ack_tmo;
972 __le16 ssn;
973} __packed;
974
975struct host_cmd_ds_11n_addba_rsp {
976 u8 add_rsp_result;
977 u8 peer_mac_addr[ETH_ALEN];
978 u8 dialog_token;
979 __le16 status_code;
980 __le16 block_ack_param_set;
981 __le16 block_ack_tmo;
982 __le16 ssn;
983} __packed;
984
985struct host_cmd_ds_11n_delba {
986 u8 del_result;
987 u8 peer_mac_addr[ETH_ALEN];
988 __le16 del_ba_param_set;
989 __le16 reason_code;
990 u8 reserved;
991} __packed;
992
993struct host_cmd_ds_11n_batimeout {
994 u8 tid;
995 u8 peer_mac_addr[ETH_ALEN];
996 u8 origninator;
997} __packed;
998
999struct host_cmd_ds_11n_cfg {
1000 __le16 action;
1001 __le16 ht_tx_cap;
1002 __le16 ht_tx_info;
1003} __packed;
1004
1005struct host_cmd_ds_txbuf_cfg {
1006 __le16 action;
1007 __le16 buff_size;
1008 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1009 __le16 reserved3;
1010} __packed;
1011
1012struct host_cmd_ds_amsdu_aggr_ctrl {
1013 __le16 action;
1014 __le16 enable;
1015 __le16 curr_buf_size;
1016} __packed;
1017
1018struct mwifiex_ie_types_wmm_param_set {
1019 struct mwifiex_ie_types_header header;
1020 u8 wmm_ie[1];
1021};
1022
1023struct mwifiex_ie_types_wmm_queue_status {
1024 struct mwifiex_ie_types_header header;
1025 u8 queue_index;
1026 u8 disabled;
1027 u16 medium_time;
1028 u8 flow_required;
1029 u8 flow_created;
1030 u32 reserved;
1031};
1032
1033struct ieee_types_vendor_header {
1034 u8 element_id;
1035 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001036 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001037 u8 oui_subtype;
1038 u8 version;
1039} __packed;
1040
1041struct ieee_types_wmm_ac_parameters {
1042 u8 aci_aifsn_bitmap;
1043 u8 ecw_bitmap;
1044 __le16 tx_op_limit;
1045} __packed;
1046
1047struct ieee_types_wmm_parameter {
1048 /*
1049 * WMM Parameter IE - Vendor Specific Header:
1050 * element_id [221/0xdd]
1051 * Len [24]
1052 * Oui [00:50:f2]
1053 * OuiType [2]
1054 * OuiSubType [1]
1055 * Version [1]
1056 */
1057 struct ieee_types_vendor_header vend_hdr;
1058 u8 qos_info_bitmap;
1059 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001060 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001061} __packed;
1062
1063struct ieee_types_wmm_info {
1064
1065 /*
1066 * WMM Info IE - Vendor Specific Header:
1067 * element_id [221/0xdd]
1068 * Len [7]
1069 * Oui [00:50:f2]
1070 * OuiType [2]
1071 * OuiSubType [0]
1072 * Version [1]
1073 */
1074 struct ieee_types_vendor_header vend_hdr;
1075
1076 u8 qos_info_bitmap;
1077} __packed;
1078
1079struct host_cmd_ds_wmm_get_status {
1080 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001081 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001082 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1083} __packed;
1084
1085struct mwifiex_wmm_ac_status {
1086 u8 disabled;
1087 u8 flow_required;
1088 u8 flow_created;
1089};
1090
1091struct mwifiex_ie_types_htcap {
1092 struct mwifiex_ie_types_header header;
1093 struct ieee80211_ht_cap ht_cap;
1094} __packed;
1095
1096struct mwifiex_ie_types_htinfo {
1097 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001098 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001099} __packed;
1100
1101struct mwifiex_ie_types_2040bssco {
1102 struct mwifiex_ie_types_header header;
1103 u8 bss_co_2040;
1104} __packed;
1105
1106struct mwifiex_ie_types_extcap {
1107 struct mwifiex_ie_types_header header;
1108 u8 ext_cap;
1109} __packed;
1110
1111struct host_cmd_ds_mac_reg_access {
1112 __le16 action;
1113 __le16 offset;
1114 __le32 value;
1115} __packed;
1116
1117struct host_cmd_ds_bbp_reg_access {
1118 __le16 action;
1119 __le16 offset;
1120 u8 value;
1121 u8 reserved[3];
1122} __packed;
1123
1124struct host_cmd_ds_rf_reg_access {
1125 __le16 action;
1126 __le16 offset;
1127 u8 value;
1128 u8 reserved[3];
1129} __packed;
1130
1131struct host_cmd_ds_pmic_reg_access {
1132 __le16 action;
1133 __le16 offset;
1134 u8 value;
1135 u8 reserved[3];
1136} __packed;
1137
1138struct host_cmd_ds_802_11_eeprom_access {
1139 __le16 action;
1140
1141 __le16 offset;
1142 __le16 byte_count;
1143 u8 value;
1144} __packed;
1145
Avinash Patil75edd2c2012-05-08 18:30:18 -07001146struct host_cmd_tlv {
1147 __le16 type;
1148 __le16 len;
1149} __packed;
1150
Avinash Patile5686342012-05-08 18:30:25 -07001151struct mwifiex_assoc_event {
1152 u8 sta_addr[ETH_ALEN];
1153 __le16 type;
1154 __le16 len;
1155 __le16 frame_control;
1156 __le16 cap_info;
1157 __le16 listen_interval;
1158 u8 data[0];
1159} __packed;
1160
Avinash Patil4db16a12012-05-08 18:30:20 -07001161struct host_cmd_ds_sys_config {
1162 __le16 action;
1163 u8 tlv[0];
1164};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001165
1166struct host_cmd_tlv_akmp {
1167 struct host_cmd_tlv tlv;
1168 __le16 key_mgmt;
1169 __le16 key_mgmt_operation;
1170} __packed;
1171
1172struct host_cmd_tlv_pwk_cipher {
1173 struct host_cmd_tlv tlv;
1174 __le16 proto;
1175 u8 cipher;
1176 u8 reserved;
1177} __packed;
1178
1179struct host_cmd_tlv_gwk_cipher {
1180 struct host_cmd_tlv tlv;
1181 u8 cipher;
1182 u8 reserved;
1183} __packed;
1184
1185struct host_cmd_tlv_passphrase {
1186 struct host_cmd_tlv tlv;
1187 u8 passphrase[0];
1188} __packed;
1189
1190struct host_cmd_tlv_auth_type {
1191 struct host_cmd_tlv tlv;
1192 u8 auth_type;
1193} __packed;
1194
1195struct host_cmd_tlv_encrypt_protocol {
1196 struct host_cmd_tlv tlv;
1197 __le16 proto;
1198} __packed;
1199
Avinash Patil12190c52012-05-08 18:30:24 -07001200struct host_cmd_tlv_ssid {
1201 struct host_cmd_tlv tlv;
1202 u8 ssid[0];
1203} __packed;
1204
1205struct host_cmd_tlv_beacon_period {
1206 struct host_cmd_tlv tlv;
1207 __le16 period;
1208} __packed;
1209
1210struct host_cmd_tlv_dtim_period {
1211 struct host_cmd_tlv tlv;
1212 u8 period;
1213} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001214
Avinash Patil9b930ea2012-05-08 18:30:23 -07001215struct host_cmd_tlv_frag_threshold {
1216 struct host_cmd_tlv tlv;
1217 __le16 frag_thr;
1218} __packed;
1219
1220struct host_cmd_tlv_rts_threshold {
1221 struct host_cmd_tlv tlv;
1222 __le16 rts_thr;
1223} __packed;
1224
1225struct host_cmd_tlv_retry_limit {
1226 struct host_cmd_tlv tlv;
1227 u8 limit;
1228} __packed;
1229
Avinash Patil75edd2c2012-05-08 18:30:18 -07001230struct host_cmd_tlv_mac_addr {
1231 struct host_cmd_tlv tlv;
1232 u8 mac_addr[ETH_ALEN];
1233} __packed;
1234
Avinash Patil4db16a12012-05-08 18:30:20 -07001235struct host_cmd_tlv_channel_band {
1236 struct host_cmd_tlv tlv;
1237 u8 band_config;
1238 u8 channel;
1239} __packed;
1240
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001241struct host_cmd_ds_802_11_rf_channel {
1242 __le16 action;
1243 __le16 current_channel;
1244 __le16 rf_type;
1245 __le16 reserved;
1246 u8 reserved_1[32];
1247} __packed;
1248
1249struct host_cmd_ds_version_ext {
1250 u8 version_str_sel;
1251 char version_str[128];
1252} __packed;
1253
1254struct host_cmd_ds_802_11_ibss_status {
1255 __le16 action;
1256 __le16 enable;
1257 u8 bssid[ETH_ALEN];
1258 __le16 beacon_interval;
1259 __le16 atim_window;
1260 __le16 use_g_rate_protect;
1261} __packed;
1262
1263#define CONNECTION_TYPE_INFRA 0
1264#define CONNECTION_TYPE_ADHOC 1
1265
1266struct host_cmd_ds_set_bss_mode {
1267 u8 con_type;
1268} __packed;
1269
Amitkumar Karward930fae2011-10-11 17:41:21 -07001270struct host_cmd_ds_pcie_details {
1271 /* TX buffer descriptor ring address */
1272 u32 txbd_addr_lo;
1273 u32 txbd_addr_hi;
1274 /* TX buffer descriptor ring count */
1275 u32 txbd_count;
1276
1277 /* RX buffer descriptor ring address */
1278 u32 rxbd_addr_lo;
1279 u32 rxbd_addr_hi;
1280 /* RX buffer descriptor ring count */
1281 u32 rxbd_count;
1282
1283 /* Event buffer descriptor ring address */
1284 u32 evtbd_addr_lo;
1285 u32 evtbd_addr_hi;
1286 /* Event buffer descriptor ring count */
1287 u32 evtbd_count;
1288
1289 /* Sleep cookie buffer physical address */
1290 u32 sleep_cookie_addr_lo;
1291 u32 sleep_cookie_addr_hi;
1292} __packed;
1293
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001294struct mwifiex_ie_types_rssi_threshold {
1295 struct mwifiex_ie_types_header header;
1296 u8 abs_value;
1297 u8 evt_freq;
1298} __packed;
1299
1300struct host_cmd_ds_802_11_subsc_evt {
1301 __le16 action;
1302 __le16 events;
1303} __packed;
1304
Avinash Patilede98bf2012-05-08 18:30:28 -07001305struct mwifiex_ie {
1306 __le16 ie_index;
1307 __le16 mgmt_subtype_mask;
1308 __le16 ie_length;
1309 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1310} __packed;
1311
1312#define MAX_MGMT_IE_INDEX 16
1313struct mwifiex_ie_list {
1314 __le16 type;
1315 __le16 len;
1316 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1317} __packed;
1318
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001319struct host_cmd_ds_command {
1320 __le16 command;
1321 __le16 size;
1322 __le16 seq_num;
1323 __le16 result;
1324 union {
1325 struct host_cmd_ds_get_hw_spec hw_spec;
1326 struct host_cmd_ds_mac_control mac_ctrl;
1327 struct host_cmd_ds_802_11_mac_address mac_addr;
1328 struct host_cmd_ds_mac_multicast_adr mc_addr;
1329 struct host_cmd_ds_802_11_get_log get_log;
1330 struct host_cmd_ds_802_11_rssi_info rssi_info;
1331 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1332 struct host_cmd_ds_802_11_snmp_mib smib;
1333 struct host_cmd_ds_802_11_rf_channel rf_channel;
1334 struct host_cmd_ds_tx_rate_query tx_rate;
1335 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1336 struct host_cmd_ds_txpwr_cfg txp_cfg;
1337 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1338 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1339 struct host_cmd_ds_802_11_scan scan;
1340 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1341 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1342 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1343 struct host_cmd_ds_802_11_associate associate;
1344 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1345 struct host_cmd_ds_802_11_deauthenticate deauth;
1346 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1347 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1348 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1349 struct host_cmd_ds_802_11d_domain_info domain_info;
1350 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1351 struct host_cmd_ds_11n_addba_req add_ba_req;
1352 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1353 struct host_cmd_ds_11n_delba del_ba;
1354 struct host_cmd_ds_txbuf_cfg tx_buf;
1355 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1356 struct host_cmd_ds_11n_cfg htcfg;
1357 struct host_cmd_ds_wmm_get_status get_wmm_status;
1358 struct host_cmd_ds_802_11_key_material key_material;
1359 struct host_cmd_ds_version_ext verext;
1360 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1361 struct host_cmd_ds_mac_reg_access mac_reg;
1362 struct host_cmd_ds_bbp_reg_access bbp_reg;
1363 struct host_cmd_ds_rf_reg_access rf_reg;
1364 struct host_cmd_ds_pmic_reg_access pmic_reg;
1365 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001366 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001367 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001368 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001369 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001370 } params;
1371} __packed;
1372
1373struct mwifiex_opt_sleep_confirm {
1374 __le16 command;
1375 __le16 size;
1376 __le16 seq_num;
1377 __le16 result;
1378 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001379 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001380} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001381#endif /* !_MWIFIEX_FW_H_ */