blob: 98269bfd2b31e083ce78907ebaf11a7a0ddf087e [file] [log] [blame]
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001/*
2 * Marvell Wireless LAN device driver: Firmware specific macros & structures
3 *
Xinming Hu65da33f2014-06-19 21:38:57 -07004 * Copyright (C) 2011-2014, Marvell International Ltd.
Bing Zhao5e6e3a92011-03-21 18:00:50 -07005 *
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];
Amitkumar Karwara6efc5b2013-12-02 23:17:49 -080033 __be16 snap_type;
Bing Zhao5e6e3a92011-03-21 18:00:50 -070034};
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 | \
Bing Zhaof25b1432014-02-07 16:21:01 -080053 BAND_AN | 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) | \
Bing Zhaof25b1432014-02-07 16:21:01 -080056 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
Bing Zhaof25b1432014-02-07 16:21:01 -080060/* bit 13: 11ac BAND_AAC
61 * bit 12: reserved for lab testing, will be reused for BAND_AN
62 * bit 11: 11n BAND_GN
63 * bit 10: 11a BAND_A
64 * bit 9: 11g BAND_G
65 * bit 8: 11b BAND_B
66 * Map these bits to band capability by right shifting 8 bits.
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080067 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -070068#define GET_FW_DEFAULT_BANDS(adapter) \
Bing Zhaof25b1432014-02-07 16:21:01 -080069 (((adapter->fw_cap_info & 0x2f00) >> 8) & \
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -080070 ALL_802_11_BANDS)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070071
Bing Zhao5e6e3a92011-03-21 18:00:50 -070072#define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
73
74#define KEY_INFO_ENABLED 0x01
75enum KEY_TYPE_ID {
76 KEY_TYPE_ID_WEP = 0,
77 KEY_TYPE_ID_TKIP,
78 KEY_TYPE_ID_AES,
79 KEY_TYPE_ID_WAPI,
Ying Luob877f4c2012-08-03 18:06:14 -070080 KEY_TYPE_ID_AES_CMAC,
Bing Zhao5e6e3a92011-03-21 18:00:50 -070081};
Avinash Patile57f1732014-02-07 16:32:35 -080082
83#define WPA_PN_SIZE 8
84#define KEY_PARAMS_FIXED_LEN 10
85#define KEY_INDEX_MASK 0xf
Amitkumar Karwar4b9fede2014-08-19 08:24:25 -040086#define KEY_API_VER_MAJOR_V2 2
Avinash Patile57f1732014-02-07 16:32:35 -080087
Yogesh Ashok Powar6a35a0a2011-04-06 16:46:56 -070088#define KEY_MCAST BIT(0)
89#define KEY_UNICAST BIT(1)
90#define KEY_ENABLED BIT(2)
Avinash Patile57f1732014-02-07 16:32:35 -080091#define KEY_DEFAULT BIT(3)
92#define KEY_TX_KEY BIT(4)
93#define KEY_RX_KEY BIT(5)
Ying Luob877f4c2012-08-03 18:06:14 -070094#define KEY_IGTK BIT(10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070095
Avinash Patile57f1732014-02-07 16:32:35 -080096#define WAPI_KEY_LEN (WLAN_KEY_LEN_SMS4 + PN_LEN + 2)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070097
Bing Zhao5e6e3a92011-03-21 18:00:50 -070098#define MAX_POLL_TRIES 100
Bing Zhao5e6e3a92011-03-21 18:00:50 -070099#define MAX_FIRMWARE_POLL_TRIES 100
100
Amitkumar Karward930fae2011-10-11 17:41:21 -0700101#define FIRMWARE_READY_SDIO 0xfedc
102#define FIRMWARE_READY_PCIE 0xfedcba00
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700103
Amitkumar Karwar4daffe32012-04-18 20:08:28 -0700104enum mwifiex_usb_ep {
105 MWIFIEX_USB_EP_CMD_EVENT = 1,
106 MWIFIEX_USB_EP_DATA = 2,
107};
108
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700109enum MWIFIEX_802_11_PRIVACY_FILTER {
110 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
111 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
112};
113
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700114#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
Stone Piao2dbaf752012-09-25 20:23:35 -0700115#define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700116
Avinash Patile76268d2012-05-08 18:30:27 -0700117#define UAP_BSS_PARAMS_I 0
Avinash Patilede98bf2012-05-08 18:30:28 -0700118#define UAP_CUSTOM_IE_I 1
119#define MWIFIEX_AUTO_IDX_MASK 0xffff
120#define MWIFIEX_DELETE_MASK 0x0000
Avinash Patilf31acab2012-05-08 18:30:29 -0700121#define MGMT_MASK_ASSOC_REQ 0x01
122#define MGMT_MASK_REASSOC_REQ 0x04
123#define MGMT_MASK_ASSOC_RESP 0x02
124#define MGMT_MASK_REASSOC_RESP 0x08
125#define MGMT_MASK_PROBE_REQ 0x10
126#define MGMT_MASK_PROBE_RESP 0x20
127#define MGMT_MASK_BEACON 0x100
Avinash Patile76268d2012-05-08 18:30:27 -0700128
Avinash Patil12190c52012-05-08 18:30:24 -0700129#define TLV_TYPE_UAP_SSID 0x0000
Avinash Patila3c2c4f2012-08-27 20:32:53 -0700130#define TLV_TYPE_UAP_RATES 0x0001
Avinash Patil8a73dd62015-06-03 16:59:41 +0530131#define TLV_TYPE_PWR_CONSTRAINT 0x0020
Avinash Patil12190c52012-05-08 18:30:24 -0700132
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700133#define PROPRIETARY_TLV_BASE_ID 0x0100
134#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
135#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
136#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700137#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700138#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700139#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
140#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
141#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700142#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700143#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700144#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Amitkumar Karwar21f58d202014-02-11 18:39:56 -0800145#define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700146#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700147#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
148#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil605b73a2012-05-16 21:24:55 -0700149#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700150#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700151#define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
Avinash Patil96893532012-06-15 12:21:55 -0700152#define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700153#define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
154#define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
155#define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700156#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700157#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
158#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
159#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Amitkumar Karwar21f58d202014-02-11 18:39:56 -0800160#define TLV_TYPE_BSS_SCAN_RSP (PROPRIETARY_TLV_BASE_ID + 86)
161#define TLV_TYPE_BSS_SCAN_INFO (PROPRIETARY_TLV_BASE_ID + 87)
Avinash Patil0a694d62015-01-28 15:54:22 +0530162#define TLV_TYPE_CHANRPT_11H_BASIC (PROPRIETARY_TLV_BASE_ID + 91)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700163#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700164#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700165#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700166#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700167#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
168#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Kevin Gan8b4509f2012-09-25 20:23:45 -0700169#define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
Avinash Patilf752dcd2012-05-08 18:30:26 -0700170#define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
171#define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
Avinash Patil4e6ee912015-06-22 19:06:07 +0530172#define TLV_TYPE_TX_PAUSE (PROPRIETARY_TLV_BASE_ID + 148)
Amitkumar Karwar562fc5b2013-08-05 18:52:00 -0700173#define TLV_TYPE_COALESCE_RULE (PROPRIETARY_TLV_BASE_ID + 154)
Avinash Patile57f1732014-02-07 16:32:35 -0800174#define TLV_TYPE_KEY_PARAM_V2 (PROPRIETARY_TLV_BASE_ID + 156)
Avinash Patil8d6b5382015-06-22 19:06:23 +0530175#define TLV_TYPE_MULTI_CHAN_INFO (PROPRIETARY_TLV_BASE_ID + 183)
Avinash Patild29caf22014-05-06 22:02:43 -0700176#define TLV_TYPE_TDLS_IDLE_TIMEOUT (PROPRIETARY_TLV_BASE_ID + 194)
Avinash Patilcb91be82014-09-12 20:08:54 +0530177#define TLV_TYPE_SCAN_CHANNEL_GAP (PROPRIETARY_TLV_BASE_ID + 197)
178#define TLV_TYPE_API_REV (PROPRIETARY_TLV_BASE_ID + 199)
Avinash Patilbf354432014-10-31 16:08:26 +0530179#define TLV_TYPE_CHANNEL_STATS (PROPRIETARY_TLV_BASE_ID + 198)
Chunfan Chend219b7e2015-06-10 06:19:48 -0700180#define TLV_BTCOEX_WL_AGGR_WINSIZE (PROPRIETARY_TLV_BASE_ID + 202)
181#define TLV_BTCOEX_WL_SCANTIME (PROPRIETARY_TLV_BASE_ID + 203)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700182
183#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
184
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700185#define SSN_MASK 0xfff0
186
187#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700188#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700189
190#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
191
192#define BA_STREAM_NOT_ALLOWED 0xff
193
194#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700195 priv->adapter->config_bands & BAND_AN) && \
196 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700197#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
198 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
199
200#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
201#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700202
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700203#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Avinash Patilb23bce22014-02-07 16:27:32 -0800204#define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14))
Avinash Patild5b036c2015-06-22 19:06:20 +0530205#define ISSUPP_DRCS_ENABLED(FwCapInfo) (FwCapInfo & BIT(15))
Zhaoyang Liu92263a82015-03-13 17:37:58 +0530206#define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16))
Marc Yang6d2bd912011-03-25 19:47:02 -0700207
Avinash Patil22281252012-06-15 12:21:53 -0700208#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
209 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
210 IEEE80211_HT_CAP_SM_PS)
211
Amitkumar Karwar645097c2014-02-07 16:27:26 -0800212#define MWIFIEX_DEF_11N_TX_BF_CAP 0x09E1E008
213
Avinash Patil22281252012-06-15 12:21:53 -0700214#define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
215
Maithili Hinge474a41e2014-03-18 22:24:10 -0700216#define GET_RXSTBC(x) (x & IEEE80211_HT_CAP_RX_STBC)
217#define MWIFIEX_RX_STBC1 0x0100
218#define MWIFIEX_RX_STBC12 0x0200
219#define MWIFIEX_RX_STBC123 0x0300
220
Marc Yang6d2bd912011-03-25 19:47:02 -0700221/* dev_cap bitmap
222 * BIT
223 * 0-16 reserved
224 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
225 * 18-22 reserved
226 * 23 IEEE80211_HT_CAP_SGI_20
227 * 24 IEEE80211_HT_CAP_SGI_40
228 * 25 IEEE80211_HT_CAP_TX_STBC
229 * 26 IEEE80211_HT_CAP_RX_STBC
230 * 27-28 reserved
231 * 29 IEEE80211_HT_CAP_GRN_FLD
232 * 30-31 reserved
233 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700234#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700235#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
236#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
237#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
238#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
239#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
Avinash Patildd0d83c2012-11-27 12:09:20 -0800240#define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
241#define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
Amitkumar Karwar645097c2014-02-07 16:27:26 -0800242#define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & BIT(30))
Avinash Patil396939f2014-05-06 22:02:45 -0700243#define ISALLOWED_CHANWIDTH40(ht_param) (ht_param & BIT(2))
Avinash Patil4f3dfdf2014-12-26 03:02:34 -0800244#define GETSUPP_TXBASTREAMS(Dot11nDevCap) ((Dot11nDevCap >> 18) & 0xF)
Marc Yang6d2bd912011-03-25 19:47:02 -0700245
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700246/* httxcfg bitmap
247 * 0 reserved
248 * 1 20/40 Mhz enable(1)/disable(0)
249 * 2-3 reserved
250 * 4 green field enable(1)/disable(0)
251 * 5 short GI in 20 Mhz enable(1)/disable(0)
252 * 6 short GI in 40 Mhz enable(1)/disable(0)
253 * 7-15 reserved
254 */
255#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
256
Amitkumar Karwara5333912014-02-27 19:35:18 -0800257/* 11AC Tx and Rx MCS map for 1x1 mode:
258 * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1
259 * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 7 streams
260 */
261#define MWIFIEX_11AC_MCS_MAP_1X1 0xfffefffe
262
263/* 11AC Tx and Rx MCS map for 2x2 mode:
264 * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1 and 2
265 * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 6 streams
266 */
267#define MWIFIEX_11AC_MCS_MAP_2X2 0xfffafffa
268
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700269#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700270#define SETHT_MCS32(x) (x[4] |= 1)
Amitkumar Karwara5333912014-02-27 19:35:18 -0800271#define HT_STREAM_1X1 0x11
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800272#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700273
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700274#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
275
276#define LLC_SNAP_LEN 8
277
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800278/* HW_SPEC fw_cap_info */
279
Bing Zhaof25b1432014-02-07 16:21:01 -0800280#define ISSUPP_11ACENABLED(fw_cap_info) (fw_cap_info & BIT(13))
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800281
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800282#define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
283#define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
284#define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
285 (2 * (nss - 1)))
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800286#define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
287#define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
288
Amitkumar Karwar79d9a542014-02-07 16:27:27 -0800289/* Clear SU Beanformer, MU beanformer, MU beanformee and
290 * sounding dimensions bits
291 */
292#define MWIFIEX_DEF_11AC_CAP_BF_RESET_MASK \
293 (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | \
294 IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE | \
295 IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE | \
296 IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK)
297
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700298#define MOD_CLASS_HR_DSSS 0x03
299#define MOD_CLASS_OFDM 0x07
300#define MOD_CLASS_HT 0x08
301#define HT_BW_20 0
302#define HT_BW_40 1
303
Amitkumar Karwarb8876642013-06-18 16:36:58 -0700304#define DFS_CHAN_MOVE_TIME 10000
305
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700306#define HostCmd_CMD_GET_HW_SPEC 0x0003
307#define HostCmd_CMD_802_11_SCAN 0x0006
308#define HostCmd_CMD_802_11_GET_LOG 0x000b
309#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
310#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
311#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
312#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
313#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
314#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
315#define HostCmd_CMD_RF_REG_ACCESS 0x001b
316#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
Amitkumar Karwarcaa89842012-06-27 19:57:57 -0700317#define HostCmd_CMD_RF_TX_PWR 0x001e
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700318#define HostCmd_CMD_RF_ANTENNA 0x0020
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700319#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
320#define HostCmd_CMD_MAC_CONTROL 0x0028
321#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
322#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
323#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
324#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
325#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
326#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
327#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
328#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700329#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700330#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
331#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
Chin-ran Loc2c6c852015-05-12 00:48:17 +0530332#define HostCmd_CMD_MEM_ACCESS 0x0086
Amitkumar Karwar388ec382013-05-17 17:50:25 -0700333#define HostCmd_CMD_CFG_DATA 0x008f
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700334#define HostCmd_CMD_VERSION_EXT 0x0097
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800335#define HostCmd_CMD_MEF_CFG 0x009a
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700336#define HostCmd_CMD_RSSI_INFO 0x00a4
337#define HostCmd_CMD_FUNC_INIT 0x00a9
338#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patiled5cfbe2015-06-03 16:59:33 +0530339#define HOST_CMD_APCMD_SYS_RESET 0x00af
Avinash Patil40d07032012-05-08 18:30:19 -0700340#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
341#define HostCmd_CMD_UAP_BSS_START 0x00b1
342#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Xinming Hub21783e2015-06-03 16:59:39 +0530343#define HOST_CMD_APCMD_STA_LIST 0x00b3
Avinash Patil0f9e9b82013-05-17 17:50:23 -0700344#define HostCmd_CMD_UAP_STA_DEAUTH 0x00b5
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700345#define HostCmd_CMD_11N_CFG 0x00cd
346#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
347#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
348#define HostCmd_CMD_11N_DELBA 0x00d0
349#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
Avinash Patil85afb182015-01-28 15:54:21 +0530350#define HostCmd_CMD_CHAN_REPORT_REQUEST 0x00dd
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700351#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
352#define HostCmd_CMD_TXPWR_CFG 0x00d1
353#define HostCmd_CMD_TX_RATE_CFG 0x00d6
354#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
355#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700356#define HostCmd_CMD_P2P_MODE_CFG 0x00eb
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700357#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
358#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700359#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Amitkumar Karwar21f58d202014-02-11 18:39:56 -0800360#define HostCmd_CMD_802_11_SCAN_EXT 0x0107
Amitkumar Karwar562fc5b2013-08-05 18:52:00 -0700361#define HostCmd_CMD_COALESCE_CFG 0x010a
Stone Piao3cec6872012-09-25 20:23:34 -0700362#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
Stone Piao7feb4c42012-09-25 20:23:36 -0700363#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -0700364#define HostCmd_CMD_11AC_CFG 0x0112
Xinming Hu449b8bb2015-06-22 19:06:12 +0530365#define HostCmd_CMD_TDLS_CONFIG 0x0100
Avinash Patild5b036c2015-06-22 19:06:20 +0530366#define HostCmd_CMD_MC_POLICY 0x0121
Avinash Patil429d90d2014-02-07 16:27:34 -0800367#define HostCmd_CMD_TDLS_OPER 0x0122
Zhaoyang Liu92263a82015-03-13 17:37:58 +0530368#define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700369
Avinash Patilf752dcd2012-05-08 18:30:26 -0700370#define PROTOCOL_NO_SECURITY 0x01
371#define PROTOCOL_STATIC_WEP 0x02
372#define PROTOCOL_WPA 0x08
373#define PROTOCOL_WPA2 0x20
374#define PROTOCOL_WPA2_MIXED 0x28
375#define PROTOCOL_EAP 0x40
376#define KEY_MGMT_NONE 0x04
377#define KEY_MGMT_PSK 0x02
378#define KEY_MGMT_EAP 0x01
379#define CIPHER_TKIP 0x04
380#define CIPHER_AES_CCMP 0x08
381#define VALID_CIPHER_BITMAP 0x0c
382
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700383enum ENH_PS_MODES {
384 EN_PS = 1,
385 DIS_PS = 2,
386 EN_AUTO_DS = 3,
387 DIS_AUTO_DS = 4,
388 SLEEP_CONFIRM = 5,
389 GET_PS = 0,
390 EN_AUTO_PS = 0xff,
391 DIS_AUTO_PS = 0xfe,
392};
393
Stone Piaoe1a2b7a2012-09-25 20:23:41 -0700394enum P2P_MODES {
395 P2P_MODE_DISABLE = 0,
396 P2P_MODE_DEVICE = 1,
397 P2P_MODE_GO = 2,
398 P2P_MODE_CLIENT = 3,
399};
400
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700401#define HostCmd_RET_BIT 0x8000
402#define HostCmd_ACT_GEN_GET 0x0000
403#define HostCmd_ACT_GEN_SET 0x0001
Stone Piao7feb4c42012-09-25 20:23:36 -0700404#define HostCmd_ACT_GEN_REMOVE 0x0004
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700405#define HostCmd_ACT_BITWISE_SET 0x0002
406#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700407#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700408
409#define HostCmd_ACT_MAC_RX_ON 0x0001
410#define HostCmd_ACT_MAC_TX_ON 0x0002
411#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
412#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
413#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
414#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700415#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
416
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700417#define HostCmd_BSS_MODE_IBSS 0x0002
418#define HostCmd_BSS_MODE_ANY 0x0003
419
420#define HostCmd_SCAN_RADIO_TYPE_BG 0
421#define HostCmd_SCAN_RADIO_TYPE_A 1
422
Amitkumar Karwarcc0b5a62013-03-04 16:27:57 -0800423#define HS_CFG_CANCEL 0xffffffff
424#define HS_CFG_COND_DEF 0x00000000
425#define HS_CFG_GPIO_DEF 0xff
Bing Zhao915f36d2014-05-27 21:39:34 -0700426#define HS_CFG_GAP_DEF 0xff
Amitkumar Karwar0d7f53e2013-03-04 16:27:58 -0800427#define HS_CFG_COND_BROADCAST_DATA 0x00000001
428#define HS_CFG_COND_UNICAST_DATA 0x00000002
429#define HS_CFG_COND_MAC_EVENT 0x00000004
430#define HS_CFG_COND_MULTICAST_DATA 0x00000008
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700431
Avinash Patil12d11102015-06-03 16:59:31 +0530432#define CONNECT_ERR_AUTH_ERR_STA_FAILURE 0xFFFB
433#define CONNECT_ERR_ASSOC_ERR_TIMEOUT 0xFFFC
434#define CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED 0xFFFD
435#define CONNECT_ERR_AUTH_MSG_UNHANDLED 0xFFFE
436#define CONNECT_ERR_STA_FAILURE 0xFFFF
437
Amitkumar Karwar7532c7d2013-01-17 17:41:57 -0800438
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700439#define CMD_F_HOSTCMD (1 << 0)
440#define CMD_F_CANCELED (1 << 1)
441
442#define HostCmd_CMD_ID_MASK 0x0fff
443
444#define HostCmd_SEQ_NUM_MASK 0x00ff
445
446#define HostCmd_BSS_NUM_MASK 0x0f00
447
448#define HostCmd_BSS_TYPE_MASK 0xf000
449
Amitkumar Karwar8a279d52012-07-02 19:32:33 -0700450#define HostCmd_ACT_SET_RX 0x0001
451#define HostCmd_ACT_SET_TX 0x0002
452#define HostCmd_ACT_SET_BOTH 0x0003
453
454#define RF_ANTENNA_AUTO 0xFFFF
455
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700456#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
457 (((seq) & 0x00ff) | \
458 (((num) & 0x000f) << 8)) | \
459 (((type) & 0x000f) << 12); }
460
461#define HostCmd_GET_SEQ_NO(seq) \
462 ((seq) & HostCmd_SEQ_NUM_MASK)
463
464#define HostCmd_GET_BSS_NO(seq) \
465 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
466
467#define HostCmd_GET_BSS_TYPE(seq) \
468 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
469
470#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
471#define EVENT_LINK_LOST 0x00000003
472#define EVENT_LINK_SENSED 0x00000004
473#define EVENT_MIB_CHANGED 0x00000006
474#define EVENT_INIT_DONE 0x00000007
475#define EVENT_DEAUTHENTICATED 0x00000008
476#define EVENT_DISASSOCIATED 0x00000009
477#define EVENT_PS_AWAKE 0x0000000a
478#define EVENT_PS_SLEEP 0x0000000b
479#define EVENT_MIC_ERR_MULTICAST 0x0000000d
480#define EVENT_MIC_ERR_UNICAST 0x0000000e
481#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
482#define EVENT_ADHOC_BCN_LOST 0x00000011
483
484#define EVENT_WMM_STATUS_CHANGE 0x00000017
485#define EVENT_BG_SCAN_REPORT 0x00000018
486#define EVENT_RSSI_LOW 0x00000019
487#define EVENT_SNR_LOW 0x0000001a
488#define EVENT_MAX_FAIL 0x0000001b
489#define EVENT_RSSI_HIGH 0x0000001c
490#define EVENT_SNR_HIGH 0x0000001d
491#define EVENT_IBSS_COALESCED 0x0000001e
492#define EVENT_DATA_RSSI_LOW 0x00000024
493#define EVENT_DATA_SNR_LOW 0x00000025
494#define EVENT_DATA_RSSI_HIGH 0x00000026
495#define EVENT_DATA_SNR_HIGH 0x00000027
496#define EVENT_LINK_QUALITY 0x00000028
497#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700498#define EVENT_UAP_STA_DEAUTH 0x0000002c
499#define EVENT_UAP_STA_ASSOC 0x0000002d
500#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700501#define EVENT_PRE_BEACON_LOST 0x00000031
502#define EVENT_ADDBA 0x00000033
503#define EVENT_DELBA 0x00000034
504#define EVENT_BA_STREAM_TIEMOUT 0x00000037
505#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700506#define EVENT_UAP_BSS_IDLE 0x00000043
507#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700508#define EVENT_WEP_ICV_ERR 0x00000046
509#define EVENT_HS_ACT_REQ 0x00000047
510#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700511#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700512#define EVENT_HOSTWAKE_STAIE 0x0000004d
Amitkumar Karwar2a7305c2013-06-19 08:49:05 -0700513#define EVENT_CHANNEL_SWITCH_ANN 0x00000050
Avinash Patil79ff4342014-05-06 22:02:44 -0700514#define EVENT_TDLS_GENERIC_EVENT 0x00000052
Avinash Patil3b57c1a2015-01-28 15:54:23 +0530515#define EVENT_RADAR_DETECTED 0x00000053
Avinash Patil0a694d62015-01-28 15:54:22 +0530516#define EVENT_CHANNEL_REPORT_RDY 0x00000054
Avinash Patil4e6ee912015-06-22 19:06:07 +0530517#define EVENT_TX_DATA_PAUSE 0x00000055
Amitkumar Karwar21f58d202014-02-11 18:39:56 -0800518#define EVENT_EXT_SCAN_REPORT 0x00000058
Stone Piaoeab1c762012-09-25 20:23:37 -0700519#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
Avinash Patil8d6b5382015-06-22 19:06:23 +0530520#define EVENT_MULTI_CHAN_INFO 0x0000006a
Amitkumar Karwar808bbeb2014-11-25 06:43:05 -0800521#define EVENT_TX_STATUS_REPORT 0x00000074
Chunfan Chend219b7e2015-06-10 06:19:48 -0700522#define EVENT_BT_COEX_WLAN_PARA_CHANGE 0X00000076
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700523
524#define EVENT_ID_MASK 0xffff
525#define BSS_NUM_MASK 0xf
526
527#define EVENT_GET_BSS_NUM(event_cause) \
528 (((event_cause) >> 16) & BSS_NUM_MASK)
529
530#define EVENT_GET_BSS_TYPE(event_cause) \
531 (((event_cause) >> 24) & 0x00ff)
532
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800533#define MWIFIEX_MAX_PATTERN_LEN 20
Amitkumar Karwarafd84de42013-08-05 18:51:59 -0700534#define MWIFIEX_MAX_OFFSET_LEN 100
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800535#define STACK_NBYTES 100
536#define TYPE_DNUM 1
537#define TYPE_BYTESEQ 2
538#define MAX_OPERAND 0x40
539#define TYPE_EQ (MAX_OPERAND+1)
540#define TYPE_EQ_DNUM (MAX_OPERAND+2)
541#define TYPE_EQ_BIT (MAX_OPERAND+3)
542#define TYPE_AND (MAX_OPERAND+4)
543#define TYPE_OR (MAX_OPERAND+5)
544#define MEF_MODE_HOST_SLEEP 1
545#define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
Maithili Hingeb533be12015-03-12 00:38:39 -0700546#define MEF_ACTION_AUTO_ARP 0x10
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800547#define MWIFIEX_CRITERIA_BROADCAST BIT(0)
548#define MWIFIEX_CRITERIA_UNICAST BIT(1)
549#define MWIFIEX_CRITERIA_MULTICAST BIT(3)
Maithili Hingeb533be12015-03-12 00:38:39 -0700550#define MWIFIEX_MAX_SUPPORTED_IPADDR 4
Amitkumar Karwar7da060c2013-03-04 16:27:59 -0800551
Avinash Patil429d90d2014-02-07 16:27:34 -0800552#define ACT_TDLS_DELETE 0x00
553#define ACT_TDLS_CREATE 0x01
554#define ACT_TDLS_CONFIG 0x02
Xinming Huf7669872015-06-22 19:06:11 +0530555
556#define TDLS_EVENT_LINK_TEAR_DOWN 3
557#define TDLS_EVENT_CHAN_SWITCH_RESULT 7
558#define TDLS_EVENT_START_CHAN_SWITCH 8
559#define TDLS_EVENT_CHAN_SWITCH_STOPPED 9
560
561#define TDLS_BASE_CHANNEL 0
562#define TDLS_OFF_CHANNEL 1
Avinash Patil429d90d2014-02-07 16:27:34 -0800563
Xinming Hu449b8bb2015-06-22 19:06:12 +0530564#define ACT_TDLS_CS_ENABLE_CONFIG 0x00
565#define ACT_TDLS_CS_INIT 0x06
566#define ACT_TDLS_CS_STOP 0x07
567#define ACT_TDLS_CS_PARAMS 0x08
568
569#define MWIFIEX_DEF_CS_UNIT_TIME 2
570#define MWIFIEX_DEF_CS_THR_OTHERLINK 10
571#define MWIFIEX_DEF_THR_DIRECTLINK 0
572#define MWIFIEX_DEF_CS_TIME 10
573#define MWIFIEX_DEF_CS_TIMEOUT 16
574#define MWIFIEX_DEF_CS_REG_CLASS 12
575#define MWIFIEX_DEF_CS_PERIODICITY 1
576
Amitkumar Karwar8e17ea22014-03-07 19:41:26 -0800577#define MWIFIEX_FW_V15 15
578
Avinash Patilcf075ea2015-01-28 15:54:25 +0530579#define MWIFIEX_MASTER_RADAR_DET_MASK BIT(1)
580
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700581struct mwifiex_ie_types_header {
582 __le16 type;
583 __le16 len;
584} __packed;
585
586struct mwifiex_ie_types_data {
587 struct mwifiex_ie_types_header header;
588 u8 data[1];
589} __packed;
590
591#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
592#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
Avinash Patilb23bce22014-02-07 16:27:32 -0800593#define MWIFIEX_TXPD_FLAGS_TDLS_PACKET 0x10
Avinash Patil09869492014-05-21 22:02:31 -0700594#define MWIFIEX_RXPD_FLAGS_TDLS_PACKET 0x01
Amitkumar Karwar808bbeb2014-11-25 06:43:05 -0800595#define MWIFIEX_TXPD_FLAGS_REQ_TX_STATUS 0x20
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700596
597struct txpd {
598 u8 bss_type;
599 u8 bss_num;
600 __le16 tx_pkt_length;
601 __le16 tx_pkt_offset;
602 __le16 tx_pkt_type;
603 __le32 tx_control;
604 u8 priority;
605 u8 flags;
606 u8 pkt_delay_2ms;
Amitkumar Karwar808bbeb2014-11-25 06:43:05 -0800607 u8 reserved1[2];
608 u8 tx_token_id;
609 u8 reserved[2];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700610} __packed;
611
612struct rxpd {
613 u8 bss_type;
614 u8 bss_num;
Amitkumar Karwared1ea6f2012-08-03 18:06:02 -0700615 __le16 rx_pkt_length;
616 __le16 rx_pkt_offset;
617 __le16 rx_pkt_type;
618 __le16 seq_num;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700619 u8 priority;
620 u8 rx_rate;
621 s8 snr;
622 s8 nf;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800623
624 /* For: Non-802.11 AC cards
625 *
626 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700627 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800628 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
629 *
630 * For: 802.11 AC cards
631 * [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
632 * [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01
633 * BW80 = 10 BW160 = 11
634 * [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
635 * [Bit 5] STBC support Enabled = 1
636 * [Bit 6] LDPC support Enabled = 1
637 * [Bit 7] Reserved
638 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700639 u8 ht_info;
Avinash Patil9d31c1c2014-11-13 21:54:13 +0530640 u8 reserved[3];
Avinash Patil09869492014-05-21 22:02:31 -0700641 u8 flags;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700642} __packed;
643
Avinash Patil838e4f42012-08-03 18:06:08 -0700644struct uap_txpd {
645 u8 bss_type;
646 u8 bss_num;
647 __le16 tx_pkt_length;
648 __le16 tx_pkt_offset;
649 __le16 tx_pkt_type;
650 __le32 tx_control;
651 u8 priority;
652 u8 flags;
653 u8 pkt_delay_2ms;
Amitkumar Karwar808bbeb2014-11-25 06:43:05 -0800654 u8 reserved1[2];
655 u8 tx_token_id;
656 u8 reserved[2];
Avinash Patil838e4f42012-08-03 18:06:08 -0700657};
658
659struct uap_rxpd {
660 u8 bss_type;
661 u8 bss_num;
662 __le16 rx_pkt_length;
663 __le16 rx_pkt_offset;
664 __le16 rx_pkt_type;
665 __le16 seq_num;
666 u8 priority;
Xinming Hu442f6f92015-06-03 16:59:38 +0530667 u8 rx_rate;
668 s8 snr;
669 s8 nf;
670 u8 ht_info;
671 u8 reserved[3];
672 u8 flags;
Avinash Patil838e4f42012-08-03 18:06:08 -0700673};
674
Avinash Patilbf354432014-10-31 16:08:26 +0530675struct mwifiex_fw_chan_stats {
676 u8 chan_num;
677 u8 bandcfg;
678 u8 flags;
679 s8 noise;
680 __le16 total_bss;
681 __le16 cca_scan_dur;
682 __le16 cca_busy_dur;
683} __packed;
684
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700685enum mwifiex_chan_scan_mode_bitmasks {
686 MWIFIEX_PASSIVE_SCAN = BIT(0),
687 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
688};
689
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700690struct mwifiex_chan_scan_param_set {
691 u8 radio_type;
692 u8 chan_number;
693 u8 chan_scan_mode_bitmap;
694 __le16 min_scan_time;
695 __le16 max_scan_time;
696} __packed;
697
698struct mwifiex_ie_types_chan_list_param_set {
699 struct mwifiex_ie_types_header header;
700 struct mwifiex_chan_scan_param_set chan_scan_param[1];
701} __packed;
702
703struct chan_band_param_set {
704 u8 radio_type;
705 u8 chan_number;
706};
707
708struct mwifiex_ie_types_chan_band_list_param_set {
709 struct mwifiex_ie_types_header header;
710 struct chan_band_param_set chan_band_param[1];
711} __packed;
712
713struct mwifiex_ie_types_rates_param_set {
714 struct mwifiex_ie_types_header header;
715 u8 rates[1];
716} __packed;
717
718struct mwifiex_ie_types_ssid_param_set {
719 struct mwifiex_ie_types_header header;
720 u8 ssid[1];
721} __packed;
722
723struct mwifiex_ie_types_num_probes {
724 struct mwifiex_ie_types_header header;
725 __le16 num_probes;
726} __packed;
727
Avinash Patilcb91be82014-09-12 20:08:54 +0530728struct mwifiex_ie_types_scan_chan_gap {
729 struct mwifiex_ie_types_header header;
730 /* time gap in TUs to be used between two consecutive channels scan */
731 __le16 chan_gap;
732} __packed;
733
Avinash Patilbf354432014-10-31 16:08:26 +0530734struct mwifiex_ietypes_chanstats {
735 struct mwifiex_ie_types_header header;
736 struct mwifiex_fw_chan_stats chanstats[0];
737} __packed;
738
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700739struct mwifiex_ie_types_wildcard_ssid_params {
740 struct mwifiex_ie_types_header header;
741 u8 max_ssid_length;
742 u8 ssid[1];
743} __packed;
744
745#define TSF_DATA_SIZE 8
746struct mwifiex_ie_types_tsf_timestamp {
747 struct mwifiex_ie_types_header header;
748 u8 tsf_data[1];
749} __packed;
750
751struct mwifiex_cf_param_set {
752 u8 cfp_cnt;
753 u8 cfp_period;
Ujjal Roy4348d082013-12-02 23:17:48 -0800754 __le16 cfp_max_duration;
755 __le16 cfp_duration_remaining;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700756} __packed;
757
758struct mwifiex_ibss_param_set {
Ujjal Roy4348d082013-12-02 23:17:48 -0800759 __le16 atim_window;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700760} __packed;
761
762struct mwifiex_ie_types_ss_param_set {
763 struct mwifiex_ie_types_header header;
764 union {
765 struct mwifiex_cf_param_set cf_param_set[1];
766 struct mwifiex_ibss_param_set ibss_param_set[1];
767 } cf_ibss;
768} __packed;
769
770struct mwifiex_fh_param_set {
Ujjal Roy4348d082013-12-02 23:17:48 -0800771 __le16 dwell_time;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700772 u8 hop_set;
773 u8 hop_pattern;
774 u8 hop_index;
775} __packed;
776
777struct mwifiex_ds_param_set {
778 u8 current_chan;
779} __packed;
780
781struct mwifiex_ie_types_phy_param_set {
782 struct mwifiex_ie_types_header header;
783 union {
784 struct mwifiex_fh_param_set fh_param_set[1];
785 struct mwifiex_ds_param_set ds_param_set[1];
786 } fh_ds;
787} __packed;
788
789struct mwifiex_ie_types_auth_type {
790 struct mwifiex_ie_types_header header;
791 __le16 auth_type;
792} __packed;
793
794struct mwifiex_ie_types_vendor_param_set {
795 struct mwifiex_ie_types_header header;
796 u8 ie[MWIFIEX_MAX_VSIE_LEN];
797};
798
Bing Zhao30fa51c2014-07-11 20:57:13 -0700799#define MWIFIEX_TDLS_IDLE_TIMEOUT_IN_SEC 60
Avinash Patild29caf22014-05-06 22:02:43 -0700800
801struct mwifiex_ie_types_tdls_idle_timeout {
802 struct mwifiex_ie_types_header header;
803 __le16 value;
804} __packed;
805
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700806struct mwifiex_ie_types_rsn_param_set {
807 struct mwifiex_ie_types_header header;
808 u8 rsn_ie[1];
809} __packed;
810
811#define KEYPARAMSET_FIXED_LEN 6
812
813struct mwifiex_ie_type_key_param_set {
814 __le16 type;
815 __le16 length;
816 __le16 key_type_id;
817 __le16 key_info;
818 __le16 key_len;
819 u8 key[50];
820} __packed;
821
Ying Luob877f4c2012-08-03 18:06:14 -0700822#define IGTK_PN_LEN 8
823
824struct mwifiex_cmac_param {
825 u8 ipn[IGTK_PN_LEN];
826 u8 key[WLAN_KEY_LEN_AES_CMAC];
827} __packed;
828
Avinash Patile57f1732014-02-07 16:32:35 -0800829struct mwifiex_wep_param {
830 __le16 key_len;
831 u8 key[WLAN_KEY_LEN_WEP104];
832} __packed;
833
834struct mwifiex_tkip_param {
835 u8 pn[WPA_PN_SIZE];
836 __le16 key_len;
837 u8 key[WLAN_KEY_LEN_TKIP];
838} __packed;
839
840struct mwifiex_aes_param {
841 u8 pn[WPA_PN_SIZE];
842 __le16 key_len;
843 u8 key[WLAN_KEY_LEN_CCMP];
844} __packed;
845
846struct mwifiex_wapi_param {
847 u8 pn[PN_LEN];
848 __le16 key_len;
849 u8 key[WLAN_KEY_LEN_SMS4];
850} __packed;
851
852struct mwifiex_cmac_aes_param {
853 u8 ipn[IGTK_PN_LEN];
854 __le16 key_len;
855 u8 key[WLAN_KEY_LEN_AES_CMAC];
856} __packed;
857
858struct mwifiex_ie_type_key_param_set_v2 {
859 __le16 type;
860 __le16 len;
861 u8 mac_addr[ETH_ALEN];
862 u8 key_idx;
863 u8 key_type;
864 __le16 key_info;
865 union {
866 struct mwifiex_wep_param wep;
867 struct mwifiex_tkip_param tkip;
868 struct mwifiex_aes_param aes;
869 struct mwifiex_wapi_param wapi;
870 struct mwifiex_cmac_aes_param cmac_aes;
871 } key_params;
872} __packed;
873
874struct host_cmd_ds_802_11_key_material_v2 {
875 __le16 action;
876 struct mwifiex_ie_type_key_param_set_v2 key_param_set;
877} __packed;
878
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700879struct host_cmd_ds_802_11_key_material {
880 __le16 action;
881 struct mwifiex_ie_type_key_param_set key_param_set;
882} __packed;
883
884struct host_cmd_ds_gen {
Ujjal Roy4348d082013-12-02 23:17:48 -0800885 __le16 command;
886 __le16 size;
887 __le16 seq_num;
888 __le16 result;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700889};
890
891#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
892
893enum sleep_resp_ctrl {
894 RESP_NOT_NEEDED = 0,
895 RESP_NEEDED,
896};
897
898struct mwifiex_ps_param {
899 __le16 null_pkt_interval;
900 __le16 multiple_dtims;
901 __le16 bcn_miss_timeout;
902 __le16 local_listen_interval;
903 __le16 adhoc_wake_period;
904 __le16 mode;
905 __le16 delay_to_ps;
906};
907
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700908#define BITMAP_AUTO_DS 0x01
909#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700910
911struct mwifiex_ie_types_auto_ds_param {
912 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700913 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700914} __packed;
915
916struct mwifiex_ie_types_ps_param {
917 struct mwifiex_ie_types_header header;
918 struct mwifiex_ps_param param;
919} __packed;
920
921struct host_cmd_ds_802_11_ps_mode_enh {
922 __le16 action;
923
924 union {
925 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700926 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700927 } params;
928} __packed;
929
Amitkumar Karwar4b9fede2014-08-19 08:24:25 -0400930enum API_VER_ID {
Avinash Patil7f445d02014-02-07 16:30:42 -0800931 KEY_API_VER_ID = 1,
Amitkumar Karwar89be7ce2014-08-19 08:24:26 -0400932 FW_API_VER_ID = 2,
Avinash Patil7f445d02014-02-07 16:30:42 -0800933};
934
Amitkumar Karwar4b9fede2014-08-19 08:24:25 -0400935struct hw_spec_api_rev {
Avinash Patil7f445d02014-02-07 16:30:42 -0800936 struct mwifiex_ie_types_header header;
937 __le16 api_id;
938 u8 major_ver;
939 u8 minor_ver;
940} __packed;
941
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700942struct host_cmd_ds_get_hw_spec {
943 __le16 hw_if_version;
944 __le16 version;
945 __le16 reserved;
946 __le16 num_of_mcast_adr;
947 u8 permanent_addr[ETH_ALEN];
948 __le16 region_code;
949 __le16 number_of_antenna;
950 __le32 fw_release_number;
951 __le32 reserved_1;
952 __le32 reserved_2;
953 __le32 reserved_3;
954 __le32 fw_cap_info;
955 __le32 dot_11n_dev_cap;
956 u8 dev_mcs_support;
957 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -0800958 __le16 mgmt_buf_count; /* mgmt IE buffer count */
959 __le32 reserved_5;
960 __le32 reserved_6;
961 __le32 dot_11ac_dev_cap;
962 __le32 dot_11ac_mcs_support;
Avinash Patil7f445d02014-02-07 16:30:42 -0800963 u8 tlvs[0];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700964} __packed;
965
966struct host_cmd_ds_802_11_rssi_info {
967 __le16 action;
968 __le16 ndata;
969 __le16 nbcn;
970 __le16 reserved[9];
971 long long reserved_1;
972};
973
974struct host_cmd_ds_802_11_rssi_info_rsp {
975 __le16 action;
976 __le16 ndata;
977 __le16 nbcn;
978 __le16 data_rssi_last;
979 __le16 data_nf_last;
980 __le16 data_rssi_avg;
981 __le16 data_nf_avg;
982 __le16 bcn_rssi_last;
983 __le16 bcn_nf_last;
984 __le16 bcn_rssi_avg;
985 __le16 bcn_nf_avg;
986 long long tsf_bcn;
987};
988
989struct host_cmd_ds_802_11_mac_address {
990 __le16 action;
991 u8 mac_addr[ETH_ALEN];
992};
993
994struct host_cmd_ds_mac_control {
995 __le16 action;
996 __le16 reserved;
997};
998
999struct host_cmd_ds_mac_multicast_adr {
1000 __le16 action;
1001 __le16 num_of_adrs;
1002 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
1003} __packed;
1004
1005struct host_cmd_ds_802_11_deauthenticate {
1006 u8 mac_addr[ETH_ALEN];
1007 __le16 reason_code;
1008} __packed;
1009
1010struct host_cmd_ds_802_11_associate {
1011 u8 peer_sta_addr[ETH_ALEN];
1012 __le16 cap_info_bitmap;
1013 __le16 listen_interval;
1014 __le16 beacon_period;
1015 u8 dtim_period;
1016} __packed;
1017
1018struct ieee_types_assoc_rsp {
1019 __le16 cap_info_bitmap;
1020 __le16 status_code;
1021 __le16 a_id;
1022 u8 ie_buffer[1];
1023} __packed;
1024
1025struct host_cmd_ds_802_11_associate_rsp {
1026 struct ieee_types_assoc_rsp assoc_rsp;
1027} __packed;
1028
1029struct ieee_types_cf_param_set {
1030 u8 element_id;
1031 u8 len;
1032 u8 cfp_cnt;
1033 u8 cfp_period;
Ujjal Roy4348d082013-12-02 23:17:48 -08001034 __le16 cfp_max_duration;
1035 __le16 cfp_duration_remaining;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001036} __packed;
1037
1038struct ieee_types_ibss_param_set {
1039 u8 element_id;
1040 u8 len;
1041 __le16 atim_window;
1042} __packed;
1043
1044union ieee_types_ss_param_set {
1045 struct ieee_types_cf_param_set cf_param_set;
1046 struct ieee_types_ibss_param_set ibss_param_set;
1047} __packed;
1048
1049struct ieee_types_fh_param_set {
1050 u8 element_id;
1051 u8 len;
1052 __le16 dwell_time;
1053 u8 hop_set;
1054 u8 hop_pattern;
1055 u8 hop_index;
1056} __packed;
1057
1058struct ieee_types_ds_param_set {
1059 u8 element_id;
1060 u8 len;
1061 u8 current_chan;
1062} __packed;
1063
1064union ieee_types_phy_param_set {
1065 struct ieee_types_fh_param_set fh_param_set;
1066 struct ieee_types_ds_param_set ds_param_set;
1067} __packed;
1068
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001069struct ieee_types_oper_mode_ntf {
1070 u8 element_id;
1071 u8 len;
1072 u8 oper_mode;
1073} __packed;
1074
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001075struct host_cmd_ds_802_11_ad_hoc_start {
1076 u8 ssid[IEEE80211_MAX_SSID_LEN];
1077 u8 bss_mode;
1078 __le16 beacon_period;
1079 u8 dtim_period;
1080 union ieee_types_ss_param_set ss_param_set;
1081 union ieee_types_phy_param_set phy_param_set;
1082 u16 reserved1;
1083 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -08001084 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001085} __packed;
1086
1087struct host_cmd_ds_802_11_ad_hoc_result {
1088 u8 pad[3];
1089 u8 bssid[ETH_ALEN];
1090} __packed;
1091
1092struct adhoc_bss_desc {
1093 u8 bssid[ETH_ALEN];
1094 u8 ssid[IEEE80211_MAX_SSID_LEN];
1095 u8 bss_mode;
1096 __le16 beacon_period;
1097 u8 dtim_period;
1098 u8 time_stamp[8];
1099 u8 local_time[8];
1100 union ieee_types_phy_param_set phy_param_set;
1101 union ieee_types_ss_param_set ss_param_set;
1102 __le16 cap_info_bitmap;
1103 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
1104
1105 /*
1106 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
1107 * It is used in the Adhoc join command and will cause a
1108 * binary layout mismatch with the firmware
1109 */
1110} __packed;
1111
1112struct host_cmd_ds_802_11_ad_hoc_join {
1113 struct adhoc_bss_desc bss_descriptor;
1114 u16 reserved1;
1115 u16 reserved2;
1116} __packed;
1117
1118struct host_cmd_ds_802_11_get_log {
1119 __le32 mcast_tx_frame;
1120 __le32 failed;
1121 __le32 retry;
1122 __le32 multi_retry;
1123 __le32 frame_dup;
1124 __le32 rts_success;
1125 __le32 rts_failure;
1126 __le32 ack_failure;
1127 __le32 rx_frag;
1128 __le32 mcast_rx_frame;
1129 __le32 fcs_error;
1130 __le32 tx_frame;
1131 __le32 reserved;
1132 __le32 wep_icv_err_cnt[4];
Xinming Hud35b6392014-12-23 19:14:06 +05301133 __le32 bcn_rcv_cnt;
1134 __le32 bcn_miss_cnt;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001135};
1136
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001137/* Enumeration for rate format */
1138enum _mwifiex_rate_format {
1139 MWIFIEX_RATE_FORMAT_LG = 0,
1140 MWIFIEX_RATE_FORMAT_HT,
1141 MWIFIEX_RATE_FORMAT_VHT,
1142 MWIFIEX_RATE_FORMAT_AUTO = 0xFF,
1143};
1144
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001145struct host_cmd_ds_tx_rate_query {
1146 u8 tx_rate;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001147 /* Tx Rate Info: For 802.11 AC cards
1148 *
1149 * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
1150 * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
1151 * [Bit 4] HT/VHT Guard Interval: LGI = 0, SGI = 1
1152 *
1153 * For non-802.11 AC cards
1154 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001155 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001156 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
1157 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001158 u8 ht_info;
1159} __packed;
1160
Avinash Patil4e6ee912015-06-22 19:06:07 +05301161struct mwifiex_tx_pause_tlv {
1162 struct mwifiex_ie_types_header header;
1163 u8 peermac[ETH_ALEN];
1164 u8 tx_pause;
1165 u8 pkt_cnt;
1166} __packed;
1167
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001168enum Host_Sleep_Action {
1169 HS_CONFIGURE = 0x0001,
1170 HS_ACTIVATE = 0x0002,
1171};
1172
1173struct mwifiex_hs_config_param {
1174 __le32 conditions;
1175 u8 gpio;
1176 u8 gap;
1177} __packed;
1178
1179struct hs_activate_param {
Ujjal Roy4348d082013-12-02 23:17:48 -08001180 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001181} __packed;
1182
1183struct host_cmd_ds_802_11_hs_cfg_enh {
1184 __le16 action;
1185
1186 union {
1187 struct mwifiex_hs_config_param hs_config;
1188 struct hs_activate_param hs_activate;
1189 } params;
1190} __packed;
1191
1192enum SNMP_MIB_INDEX {
1193 OP_RATE_SET_I = 1,
1194 DTIM_PERIOD_I = 3,
1195 RTS_THRESH_I = 5,
1196 SHORT_RETRY_LIM_I = 6,
1197 LONG_RETRY_LIM_I = 7,
1198 FRAG_THRESH_I = 8,
1199 DOT11D_I = 9,
Amitkumar Karwar2a7305c2013-06-19 08:49:05 -07001200 DOT11H_I = 10,
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001201};
1202
Avinash Patil12d11102015-06-03 16:59:31 +05301203enum mwifiex_assocmd_failurepoint {
1204 MWIFIEX_ASSOC_CMD_SUCCESS = 0,
1205 MWIFIEX_ASSOC_CMD_FAILURE_ASSOC,
1206 MWIFIEX_ASSOC_CMD_FAILURE_AUTH,
1207 MWIFIEX_ASSOC_CMD_FAILURE_JOIN
1208};
1209
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001210#define MAX_SNMP_BUF_SIZE 128
1211
1212struct host_cmd_ds_802_11_snmp_mib {
1213 __le16 query_type;
1214 __le16 oid;
1215 __le16 buf_size;
1216 u8 value[1];
1217} __packed;
1218
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001219struct mwifiex_rate_scope {
1220 __le16 type;
1221 __le16 length;
1222 __le16 hr_dsss_rate_bitmap;
1223 __le16 ofdm_rate_bitmap;
1224 __le16 ht_mcs_rate_bitmap[8];
Amitkumar Karwara0b7315a2014-03-07 19:41:27 -08001225 __le16 vht_mcs_rate_bitmap[8];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001226} __packed;
1227
1228struct mwifiex_rate_drop_pattern {
1229 __le16 type;
1230 __le16 length;
1231 __le32 rate_drop_mode;
1232} __packed;
1233
1234struct host_cmd_ds_tx_rate_cfg {
1235 __le16 action;
1236 __le16 cfg_index;
1237} __packed;
1238
1239struct mwifiex_power_group {
1240 u8 modulation_class;
1241 u8 first_rate_code;
1242 u8 last_rate_code;
1243 s8 power_step;
1244 s8 power_min;
1245 s8 power_max;
1246 u8 ht_bandwidth;
1247 u8 reserved;
1248} __packed;
1249
1250struct mwifiex_types_power_group {
Amitkumar Karwar930fd352013-10-22 15:24:43 -07001251 __le16 type;
1252 __le16 length;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001253} __packed;
1254
1255struct host_cmd_ds_txpwr_cfg {
1256 __le16 action;
1257 __le16 cfg_index;
1258 __le32 mode;
1259} __packed;
1260
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07001261struct host_cmd_ds_rf_tx_pwr {
1262 __le16 action;
1263 __le16 cur_level;
1264 u8 max_power;
1265 u8 min_power;
1266} __packed;
1267
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07001268struct host_cmd_ds_rf_ant_mimo {
1269 __le16 action_tx;
1270 __le16 tx_ant_mode;
1271 __le16 action_rx;
1272 __le16 rx_ant_mode;
1273};
1274
1275struct host_cmd_ds_rf_ant_siso {
1276 __le16 action;
1277 __le16 ant_mode;
1278};
1279
Avinash Patil429d90d2014-02-07 16:27:34 -08001280struct host_cmd_ds_tdls_oper {
1281 __le16 tdls_action;
1282 __le16 reason;
1283 u8 peer_mac[ETH_ALEN];
1284} __packed;
1285
Xinming Hu449b8bb2015-06-22 19:06:12 +05301286struct mwifiex_tdls_config {
1287 __le16 enable;
1288};
1289
1290struct mwifiex_tdls_config_cs_params {
1291 u8 unit_time;
1292 u8 thr_otherlink;
1293 u8 thr_directlink;
1294};
1295
1296struct mwifiex_tdls_init_cs_params {
1297 u8 peer_mac[ETH_ALEN];
1298 u8 primary_chan;
1299 u8 second_chan_offset;
1300 u8 band;
1301 __le16 switch_time;
1302 __le16 switch_timeout;
1303 u8 reg_class;
1304 u8 periodicity;
1305} __packed;
1306
1307struct mwifiex_tdls_stop_cs_params {
1308 u8 peer_mac[ETH_ALEN];
1309};
1310
1311struct host_cmd_ds_tdls_config {
1312 __le16 tdls_action;
1313 u8 tdls_data[1];
1314} __packed;
1315
Avinash Patil85afb182015-01-28 15:54:21 +05301316struct mwifiex_chan_desc {
1317 __le16 start_freq;
1318 u8 chan_width;
1319 u8 chan_num;
1320} __packed;
1321
1322struct host_cmd_ds_chan_rpt_req {
1323 struct mwifiex_chan_desc chan_desc;
1324 __le32 msec_dwell_time;
1325} __packed;
1326
Avinash Patil0a694d62015-01-28 15:54:22 +05301327struct host_cmd_ds_chan_rpt_event {
1328 __le32 result;
1329 __le64 start_tsf;
1330 __le32 duration;
1331 u8 tlvbuf[0];
1332} __packed;
1333
Zhaoyang Liu92263a82015-03-13 17:37:58 +05301334struct host_cmd_sdio_sp_rx_aggr_cfg {
1335 u8 action;
1336 u8 enable;
1337 __le16 block_size;
1338} __packed;
1339
Amitkumar Karwarb8b3ece2014-02-07 16:23:34 -08001340struct mwifiex_fixed_bcn_param {
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -07001341 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -07001342 __le16 beacon_period;
1343 __le16 cap_info_bitmap;
1344} __packed;
1345
Amitkumar Karwar21f58d202014-02-11 18:39:56 -08001346struct mwifiex_event_scan_result {
1347 __le16 event_id;
1348 u8 bss_index;
1349 u8 bss_type;
1350 u8 more_event;
1351 u8 reserved[3];
1352 __le16 buf_size;
1353 u8 num_of_set;
1354} __packed;
1355
Amitkumar Karwar808bbeb2014-11-25 06:43:05 -08001356struct tx_status_event {
1357 u8 packet_type;
1358 u8 tx_token_id;
1359 u8 status;
1360} __packed;
1361
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001362#define MWIFIEX_USER_SCAN_CHAN_MAX 50
1363
1364#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
1365
1366struct mwifiex_scan_cmd_config {
1367 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -07001368 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001369 */
1370 u8 bss_mode;
1371
1372 /* Specific BSSID used to filter scan results in the firmware */
1373 u8 specific_bssid[ETH_ALEN];
1374
1375 /* Length of TLVs sent in command starting at tlvBuffer */
1376 u32 tlv_buf_len;
1377
1378 /*
1379 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
1380 *
1381 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
1382 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
1383 */
1384 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
1385 here */
1386} __packed;
1387
1388struct mwifiex_user_scan_chan {
1389 u8 chan_number;
1390 u8 radio_type;
1391 u8 scan_type;
1392 u8 reserved;
1393 u32 scan_time;
1394} __packed;
1395
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001396struct mwifiex_user_scan_cfg {
1397 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001398 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001399 */
1400 u8 bss_mode;
1401 /* Configure the number of probe requests for active chan scans */
1402 u8 num_probes;
1403 u8 reserved;
1404 /* BSSID filter sent in the firmware command to limit the results */
1405 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -08001406 /* SSID filter list used in the firmware to limit the scan results */
1407 struct cfg80211_ssid *ssid_list;
1408 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001409 /* Variable number (fixed maximum) of channels to scan up */
1410 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
Avinash Patilcb91be82014-09-12 20:08:54 +05301411 u16 scan_chan_gap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001412} __packed;
1413
1414struct ie_body {
1415 u8 grp_key_oui[4];
1416 u8 ptk_cnt[2];
1417 u8 ptk_body[4];
1418} __packed;
1419
1420struct host_cmd_ds_802_11_scan {
1421 u8 bss_mode;
1422 u8 bssid[ETH_ALEN];
1423 u8 tlv_buffer[1];
1424} __packed;
1425
1426struct host_cmd_ds_802_11_scan_rsp {
1427 __le16 bss_descript_size;
1428 u8 number_of_sets;
1429 u8 bss_desc_and_tlv_buffer[1];
1430} __packed;
1431
Amitkumar Karwar21f58d202014-02-11 18:39:56 -08001432struct host_cmd_ds_802_11_scan_ext {
1433 u32 reserved;
1434 u8 tlv_buffer[1];
1435} __packed;
1436
1437struct mwifiex_ie_types_bss_scan_rsp {
1438 struct mwifiex_ie_types_header header;
1439 u8 bssid[ETH_ALEN];
1440 u8 frame_body[1];
1441} __packed;
1442
1443struct mwifiex_ie_types_bss_scan_info {
1444 struct mwifiex_ie_types_header header;
1445 __le16 rssi;
1446 __le16 anpi;
1447 u8 cca_busy_fraction;
1448 u8 radio_type;
1449 u8 channel;
1450 u8 reserved;
1451 __le64 tsf;
1452} __packed;
1453
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001454struct host_cmd_ds_802_11_bg_scan_query {
1455 u8 flush;
1456} __packed;
1457
1458struct host_cmd_ds_802_11_bg_scan_query_rsp {
Ujjal Roy4348d082013-12-02 23:17:48 -08001459 __le32 report_condition;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001460 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1461} __packed;
1462
1463struct mwifiex_ietypes_domain_param_set {
1464 struct mwifiex_ie_types_header header;
1465 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1466 struct ieee80211_country_ie_triplet triplet[1];
1467} __packed;
1468
1469struct host_cmd_ds_802_11d_domain_info {
1470 __le16 action;
1471 struct mwifiex_ietypes_domain_param_set domain;
1472} __packed;
1473
1474struct host_cmd_ds_802_11d_domain_info_rsp {
1475 __le16 action;
1476 struct mwifiex_ietypes_domain_param_set domain;
1477} __packed;
1478
1479struct host_cmd_ds_11n_addba_req {
1480 u8 add_req_result;
1481 u8 peer_mac_addr[ETH_ALEN];
1482 u8 dialog_token;
1483 __le16 block_ack_param_set;
1484 __le16 block_ack_tmo;
1485 __le16 ssn;
1486} __packed;
1487
1488struct host_cmd_ds_11n_addba_rsp {
1489 u8 add_rsp_result;
1490 u8 peer_mac_addr[ETH_ALEN];
1491 u8 dialog_token;
1492 __le16 status_code;
1493 __le16 block_ack_param_set;
1494 __le16 block_ack_tmo;
1495 __le16 ssn;
1496} __packed;
1497
1498struct host_cmd_ds_11n_delba {
1499 u8 del_result;
1500 u8 peer_mac_addr[ETH_ALEN];
1501 __le16 del_ba_param_set;
1502 __le16 reason_code;
1503 u8 reserved;
1504} __packed;
1505
1506struct host_cmd_ds_11n_batimeout {
1507 u8 tid;
1508 u8 peer_mac_addr[ETH_ALEN];
1509 u8 origninator;
1510} __packed;
1511
1512struct host_cmd_ds_11n_cfg {
1513 __le16 action;
1514 __le16 ht_tx_cap;
1515 __le16 ht_tx_info;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001516 __le16 misc_config; /* Needed for 802.11AC cards only */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001517} __packed;
1518
1519struct host_cmd_ds_txbuf_cfg {
1520 __le16 action;
1521 __le16 buff_size;
1522 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1523 __le16 reserved3;
1524} __packed;
1525
1526struct host_cmd_ds_amsdu_aggr_ctrl {
1527 __le16 action;
1528 __le16 enable;
1529 __le16 curr_buf_size;
1530} __packed;
1531
Avinash Patil0f9e9b82013-05-17 17:50:23 -07001532struct host_cmd_ds_sta_deauth {
1533 u8 mac[ETH_ALEN];
1534 __le16 reason;
1535} __packed;
1536
Xinming Hub21783e2015-06-03 16:59:39 +05301537struct mwifiex_ie_types_sta_info {
1538 struct mwifiex_ie_types_header header;
1539 u8 mac[ETH_ALEN];
1540 u8 power_mfg_status;
1541 s8 rssi;
1542};
1543
1544struct host_cmd_ds_sta_list {
1545 u16 sta_count;
1546 u8 tlv[0];
1547} __packed;
1548
Amitkumar Karwar2a7305c2013-06-19 08:49:05 -07001549struct mwifiex_ie_types_pwr_capability {
1550 struct mwifiex_ie_types_header header;
1551 s8 min_pwr;
1552 s8 max_pwr;
1553};
1554
1555struct mwifiex_ie_types_local_pwr_constraint {
1556 struct mwifiex_ie_types_header header;
1557 u8 chan;
1558 u8 constraint;
1559};
1560
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001561struct mwifiex_ie_types_wmm_param_set {
1562 struct mwifiex_ie_types_header header;
1563 u8 wmm_ie[1];
1564};
1565
1566struct mwifiex_ie_types_wmm_queue_status {
1567 struct mwifiex_ie_types_header header;
1568 u8 queue_index;
1569 u8 disabled;
Ujjal Roy4348d082013-12-02 23:17:48 -08001570 __le16 medium_time;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001571 u8 flow_required;
1572 u8 flow_created;
1573 u32 reserved;
1574};
1575
1576struct ieee_types_vendor_header {
1577 u8 element_id;
1578 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001579 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001580 u8 oui_subtype;
1581 u8 version;
1582} __packed;
1583
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001584struct ieee_types_wmm_parameter {
1585 /*
1586 * WMM Parameter IE - Vendor Specific Header:
1587 * element_id [221/0xdd]
1588 * Len [24]
1589 * Oui [00:50:f2]
1590 * OuiType [2]
1591 * OuiSubType [1]
1592 * Version [1]
1593 */
1594 struct ieee_types_vendor_header vend_hdr;
1595 u8 qos_info_bitmap;
1596 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001597 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001598} __packed;
1599
1600struct ieee_types_wmm_info {
1601
1602 /*
1603 * WMM Info IE - Vendor Specific Header:
1604 * element_id [221/0xdd]
1605 * Len [7]
1606 * Oui [00:50:f2]
1607 * OuiType [2]
1608 * OuiSubType [0]
1609 * Version [1]
1610 */
1611 struct ieee_types_vendor_header vend_hdr;
1612
1613 u8 qos_info_bitmap;
1614} __packed;
1615
1616struct host_cmd_ds_wmm_get_status {
1617 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001618 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001619 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1620} __packed;
1621
1622struct mwifiex_wmm_ac_status {
1623 u8 disabled;
1624 u8 flow_required;
1625 u8 flow_created;
1626};
1627
1628struct mwifiex_ie_types_htcap {
1629 struct mwifiex_ie_types_header header;
1630 struct ieee80211_ht_cap ht_cap;
1631} __packed;
1632
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001633struct mwifiex_ie_types_vhtcap {
1634 struct mwifiex_ie_types_header header;
1635 struct ieee80211_vht_cap vht_cap;
1636} __packed;
1637
Avinash Patil5f6d5982014-02-07 16:30:39 -08001638struct mwifiex_ie_types_aid {
1639 struct mwifiex_ie_types_header header;
1640 __le16 aid;
1641} __packed;
1642
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001643struct mwifiex_ie_types_oper_mode_ntf {
1644 struct mwifiex_ie_types_header header;
1645 u8 oper_mode;
1646} __packed;
1647
1648/* VHT Operations IE */
1649struct mwifiex_ie_types_vht_oper {
1650 struct mwifiex_ie_types_header header;
1651 u8 chan_width;
1652 u8 chan_center_freq_1;
1653 u8 chan_center_freq_2;
1654 /* Basic MCS set map, each 2 bits stands for a NSS */
Ujjal Roy4348d082013-12-02 23:17:48 -08001655 __le16 basic_mcs_map;
Yogesh Ashok Powara5f39052013-02-15 21:44:30 -08001656} __packed;
1657
Avinash Patil54428c52013-01-02 16:56:01 -08001658struct mwifiex_ie_types_wmmcap {
1659 struct mwifiex_ie_types_header header;
1660 struct mwifiex_types_wmm_info wmm_info;
1661} __packed;
1662
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001663struct mwifiex_ie_types_htinfo {
1664 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001665 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001666} __packed;
1667
1668struct mwifiex_ie_types_2040bssco {
1669 struct mwifiex_ie_types_header header;
1670 u8 bss_co_2040;
1671} __packed;
1672
1673struct mwifiex_ie_types_extcap {
1674 struct mwifiex_ie_types_header header;
Avinash Patil68f95b092013-08-23 16:48:22 -07001675 u8 ext_capab[0];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001676} __packed;
1677
Chin-ran Loc2c6c852015-05-12 00:48:17 +05301678struct host_cmd_ds_mem_access {
1679 __le16 action;
1680 __le16 reserved;
1681 __le32 addr;
1682 __le32 value;
1683};
1684
Avinash Patil1f4dfd82014-02-07 16:30:34 -08001685struct mwifiex_ie_types_qos_info {
1686 struct mwifiex_ie_types_header header;
1687 u8 qos_info;
1688} __packed;
1689
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001690struct host_cmd_ds_mac_reg_access {
1691 __le16 action;
1692 __le16 offset;
1693 __le32 value;
1694} __packed;
1695
1696struct host_cmd_ds_bbp_reg_access {
1697 __le16 action;
1698 __le16 offset;
1699 u8 value;
1700 u8 reserved[3];
1701} __packed;
1702
1703struct host_cmd_ds_rf_reg_access {
1704 __le16 action;
1705 __le16 offset;
1706 u8 value;
1707 u8 reserved[3];
1708} __packed;
1709
1710struct host_cmd_ds_pmic_reg_access {
1711 __le16 action;
1712 __le16 offset;
1713 u8 value;
1714 u8 reserved[3];
1715} __packed;
1716
1717struct host_cmd_ds_802_11_eeprom_access {
1718 __le16 action;
1719
1720 __le16 offset;
1721 __le16 byte_count;
1722 u8 value;
1723} __packed;
1724
Avinash Patile5686342012-05-08 18:30:25 -07001725struct mwifiex_assoc_event {
1726 u8 sta_addr[ETH_ALEN];
1727 __le16 type;
1728 __le16 len;
1729 __le16 frame_control;
1730 __le16 cap_info;
1731 __le16 listen_interval;
1732 u8 data[0];
1733} __packed;
1734
Avinash Patil4db16a12012-05-08 18:30:20 -07001735struct host_cmd_ds_sys_config {
1736 __le16 action;
1737 u8 tlv[0];
1738};
Avinash Patilf752dcd2012-05-08 18:30:26 -07001739
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -07001740struct host_cmd_11ac_vht_cfg {
1741 __le16 action;
1742 u8 band_config;
1743 u8 misc_config;
1744 __le32 cap_info;
1745 __le32 mcs_tx_set;
1746 __le32 mcs_rx_set;
1747} __packed;
1748
Avinash Patilf752dcd2012-05-08 18:30:26 -07001749struct host_cmd_tlv_akmp {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001750 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001751 __le16 key_mgmt;
1752 __le16 key_mgmt_operation;
1753} __packed;
1754
1755struct host_cmd_tlv_pwk_cipher {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001756 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001757 __le16 proto;
1758 u8 cipher;
1759 u8 reserved;
1760} __packed;
1761
1762struct host_cmd_tlv_gwk_cipher {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001763 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001764 u8 cipher;
1765 u8 reserved;
1766} __packed;
1767
1768struct host_cmd_tlv_passphrase {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001769 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001770 u8 passphrase[0];
1771} __packed;
1772
Avinash Patil96893532012-06-15 12:21:55 -07001773struct host_cmd_tlv_wep_key {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001774 struct mwifiex_ie_types_header header;
Avinash Patil96893532012-06-15 12:21:55 -07001775 u8 key_index;
1776 u8 is_default;
1777 u8 key[1];
1778};
1779
Avinash Patilf752dcd2012-05-08 18:30:26 -07001780struct host_cmd_tlv_auth_type {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001781 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001782 u8 auth_type;
1783} __packed;
1784
1785struct host_cmd_tlv_encrypt_protocol {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001786 struct mwifiex_ie_types_header header;
Avinash Patilf752dcd2012-05-08 18:30:26 -07001787 __le16 proto;
1788} __packed;
1789
Avinash Patil12190c52012-05-08 18:30:24 -07001790struct host_cmd_tlv_ssid {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001791 struct mwifiex_ie_types_header header;
Avinash Patil12190c52012-05-08 18:30:24 -07001792 u8 ssid[0];
1793} __packed;
1794
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001795struct host_cmd_tlv_rates {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001796 struct mwifiex_ie_types_header header;
Avinash Patila3c2c4f2012-08-27 20:32:53 -07001797 u8 rates[0];
1798} __packed;
1799
Amitkumar Karwar21f58d202014-02-11 18:39:56 -08001800struct mwifiex_ie_types_bssid_list {
1801 struct mwifiex_ie_types_header header;
1802 u8 bssid[ETH_ALEN];
1803} __packed;
1804
Avinash Patil605b73a2012-05-16 21:24:55 -07001805struct host_cmd_tlv_bcast_ssid {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001806 struct mwifiex_ie_types_header header;
Avinash Patil605b73a2012-05-16 21:24:55 -07001807 u8 bcast_ctl;
1808} __packed;
1809
Avinash Patil12190c52012-05-08 18:30:24 -07001810struct host_cmd_tlv_beacon_period {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001811 struct mwifiex_ie_types_header header;
Avinash Patil12190c52012-05-08 18:30:24 -07001812 __le16 period;
1813} __packed;
1814
1815struct host_cmd_tlv_dtim_period {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001816 struct mwifiex_ie_types_header header;
Avinash Patil12190c52012-05-08 18:30:24 -07001817 u8 period;
1818} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001819
Avinash Patil9b930ea2012-05-08 18:30:23 -07001820struct host_cmd_tlv_frag_threshold {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001821 struct mwifiex_ie_types_header header;
Avinash Patil9b930ea2012-05-08 18:30:23 -07001822 __le16 frag_thr;
1823} __packed;
1824
1825struct host_cmd_tlv_rts_threshold {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001826 struct mwifiex_ie_types_header header;
Avinash Patil9b930ea2012-05-08 18:30:23 -07001827 __le16 rts_thr;
1828} __packed;
1829
1830struct host_cmd_tlv_retry_limit {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001831 struct mwifiex_ie_types_header header;
Avinash Patil9b930ea2012-05-08 18:30:23 -07001832 u8 limit;
1833} __packed;
1834
Avinash Patil75edd2c2012-05-08 18:30:18 -07001835struct host_cmd_tlv_mac_addr {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001836 struct mwifiex_ie_types_header header;
Avinash Patil75edd2c2012-05-08 18:30:18 -07001837 u8 mac_addr[ETH_ALEN];
1838} __packed;
1839
Avinash Patil4db16a12012-05-08 18:30:20 -07001840struct host_cmd_tlv_channel_band {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001841 struct mwifiex_ie_types_header header;
Avinash Patil4db16a12012-05-08 18:30:20 -07001842 u8 band_config;
1843 u8 channel;
1844} __packed;
1845
Kevin Gan8b4509f2012-09-25 20:23:45 -07001846struct host_cmd_tlv_ageout_timer {
Amitkumar Karwar6b21a692013-07-22 19:17:57 -07001847 struct mwifiex_ie_types_header header;
Kevin Gan8b4509f2012-09-25 20:23:45 -07001848 __le32 sta_ao_timer;
1849} __packed;
1850
Avinash Patil8a73dd62015-06-03 16:59:41 +05301851struct host_cmd_tlv_power_constraint {
1852 struct mwifiex_ie_types_header header;
1853 u8 constraint;
1854} __packed;
1855
Chunfan Chend219b7e2015-06-10 06:19:48 -07001856struct mwifiex_ie_types_btcoex_scan_time {
1857 struct mwifiex_ie_types_header header;
1858 u8 coex_scan;
1859 u8 reserved;
1860 u16 min_scan_time;
1861 u16 max_scan_time;
1862} __packed;
1863
1864struct mwifiex_ie_types_btcoex_aggr_win_size {
1865 struct mwifiex_ie_types_header header;
1866 u8 coex_win_size;
1867 u8 tx_win_size;
1868 u8 rx_win_size;
1869 u8 reserved;
1870} __packed;
1871
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001872struct host_cmd_ds_version_ext {
1873 u8 version_str_sel;
1874 char version_str[128];
1875} __packed;
1876
Stone Piao3cec6872012-09-25 20:23:34 -07001877struct host_cmd_ds_mgmt_frame_reg {
1878 __le16 action;
1879 __le32 mask;
1880} __packed;
1881
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07001882struct host_cmd_ds_p2p_mode_cfg {
1883 __le16 action;
1884 __le16 mode;
1885} __packed;
1886
Stone Piao7feb4c42012-09-25 20:23:36 -07001887struct host_cmd_ds_remain_on_chan {
1888 __le16 action;
1889 u8 status;
1890 u8 reserved;
1891 u8 band_cfg;
1892 u8 channel;
1893 __le32 duration;
1894} __packed;
1895
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001896struct host_cmd_ds_802_11_ibss_status {
1897 __le16 action;
1898 __le16 enable;
1899 u8 bssid[ETH_ALEN];
1900 __le16 beacon_interval;
1901 __le16 atim_window;
1902 __le16 use_g_rate_protect;
1903} __packed;
1904
Amitkumar Karwar7da060c2013-03-04 16:27:59 -08001905struct mwifiex_fw_mef_entry {
1906 u8 mode;
1907 u8 action;
1908 __le16 exprsize;
1909 u8 expr[0];
1910} __packed;
1911
1912struct host_cmd_ds_mef_cfg {
1913 __le32 criteria;
1914 __le16 num_entries;
1915 struct mwifiex_fw_mef_entry mef_entry[0];
1916} __packed;
1917
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001918#define CONNECTION_TYPE_INFRA 0
1919#define CONNECTION_TYPE_ADHOC 1
Stone Piao9197ab92012-09-25 20:23:42 -07001920#define CONNECTION_TYPE_AP 2
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001921
1922struct host_cmd_ds_set_bss_mode {
1923 u8 con_type;
1924} __packed;
1925
Amitkumar Karward930fae2011-10-11 17:41:21 -07001926struct host_cmd_ds_pcie_details {
1927 /* TX buffer descriptor ring address */
1928 u32 txbd_addr_lo;
1929 u32 txbd_addr_hi;
1930 /* TX buffer descriptor ring count */
1931 u32 txbd_count;
1932
1933 /* RX buffer descriptor ring address */
1934 u32 rxbd_addr_lo;
1935 u32 rxbd_addr_hi;
1936 /* RX buffer descriptor ring count */
1937 u32 rxbd_count;
1938
1939 /* Event buffer descriptor ring address */
1940 u32 evtbd_addr_lo;
1941 u32 evtbd_addr_hi;
1942 /* Event buffer descriptor ring count */
1943 u32 evtbd_count;
1944
1945 /* Sleep cookie buffer physical address */
1946 u32 sleep_cookie_addr_lo;
1947 u32 sleep_cookie_addr_hi;
1948} __packed;
1949
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001950struct mwifiex_ie_types_rssi_threshold {
1951 struct mwifiex_ie_types_header header;
1952 u8 abs_value;
1953 u8 evt_freq;
1954} __packed;
1955
Avinash Patil3b57c1a2015-01-28 15:54:23 +05301956#define MWIFIEX_DFS_REC_HDR_LEN 8
1957#define MWIFIEX_DFS_REC_HDR_NUM 10
1958#define MWIFIEX_BIN_COUNTER_LEN 7
1959
1960struct mwifiex_radar_det_event {
1961 __le32 detect_count;
1962 u8 reg_domain; /*1=fcc, 2=etsi, 3=mic*/
1963 u8 det_type; /*0=none, 1=pw(chirp), 2=pri(radar)*/
1964 __le16 pw_chirp_type;
1965 u8 pw_chirp_idx;
1966 u8 pw_value;
1967 u8 pri_radar_type;
1968 u8 pri_bincnt;
1969 u8 bin_counter[MWIFIEX_BIN_COUNTER_LEN];
1970 u8 num_dfs_records;
1971 u8 dfs_record_hdr[MWIFIEX_DFS_REC_HDR_NUM][MWIFIEX_DFS_REC_HDR_LEN];
1972 __le32 passed;
1973} __packed;
1974
Avinash Patil8d6b5382015-06-22 19:06:23 +05301975struct mwifiex_ie_types_multi_chan_info {
1976 struct mwifiex_ie_types_header header;
1977 __le16 status;
1978 u8 tlv_buffer[0];
1979} __packed;
1980
Avinash Patil0a694d62015-01-28 15:54:22 +05301981struct meas_rpt_map {
1982 u8 rssi:3;
1983 u8 unmeasured:1;
1984 u8 radar:1;
1985 u8 unidentified_sig:1;
1986 u8 ofdm_preamble:1;
1987 u8 bss:1;
1988} __packed;
1989
1990struct mwifiex_ie_types_chan_rpt_data {
1991 struct mwifiex_ie_types_header header;
1992 struct meas_rpt_map map;
1993} __packed;
1994
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001995struct host_cmd_ds_802_11_subsc_evt {
1996 __le16 action;
1997 __le16 events;
1998} __packed;
1999
Xinming Huf7669872015-06-22 19:06:11 +05302000struct chan_switch_result {
2001 u8 cur_chan;
2002 u8 status;
2003 u8 reason;
2004} __packed;
2005
Avinash Patil79ff4342014-05-06 22:02:44 -07002006struct mwifiex_tdls_generic_event {
2007 __le16 type;
2008 u8 peer_mac[ETH_ALEN];
2009 union {
Xinming Huf7669872015-06-22 19:06:11 +05302010 struct chan_switch_result switch_result;
2011 u8 cs_stop_reason;
Avinash Patil79ff4342014-05-06 22:02:44 -07002012 __le16 reason_code;
2013 __le16 reserved;
2014 } u;
2015} __packed;
2016
Avinash Patilede98bf2012-05-08 18:30:28 -07002017struct mwifiex_ie {
2018 __le16 ie_index;
2019 __le16 mgmt_subtype_mask;
2020 __le16 ie_length;
2021 u8 ie_buffer[IEEE_MAX_IE_SIZE];
2022} __packed;
2023
2024#define MAX_MGMT_IE_INDEX 16
2025struct mwifiex_ie_list {
2026 __le16 type;
2027 __le16 len;
2028 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
2029} __packed;
2030
Amitkumar Karwar562fc5b2013-08-05 18:52:00 -07002031struct coalesce_filt_field_param {
2032 u8 operation;
2033 u8 operand_len;
2034 __le16 offset;
2035 u8 operand_byte_stream[4];
2036};
2037
2038struct coalesce_receive_filt_rule {
2039 struct mwifiex_ie_types_header header;
2040 u8 num_of_fields;
2041 u8 pkt_type;
2042 __le16 max_coalescing_delay;
2043 struct coalesce_filt_field_param params[0];
2044} __packed;
2045
2046struct host_cmd_ds_coalesce_cfg {
2047 __le16 action;
2048 __le16 num_of_rules;
2049 struct coalesce_receive_filt_rule rule[0];
2050} __packed;
2051
Avinash Patild5b036c2015-06-22 19:06:20 +05302052struct host_cmd_ds_multi_chan_policy {
2053 __le16 action;
2054 __le16 policy;
2055} __packed;
2056
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002057struct host_cmd_ds_command {
2058 __le16 command;
2059 __le16 size;
2060 __le16 seq_num;
2061 __le16 result;
2062 union {
2063 struct host_cmd_ds_get_hw_spec hw_spec;
2064 struct host_cmd_ds_mac_control mac_ctrl;
2065 struct host_cmd_ds_802_11_mac_address mac_addr;
2066 struct host_cmd_ds_mac_multicast_adr mc_addr;
2067 struct host_cmd_ds_802_11_get_log get_log;
2068 struct host_cmd_ds_802_11_rssi_info rssi_info;
2069 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
2070 struct host_cmd_ds_802_11_snmp_mib smib;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002071 struct host_cmd_ds_tx_rate_query tx_rate;
2072 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
2073 struct host_cmd_ds_txpwr_cfg txp_cfg;
Amitkumar Karwarcaa89842012-06-27 19:57:57 -07002074 struct host_cmd_ds_rf_tx_pwr txp;
Amitkumar Karwar8a279d52012-07-02 19:32:33 -07002075 struct host_cmd_ds_rf_ant_mimo ant_mimo;
2076 struct host_cmd_ds_rf_ant_siso ant_siso;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002077 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
2078 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
2079 struct host_cmd_ds_802_11_scan scan;
Amitkumar Karwar21f58d202014-02-11 18:39:56 -08002080 struct host_cmd_ds_802_11_scan_ext ext_scan;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002081 struct host_cmd_ds_802_11_scan_rsp scan_resp;
2082 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
2083 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
2084 struct host_cmd_ds_802_11_associate associate;
2085 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
2086 struct host_cmd_ds_802_11_deauthenticate deauth;
2087 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
2088 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
2089 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
2090 struct host_cmd_ds_802_11d_domain_info domain_info;
2091 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
2092 struct host_cmd_ds_11n_addba_req add_ba_req;
2093 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
2094 struct host_cmd_ds_11n_delba del_ba;
2095 struct host_cmd_ds_txbuf_cfg tx_buf;
2096 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
2097 struct host_cmd_ds_11n_cfg htcfg;
2098 struct host_cmd_ds_wmm_get_status get_wmm_status;
2099 struct host_cmd_ds_802_11_key_material key_material;
Avinash Patile57f1732014-02-07 16:32:35 -08002100 struct host_cmd_ds_802_11_key_material_v2 key_material_v2;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002101 struct host_cmd_ds_version_ext verext;
Stone Piao3cec6872012-09-25 20:23:34 -07002102 struct host_cmd_ds_mgmt_frame_reg reg_mask;
Stone Piao7feb4c42012-09-25 20:23:36 -07002103 struct host_cmd_ds_remain_on_chan roc_cfg;
Stone Piaoe1a2b7a2012-09-25 20:23:41 -07002104 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002105 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
Amitkumar Karwar7da060c2013-03-04 16:27:59 -08002106 struct host_cmd_ds_mef_cfg mef_cfg;
Chin-ran Loc2c6c852015-05-12 00:48:17 +05302107 struct host_cmd_ds_mem_access mem;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002108 struct host_cmd_ds_mac_reg_access mac_reg;
2109 struct host_cmd_ds_bbp_reg_access bbp_reg;
2110 struct host_cmd_ds_rf_reg_access rf_reg;
2111 struct host_cmd_ds_pmic_reg_access pmic_reg;
2112 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07002113 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002114 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07002115 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07002116 struct host_cmd_ds_sys_config uap_sys_config;
Avinash Patil0f9e9b82013-05-17 17:50:23 -07002117 struct host_cmd_ds_sta_deauth sta_deauth;
Xinming Hub21783e2015-06-03 16:59:39 +05302118 struct host_cmd_ds_sta_list sta_list;
Yogesh Ashok Powar83c78da2013-03-18 20:06:03 -07002119 struct host_cmd_11ac_vht_cfg vht_cfg;
Amitkumar Karwar562fc5b2013-08-05 18:52:00 -07002120 struct host_cmd_ds_coalesce_cfg coalesce_cfg;
Xinming Hu449b8bb2015-06-22 19:06:12 +05302121 struct host_cmd_ds_tdls_config tdls_config;
Avinash Patil429d90d2014-02-07 16:27:34 -08002122 struct host_cmd_ds_tdls_oper tdls_oper;
Avinash Patil85afb182015-01-28 15:54:21 +05302123 struct host_cmd_ds_chan_rpt_req chan_rpt_req;
Zhaoyang Liu92263a82015-03-13 17:37:58 +05302124 struct host_cmd_sdio_sp_rx_aggr_cfg sdio_rx_aggr_cfg;
Avinash Patild5b036c2015-06-22 19:06:20 +05302125 struct host_cmd_ds_multi_chan_policy mc_policy;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002126 } params;
2127} __packed;
2128
2129struct mwifiex_opt_sleep_confirm {
2130 __le16 command;
2131 __le16 size;
2132 __le16 seq_num;
2133 __le16 result;
2134 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07002135 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002136} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07002137#endif /* !_MWIFIEX_FW_H_ */