blob: d3c1e01b4fc2bffa5836a6f245c59aa3e2c10f11 [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
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080052#define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN | \
53 BAND_AN | BAND_GAC | BAND_AAC)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070054
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080055#define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11) | \
56 BIT(12) | BIT(13))
Bing Zhao5e6e3a92011-03-21 18:00:50 -070057#define IS_SUPPORT_MULTI_BANDS(adapter) \
58 (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080059
60/* shift bit 12 and bit 13 in fw_cap_info from the firmware to bit 13 and 14
61 * for 11ac so that bit 11 is for GN, bit 12 for AN, bit 13 for GAC, and bit
62 * bit 14 for AAC, in order to be compatible with the band capability
63 * defined in the driver after right shift of 8 bits.
64 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -070065#define GET_FW_DEFAULT_BANDS(adapter) \
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080066 (((((adapter->fw_cap_info & 0x3000) << 1) | \
67 (adapter->fw_cap_info & ~0xF000)) >> 8) & \
68 ALL_802_11_BANDS)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070069
Bing Zhao5e6e3a92011-03-21 18:00:50 -070070#define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
71
72#define KEY_INFO_ENABLED 0x01
73enum KEY_TYPE_ID {
74 KEY_TYPE_ID_WEP = 0,
75 KEY_TYPE_ID_TKIP,
76 KEY_TYPE_ID_AES,
77 KEY_TYPE_ID_WAPI,
Ying Luob877f4c2012-08-03 18:06:14 -070078 KEY_TYPE_ID_AES_CMAC,
Bing Zhao5e6e3a92011-03-21 18:00:50 -070079};
Yogesh Ashok Powar6a35a0a2011-04-06 16:46:56 -070080#define KEY_MCAST BIT(0)
81#define KEY_UNICAST BIT(1)
82#define KEY_ENABLED BIT(2)
Ying Luob877f4c2012-08-03 18:06:14 -070083#define KEY_IGTK BIT(10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070084
85#define WAPI_KEY_LEN 50
86
Bing Zhao5e6e3a92011-03-21 18:00:50 -070087#define MAX_POLL_TRIES 100
88
89#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
90
91#define MAX_FIRMWARE_POLL_TRIES 100
92
Amitkumar Karward930fae2011-10-11 17:41:21 -070093#define FIRMWARE_READY_SDIO 0xfedc
94#define FIRMWARE_READY_PCIE 0xfedcba00
Bing Zhao5e6e3a92011-03-21 18:00:50 -070095
Amitkumar Karwar4daffe32012-04-18 20:08:28 -070096enum mwifiex_usb_ep {
97 MWIFIEX_USB_EP_CMD_EVENT = 1,
98 MWIFIEX_USB_EP_DATA = 2,
99};
100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700101enum MWIFIEX_802_11_PRIVACY_FILTER {
102 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
103 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
104};
105
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700106#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
Stone Piao2dbaf752012-09-25 20:23:35 -0700107#define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700108
Avinash Patile76268d2012-05-08 18:30:27 -0700109#define UAP_BSS_PARAMS_I 0
Avinash Patilede98bf2012-05-08 18:30:28 -0700110#define UAP_CUSTOM_IE_I 1
111#define MWIFIEX_AUTO_IDX_MASK 0xffff
112#define MWIFIEX_DELETE_MASK 0x0000
Avinash Patilf31acab2012-05-08 18:30:29 -0700113#define MGMT_MASK_ASSOC_REQ 0x01
114#define MGMT_MASK_REASSOC_REQ 0x04
115#define MGMT_MASK_ASSOC_RESP 0x02
116#define MGMT_MASK_REASSOC_RESP 0x08
117#define MGMT_MASK_PROBE_REQ 0x10
118#define MGMT_MASK_PROBE_RESP 0x20
119#define MGMT_MASK_BEACON 0x100
Avinash Patile76268d2012-05-08 18:30:27 -0700120
Avinash Patil12190c52012-05-08 18:30:24 -0700121#define TLV_TYPE_UAP_SSID 0x0000
Avinash Patila3c2c4f2012-08-27 20:32:53 -0700122#define TLV_TYPE_UAP_RATES 0x0001
Avinash Patil12190c52012-05-08 18:30:24 -0700123
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700124#define PROPRIETARY_TLV_BASE_ID 0x0100
125#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
126#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
127#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700128#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700129#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700130#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
131#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
132#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700133#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700134#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700135#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700136#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700137#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
138#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil605b73a2012-05-16 21:24:55 -0700139#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700140#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700141#define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
Avinash Patil96893532012-06-15 12:21:55 -0700142#define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700143#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
144#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
145#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700146#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700147#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
148#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
149#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700150#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700151#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700152#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700153#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700154#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
155#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700156#define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700157#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
158#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700159
160#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
161
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700162#define SSN_MASK 0xfff0
163
164#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700165#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700166
167#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
168
169#define BA_STREAM_NOT_ALLOWED 0xff
170
171#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700172 priv->adapter->config_bands & BAND_AN) && \
173 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700174#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
175 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
176
177#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
178#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700179
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700180#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700181
Avinash Patil22281252012-06-15 12:21:53 -0700182#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
183 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
184 IEEE80211_HT_CAP_SM_PS)
185
186#define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
187
Marc Yang6d2bd912011-03-25 19:47:02 -0700188/* dev_cap bitmap
189 * BIT
190 * 0-16 reserved
191 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
192 * 18-22 reserved
193 * 23 IEEE80211_HT_CAP_SGI_20
194 * 24 IEEE80211_HT_CAP_SGI_40
195 * 25 IEEE80211_HT_CAP_TX_STBC
196 * 26 IEEE80211_HT_CAP_RX_STBC
197 * 27-28 reserved
198 * 29 IEEE80211_HT_CAP_GRN_FLD
199 * 30-31 reserved
200 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700201#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700202#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
203#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
204#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
205#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
206#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
Avinash Patildd0d83c2012-11-27 12:09:20 -0800207#define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
208#define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
Marc Yang6d2bd912011-03-25 19:47:02 -0700209
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700210/* httxcfg bitmap
211 * 0 reserved
212 * 1 20/40 Mhz enable(1)/disable(0)
213 * 2-3 reserved
214 * 4 green field enable(1)/disable(0)
215 * 5 short GI in 20 Mhz enable(1)/disable(0)
216 * 6 short GI in 40 Mhz enable(1)/disable(0)
217 * 7-15 reserved
218 */
219#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
220
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700221#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700222#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800223#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700224
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700225#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
226
227#define LLC_SNAP_LEN 8
228
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800229/* HW_SPEC fw_cap_info */
230
231#define ISSUPP_11ACENABLED(fw_cap_info) (fw_cap_info & (BIT(13)|BIT(14)))
232
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800233#define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
234#define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
235#define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
236 (2 * (nss - 1)))
237#define NO_NSS_SUPPORT 0x3
238
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800239#define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
240#define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
241
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700242#define MOD_CLASS_HR_DSSS 0x03
243#define MOD_CLASS_OFDM 0x07
244#define MOD_CLASS_HT 0x08
245#define HT_BW_20 0
246#define HT_BW_40 1
247
248#define HostCmd_CMD_GET_HW_SPEC 0x0003
249#define HostCmd_CMD_802_11_SCAN 0x0006
250#define HostCmd_CMD_802_11_GET_LOG 0x000b
251#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
252#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
253#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
254#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
255#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
256#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
257#define HostCmd_CMD_RF_REG_ACCESS 0x001b
258#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700259#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700260#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700261#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
262#define HostCmd_CMD_MAC_CONTROL 0x0028
263#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
264#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
265#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
266#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
267#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
268#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
269#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
270#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700271#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700272#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
273#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
274#define HostCmd_CMD_VERSION_EXT 0x0097
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800275#define HostCmd_CMD_MEF_CFG 0x009a
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700276#define HostCmd_CMD_RSSI_INFO 0x00a4
277#define HostCmd_CMD_FUNC_INIT 0x00a9
278#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700279#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
280#define HostCmd_CMD_UAP_BSS_START 0x00b1
281#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Avinash Patil0f9e9b82013-05-17 17:50:23 -0700282#define HostCmd_CMD_UAP_STA_DEAUTH 0x00b5
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700283#define HostCmd_CMD_11N_CFG 0x00cd
284#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
285#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
286#define HostCmd_CMD_11N_DELBA 0x00d0
287#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
288#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
289#define HostCmd_CMD_TXPWR_CFG 0x00d1
290#define HostCmd_CMD_TX_RATE_CFG 0x00d6
291#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
292#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700293#define HostCmd_CMD_P2P_MODE_CFG 0x00eb
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700294#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
295#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700296#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Stone Piao3cec6872012-09-25 20:23:34 -0700297#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
Stone Piao7feb4c42012-09-25 20:23:36 -0700298#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -0700299#define HostCmd_CMD_11AC_CFG 0x0112
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700300
Avinash Patilf752dcd2012-05-08 18:30:26 -0700301#define PROTOCOL_NO_SECURITY 0x01
302#define PROTOCOL_STATIC_WEP 0x02
303#define PROTOCOL_WPA 0x08
304#define PROTOCOL_WPA2 0x20
305#define PROTOCOL_WPA2_MIXED 0x28
306#define PROTOCOL_EAP 0x40
307#define KEY_MGMT_NONE 0x04
308#define KEY_MGMT_PSK 0x02
309#define KEY_MGMT_EAP 0x01
310#define CIPHER_TKIP 0x04
311#define CIPHER_AES_CCMP 0x08
312#define VALID_CIPHER_BITMAP 0x0c
313
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700314enum ENH_PS_MODES {
315 EN_PS = 1,
316 DIS_PS = 2,
317 EN_AUTO_DS = 3,
318 DIS_AUTO_DS = 4,
319 SLEEP_CONFIRM = 5,
320 GET_PS = 0,
321 EN_AUTO_PS = 0xff,
322 DIS_AUTO_PS = 0xfe,
323};
324
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700325enum P2P_MODES {
326 P2P_MODE_DISABLE = 0,
327 P2P_MODE_DEVICE = 1,
328 P2P_MODE_GO = 2,
329 P2P_MODE_CLIENT = 3,
330};
331
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700332#define HostCmd_RET_BIT 0x8000
333#define HostCmd_ACT_GEN_GET 0x0000
334#define HostCmd_ACT_GEN_SET 0x0001
Stone Piao7feb4c42012-09-25 20:23:36 -0700335#define HostCmd_ACT_GEN_REMOVE 0x0004
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700336#define HostCmd_ACT_BITWISE_SET 0x0002
337#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700338#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700339
340#define HostCmd_ACT_MAC_RX_ON 0x0001
341#define HostCmd_ACT_MAC_TX_ON 0x0002
342#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
343#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
344#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
345#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700346#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
347
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700348#define HostCmd_BSS_MODE_IBSS 0x0002
349#define HostCmd_BSS_MODE_ANY 0x0003
350
351#define HostCmd_SCAN_RADIO_TYPE_BG 0
352#define HostCmd_SCAN_RADIO_TYPE_A 1
353
Amitkumar Karwarcc0b5a62013-03-04 16:27:57 -0800354#define HS_CFG_CANCEL 0xffffffff
355#define HS_CFG_COND_DEF 0x00000000
356#define HS_CFG_GPIO_DEF 0xff
357#define HS_CFG_GAP_DEF 0
Amitkumar Karwar0d7f53e2013-03-04 16:27:58 -0800358#define HS_CFG_COND_BROADCAST_DATA 0x00000001
359#define HS_CFG_COND_UNICAST_DATA 0x00000002
360#define HS_CFG_COND_MAC_EVENT 0x00000004
361#define HS_CFG_COND_MULTICAST_DATA 0x00000008
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700362
Amitkumar Karwar7532c7d2013-01-17 17:41:57 -0800363#define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
364#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
365
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700366#define CMD_F_HOSTCMD (1 << 0)
367#define CMD_F_CANCELED (1 << 1)
368
369#define HostCmd_CMD_ID_MASK 0x0fff
370
371#define HostCmd_SEQ_NUM_MASK 0x00ff
372
373#define HostCmd_BSS_NUM_MASK 0x0f00
374
375#define HostCmd_BSS_TYPE_MASK 0xf000
376
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700377#define HostCmd_ACT_SET_RX 0x0001
378#define HostCmd_ACT_SET_TX 0x0002
379#define HostCmd_ACT_SET_BOTH 0x0003
380
381#define RF_ANTENNA_AUTO 0xFFFF
382
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700383#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
384 (((seq) & 0x00ff) | \
385 (((num) & 0x000f) << 8)) | \
386 (((type) & 0x000f) << 12); }
387
388#define HostCmd_GET_SEQ_NO(seq) \
389 ((seq) & HostCmd_SEQ_NUM_MASK)
390
391#define HostCmd_GET_BSS_NO(seq) \
392 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
393
394#define HostCmd_GET_BSS_TYPE(seq) \
395 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
396
397#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
398#define EVENT_LINK_LOST 0x00000003
399#define EVENT_LINK_SENSED 0x00000004
400#define EVENT_MIB_CHANGED 0x00000006
401#define EVENT_INIT_DONE 0x00000007
402#define EVENT_DEAUTHENTICATED 0x00000008
403#define EVENT_DISASSOCIATED 0x00000009
404#define EVENT_PS_AWAKE 0x0000000a
405#define EVENT_PS_SLEEP 0x0000000b
406#define EVENT_MIC_ERR_MULTICAST 0x0000000d
407#define EVENT_MIC_ERR_UNICAST 0x0000000e
408#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
409#define EVENT_ADHOC_BCN_LOST 0x00000011
410
411#define EVENT_WMM_STATUS_CHANGE 0x00000017
412#define EVENT_BG_SCAN_REPORT 0x00000018
413#define EVENT_RSSI_LOW 0x00000019
414#define EVENT_SNR_LOW 0x0000001a
415#define EVENT_MAX_FAIL 0x0000001b
416#define EVENT_RSSI_HIGH 0x0000001c
417#define EVENT_SNR_HIGH 0x0000001d
418#define EVENT_IBSS_COALESCED 0x0000001e
419#define EVENT_DATA_RSSI_LOW 0x00000024
420#define EVENT_DATA_SNR_LOW 0x00000025
421#define EVENT_DATA_RSSI_HIGH 0x00000026
422#define EVENT_DATA_SNR_HIGH 0x00000027
423#define EVENT_LINK_QUALITY 0x00000028
424#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700425#define EVENT_UAP_STA_DEAUTH 0x0000002c
426#define EVENT_UAP_STA_ASSOC 0x0000002d
427#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700428#define EVENT_PRE_BEACON_LOST 0x00000031
429#define EVENT_ADDBA 0x00000033
430#define EVENT_DELBA 0x00000034
431#define EVENT_BA_STREAM_TIEMOUT 0x00000037
432#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700433#define EVENT_UAP_BSS_IDLE 0x00000043
434#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700435#define EVENT_WEP_ICV_ERR 0x00000046
436#define EVENT_HS_ACT_REQ 0x00000047
437#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700438#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700439#define EVENT_HOSTWAKE_STAIE 0x0000004d
Stone Piaoeab1c762012-09-25 20:23:37 -0700440#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700441
442#define EVENT_ID_MASK 0xffff
443#define BSS_NUM_MASK 0xf
444
445#define EVENT_GET_BSS_NUM(event_cause) \
446 (((event_cause) >> 16) & BSS_NUM_MASK)
447
448#define EVENT_GET_BSS_TYPE(event_cause) \
449 (((event_cause) >> 24) & 0x00ff)
450
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800451#define MWIFIEX_MAX_PATTERN_LEN 20
452#define MWIFIEX_MAX_OFFSET_LEN 50
453#define STACK_NBYTES 100
454#define TYPE_DNUM 1
455#define TYPE_BYTESEQ 2
456#define MAX_OPERAND 0x40
457#define TYPE_EQ (MAX_OPERAND+1)
458#define TYPE_EQ_DNUM (MAX_OPERAND+2)
459#define TYPE_EQ_BIT (MAX_OPERAND+3)
460#define TYPE_AND (MAX_OPERAND+4)
461#define TYPE_OR (MAX_OPERAND+5)
462#define MEF_MODE_HOST_SLEEP 1
463#define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
464#define MWIFIEX_CRITERIA_BROADCAST BIT(0)
465#define MWIFIEX_CRITERIA_UNICAST BIT(1)
466#define MWIFIEX_CRITERIA_MULTICAST BIT(3)
467
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700468struct mwifiex_ie_types_header {
469 __le16 type;
470 __le16 len;
471} __packed;
472
473struct mwifiex_ie_types_data {
474 struct mwifiex_ie_types_header header;
475 u8 data[1];
476} __packed;
477
478#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
479#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
480
481struct txpd {
482 u8 bss_type;
483 u8 bss_num;
484 __le16 tx_pkt_length;
485 __le16 tx_pkt_offset;
486 __le16 tx_pkt_type;
487 __le32 tx_control;
488 u8 priority;
489 u8 flags;
490 u8 pkt_delay_2ms;
491 u8 reserved1;
492} __packed;
493
494struct rxpd {
495 u8 bss_type;
496 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700497 __le16 rx_pkt_length;
498 __le16 rx_pkt_offset;
499 __le16 rx_pkt_type;
500 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700501 u8 priority;
502 u8 rx_rate;
503 s8 snr;
504 s8 nf;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800505
506 /* For: Non-802.11 AC cards
507 *
508 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700509 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800510 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
511 *
512 * For: 802.11 AC cards
513 * [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
514 * [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01
515 * BW80 = 10 BW160 = 11
516 * [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
517 * [Bit 5] STBC support Enabled = 1
518 * [Bit 6] LDPC support Enabled = 1
519 * [Bit 7] Reserved
520 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700521 u8 ht_info;
522 u8 reserved;
523} __packed;
524
Avinash Patil838e4f42012-08-03 18:06:08 -0700525struct uap_txpd {
526 u8 bss_type;
527 u8 bss_num;
528 __le16 tx_pkt_length;
529 __le16 tx_pkt_offset;
530 __le16 tx_pkt_type;
531 __le32 tx_control;
532 u8 priority;
533 u8 flags;
534 u8 pkt_delay_2ms;
535 u8 reserved1;
536 __le32 reserved2;
537};
538
539struct uap_rxpd {
540 u8 bss_type;
541 u8 bss_num;
542 __le16 rx_pkt_length;
543 __le16 rx_pkt_offset;
544 __le16 rx_pkt_type;
545 __le16 seq_num;
546 u8 priority;
547 u8 reserved1;
548};
549
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700550enum mwifiex_chan_scan_mode_bitmasks {
551 MWIFIEX_PASSIVE_SCAN = BIT(0),
552 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
553};
554
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700555struct mwifiex_chan_scan_param_set {
556 u8 radio_type;
557 u8 chan_number;
558 u8 chan_scan_mode_bitmap;
559 __le16 min_scan_time;
560 __le16 max_scan_time;
561} __packed;
562
563struct mwifiex_ie_types_chan_list_param_set {
564 struct mwifiex_ie_types_header header;
565 struct mwifiex_chan_scan_param_set chan_scan_param[1];
566} __packed;
567
568struct chan_band_param_set {
569 u8 radio_type;
570 u8 chan_number;
571};
572
573struct mwifiex_ie_types_chan_band_list_param_set {
574 struct mwifiex_ie_types_header header;
575 struct chan_band_param_set chan_band_param[1];
576} __packed;
577
578struct mwifiex_ie_types_rates_param_set {
579 struct mwifiex_ie_types_header header;
580 u8 rates[1];
581} __packed;
582
583struct mwifiex_ie_types_ssid_param_set {
584 struct mwifiex_ie_types_header header;
585 u8 ssid[1];
586} __packed;
587
588struct mwifiex_ie_types_num_probes {
589 struct mwifiex_ie_types_header header;
590 __le16 num_probes;
591} __packed;
592
593struct mwifiex_ie_types_wildcard_ssid_params {
594 struct mwifiex_ie_types_header header;
595 u8 max_ssid_length;
596 u8 ssid[1];
597} __packed;
598
599#define TSF_DATA_SIZE 8
600struct mwifiex_ie_types_tsf_timestamp {
601 struct mwifiex_ie_types_header header;
602 u8 tsf_data[1];
603} __packed;
604
605struct mwifiex_cf_param_set {
606 u8 cfp_cnt;
607 u8 cfp_period;
608 u16 cfp_max_duration;
609 u16 cfp_duration_remaining;
610} __packed;
611
612struct mwifiex_ibss_param_set {
613 u16 atim_window;
614} __packed;
615
616struct mwifiex_ie_types_ss_param_set {
617 struct mwifiex_ie_types_header header;
618 union {
619 struct mwifiex_cf_param_set cf_param_set[1];
620 struct mwifiex_ibss_param_set ibss_param_set[1];
621 } cf_ibss;
622} __packed;
623
624struct mwifiex_fh_param_set {
625 u16 dwell_time;
626 u8 hop_set;
627 u8 hop_pattern;
628 u8 hop_index;
629} __packed;
630
631struct mwifiex_ds_param_set {
632 u8 current_chan;
633} __packed;
634
635struct mwifiex_ie_types_phy_param_set {
636 struct mwifiex_ie_types_header header;
637 union {
638 struct mwifiex_fh_param_set fh_param_set[1];
639 struct mwifiex_ds_param_set ds_param_set[1];
640 } fh_ds;
641} __packed;
642
643struct mwifiex_ie_types_auth_type {
644 struct mwifiex_ie_types_header header;
645 __le16 auth_type;
646} __packed;
647
648struct mwifiex_ie_types_vendor_param_set {
649 struct mwifiex_ie_types_header header;
650 u8 ie[MWIFIEX_MAX_VSIE_LEN];
651};
652
653struct mwifiex_ie_types_rsn_param_set {
654 struct mwifiex_ie_types_header header;
655 u8 rsn_ie[1];
656} __packed;
657
658#define KEYPARAMSET_FIXED_LEN 6
659
660struct mwifiex_ie_type_key_param_set {
661 __le16 type;
662 __le16 length;
663 __le16 key_type_id;
664 __le16 key_info;
665 __le16 key_len;
666 u8 key[50];
667} __packed;
668
Ying Luob877f4c2012-08-03 18:06:14 -0700669#define IGTK_PN_LEN 8
670
671struct mwifiex_cmac_param {
672 u8 ipn[IGTK_PN_LEN];
673 u8 key[WLAN_KEY_LEN_AES_CMAC];
674} __packed;
675
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700676struct host_cmd_ds_802_11_key_material {
677 __le16 action;
678 struct mwifiex_ie_type_key_param_set key_param_set;
679} __packed;
680
681struct host_cmd_ds_gen {
682 u16 command;
683 u16 size;
684 u16 seq_num;
685 u16 result;
686};
687
688#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
689
690enum sleep_resp_ctrl {
691 RESP_NOT_NEEDED = 0,
692 RESP_NEEDED,
693};
694
695struct mwifiex_ps_param {
696 __le16 null_pkt_interval;
697 __le16 multiple_dtims;
698 __le16 bcn_miss_timeout;
699 __le16 local_listen_interval;
700 __le16 adhoc_wake_period;
701 __le16 mode;
702 __le16 delay_to_ps;
703};
704
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700705#define BITMAP_AUTO_DS 0x01
706#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700707
708struct mwifiex_ie_types_auto_ds_param {
709 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700710 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700711} __packed;
712
713struct mwifiex_ie_types_ps_param {
714 struct mwifiex_ie_types_header header;
715 struct mwifiex_ps_param param;
716} __packed;
717
718struct host_cmd_ds_802_11_ps_mode_enh {
719 __le16 action;
720
721 union {
722 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700723 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700724 } params;
725} __packed;
726
727struct host_cmd_ds_get_hw_spec {
728 __le16 hw_if_version;
729 __le16 version;
730 __le16 reserved;
731 __le16 num_of_mcast_adr;
732 u8 permanent_addr[ETH_ALEN];
733 __le16 region_code;
734 __le16 number_of_antenna;
735 __le32 fw_release_number;
736 __le32 reserved_1;
737 __le32 reserved_2;
738 __le32 reserved_3;
739 __le32 fw_cap_info;
740 __le32 dot_11n_dev_cap;
741 u8 dev_mcs_support;
742 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800743 __le16 mgmt_buf_count; /* mgmt IE buffer count */
744 __le32 reserved_5;
745 __le32 reserved_6;
746 __le32 dot_11ac_dev_cap;
747 __le32 dot_11ac_mcs_support;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700748} __packed;
749
750struct host_cmd_ds_802_11_rssi_info {
751 __le16 action;
752 __le16 ndata;
753 __le16 nbcn;
754 __le16 reserved[9];
755 long long reserved_1;
756};
757
758struct host_cmd_ds_802_11_rssi_info_rsp {
759 __le16 action;
760 __le16 ndata;
761 __le16 nbcn;
762 __le16 data_rssi_last;
763 __le16 data_nf_last;
764 __le16 data_rssi_avg;
765 __le16 data_nf_avg;
766 __le16 bcn_rssi_last;
767 __le16 bcn_nf_last;
768 __le16 bcn_rssi_avg;
769 __le16 bcn_nf_avg;
770 long long tsf_bcn;
771};
772
773struct host_cmd_ds_802_11_mac_address {
774 __le16 action;
775 u8 mac_addr[ETH_ALEN];
776};
777
778struct host_cmd_ds_mac_control {
779 __le16 action;
780 __le16 reserved;
781};
782
783struct host_cmd_ds_mac_multicast_adr {
784 __le16 action;
785 __le16 num_of_adrs;
786 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
787} __packed;
788
789struct host_cmd_ds_802_11_deauthenticate {
790 u8 mac_addr[ETH_ALEN];
791 __le16 reason_code;
792} __packed;
793
794struct host_cmd_ds_802_11_associate {
795 u8 peer_sta_addr[ETH_ALEN];
796 __le16 cap_info_bitmap;
797 __le16 listen_interval;
798 __le16 beacon_period;
799 u8 dtim_period;
800} __packed;
801
802struct ieee_types_assoc_rsp {
803 __le16 cap_info_bitmap;
804 __le16 status_code;
805 __le16 a_id;
806 u8 ie_buffer[1];
807} __packed;
808
809struct host_cmd_ds_802_11_associate_rsp {
810 struct ieee_types_assoc_rsp assoc_rsp;
811} __packed;
812
813struct ieee_types_cf_param_set {
814 u8 element_id;
815 u8 len;
816 u8 cfp_cnt;
817 u8 cfp_period;
818 u16 cfp_max_duration;
819 u16 cfp_duration_remaining;
820} __packed;
821
822struct ieee_types_ibss_param_set {
823 u8 element_id;
824 u8 len;
825 __le16 atim_window;
826} __packed;
827
828union ieee_types_ss_param_set {
829 struct ieee_types_cf_param_set cf_param_set;
830 struct ieee_types_ibss_param_set ibss_param_set;
831} __packed;
832
833struct ieee_types_fh_param_set {
834 u8 element_id;
835 u8 len;
836 __le16 dwell_time;
837 u8 hop_set;
838 u8 hop_pattern;
839 u8 hop_index;
840} __packed;
841
842struct ieee_types_ds_param_set {
843 u8 element_id;
844 u8 len;
845 u8 current_chan;
846} __packed;
847
848union ieee_types_phy_param_set {
849 struct ieee_types_fh_param_set fh_param_set;
850 struct ieee_types_ds_param_set ds_param_set;
851} __packed;
852
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800853struct ieee_types_oper_mode_ntf {
854 u8 element_id;
855 u8 len;
856 u8 oper_mode;
857} __packed;
858
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700859struct host_cmd_ds_802_11_ad_hoc_start {
860 u8 ssid[IEEE80211_MAX_SSID_LEN];
861 u8 bss_mode;
862 __le16 beacon_period;
863 u8 dtim_period;
864 union ieee_types_ss_param_set ss_param_set;
865 union ieee_types_phy_param_set phy_param_set;
866 u16 reserved1;
867 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800868 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700869} __packed;
870
871struct host_cmd_ds_802_11_ad_hoc_result {
872 u8 pad[3];
873 u8 bssid[ETH_ALEN];
874} __packed;
875
876struct adhoc_bss_desc {
877 u8 bssid[ETH_ALEN];
878 u8 ssid[IEEE80211_MAX_SSID_LEN];
879 u8 bss_mode;
880 __le16 beacon_period;
881 u8 dtim_period;
882 u8 time_stamp[8];
883 u8 local_time[8];
884 union ieee_types_phy_param_set phy_param_set;
885 union ieee_types_ss_param_set ss_param_set;
886 __le16 cap_info_bitmap;
887 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
888
889 /*
890 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
891 * It is used in the Adhoc join command and will cause a
892 * binary layout mismatch with the firmware
893 */
894} __packed;
895
896struct host_cmd_ds_802_11_ad_hoc_join {
897 struct adhoc_bss_desc bss_descriptor;
898 u16 reserved1;
899 u16 reserved2;
900} __packed;
901
902struct host_cmd_ds_802_11_get_log {
903 __le32 mcast_tx_frame;
904 __le32 failed;
905 __le32 retry;
906 __le32 multi_retry;
907 __le32 frame_dup;
908 __le32 rts_success;
909 __le32 rts_failure;
910 __le32 ack_failure;
911 __le32 rx_frag;
912 __le32 mcast_rx_frame;
913 __le32 fcs_error;
914 __le32 tx_frame;
915 __le32 reserved;
916 __le32 wep_icv_err_cnt[4];
917};
918
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800919/* Enumeration for rate format */
920enum _mwifiex_rate_format {
921 MWIFIEX_RATE_FORMAT_LG = 0,
922 MWIFIEX_RATE_FORMAT_HT,
923 MWIFIEX_RATE_FORMAT_VHT,
924 MWIFIEX_RATE_FORMAT_AUTO = 0xFF,
925};
926
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700927struct host_cmd_ds_tx_rate_query {
928 u8 tx_rate;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800929 /* Tx Rate Info: For 802.11 AC cards
930 *
931 * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
932 * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
933 * [Bit 4] HT/VHT Guard Interval: LGI = 0, SGI = 1
934 *
935 * For non-802.11 AC cards
936 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700937 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800938 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
939 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700940 u8 ht_info;
941} __packed;
942
943enum Host_Sleep_Action {
944 HS_CONFIGURE = 0x0001,
945 HS_ACTIVATE = 0x0002,
946};
947
948struct mwifiex_hs_config_param {
949 __le32 conditions;
950 u8 gpio;
951 u8 gap;
952} __packed;
953
954struct hs_activate_param {
955 u16 resp_ctrl;
956} __packed;
957
958struct host_cmd_ds_802_11_hs_cfg_enh {
959 __le16 action;
960
961 union {
962 struct mwifiex_hs_config_param hs_config;
963 struct hs_activate_param hs_activate;
964 } params;
965} __packed;
966
967enum SNMP_MIB_INDEX {
968 OP_RATE_SET_I = 1,
969 DTIM_PERIOD_I = 3,
970 RTS_THRESH_I = 5,
971 SHORT_RETRY_LIM_I = 6,
972 LONG_RETRY_LIM_I = 7,
973 FRAG_THRESH_I = 8,
974 DOT11D_I = 9,
975};
976
977#define MAX_SNMP_BUF_SIZE 128
978
979struct host_cmd_ds_802_11_snmp_mib {
980 __le16 query_type;
981 __le16 oid;
982 __le16 buf_size;
983 u8 value[1];
984} __packed;
985
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700986struct mwifiex_rate_scope {
987 __le16 type;
988 __le16 length;
989 __le16 hr_dsss_rate_bitmap;
990 __le16 ofdm_rate_bitmap;
991 __le16 ht_mcs_rate_bitmap[8];
992} __packed;
993
994struct mwifiex_rate_drop_pattern {
995 __le16 type;
996 __le16 length;
997 __le32 rate_drop_mode;
998} __packed;
999
1000struct host_cmd_ds_tx_rate_cfg {
1001 __le16 action;
1002 __le16 cfg_index;
1003} __packed;
1004
1005struct mwifiex_power_group {
1006 u8 modulation_class;
1007 u8 first_rate_code;
1008 u8 last_rate_code;
1009 s8 power_step;
1010 s8 power_min;
1011 s8 power_max;
1012 u8 ht_bandwidth;
1013 u8 reserved;
1014} __packed;
1015
1016struct mwifiex_types_power_group {
1017 u16 type;
1018 u16 length;
1019} __packed;
1020
1021struct host_cmd_ds_txpwr_cfg {
1022 __le16 action;
1023 __le16 cfg_index;
1024 __le32 mode;
1025} __packed;
1026
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001027struct host_cmd_ds_rf_tx_pwr {
1028 __le16 action;
1029 __le16 cur_level;
1030 u8 max_power;
1031 u8 min_power;
1032} __packed;
1033
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001034struct host_cmd_ds_rf_ant_mimo {
1035 __le16 action_tx;
1036 __le16 tx_ant_mode;
1037 __le16 action_rx;
1038 __le16 rx_ant_mode;
1039};
1040
1041struct host_cmd_ds_rf_ant_siso {
1042 __le16 action;
1043 __le16 ant_mode;
1044};
1045
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -07001046struct mwifiex_bcn_param {
1047 u8 bssid[ETH_ALEN];
1048 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -07001049 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -07001050 __le16 beacon_period;
1051 __le16 cap_info_bitmap;
1052} __packed;
1053
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001054#define MWIFIEX_USER_SCAN_CHAN_MAX 50
1055
1056#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
1057
1058struct mwifiex_scan_cmd_config {
1059 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -07001060 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001061 */
1062 u8 bss_mode;
1063
1064 /* Specific BSSID used to filter scan results in the firmware */
1065 u8 specific_bssid[ETH_ALEN];
1066
1067 /* Length of TLVs sent in command starting at tlvBuffer */
1068 u32 tlv_buf_len;
1069
1070 /*
1071 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
1072 *
1073 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
1074 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
1075 */
1076 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
1077 here */
1078} __packed;
1079
1080struct mwifiex_user_scan_chan {
1081 u8 chan_number;
1082 u8 radio_type;
1083 u8 scan_type;
1084 u8 reserved;
1085 u32 scan_time;
1086} __packed;
1087
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001088struct mwifiex_user_scan_cfg {
1089 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001090 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001091 */
1092 u8 bss_mode;
1093 /* Configure the number of probe requests for active chan scans */
1094 u8 num_probes;
1095 u8 reserved;
1096 /* BSSID filter sent in the firmware command to limit the results */
1097 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -08001098 /* SSID filter list used in the firmware to limit the scan results */
1099 struct cfg80211_ssid *ssid_list;
1100 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001101 /* Variable number (fixed maximum) of channels to scan up */
1102 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
1103} __packed;
1104
1105struct ie_body {
1106 u8 grp_key_oui[4];
1107 u8 ptk_cnt[2];
1108 u8 ptk_body[4];
1109} __packed;
1110
1111struct host_cmd_ds_802_11_scan {
1112 u8 bss_mode;
1113 u8 bssid[ETH_ALEN];
1114 u8 tlv_buffer[1];
1115} __packed;
1116
1117struct host_cmd_ds_802_11_scan_rsp {
1118 __le16 bss_descript_size;
1119 u8 number_of_sets;
1120 u8 bss_desc_and_tlv_buffer[1];
1121} __packed;
1122
1123struct host_cmd_ds_802_11_bg_scan_query {
1124 u8 flush;
1125} __packed;
1126
1127struct host_cmd_ds_802_11_bg_scan_query_rsp {
1128 u32 report_condition;
1129 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1130} __packed;
1131
1132struct mwifiex_ietypes_domain_param_set {
1133 struct mwifiex_ie_types_header header;
1134 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1135 struct ieee80211_country_ie_triplet triplet[1];
1136} __packed;
1137
1138struct host_cmd_ds_802_11d_domain_info {
1139 __le16 action;
1140 struct mwifiex_ietypes_domain_param_set domain;
1141} __packed;
1142
1143struct host_cmd_ds_802_11d_domain_info_rsp {
1144 __le16 action;
1145 struct mwifiex_ietypes_domain_param_set domain;
1146} __packed;
1147
1148struct host_cmd_ds_11n_addba_req {
1149 u8 add_req_result;
1150 u8 peer_mac_addr[ETH_ALEN];
1151 u8 dialog_token;
1152 __le16 block_ack_param_set;
1153 __le16 block_ack_tmo;
1154 __le16 ssn;
1155} __packed;
1156
1157struct host_cmd_ds_11n_addba_rsp {
1158 u8 add_rsp_result;
1159 u8 peer_mac_addr[ETH_ALEN];
1160 u8 dialog_token;
1161 __le16 status_code;
1162 __le16 block_ack_param_set;
1163 __le16 block_ack_tmo;
1164 __le16 ssn;
1165} __packed;
1166
1167struct host_cmd_ds_11n_delba {
1168 u8 del_result;
1169 u8 peer_mac_addr[ETH_ALEN];
1170 __le16 del_ba_param_set;
1171 __le16 reason_code;
1172 u8 reserved;
1173} __packed;
1174
1175struct host_cmd_ds_11n_batimeout {
1176 u8 tid;
1177 u8 peer_mac_addr[ETH_ALEN];
1178 u8 origninator;
1179} __packed;
1180
1181struct host_cmd_ds_11n_cfg {
1182 __le16 action;
1183 __le16 ht_tx_cap;
1184 __le16 ht_tx_info;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001185 __le16 misc_config; /* Needed for 802.11AC cards only */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001186} __packed;
1187
1188struct host_cmd_ds_txbuf_cfg {
1189 __le16 action;
1190 __le16 buff_size;
1191 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1192 __le16 reserved3;
1193} __packed;
1194
1195struct host_cmd_ds_amsdu_aggr_ctrl {
1196 __le16 action;
1197 __le16 enable;
1198 __le16 curr_buf_size;
1199} __packed;
1200
Avinash Patil0f9e9b82013-05-17 17:50:23 -07001201struct host_cmd_ds_sta_deauth {
1202 u8 mac[ETH_ALEN];
1203 __le16 reason;
1204} __packed;
1205
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001206struct mwifiex_ie_types_wmm_param_set {
1207 struct mwifiex_ie_types_header header;
1208 u8 wmm_ie[1];
1209};
1210
1211struct mwifiex_ie_types_wmm_queue_status {
1212 struct mwifiex_ie_types_header header;
1213 u8 queue_index;
1214 u8 disabled;
1215 u16 medium_time;
1216 u8 flow_required;
1217 u8 flow_created;
1218 u32 reserved;
1219};
1220
1221struct ieee_types_vendor_header {
1222 u8 element_id;
1223 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001224 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001225 u8 oui_subtype;
1226 u8 version;
1227} __packed;
1228
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001229struct ieee_types_wmm_parameter {
1230 /*
1231 * WMM Parameter IE - Vendor Specific Header:
1232 * element_id [221/0xdd]
1233 * Len [24]
1234 * Oui [00:50:f2]
1235 * OuiType [2]
1236 * OuiSubType [1]
1237 * Version [1]
1238 */
1239 struct ieee_types_vendor_header vend_hdr;
1240 u8 qos_info_bitmap;
1241 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001242 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001243} __packed;
1244
1245struct ieee_types_wmm_info {
1246
1247 /*
1248 * WMM Info IE - Vendor Specific Header:
1249 * element_id [221/0xdd]
1250 * Len [7]
1251 * Oui [00:50:f2]
1252 * OuiType [2]
1253 * OuiSubType [0]
1254 * Version [1]
1255 */
1256 struct ieee_types_vendor_header vend_hdr;
1257
1258 u8 qos_info_bitmap;
1259} __packed;
1260
1261struct host_cmd_ds_wmm_get_status {
1262 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001263 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001264 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1265} __packed;
1266
1267struct mwifiex_wmm_ac_status {
1268 u8 disabled;
1269 u8 flow_required;
1270 u8 flow_created;
1271};
1272
1273struct mwifiex_ie_types_htcap {
1274 struct mwifiex_ie_types_header header;
1275 struct ieee80211_ht_cap ht_cap;
1276} __packed;
1277
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001278struct mwifiex_ie_types_vhtcap {
1279 struct mwifiex_ie_types_header header;
1280 struct ieee80211_vht_cap vht_cap;
1281} __packed;
1282
1283struct mwifiex_ie_types_oper_mode_ntf {
1284 struct mwifiex_ie_types_header header;
1285 u8 oper_mode;
1286} __packed;
1287
1288/* VHT Operations IE */
1289struct mwifiex_ie_types_vht_oper {
1290 struct mwifiex_ie_types_header header;
1291 u8 chan_width;
1292 u8 chan_center_freq_1;
1293 u8 chan_center_freq_2;
1294 /* Basic MCS set map, each 2 bits stands for a NSS */
1295 u16 basic_mcs_map;
1296} __packed;
1297
Avinash Patil54428c52013-01-02 16:56:01 -08001298struct mwifiex_ie_types_wmmcap {
1299 struct mwifiex_ie_types_header header;
1300 struct mwifiex_types_wmm_info wmm_info;
1301} __packed;
1302
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001303struct mwifiex_ie_types_htinfo {
1304 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001305 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001306} __packed;
1307
1308struct mwifiex_ie_types_2040bssco {
1309 struct mwifiex_ie_types_header header;
1310 u8 bss_co_2040;
1311} __packed;
1312
1313struct mwifiex_ie_types_extcap {
1314 struct mwifiex_ie_types_header header;
1315 u8 ext_cap;
1316} __packed;
1317
1318struct host_cmd_ds_mac_reg_access {
1319 __le16 action;
1320 __le16 offset;
1321 __le32 value;
1322} __packed;
1323
1324struct host_cmd_ds_bbp_reg_access {
1325 __le16 action;
1326 __le16 offset;
1327 u8 value;
1328 u8 reserved[3];
1329} __packed;
1330
1331struct host_cmd_ds_rf_reg_access {
1332 __le16 action;
1333 __le16 offset;
1334 u8 value;
1335 u8 reserved[3];
1336} __packed;
1337
1338struct host_cmd_ds_pmic_reg_access {
1339 __le16 action;
1340 __le16 offset;
1341 u8 value;
1342 u8 reserved[3];
1343} __packed;
1344
1345struct host_cmd_ds_802_11_eeprom_access {
1346 __le16 action;
1347
1348 __le16 offset;
1349 __le16 byte_count;
1350 u8 value;
1351} __packed;
1352
Avinash Patil75edd2c2012-05-08 18:30:18 -07001353struct host_cmd_tlv {
1354 __le16 type;
1355 __le16 len;
1356} __packed;
1357
Avinash Patile5686342012-05-08 18:30:25 -07001358struct mwifiex_assoc_event {
1359 u8 sta_addr[ETH_ALEN];
1360 __le16 type;
1361 __le16 len;
1362 __le16 frame_control;
1363 __le16 cap_info;
1364 __le16 listen_interval;
1365 u8 data[0];
1366} __packed;
1367
Avinash Patil4db16a12012-05-08 18:30:20 -07001368struct host_cmd_ds_sys_config {
1369 __le16 action;
1370 u8 tlv[0];
1371};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001372
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -07001373struct host_cmd_11ac_vht_cfg {
1374 __le16 action;
1375 u8 band_config;
1376 u8 misc_config;
1377 __le32 cap_info;
1378 __le32 mcs_tx_set;
1379 __le32 mcs_rx_set;
1380} __packed;
1381
Avinash Patilf752dcd2012-05-08 18:30:26 -07001382struct host_cmd_tlv_akmp {
1383 struct host_cmd_tlv tlv;
1384 __le16 key_mgmt;
1385 __le16 key_mgmt_operation;
1386} __packed;
1387
1388struct host_cmd_tlv_pwk_cipher {
1389 struct host_cmd_tlv tlv;
1390 __le16 proto;
1391 u8 cipher;
1392 u8 reserved;
1393} __packed;
1394
1395struct host_cmd_tlv_gwk_cipher {
1396 struct host_cmd_tlv tlv;
1397 u8 cipher;
1398 u8 reserved;
1399} __packed;
1400
1401struct host_cmd_tlv_passphrase {
1402 struct host_cmd_tlv tlv;
1403 u8 passphrase[0];
1404} __packed;
1405
Avinash Patil96893532012-06-15 12:21:55 -07001406struct host_cmd_tlv_wep_key {
1407 struct host_cmd_tlv tlv;
1408 u8 key_index;
1409 u8 is_default;
1410 u8 key[1];
1411};
1412
Avinash Patilf752dcd2012-05-08 18:30:26 -07001413struct host_cmd_tlv_auth_type {
1414 struct host_cmd_tlv tlv;
1415 u8 auth_type;
1416} __packed;
1417
1418struct host_cmd_tlv_encrypt_protocol {
1419 struct host_cmd_tlv tlv;
1420 __le16 proto;
1421} __packed;
1422
Avinash Patil12190c52012-05-08 18:30:24 -07001423struct host_cmd_tlv_ssid {
1424 struct host_cmd_tlv tlv;
1425 u8 ssid[0];
1426} __packed;
1427
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001428struct host_cmd_tlv_rates {
1429 struct host_cmd_tlv tlv;
1430 u8 rates[0];
1431} __packed;
1432
Avinash Patil605b73a2012-05-16 21:24:55 -07001433struct host_cmd_tlv_bcast_ssid {
1434 struct host_cmd_tlv tlv;
1435 u8 bcast_ctl;
1436} __packed;
1437
Avinash Patil12190c52012-05-08 18:30:24 -07001438struct host_cmd_tlv_beacon_period {
1439 struct host_cmd_tlv tlv;
1440 __le16 period;
1441} __packed;
1442
1443struct host_cmd_tlv_dtim_period {
1444 struct host_cmd_tlv tlv;
1445 u8 period;
1446} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001447
Avinash Patil9b930ea2012-05-08 18:30:23 -07001448struct host_cmd_tlv_frag_threshold {
1449 struct host_cmd_tlv tlv;
1450 __le16 frag_thr;
1451} __packed;
1452
1453struct host_cmd_tlv_rts_threshold {
1454 struct host_cmd_tlv tlv;
1455 __le16 rts_thr;
1456} __packed;
1457
1458struct host_cmd_tlv_retry_limit {
1459 struct host_cmd_tlv tlv;
1460 u8 limit;
1461} __packed;
1462
Avinash Patil75edd2c2012-05-08 18:30:18 -07001463struct host_cmd_tlv_mac_addr {
1464 struct host_cmd_tlv tlv;
1465 u8 mac_addr[ETH_ALEN];
1466} __packed;
1467
Avinash Patil4db16a12012-05-08 18:30:20 -07001468struct host_cmd_tlv_channel_band {
1469 struct host_cmd_tlv tlv;
1470 u8 band_config;
1471 u8 channel;
1472} __packed;
1473
Kevin Gan8b4509f2012-09-25 20:23:45 -07001474struct host_cmd_tlv_ageout_timer {
1475 struct host_cmd_tlv tlv;
1476 __le32 sta_ao_timer;
1477} __packed;
1478
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001479struct host_cmd_ds_version_ext {
1480 u8 version_str_sel;
1481 char version_str[128];
1482} __packed;
1483
Stone Piao3cec6872012-09-25 20:23:34 -07001484struct host_cmd_ds_mgmt_frame_reg {
1485 __le16 action;
1486 __le32 mask;
1487} __packed;
1488
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001489struct host_cmd_ds_p2p_mode_cfg {
1490 __le16 action;
1491 __le16 mode;
1492} __packed;
1493
Stone Piao7feb4c42012-09-25 20:23:36 -07001494struct host_cmd_ds_remain_on_chan {
1495 __le16 action;
1496 u8 status;
1497 u8 reserved;
1498 u8 band_cfg;
1499 u8 channel;
1500 __le32 duration;
1501} __packed;
1502
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001503struct host_cmd_ds_802_11_ibss_status {
1504 __le16 action;
1505 __le16 enable;
1506 u8 bssid[ETH_ALEN];
1507 __le16 beacon_interval;
1508 __le16 atim_window;
1509 __le16 use_g_rate_protect;
1510} __packed;
1511
Amitkumar Karwar7da060c2013-03-04 16:27:59 -08001512struct mwifiex_fw_mef_entry {
1513 u8 mode;
1514 u8 action;
1515 __le16 exprsize;
1516 u8 expr[0];
1517} __packed;
1518
1519struct host_cmd_ds_mef_cfg {
1520 __le32 criteria;
1521 __le16 num_entries;
1522 struct mwifiex_fw_mef_entry mef_entry[0];
1523} __packed;
1524
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001525#define CONNECTION_TYPE_INFRA 0
1526#define CONNECTION_TYPE_ADHOC 1
Stone Piao9197ab92012-09-25 20:23:42 -07001527#define CONNECTION_TYPE_AP 2
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001528
1529struct host_cmd_ds_set_bss_mode {
1530 u8 con_type;
1531} __packed;
1532
Amitkumar Karward930fae2011-10-11 17:41:21 -07001533struct host_cmd_ds_pcie_details {
1534 /* TX buffer descriptor ring address */
1535 u32 txbd_addr_lo;
1536 u32 txbd_addr_hi;
1537 /* TX buffer descriptor ring count */
1538 u32 txbd_count;
1539
1540 /* RX buffer descriptor ring address */
1541 u32 rxbd_addr_lo;
1542 u32 rxbd_addr_hi;
1543 /* RX buffer descriptor ring count */
1544 u32 rxbd_count;
1545
1546 /* Event buffer descriptor ring address */
1547 u32 evtbd_addr_lo;
1548 u32 evtbd_addr_hi;
1549 /* Event buffer descriptor ring count */
1550 u32 evtbd_count;
1551
1552 /* Sleep cookie buffer physical address */
1553 u32 sleep_cookie_addr_lo;
1554 u32 sleep_cookie_addr_hi;
1555} __packed;
1556
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001557struct mwifiex_ie_types_rssi_threshold {
1558 struct mwifiex_ie_types_header header;
1559 u8 abs_value;
1560 u8 evt_freq;
1561} __packed;
1562
1563struct host_cmd_ds_802_11_subsc_evt {
1564 __le16 action;
1565 __le16 events;
1566} __packed;
1567
Avinash Patilede98bf2012-05-08 18:30:28 -07001568struct mwifiex_ie {
1569 __le16 ie_index;
1570 __le16 mgmt_subtype_mask;
1571 __le16 ie_length;
1572 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1573} __packed;
1574
1575#define MAX_MGMT_IE_INDEX 16
1576struct mwifiex_ie_list {
1577 __le16 type;
1578 __le16 len;
1579 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1580} __packed;
1581
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001582struct host_cmd_ds_command {
1583 __le16 command;
1584 __le16 size;
1585 __le16 seq_num;
1586 __le16 result;
1587 union {
1588 struct host_cmd_ds_get_hw_spec hw_spec;
1589 struct host_cmd_ds_mac_control mac_ctrl;
1590 struct host_cmd_ds_802_11_mac_address mac_addr;
1591 struct host_cmd_ds_mac_multicast_adr mc_addr;
1592 struct host_cmd_ds_802_11_get_log get_log;
1593 struct host_cmd_ds_802_11_rssi_info rssi_info;
1594 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1595 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001596 struct host_cmd_ds_tx_rate_query tx_rate;
1597 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1598 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001599 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001600 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1601 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001602 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1603 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1604 struct host_cmd_ds_802_11_scan scan;
1605 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1606 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1607 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1608 struct host_cmd_ds_802_11_associate associate;
1609 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1610 struct host_cmd_ds_802_11_deauthenticate deauth;
1611 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1612 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1613 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1614 struct host_cmd_ds_802_11d_domain_info domain_info;
1615 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1616 struct host_cmd_ds_11n_addba_req add_ba_req;
1617 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1618 struct host_cmd_ds_11n_delba del_ba;
1619 struct host_cmd_ds_txbuf_cfg tx_buf;
1620 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1621 struct host_cmd_ds_11n_cfg htcfg;
1622 struct host_cmd_ds_wmm_get_status get_wmm_status;
1623 struct host_cmd_ds_802_11_key_material key_material;
1624 struct host_cmd_ds_version_ext verext;
Stone Piao3cec6872012-09-25 20:23:34 -07001625 struct host_cmd_ds_mgmt_frame_reg reg_mask;
Stone Piao7feb4c42012-09-25 20:23:36 -07001626 struct host_cmd_ds_remain_on_chan roc_cfg;
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001627 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001628 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
Amitkumar Karwar7da060c2013-03-04 16:27:59 -08001629 struct host_cmd_ds_mef_cfg mef_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001630 struct host_cmd_ds_mac_reg_access mac_reg;
1631 struct host_cmd_ds_bbp_reg_access bbp_reg;
1632 struct host_cmd_ds_rf_reg_access rf_reg;
1633 struct host_cmd_ds_pmic_reg_access pmic_reg;
1634 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001635 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001636 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001637 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001638 struct host_cmd_ds_sys_config uap_sys_config;
Avinash Patil0f9e9b82013-05-17 17:50:23 -07001639 struct host_cmd_ds_sta_deauth sta_deauth;
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -07001640 struct host_cmd_11ac_vht_cfg vht_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001641 } params;
1642} __packed;
1643
1644struct mwifiex_opt_sleep_confirm {
1645 __le16 command;
1646 __le16 size;
1647 __le16 seq_num;
1648 __le16 result;
1649 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001650 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001651} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001652#endif /* !_MWIFIEX_FW_H_ */