blob: 5a5d06659d578b3c7d78f900ddfc1d0985ee04c3 [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
233#define GET_VHTCAP_MAXMPDULEN(vht_cap_info) (vht_cap_info & 0x3)
234#define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
235#define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
236#define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
237 (2 * (nss - 1)))
238#define NO_NSS_SUPPORT 0x3
239
240/* HW_SPEC: HTC-VHT supported */
241#define ISSUPP_11ACVHTHTCVHT(Dot11acDevCap) (Dot11acDevCap & BIT(22))
242/* HW_SPEC: VHT TXOP PS support */
243#define ISSUPP_11ACVHTTXOPPS(Dot11acDevCap) (Dot11acDevCap & BIT(21))
244/* HW_SPEC: MU RX beamformee support */
245#define ISSUPP_11ACMURXBEAMFORMEE(Dot11acDevCap) (Dot11acDevCap & BIT(20))
246/* HW_SPEC: MU TX beamformee support */
247#define ISSUPP_11ACMUTXBEAMFORMEE(Dot11acDevCap) (Dot11acDevCap & BIT(19))
248/* HW_SPEC: SU Beamformee support */
249#define ISSUPP_11ACSUBEAMFORMEE(Dot11acDevCap) (Dot11acDevCap & BIT(10))
250/* HW_SPEC: SU Beamformer support */
251#define ISSUPP_11ACSUBEAMFORMER(Dot11acDevCap) (Dot11acDevCap & BIT(9))
252/* HW_SPEC: Rx STBC support */
253#define ISSUPP_11ACRXSTBC(Dot11acDevCap) (Dot11acDevCap & BIT(8))
254/* HW_SPEC: Tx STBC support */
255#define ISSUPP_11ACTXSTBC(Dot11acDevCap) (Dot11acDevCap & BIT(7))
256/* HW_SPEC: Short GI support for 160MHz BW */
257#define ISSUPP_11ACSGI160(Dot11acDevCap) (Dot11acDevCap & BIT(6))
258/* HW_SPEC: Short GI support for 80MHz BW */
259#define ISSUPP_11ACSGI80(Dot11acDevCap) (Dot11acDevCap & BIT(5))
260/* HW_SPEC: LDPC coding support */
261#define ISSUPP_11ACLDPC(Dot11acDevCap) (Dot11acDevCap & BIT(4))
262/* HW_SPEC: Channel BW 20/40/80/160/80+80 MHz support */
263#define ISSUPP_11ACBW8080(Dot11acDevCap) (Dot11acDevCap & BIT(3))
264/* HW_SPEC: Channel BW 20/40/80/160 MHz support */
265#define ISSUPP_11ACBW160(Dot11acDevCap) (Dot11acDevCap & BIT(2))
266
267#define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
268#define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
269
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700270#define MOD_CLASS_HR_DSSS 0x03
271#define MOD_CLASS_OFDM 0x07
272#define MOD_CLASS_HT 0x08
273#define HT_BW_20 0
274#define HT_BW_40 1
275
276#define HostCmd_CMD_GET_HW_SPEC 0x0003
277#define HostCmd_CMD_802_11_SCAN 0x0006
278#define HostCmd_CMD_802_11_GET_LOG 0x000b
279#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
280#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
281#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
282#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
283#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
284#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
285#define HostCmd_CMD_RF_REG_ACCESS 0x001b
286#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700287#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700288#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700289#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
290#define HostCmd_CMD_MAC_CONTROL 0x0028
291#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
292#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
293#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
294#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
295#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
296#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
297#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
298#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700299#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700300#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
301#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
302#define HostCmd_CMD_VERSION_EXT 0x0097
303#define HostCmd_CMD_RSSI_INFO 0x00a4
304#define HostCmd_CMD_FUNC_INIT 0x00a9
305#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700306#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
307#define HostCmd_CMD_UAP_BSS_START 0x00b1
308#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700309#define HostCmd_CMD_11N_CFG 0x00cd
310#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
311#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
312#define HostCmd_CMD_11N_DELBA 0x00d0
313#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
314#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
315#define HostCmd_CMD_TXPWR_CFG 0x00d1
316#define HostCmd_CMD_TX_RATE_CFG 0x00d6
317#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
318#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700319#define HostCmd_CMD_P2P_MODE_CFG 0x00eb
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700320#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
321#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700322#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Stone Piao3cec6872012-09-25 20:23:34 -0700323#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
Stone Piao7feb4c42012-09-25 20:23:36 -0700324#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700325
Avinash Patilf752dcd2012-05-08 18:30:26 -0700326#define PROTOCOL_NO_SECURITY 0x01
327#define PROTOCOL_STATIC_WEP 0x02
328#define PROTOCOL_WPA 0x08
329#define PROTOCOL_WPA2 0x20
330#define PROTOCOL_WPA2_MIXED 0x28
331#define PROTOCOL_EAP 0x40
332#define KEY_MGMT_NONE 0x04
333#define KEY_MGMT_PSK 0x02
334#define KEY_MGMT_EAP 0x01
335#define CIPHER_TKIP 0x04
336#define CIPHER_AES_CCMP 0x08
337#define VALID_CIPHER_BITMAP 0x0c
338
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700339enum ENH_PS_MODES {
340 EN_PS = 1,
341 DIS_PS = 2,
342 EN_AUTO_DS = 3,
343 DIS_AUTO_DS = 4,
344 SLEEP_CONFIRM = 5,
345 GET_PS = 0,
346 EN_AUTO_PS = 0xff,
347 DIS_AUTO_PS = 0xfe,
348};
349
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700350enum P2P_MODES {
351 P2P_MODE_DISABLE = 0,
352 P2P_MODE_DEVICE = 1,
353 P2P_MODE_GO = 2,
354 P2P_MODE_CLIENT = 3,
355};
356
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700357#define HostCmd_RET_BIT 0x8000
358#define HostCmd_ACT_GEN_GET 0x0000
359#define HostCmd_ACT_GEN_SET 0x0001
Stone Piao7feb4c42012-09-25 20:23:36 -0700360#define HostCmd_ACT_GEN_REMOVE 0x0004
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700361#define HostCmd_ACT_BITWISE_SET 0x0002
362#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700363#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700364
365#define HostCmd_ACT_MAC_RX_ON 0x0001
366#define HostCmd_ACT_MAC_TX_ON 0x0002
367#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
368#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
369#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
370#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700371#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
372
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700373#define HostCmd_BSS_MODE_IBSS 0x0002
374#define HostCmd_BSS_MODE_ANY 0x0003
375
376#define HostCmd_SCAN_RADIO_TYPE_BG 0
377#define HostCmd_SCAN_RADIO_TYPE_A 1
378
Amitkumar Karwarcc0b5a62013-03-04 16:27:57 -0800379#define HS_CFG_CANCEL 0xffffffff
380#define HS_CFG_COND_DEF 0x00000000
381#define HS_CFG_GPIO_DEF 0xff
382#define HS_CFG_GAP_DEF 0
Amitkumar Karwar0d7f53e2013-03-04 16:27:58 -0800383#define HS_CFG_COND_BROADCAST_DATA 0x00000001
384#define HS_CFG_COND_UNICAST_DATA 0x00000002
385#define HS_CFG_COND_MAC_EVENT 0x00000004
386#define HS_CFG_COND_MULTICAST_DATA 0x00000008
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700387
Amitkumar Karwar7532c7d2013-01-17 17:41:57 -0800388#define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
389#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
390
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700391#define CMD_F_HOSTCMD (1 << 0)
392#define CMD_F_CANCELED (1 << 1)
393
394#define HostCmd_CMD_ID_MASK 0x0fff
395
396#define HostCmd_SEQ_NUM_MASK 0x00ff
397
398#define HostCmd_BSS_NUM_MASK 0x0f00
399
400#define HostCmd_BSS_TYPE_MASK 0xf000
401
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700402#define HostCmd_ACT_SET_RX 0x0001
403#define HostCmd_ACT_SET_TX 0x0002
404#define HostCmd_ACT_SET_BOTH 0x0003
405
406#define RF_ANTENNA_AUTO 0xFFFF
407
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700408#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
409 (((seq) & 0x00ff) | \
410 (((num) & 0x000f) << 8)) | \
411 (((type) & 0x000f) << 12); }
412
413#define HostCmd_GET_SEQ_NO(seq) \
414 ((seq) & HostCmd_SEQ_NUM_MASK)
415
416#define HostCmd_GET_BSS_NO(seq) \
417 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
418
419#define HostCmd_GET_BSS_TYPE(seq) \
420 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
421
422#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
423#define EVENT_LINK_LOST 0x00000003
424#define EVENT_LINK_SENSED 0x00000004
425#define EVENT_MIB_CHANGED 0x00000006
426#define EVENT_INIT_DONE 0x00000007
427#define EVENT_DEAUTHENTICATED 0x00000008
428#define EVENT_DISASSOCIATED 0x00000009
429#define EVENT_PS_AWAKE 0x0000000a
430#define EVENT_PS_SLEEP 0x0000000b
431#define EVENT_MIC_ERR_MULTICAST 0x0000000d
432#define EVENT_MIC_ERR_UNICAST 0x0000000e
433#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
434#define EVENT_ADHOC_BCN_LOST 0x00000011
435
436#define EVENT_WMM_STATUS_CHANGE 0x00000017
437#define EVENT_BG_SCAN_REPORT 0x00000018
438#define EVENT_RSSI_LOW 0x00000019
439#define EVENT_SNR_LOW 0x0000001a
440#define EVENT_MAX_FAIL 0x0000001b
441#define EVENT_RSSI_HIGH 0x0000001c
442#define EVENT_SNR_HIGH 0x0000001d
443#define EVENT_IBSS_COALESCED 0x0000001e
444#define EVENT_DATA_RSSI_LOW 0x00000024
445#define EVENT_DATA_SNR_LOW 0x00000025
446#define EVENT_DATA_RSSI_HIGH 0x00000026
447#define EVENT_DATA_SNR_HIGH 0x00000027
448#define EVENT_LINK_QUALITY 0x00000028
449#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700450#define EVENT_UAP_STA_DEAUTH 0x0000002c
451#define EVENT_UAP_STA_ASSOC 0x0000002d
452#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700453#define EVENT_PRE_BEACON_LOST 0x00000031
454#define EVENT_ADDBA 0x00000033
455#define EVENT_DELBA 0x00000034
456#define EVENT_BA_STREAM_TIEMOUT 0x00000037
457#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700458#define EVENT_UAP_BSS_IDLE 0x00000043
459#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700460#define EVENT_WEP_ICV_ERR 0x00000046
461#define EVENT_HS_ACT_REQ 0x00000047
462#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700463#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700464#define EVENT_HOSTWAKE_STAIE 0x0000004d
Stone Piaoeab1c762012-09-25 20:23:37 -0700465#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700466
467#define EVENT_ID_MASK 0xffff
468#define BSS_NUM_MASK 0xf
469
470#define EVENT_GET_BSS_NUM(event_cause) \
471 (((event_cause) >> 16) & BSS_NUM_MASK)
472
473#define EVENT_GET_BSS_TYPE(event_cause) \
474 (((event_cause) >> 24) & 0x00ff)
475
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700476struct mwifiex_ie_types_header {
477 __le16 type;
478 __le16 len;
479} __packed;
480
481struct mwifiex_ie_types_data {
482 struct mwifiex_ie_types_header header;
483 u8 data[1];
484} __packed;
485
486#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
487#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
488
489struct txpd {
490 u8 bss_type;
491 u8 bss_num;
492 __le16 tx_pkt_length;
493 __le16 tx_pkt_offset;
494 __le16 tx_pkt_type;
495 __le32 tx_control;
496 u8 priority;
497 u8 flags;
498 u8 pkt_delay_2ms;
499 u8 reserved1;
500} __packed;
501
502struct rxpd {
503 u8 bss_type;
504 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700505 __le16 rx_pkt_length;
506 __le16 rx_pkt_offset;
507 __le16 rx_pkt_type;
508 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700509 u8 priority;
510 u8 rx_rate;
511 s8 snr;
512 s8 nf;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800513
514 /* For: Non-802.11 AC cards
515 *
516 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700517 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800518 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
519 *
520 * For: 802.11 AC cards
521 * [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
522 * [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01
523 * BW80 = 10 BW160 = 11
524 * [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
525 * [Bit 5] STBC support Enabled = 1
526 * [Bit 6] LDPC support Enabled = 1
527 * [Bit 7] Reserved
528 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700529 u8 ht_info;
530 u8 reserved;
531} __packed;
532
Avinash Patil838e4f42012-08-03 18:06:08 -0700533struct uap_txpd {
534 u8 bss_type;
535 u8 bss_num;
536 __le16 tx_pkt_length;
537 __le16 tx_pkt_offset;
538 __le16 tx_pkt_type;
539 __le32 tx_control;
540 u8 priority;
541 u8 flags;
542 u8 pkt_delay_2ms;
543 u8 reserved1;
544 __le32 reserved2;
545};
546
547struct uap_rxpd {
548 u8 bss_type;
549 u8 bss_num;
550 __le16 rx_pkt_length;
551 __le16 rx_pkt_offset;
552 __le16 rx_pkt_type;
553 __le16 seq_num;
554 u8 priority;
555 u8 reserved1;
556};
557
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700558enum mwifiex_chan_scan_mode_bitmasks {
559 MWIFIEX_PASSIVE_SCAN = BIT(0),
560 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
561};
562
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700563struct mwifiex_chan_scan_param_set {
564 u8 radio_type;
565 u8 chan_number;
566 u8 chan_scan_mode_bitmap;
567 __le16 min_scan_time;
568 __le16 max_scan_time;
569} __packed;
570
571struct mwifiex_ie_types_chan_list_param_set {
572 struct mwifiex_ie_types_header header;
573 struct mwifiex_chan_scan_param_set chan_scan_param[1];
574} __packed;
575
576struct chan_band_param_set {
577 u8 radio_type;
578 u8 chan_number;
579};
580
581struct mwifiex_ie_types_chan_band_list_param_set {
582 struct mwifiex_ie_types_header header;
583 struct chan_band_param_set chan_band_param[1];
584} __packed;
585
586struct mwifiex_ie_types_rates_param_set {
587 struct mwifiex_ie_types_header header;
588 u8 rates[1];
589} __packed;
590
591struct mwifiex_ie_types_ssid_param_set {
592 struct mwifiex_ie_types_header header;
593 u8 ssid[1];
594} __packed;
595
596struct mwifiex_ie_types_num_probes {
597 struct mwifiex_ie_types_header header;
598 __le16 num_probes;
599} __packed;
600
601struct mwifiex_ie_types_wildcard_ssid_params {
602 struct mwifiex_ie_types_header header;
603 u8 max_ssid_length;
604 u8 ssid[1];
605} __packed;
606
607#define TSF_DATA_SIZE 8
608struct mwifiex_ie_types_tsf_timestamp {
609 struct mwifiex_ie_types_header header;
610 u8 tsf_data[1];
611} __packed;
612
613struct mwifiex_cf_param_set {
614 u8 cfp_cnt;
615 u8 cfp_period;
616 u16 cfp_max_duration;
617 u16 cfp_duration_remaining;
618} __packed;
619
620struct mwifiex_ibss_param_set {
621 u16 atim_window;
622} __packed;
623
624struct mwifiex_ie_types_ss_param_set {
625 struct mwifiex_ie_types_header header;
626 union {
627 struct mwifiex_cf_param_set cf_param_set[1];
628 struct mwifiex_ibss_param_set ibss_param_set[1];
629 } cf_ibss;
630} __packed;
631
632struct mwifiex_fh_param_set {
633 u16 dwell_time;
634 u8 hop_set;
635 u8 hop_pattern;
636 u8 hop_index;
637} __packed;
638
639struct mwifiex_ds_param_set {
640 u8 current_chan;
641} __packed;
642
643struct mwifiex_ie_types_phy_param_set {
644 struct mwifiex_ie_types_header header;
645 union {
646 struct mwifiex_fh_param_set fh_param_set[1];
647 struct mwifiex_ds_param_set ds_param_set[1];
648 } fh_ds;
649} __packed;
650
651struct mwifiex_ie_types_auth_type {
652 struct mwifiex_ie_types_header header;
653 __le16 auth_type;
654} __packed;
655
656struct mwifiex_ie_types_vendor_param_set {
657 struct mwifiex_ie_types_header header;
658 u8 ie[MWIFIEX_MAX_VSIE_LEN];
659};
660
661struct mwifiex_ie_types_rsn_param_set {
662 struct mwifiex_ie_types_header header;
663 u8 rsn_ie[1];
664} __packed;
665
666#define KEYPARAMSET_FIXED_LEN 6
667
668struct mwifiex_ie_type_key_param_set {
669 __le16 type;
670 __le16 length;
671 __le16 key_type_id;
672 __le16 key_info;
673 __le16 key_len;
674 u8 key[50];
675} __packed;
676
Ying Luob877f4c2012-08-03 18:06:14 -0700677#define IGTK_PN_LEN 8
678
679struct mwifiex_cmac_param {
680 u8 ipn[IGTK_PN_LEN];
681 u8 key[WLAN_KEY_LEN_AES_CMAC];
682} __packed;
683
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700684struct host_cmd_ds_802_11_key_material {
685 __le16 action;
686 struct mwifiex_ie_type_key_param_set key_param_set;
687} __packed;
688
689struct host_cmd_ds_gen {
690 u16 command;
691 u16 size;
692 u16 seq_num;
693 u16 result;
694};
695
696#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
697
698enum sleep_resp_ctrl {
699 RESP_NOT_NEEDED = 0,
700 RESP_NEEDED,
701};
702
703struct mwifiex_ps_param {
704 __le16 null_pkt_interval;
705 __le16 multiple_dtims;
706 __le16 bcn_miss_timeout;
707 __le16 local_listen_interval;
708 __le16 adhoc_wake_period;
709 __le16 mode;
710 __le16 delay_to_ps;
711};
712
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700713#define BITMAP_AUTO_DS 0x01
714#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700715
716struct mwifiex_ie_types_auto_ds_param {
717 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700718 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700719} __packed;
720
721struct mwifiex_ie_types_ps_param {
722 struct mwifiex_ie_types_header header;
723 struct mwifiex_ps_param param;
724} __packed;
725
726struct host_cmd_ds_802_11_ps_mode_enh {
727 __le16 action;
728
729 union {
730 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700731 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700732 } params;
733} __packed;
734
735struct host_cmd_ds_get_hw_spec {
736 __le16 hw_if_version;
737 __le16 version;
738 __le16 reserved;
739 __le16 num_of_mcast_adr;
740 u8 permanent_addr[ETH_ALEN];
741 __le16 region_code;
742 __le16 number_of_antenna;
743 __le32 fw_release_number;
744 __le32 reserved_1;
745 __le32 reserved_2;
746 __le32 reserved_3;
747 __le32 fw_cap_info;
748 __le32 dot_11n_dev_cap;
749 u8 dev_mcs_support;
750 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800751 __le16 mgmt_buf_count; /* mgmt IE buffer count */
752 __le32 reserved_5;
753 __le32 reserved_6;
754 __le32 dot_11ac_dev_cap;
755 __le32 dot_11ac_mcs_support;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700756} __packed;
757
758struct host_cmd_ds_802_11_rssi_info {
759 __le16 action;
760 __le16 ndata;
761 __le16 nbcn;
762 __le16 reserved[9];
763 long long reserved_1;
764};
765
766struct host_cmd_ds_802_11_rssi_info_rsp {
767 __le16 action;
768 __le16 ndata;
769 __le16 nbcn;
770 __le16 data_rssi_last;
771 __le16 data_nf_last;
772 __le16 data_rssi_avg;
773 __le16 data_nf_avg;
774 __le16 bcn_rssi_last;
775 __le16 bcn_nf_last;
776 __le16 bcn_rssi_avg;
777 __le16 bcn_nf_avg;
778 long long tsf_bcn;
779};
780
781struct host_cmd_ds_802_11_mac_address {
782 __le16 action;
783 u8 mac_addr[ETH_ALEN];
784};
785
786struct host_cmd_ds_mac_control {
787 __le16 action;
788 __le16 reserved;
789};
790
791struct host_cmd_ds_mac_multicast_adr {
792 __le16 action;
793 __le16 num_of_adrs;
794 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
795} __packed;
796
797struct host_cmd_ds_802_11_deauthenticate {
798 u8 mac_addr[ETH_ALEN];
799 __le16 reason_code;
800} __packed;
801
802struct host_cmd_ds_802_11_associate {
803 u8 peer_sta_addr[ETH_ALEN];
804 __le16 cap_info_bitmap;
805 __le16 listen_interval;
806 __le16 beacon_period;
807 u8 dtim_period;
808} __packed;
809
810struct ieee_types_assoc_rsp {
811 __le16 cap_info_bitmap;
812 __le16 status_code;
813 __le16 a_id;
814 u8 ie_buffer[1];
815} __packed;
816
817struct host_cmd_ds_802_11_associate_rsp {
818 struct ieee_types_assoc_rsp assoc_rsp;
819} __packed;
820
821struct ieee_types_cf_param_set {
822 u8 element_id;
823 u8 len;
824 u8 cfp_cnt;
825 u8 cfp_period;
826 u16 cfp_max_duration;
827 u16 cfp_duration_remaining;
828} __packed;
829
830struct ieee_types_ibss_param_set {
831 u8 element_id;
832 u8 len;
833 __le16 atim_window;
834} __packed;
835
836union ieee_types_ss_param_set {
837 struct ieee_types_cf_param_set cf_param_set;
838 struct ieee_types_ibss_param_set ibss_param_set;
839} __packed;
840
841struct ieee_types_fh_param_set {
842 u8 element_id;
843 u8 len;
844 __le16 dwell_time;
845 u8 hop_set;
846 u8 hop_pattern;
847 u8 hop_index;
848} __packed;
849
850struct ieee_types_ds_param_set {
851 u8 element_id;
852 u8 len;
853 u8 current_chan;
854} __packed;
855
856union ieee_types_phy_param_set {
857 struct ieee_types_fh_param_set fh_param_set;
858 struct ieee_types_ds_param_set ds_param_set;
859} __packed;
860
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800861struct ieee_types_oper_mode_ntf {
862 u8 element_id;
863 u8 len;
864 u8 oper_mode;
865} __packed;
866
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700867struct host_cmd_ds_802_11_ad_hoc_start {
868 u8 ssid[IEEE80211_MAX_SSID_LEN];
869 u8 bss_mode;
870 __le16 beacon_period;
871 u8 dtim_period;
872 union ieee_types_ss_param_set ss_param_set;
873 union ieee_types_phy_param_set phy_param_set;
874 u16 reserved1;
875 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800876 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700877} __packed;
878
879struct host_cmd_ds_802_11_ad_hoc_result {
880 u8 pad[3];
881 u8 bssid[ETH_ALEN];
882} __packed;
883
884struct adhoc_bss_desc {
885 u8 bssid[ETH_ALEN];
886 u8 ssid[IEEE80211_MAX_SSID_LEN];
887 u8 bss_mode;
888 __le16 beacon_period;
889 u8 dtim_period;
890 u8 time_stamp[8];
891 u8 local_time[8];
892 union ieee_types_phy_param_set phy_param_set;
893 union ieee_types_ss_param_set ss_param_set;
894 __le16 cap_info_bitmap;
895 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
896
897 /*
898 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
899 * It is used in the Adhoc join command and will cause a
900 * binary layout mismatch with the firmware
901 */
902} __packed;
903
904struct host_cmd_ds_802_11_ad_hoc_join {
905 struct adhoc_bss_desc bss_descriptor;
906 u16 reserved1;
907 u16 reserved2;
908} __packed;
909
910struct host_cmd_ds_802_11_get_log {
911 __le32 mcast_tx_frame;
912 __le32 failed;
913 __le32 retry;
914 __le32 multi_retry;
915 __le32 frame_dup;
916 __le32 rts_success;
917 __le32 rts_failure;
918 __le32 ack_failure;
919 __le32 rx_frag;
920 __le32 mcast_rx_frame;
921 __le32 fcs_error;
922 __le32 tx_frame;
923 __le32 reserved;
924 __le32 wep_icv_err_cnt[4];
925};
926
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800927/* Enumeration for rate format */
928enum _mwifiex_rate_format {
929 MWIFIEX_RATE_FORMAT_LG = 0,
930 MWIFIEX_RATE_FORMAT_HT,
931 MWIFIEX_RATE_FORMAT_VHT,
932 MWIFIEX_RATE_FORMAT_AUTO = 0xFF,
933};
934
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700935struct host_cmd_ds_tx_rate_query {
936 u8 tx_rate;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800937 /* Tx Rate Info: For 802.11 AC cards
938 *
939 * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
940 * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
941 * [Bit 4] HT/VHT Guard Interval: LGI = 0, SGI = 1
942 *
943 * For non-802.11 AC cards
944 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700945 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800946 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
947 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700948 u8 ht_info;
949} __packed;
950
951enum Host_Sleep_Action {
952 HS_CONFIGURE = 0x0001,
953 HS_ACTIVATE = 0x0002,
954};
955
956struct mwifiex_hs_config_param {
957 __le32 conditions;
958 u8 gpio;
959 u8 gap;
960} __packed;
961
962struct hs_activate_param {
963 u16 resp_ctrl;
964} __packed;
965
966struct host_cmd_ds_802_11_hs_cfg_enh {
967 __le16 action;
968
969 union {
970 struct mwifiex_hs_config_param hs_config;
971 struct hs_activate_param hs_activate;
972 } params;
973} __packed;
974
975enum SNMP_MIB_INDEX {
976 OP_RATE_SET_I = 1,
977 DTIM_PERIOD_I = 3,
978 RTS_THRESH_I = 5,
979 SHORT_RETRY_LIM_I = 6,
980 LONG_RETRY_LIM_I = 7,
981 FRAG_THRESH_I = 8,
982 DOT11D_I = 9,
983};
984
985#define MAX_SNMP_BUF_SIZE 128
986
987struct host_cmd_ds_802_11_snmp_mib {
988 __le16 query_type;
989 __le16 oid;
990 __le16 buf_size;
991 u8 value[1];
992} __packed;
993
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700994struct mwifiex_rate_scope {
995 __le16 type;
996 __le16 length;
997 __le16 hr_dsss_rate_bitmap;
998 __le16 ofdm_rate_bitmap;
999 __le16 ht_mcs_rate_bitmap[8];
1000} __packed;
1001
1002struct mwifiex_rate_drop_pattern {
1003 __le16 type;
1004 __le16 length;
1005 __le32 rate_drop_mode;
1006} __packed;
1007
1008struct host_cmd_ds_tx_rate_cfg {
1009 __le16 action;
1010 __le16 cfg_index;
1011} __packed;
1012
1013struct mwifiex_power_group {
1014 u8 modulation_class;
1015 u8 first_rate_code;
1016 u8 last_rate_code;
1017 s8 power_step;
1018 s8 power_min;
1019 s8 power_max;
1020 u8 ht_bandwidth;
1021 u8 reserved;
1022} __packed;
1023
1024struct mwifiex_types_power_group {
1025 u16 type;
1026 u16 length;
1027} __packed;
1028
1029struct host_cmd_ds_txpwr_cfg {
1030 __le16 action;
1031 __le16 cfg_index;
1032 __le32 mode;
1033} __packed;
1034
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001035struct host_cmd_ds_rf_tx_pwr {
1036 __le16 action;
1037 __le16 cur_level;
1038 u8 max_power;
1039 u8 min_power;
1040} __packed;
1041
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001042struct host_cmd_ds_rf_ant_mimo {
1043 __le16 action_tx;
1044 __le16 tx_ant_mode;
1045 __le16 action_rx;
1046 __le16 rx_ant_mode;
1047};
1048
1049struct host_cmd_ds_rf_ant_siso {
1050 __le16 action;
1051 __le16 ant_mode;
1052};
1053
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -07001054struct mwifiex_bcn_param {
1055 u8 bssid[ETH_ALEN];
1056 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -07001057 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -07001058 __le16 beacon_period;
1059 __le16 cap_info_bitmap;
1060} __packed;
1061
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001062#define MWIFIEX_USER_SCAN_CHAN_MAX 50
1063
1064#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
1065
1066struct mwifiex_scan_cmd_config {
1067 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -07001068 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001069 */
1070 u8 bss_mode;
1071
1072 /* Specific BSSID used to filter scan results in the firmware */
1073 u8 specific_bssid[ETH_ALEN];
1074
1075 /* Length of TLVs sent in command starting at tlvBuffer */
1076 u32 tlv_buf_len;
1077
1078 /*
1079 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
1080 *
1081 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
1082 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
1083 */
1084 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
1085 here */
1086} __packed;
1087
1088struct mwifiex_user_scan_chan {
1089 u8 chan_number;
1090 u8 radio_type;
1091 u8 scan_type;
1092 u8 reserved;
1093 u32 scan_time;
1094} __packed;
1095
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001096struct mwifiex_user_scan_cfg {
1097 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001098 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001099 */
1100 u8 bss_mode;
1101 /* Configure the number of probe requests for active chan scans */
1102 u8 num_probes;
1103 u8 reserved;
1104 /* BSSID filter sent in the firmware command to limit the results */
1105 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -08001106 /* SSID filter list used in the firmware to limit the scan results */
1107 struct cfg80211_ssid *ssid_list;
1108 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001109 /* Variable number (fixed maximum) of channels to scan up */
1110 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
1111} __packed;
1112
1113struct ie_body {
1114 u8 grp_key_oui[4];
1115 u8 ptk_cnt[2];
1116 u8 ptk_body[4];
1117} __packed;
1118
1119struct host_cmd_ds_802_11_scan {
1120 u8 bss_mode;
1121 u8 bssid[ETH_ALEN];
1122 u8 tlv_buffer[1];
1123} __packed;
1124
1125struct host_cmd_ds_802_11_scan_rsp {
1126 __le16 bss_descript_size;
1127 u8 number_of_sets;
1128 u8 bss_desc_and_tlv_buffer[1];
1129} __packed;
1130
1131struct host_cmd_ds_802_11_bg_scan_query {
1132 u8 flush;
1133} __packed;
1134
1135struct host_cmd_ds_802_11_bg_scan_query_rsp {
1136 u32 report_condition;
1137 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1138} __packed;
1139
1140struct mwifiex_ietypes_domain_param_set {
1141 struct mwifiex_ie_types_header header;
1142 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1143 struct ieee80211_country_ie_triplet triplet[1];
1144} __packed;
1145
1146struct host_cmd_ds_802_11d_domain_info {
1147 __le16 action;
1148 struct mwifiex_ietypes_domain_param_set domain;
1149} __packed;
1150
1151struct host_cmd_ds_802_11d_domain_info_rsp {
1152 __le16 action;
1153 struct mwifiex_ietypes_domain_param_set domain;
1154} __packed;
1155
1156struct host_cmd_ds_11n_addba_req {
1157 u8 add_req_result;
1158 u8 peer_mac_addr[ETH_ALEN];
1159 u8 dialog_token;
1160 __le16 block_ack_param_set;
1161 __le16 block_ack_tmo;
1162 __le16 ssn;
1163} __packed;
1164
1165struct host_cmd_ds_11n_addba_rsp {
1166 u8 add_rsp_result;
1167 u8 peer_mac_addr[ETH_ALEN];
1168 u8 dialog_token;
1169 __le16 status_code;
1170 __le16 block_ack_param_set;
1171 __le16 block_ack_tmo;
1172 __le16 ssn;
1173} __packed;
1174
1175struct host_cmd_ds_11n_delba {
1176 u8 del_result;
1177 u8 peer_mac_addr[ETH_ALEN];
1178 __le16 del_ba_param_set;
1179 __le16 reason_code;
1180 u8 reserved;
1181} __packed;
1182
1183struct host_cmd_ds_11n_batimeout {
1184 u8 tid;
1185 u8 peer_mac_addr[ETH_ALEN];
1186 u8 origninator;
1187} __packed;
1188
1189struct host_cmd_ds_11n_cfg {
1190 __le16 action;
1191 __le16 ht_tx_cap;
1192 __le16 ht_tx_info;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001193 __le16 misc_config; /* Needed for 802.11AC cards only */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001194} __packed;
1195
1196struct host_cmd_ds_txbuf_cfg {
1197 __le16 action;
1198 __le16 buff_size;
1199 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1200 __le16 reserved3;
1201} __packed;
1202
1203struct host_cmd_ds_amsdu_aggr_ctrl {
1204 __le16 action;
1205 __le16 enable;
1206 __le16 curr_buf_size;
1207} __packed;
1208
1209struct mwifiex_ie_types_wmm_param_set {
1210 struct mwifiex_ie_types_header header;
1211 u8 wmm_ie[1];
1212};
1213
1214struct mwifiex_ie_types_wmm_queue_status {
1215 struct mwifiex_ie_types_header header;
1216 u8 queue_index;
1217 u8 disabled;
1218 u16 medium_time;
1219 u8 flow_required;
1220 u8 flow_created;
1221 u32 reserved;
1222};
1223
1224struct ieee_types_vendor_header {
1225 u8 element_id;
1226 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001227 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001228 u8 oui_subtype;
1229 u8 version;
1230} __packed;
1231
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001232struct ieee_types_wmm_parameter {
1233 /*
1234 * WMM Parameter IE - Vendor Specific Header:
1235 * element_id [221/0xdd]
1236 * Len [24]
1237 * Oui [00:50:f2]
1238 * OuiType [2]
1239 * OuiSubType [1]
1240 * Version [1]
1241 */
1242 struct ieee_types_vendor_header vend_hdr;
1243 u8 qos_info_bitmap;
1244 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001245 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001246} __packed;
1247
1248struct ieee_types_wmm_info {
1249
1250 /*
1251 * WMM Info IE - Vendor Specific Header:
1252 * element_id [221/0xdd]
1253 * Len [7]
1254 * Oui [00:50:f2]
1255 * OuiType [2]
1256 * OuiSubType [0]
1257 * Version [1]
1258 */
1259 struct ieee_types_vendor_header vend_hdr;
1260
1261 u8 qos_info_bitmap;
1262} __packed;
1263
1264struct host_cmd_ds_wmm_get_status {
1265 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001266 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001267 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1268} __packed;
1269
1270struct mwifiex_wmm_ac_status {
1271 u8 disabled;
1272 u8 flow_required;
1273 u8 flow_created;
1274};
1275
1276struct mwifiex_ie_types_htcap {
1277 struct mwifiex_ie_types_header header;
1278 struct ieee80211_ht_cap ht_cap;
1279} __packed;
1280
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001281struct mwifiex_ie_types_vhtcap {
1282 struct mwifiex_ie_types_header header;
1283 struct ieee80211_vht_cap vht_cap;
1284} __packed;
1285
1286struct mwifiex_ie_types_oper_mode_ntf {
1287 struct mwifiex_ie_types_header header;
1288 u8 oper_mode;
1289} __packed;
1290
1291/* VHT Operations IE */
1292struct mwifiex_ie_types_vht_oper {
1293 struct mwifiex_ie_types_header header;
1294 u8 chan_width;
1295 u8 chan_center_freq_1;
1296 u8 chan_center_freq_2;
1297 /* Basic MCS set map, each 2 bits stands for a NSS */
1298 u16 basic_mcs_map;
1299} __packed;
1300
Avinash Patil54428c52013-01-02 16:56:01 -08001301struct mwifiex_ie_types_wmmcap {
1302 struct mwifiex_ie_types_header header;
1303 struct mwifiex_types_wmm_info wmm_info;
1304} __packed;
1305
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001306struct mwifiex_ie_types_htinfo {
1307 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001308 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001309} __packed;
1310
1311struct mwifiex_ie_types_2040bssco {
1312 struct mwifiex_ie_types_header header;
1313 u8 bss_co_2040;
1314} __packed;
1315
1316struct mwifiex_ie_types_extcap {
1317 struct mwifiex_ie_types_header header;
1318 u8 ext_cap;
1319} __packed;
1320
1321struct host_cmd_ds_mac_reg_access {
1322 __le16 action;
1323 __le16 offset;
1324 __le32 value;
1325} __packed;
1326
1327struct host_cmd_ds_bbp_reg_access {
1328 __le16 action;
1329 __le16 offset;
1330 u8 value;
1331 u8 reserved[3];
1332} __packed;
1333
1334struct host_cmd_ds_rf_reg_access {
1335 __le16 action;
1336 __le16 offset;
1337 u8 value;
1338 u8 reserved[3];
1339} __packed;
1340
1341struct host_cmd_ds_pmic_reg_access {
1342 __le16 action;
1343 __le16 offset;
1344 u8 value;
1345 u8 reserved[3];
1346} __packed;
1347
1348struct host_cmd_ds_802_11_eeprom_access {
1349 __le16 action;
1350
1351 __le16 offset;
1352 __le16 byte_count;
1353 u8 value;
1354} __packed;
1355
Avinash Patil75edd2c2012-05-08 18:30:18 -07001356struct host_cmd_tlv {
1357 __le16 type;
1358 __le16 len;
1359} __packed;
1360
Avinash Patile5686342012-05-08 18:30:25 -07001361struct mwifiex_assoc_event {
1362 u8 sta_addr[ETH_ALEN];
1363 __le16 type;
1364 __le16 len;
1365 __le16 frame_control;
1366 __le16 cap_info;
1367 __le16 listen_interval;
1368 u8 data[0];
1369} __packed;
1370
Avinash Patil4db16a12012-05-08 18:30:20 -07001371struct host_cmd_ds_sys_config {
1372 __le16 action;
1373 u8 tlv[0];
1374};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001375
1376struct host_cmd_tlv_akmp {
1377 struct host_cmd_tlv tlv;
1378 __le16 key_mgmt;
1379 __le16 key_mgmt_operation;
1380} __packed;
1381
1382struct host_cmd_tlv_pwk_cipher {
1383 struct host_cmd_tlv tlv;
1384 __le16 proto;
1385 u8 cipher;
1386 u8 reserved;
1387} __packed;
1388
1389struct host_cmd_tlv_gwk_cipher {
1390 struct host_cmd_tlv tlv;
1391 u8 cipher;
1392 u8 reserved;
1393} __packed;
1394
1395struct host_cmd_tlv_passphrase {
1396 struct host_cmd_tlv tlv;
1397 u8 passphrase[0];
1398} __packed;
1399
Avinash Patil96893532012-06-15 12:21:55 -07001400struct host_cmd_tlv_wep_key {
1401 struct host_cmd_tlv tlv;
1402 u8 key_index;
1403 u8 is_default;
1404 u8 key[1];
1405};
1406
Avinash Patilf752dcd2012-05-08 18:30:26 -07001407struct host_cmd_tlv_auth_type {
1408 struct host_cmd_tlv tlv;
1409 u8 auth_type;
1410} __packed;
1411
1412struct host_cmd_tlv_encrypt_protocol {
1413 struct host_cmd_tlv tlv;
1414 __le16 proto;
1415} __packed;
1416
Avinash Patil12190c52012-05-08 18:30:24 -07001417struct host_cmd_tlv_ssid {
1418 struct host_cmd_tlv tlv;
1419 u8 ssid[0];
1420} __packed;
1421
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001422struct host_cmd_tlv_rates {
1423 struct host_cmd_tlv tlv;
1424 u8 rates[0];
1425} __packed;
1426
Avinash Patil605b73a2012-05-16 21:24:55 -07001427struct host_cmd_tlv_bcast_ssid {
1428 struct host_cmd_tlv tlv;
1429 u8 bcast_ctl;
1430} __packed;
1431
Avinash Patil12190c52012-05-08 18:30:24 -07001432struct host_cmd_tlv_beacon_period {
1433 struct host_cmd_tlv tlv;
1434 __le16 period;
1435} __packed;
1436
1437struct host_cmd_tlv_dtim_period {
1438 struct host_cmd_tlv tlv;
1439 u8 period;
1440} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001441
Avinash Patil9b930ea2012-05-08 18:30:23 -07001442struct host_cmd_tlv_frag_threshold {
1443 struct host_cmd_tlv tlv;
1444 __le16 frag_thr;
1445} __packed;
1446
1447struct host_cmd_tlv_rts_threshold {
1448 struct host_cmd_tlv tlv;
1449 __le16 rts_thr;
1450} __packed;
1451
1452struct host_cmd_tlv_retry_limit {
1453 struct host_cmd_tlv tlv;
1454 u8 limit;
1455} __packed;
1456
Avinash Patil75edd2c2012-05-08 18:30:18 -07001457struct host_cmd_tlv_mac_addr {
1458 struct host_cmd_tlv tlv;
1459 u8 mac_addr[ETH_ALEN];
1460} __packed;
1461
Avinash Patil4db16a12012-05-08 18:30:20 -07001462struct host_cmd_tlv_channel_band {
1463 struct host_cmd_tlv tlv;
1464 u8 band_config;
1465 u8 channel;
1466} __packed;
1467
Kevin Gan8b4509f2012-09-25 20:23:45 -07001468struct host_cmd_tlv_ageout_timer {
1469 struct host_cmd_tlv tlv;
1470 __le32 sta_ao_timer;
1471} __packed;
1472
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001473struct host_cmd_ds_version_ext {
1474 u8 version_str_sel;
1475 char version_str[128];
1476} __packed;
1477
Stone Piao3cec6872012-09-25 20:23:34 -07001478struct host_cmd_ds_mgmt_frame_reg {
1479 __le16 action;
1480 __le32 mask;
1481} __packed;
1482
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001483struct host_cmd_ds_p2p_mode_cfg {
1484 __le16 action;
1485 __le16 mode;
1486} __packed;
1487
Stone Piao7feb4c42012-09-25 20:23:36 -07001488struct host_cmd_ds_remain_on_chan {
1489 __le16 action;
1490 u8 status;
1491 u8 reserved;
1492 u8 band_cfg;
1493 u8 channel;
1494 __le32 duration;
1495} __packed;
1496
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001497struct host_cmd_ds_802_11_ibss_status {
1498 __le16 action;
1499 __le16 enable;
1500 u8 bssid[ETH_ALEN];
1501 __le16 beacon_interval;
1502 __le16 atim_window;
1503 __le16 use_g_rate_protect;
1504} __packed;
1505
1506#define CONNECTION_TYPE_INFRA 0
1507#define CONNECTION_TYPE_ADHOC 1
Stone Piao9197ab92012-09-25 20:23:42 -07001508#define CONNECTION_TYPE_AP 2
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001509
1510struct host_cmd_ds_set_bss_mode {
1511 u8 con_type;
1512} __packed;
1513
Amitkumar Karward930fae2011-10-11 17:41:21 -07001514struct host_cmd_ds_pcie_details {
1515 /* TX buffer descriptor ring address */
1516 u32 txbd_addr_lo;
1517 u32 txbd_addr_hi;
1518 /* TX buffer descriptor ring count */
1519 u32 txbd_count;
1520
1521 /* RX buffer descriptor ring address */
1522 u32 rxbd_addr_lo;
1523 u32 rxbd_addr_hi;
1524 /* RX buffer descriptor ring count */
1525 u32 rxbd_count;
1526
1527 /* Event buffer descriptor ring address */
1528 u32 evtbd_addr_lo;
1529 u32 evtbd_addr_hi;
1530 /* Event buffer descriptor ring count */
1531 u32 evtbd_count;
1532
1533 /* Sleep cookie buffer physical address */
1534 u32 sleep_cookie_addr_lo;
1535 u32 sleep_cookie_addr_hi;
1536} __packed;
1537
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001538struct mwifiex_ie_types_rssi_threshold {
1539 struct mwifiex_ie_types_header header;
1540 u8 abs_value;
1541 u8 evt_freq;
1542} __packed;
1543
1544struct host_cmd_ds_802_11_subsc_evt {
1545 __le16 action;
1546 __le16 events;
1547} __packed;
1548
Avinash Patilede98bf2012-05-08 18:30:28 -07001549struct mwifiex_ie {
1550 __le16 ie_index;
1551 __le16 mgmt_subtype_mask;
1552 __le16 ie_length;
1553 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1554} __packed;
1555
1556#define MAX_MGMT_IE_INDEX 16
1557struct mwifiex_ie_list {
1558 __le16 type;
1559 __le16 len;
1560 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1561} __packed;
1562
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001563struct host_cmd_ds_command {
1564 __le16 command;
1565 __le16 size;
1566 __le16 seq_num;
1567 __le16 result;
1568 union {
1569 struct host_cmd_ds_get_hw_spec hw_spec;
1570 struct host_cmd_ds_mac_control mac_ctrl;
1571 struct host_cmd_ds_802_11_mac_address mac_addr;
1572 struct host_cmd_ds_mac_multicast_adr mc_addr;
1573 struct host_cmd_ds_802_11_get_log get_log;
1574 struct host_cmd_ds_802_11_rssi_info rssi_info;
1575 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1576 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001577 struct host_cmd_ds_tx_rate_query tx_rate;
1578 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1579 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001580 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001581 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1582 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001583 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1584 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1585 struct host_cmd_ds_802_11_scan scan;
1586 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1587 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1588 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1589 struct host_cmd_ds_802_11_associate associate;
1590 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1591 struct host_cmd_ds_802_11_deauthenticate deauth;
1592 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1593 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1594 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1595 struct host_cmd_ds_802_11d_domain_info domain_info;
1596 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1597 struct host_cmd_ds_11n_addba_req add_ba_req;
1598 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1599 struct host_cmd_ds_11n_delba del_ba;
1600 struct host_cmd_ds_txbuf_cfg tx_buf;
1601 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1602 struct host_cmd_ds_11n_cfg htcfg;
1603 struct host_cmd_ds_wmm_get_status get_wmm_status;
1604 struct host_cmd_ds_802_11_key_material key_material;
1605 struct host_cmd_ds_version_ext verext;
Stone Piao3cec6872012-09-25 20:23:34 -07001606 struct host_cmd_ds_mgmt_frame_reg reg_mask;
Stone Piao7feb4c42012-09-25 20:23:36 -07001607 struct host_cmd_ds_remain_on_chan roc_cfg;
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001608 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001609 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1610 struct host_cmd_ds_mac_reg_access mac_reg;
1611 struct host_cmd_ds_bbp_reg_access bbp_reg;
1612 struct host_cmd_ds_rf_reg_access rf_reg;
1613 struct host_cmd_ds_pmic_reg_access pmic_reg;
1614 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001615 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001616 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001617 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001618 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001619 } params;
1620} __packed;
1621
1622struct mwifiex_opt_sleep_confirm {
1623 __le16 command;
1624 __le16 size;
1625 __le16 seq_num;
1626 __le16 result;
1627 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001628 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001629} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001630#endif /* !_MWIFIEX_FW_H_ */