mwifiex: implement extended scan feature
[deliverable/linux.git] / drivers / net / wireless / mwifiex / fw.h
1 /*
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
28 struct rfc_1042_hdr {
29 u8 llc_dsap;
30 u8 llc_ssap;
31 u8 llc_ctrl;
32 u8 snap_oui[3];
33 __be16 snap_type;
34 };
35
36 struct rx_packet_hdr {
37 struct ethhdr eth803_hdr;
38 struct rfc_1042_hdr rfc1042_hdr;
39 };
40
41 struct tx_packet_hdr {
42 struct ethhdr eth803_hdr;
43 struct rfc_1042_hdr rfc1042_hdr;
44 };
45
46 #define B_SUPPORTED_RATES 5
47 #define G_SUPPORTED_RATES 9
48 #define BG_SUPPORTED_RATES 13
49 #define A_SUPPORTED_RATES 9
50 #define HOSTCMD_SUPPORTED_RATES 14
51 #define N_SUPPORTED_RATES 3
52 #define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN | \
53 BAND_AN | BAND_AAC)
54
55 #define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11) | \
56 BIT(13))
57 #define IS_SUPPORT_MULTI_BANDS(adapter) \
58 (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
59
60 /* 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.
67 */
68 #define GET_FW_DEFAULT_BANDS(adapter) \
69 (((adapter->fw_cap_info & 0x2f00) >> 8) & \
70 ALL_802_11_BANDS)
71
72 #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
73
74 #define KEY_INFO_ENABLED 0x01
75 enum KEY_TYPE_ID {
76 KEY_TYPE_ID_WEP = 0,
77 KEY_TYPE_ID_TKIP,
78 KEY_TYPE_ID_AES,
79 KEY_TYPE_ID_WAPI,
80 KEY_TYPE_ID_AES_CMAC,
81 };
82 #define KEY_MCAST BIT(0)
83 #define KEY_UNICAST BIT(1)
84 #define KEY_ENABLED BIT(2)
85 #define KEY_IGTK BIT(10)
86
87 #define WAPI_KEY_LEN 50
88
89 #define MAX_POLL_TRIES 100
90 #define MAX_FIRMWARE_POLL_TRIES 100
91
92 #define FIRMWARE_READY_SDIO 0xfedc
93 #define FIRMWARE_READY_PCIE 0xfedcba00
94
95 enum mwifiex_usb_ep {
96 MWIFIEX_USB_EP_CMD_EVENT = 1,
97 MWIFIEX_USB_EP_DATA = 2,
98 };
99
100 enum MWIFIEX_802_11_PRIVACY_FILTER {
101 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
102 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
103 };
104
105 #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
106 #define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
107
108 #define UAP_BSS_PARAMS_I 0
109 #define UAP_CUSTOM_IE_I 1
110 #define MWIFIEX_AUTO_IDX_MASK 0xffff
111 #define MWIFIEX_DELETE_MASK 0x0000
112 #define MGMT_MASK_ASSOC_REQ 0x01
113 #define MGMT_MASK_REASSOC_REQ 0x04
114 #define MGMT_MASK_ASSOC_RESP 0x02
115 #define MGMT_MASK_REASSOC_RESP 0x08
116 #define MGMT_MASK_PROBE_REQ 0x10
117 #define MGMT_MASK_PROBE_RESP 0x20
118 #define MGMT_MASK_BEACON 0x100
119
120 #define TLV_TYPE_UAP_SSID 0x0000
121 #define TLV_TYPE_UAP_RATES 0x0001
122
123 #define PROPRIETARY_TLV_BASE_ID 0x0100
124 #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
125 #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
126 #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
127 #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
128 #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
129 #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
130 #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
131 #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
132 #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
133 #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
134 #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
135 #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
136 #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
137 #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
138 #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
139 #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
140 #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
141 #define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
142 #define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
143 #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)
146 #define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
147 #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)
150 #define TLV_TYPE_BSS_SCAN_RSP (PROPRIETARY_TLV_BASE_ID + 86)
151 #define TLV_TYPE_BSS_SCAN_INFO (PROPRIETARY_TLV_BASE_ID + 87)
152 #define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
153 #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
154 #define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
155 #define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
156 #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
157 #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
158 #define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
159 #define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
160 #define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
161 #define TLV_TYPE_COALESCE_RULE (PROPRIETARY_TLV_BASE_ID + 154)
162
163 #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
164
165 #define SSN_MASK 0xfff0
166
167 #define BA_RESULT_SUCCESS 0x0
168 #define BA_RESULT_TIMEOUT 0x2
169
170 #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
171
172 #define BA_STREAM_NOT_ALLOWED 0xff
173
174 #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
175 priv->adapter->config_bands & BAND_AN) && \
176 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
177 #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
178 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
179
180 #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
181 #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
182
183 #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
184
185 #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
186 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
187 IEEE80211_HT_CAP_SM_PS)
188
189 #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
190
191 /* dev_cap bitmap
192 * BIT
193 * 0-16 reserved
194 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
195 * 18-22 reserved
196 * 23 IEEE80211_HT_CAP_SGI_20
197 * 24 IEEE80211_HT_CAP_SGI_40
198 * 25 IEEE80211_HT_CAP_TX_STBC
199 * 26 IEEE80211_HT_CAP_RX_STBC
200 * 27-28 reserved
201 * 29 IEEE80211_HT_CAP_GRN_FLD
202 * 30-31 reserved
203 */
204 #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
205 #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
206 #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
207 #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
208 #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
209 #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
210 #define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
211 #define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
212
213 /* httxcfg bitmap
214 * 0 reserved
215 * 1 20/40 Mhz enable(1)/disable(0)
216 * 2-3 reserved
217 * 4 green field enable(1)/disable(0)
218 * 5 short GI in 20 Mhz enable(1)/disable(0)
219 * 6 short GI in 40 Mhz enable(1)/disable(0)
220 * 7-15 reserved
221 */
222 #define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
223
224 #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
225 #define SETHT_MCS32(x) (x[4] |= 1)
226 #define HT_STREAM_2X2 0x22
227
228 #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
229
230 #define LLC_SNAP_LEN 8
231
232 /* HW_SPEC fw_cap_info */
233
234 #define ISSUPP_11ACENABLED(fw_cap_info) (fw_cap_info & BIT(13))
235
236 #define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
237 #define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
238 #define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
239 (2 * (nss - 1)))
240 #define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
241 #define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
242
243 #define MOD_CLASS_HR_DSSS 0x03
244 #define MOD_CLASS_OFDM 0x07
245 #define MOD_CLASS_HT 0x08
246 #define HT_BW_20 0
247 #define HT_BW_40 1
248
249 #define DFS_CHAN_MOVE_TIME 10000
250
251 #define HostCmd_CMD_GET_HW_SPEC 0x0003
252 #define HostCmd_CMD_802_11_SCAN 0x0006
253 #define HostCmd_CMD_802_11_GET_LOG 0x000b
254 #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
255 #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
256 #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
257 #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
258 #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
259 #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
260 #define HostCmd_CMD_RF_REG_ACCESS 0x001b
261 #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
262 #define HostCmd_CMD_RF_TX_PWR 0x001e
263 #define HostCmd_CMD_RF_ANTENNA 0x0020
264 #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
265 #define HostCmd_CMD_MAC_CONTROL 0x0028
266 #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
267 #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
268 #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
269 #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
270 #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
271 #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
272 #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
273 #define HostCmd_CMD_WMM_GET_STATUS 0x0071
274 #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
275 #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
276 #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
277 #define HostCmd_CMD_CFG_DATA 0x008f
278 #define HostCmd_CMD_VERSION_EXT 0x0097
279 #define HostCmd_CMD_MEF_CFG 0x009a
280 #define HostCmd_CMD_RSSI_INFO 0x00a4
281 #define HostCmd_CMD_FUNC_INIT 0x00a9
282 #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
283 #define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
284 #define HostCmd_CMD_UAP_BSS_START 0x00b1
285 #define HostCmd_CMD_UAP_BSS_STOP 0x00b2
286 #define HostCmd_CMD_UAP_STA_DEAUTH 0x00b5
287 #define HostCmd_CMD_11N_CFG 0x00cd
288 #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
289 #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
290 #define HostCmd_CMD_11N_DELBA 0x00d0
291 #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
292 #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
293 #define HostCmd_CMD_TXPWR_CFG 0x00d1
294 #define HostCmd_CMD_TX_RATE_CFG 0x00d6
295 #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
296 #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
297 #define HostCmd_CMD_P2P_MODE_CFG 0x00eb
298 #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
299 #define HostCmd_CMD_SET_BSS_MODE 0x00f7
300 #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
301 #define HostCmd_CMD_802_11_SCAN_EXT 0x0107
302 #define HostCmd_CMD_COALESCE_CFG 0x010a
303 #define HostCmd_CMD_MGMT_FRAME_REG 0x010c
304 #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
305 #define HostCmd_CMD_11AC_CFG 0x0112
306
307 #define PROTOCOL_NO_SECURITY 0x01
308 #define PROTOCOL_STATIC_WEP 0x02
309 #define PROTOCOL_WPA 0x08
310 #define PROTOCOL_WPA2 0x20
311 #define PROTOCOL_WPA2_MIXED 0x28
312 #define PROTOCOL_EAP 0x40
313 #define KEY_MGMT_NONE 0x04
314 #define KEY_MGMT_PSK 0x02
315 #define KEY_MGMT_EAP 0x01
316 #define CIPHER_TKIP 0x04
317 #define CIPHER_AES_CCMP 0x08
318 #define VALID_CIPHER_BITMAP 0x0c
319
320 enum ENH_PS_MODES {
321 EN_PS = 1,
322 DIS_PS = 2,
323 EN_AUTO_DS = 3,
324 DIS_AUTO_DS = 4,
325 SLEEP_CONFIRM = 5,
326 GET_PS = 0,
327 EN_AUTO_PS = 0xff,
328 DIS_AUTO_PS = 0xfe,
329 };
330
331 enum P2P_MODES {
332 P2P_MODE_DISABLE = 0,
333 P2P_MODE_DEVICE = 1,
334 P2P_MODE_GO = 2,
335 P2P_MODE_CLIENT = 3,
336 };
337
338 #define HostCmd_RET_BIT 0x8000
339 #define HostCmd_ACT_GEN_GET 0x0000
340 #define HostCmd_ACT_GEN_SET 0x0001
341 #define HostCmd_ACT_GEN_REMOVE 0x0004
342 #define HostCmd_ACT_BITWISE_SET 0x0002
343 #define HostCmd_ACT_BITWISE_CLR 0x0003
344 #define HostCmd_RESULT_OK 0x0000
345
346 #define HostCmd_ACT_MAC_RX_ON 0x0001
347 #define HostCmd_ACT_MAC_TX_ON 0x0002
348 #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
349 #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
350 #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
351 #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
352 #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
353
354 #define HostCmd_BSS_MODE_IBSS 0x0002
355 #define HostCmd_BSS_MODE_ANY 0x0003
356
357 #define HostCmd_SCAN_RADIO_TYPE_BG 0
358 #define HostCmd_SCAN_RADIO_TYPE_A 1
359
360 #define HS_CFG_CANCEL 0xffffffff
361 #define HS_CFG_COND_DEF 0x00000000
362 #define HS_CFG_GPIO_DEF 0xff
363 #define HS_CFG_GAP_DEF 0
364 #define HS_CFG_COND_BROADCAST_DATA 0x00000001
365 #define HS_CFG_COND_UNICAST_DATA 0x00000002
366 #define HS_CFG_COND_MAC_EVENT 0x00000004
367 #define HS_CFG_COND_MULTICAST_DATA 0x00000008
368
369 #define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
370 #define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
371
372 #define CMD_F_HOSTCMD (1 << 0)
373 #define CMD_F_CANCELED (1 << 1)
374
375 #define HostCmd_CMD_ID_MASK 0x0fff
376
377 #define HostCmd_SEQ_NUM_MASK 0x00ff
378
379 #define HostCmd_BSS_NUM_MASK 0x0f00
380
381 #define HostCmd_BSS_TYPE_MASK 0xf000
382
383 #define HostCmd_ACT_SET_RX 0x0001
384 #define HostCmd_ACT_SET_TX 0x0002
385 #define HostCmd_ACT_SET_BOTH 0x0003
386
387 #define RF_ANTENNA_AUTO 0xFFFF
388
389 #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
390 (((seq) & 0x00ff) | \
391 (((num) & 0x000f) << 8)) | \
392 (((type) & 0x000f) << 12); }
393
394 #define HostCmd_GET_SEQ_NO(seq) \
395 ((seq) & HostCmd_SEQ_NUM_MASK)
396
397 #define HostCmd_GET_BSS_NO(seq) \
398 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
399
400 #define HostCmd_GET_BSS_TYPE(seq) \
401 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
402
403 #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
404 #define EVENT_LINK_LOST 0x00000003
405 #define EVENT_LINK_SENSED 0x00000004
406 #define EVENT_MIB_CHANGED 0x00000006
407 #define EVENT_INIT_DONE 0x00000007
408 #define EVENT_DEAUTHENTICATED 0x00000008
409 #define EVENT_DISASSOCIATED 0x00000009
410 #define EVENT_PS_AWAKE 0x0000000a
411 #define EVENT_PS_SLEEP 0x0000000b
412 #define EVENT_MIC_ERR_MULTICAST 0x0000000d
413 #define EVENT_MIC_ERR_UNICAST 0x0000000e
414 #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
415 #define EVENT_ADHOC_BCN_LOST 0x00000011
416
417 #define EVENT_WMM_STATUS_CHANGE 0x00000017
418 #define EVENT_BG_SCAN_REPORT 0x00000018
419 #define EVENT_RSSI_LOW 0x00000019
420 #define EVENT_SNR_LOW 0x0000001a
421 #define EVENT_MAX_FAIL 0x0000001b
422 #define EVENT_RSSI_HIGH 0x0000001c
423 #define EVENT_SNR_HIGH 0x0000001d
424 #define EVENT_IBSS_COALESCED 0x0000001e
425 #define EVENT_DATA_RSSI_LOW 0x00000024
426 #define EVENT_DATA_SNR_LOW 0x00000025
427 #define EVENT_DATA_RSSI_HIGH 0x00000026
428 #define EVENT_DATA_SNR_HIGH 0x00000027
429 #define EVENT_LINK_QUALITY 0x00000028
430 #define EVENT_PORT_RELEASE 0x0000002b
431 #define EVENT_UAP_STA_DEAUTH 0x0000002c
432 #define EVENT_UAP_STA_ASSOC 0x0000002d
433 #define EVENT_UAP_BSS_START 0x0000002e
434 #define EVENT_PRE_BEACON_LOST 0x00000031
435 #define EVENT_ADDBA 0x00000033
436 #define EVENT_DELBA 0x00000034
437 #define EVENT_BA_STREAM_TIEMOUT 0x00000037
438 #define EVENT_AMSDU_AGGR_CTRL 0x00000042
439 #define EVENT_UAP_BSS_IDLE 0x00000043
440 #define EVENT_UAP_BSS_ACTIVE 0x00000044
441 #define EVENT_WEP_ICV_ERR 0x00000046
442 #define EVENT_HS_ACT_REQ 0x00000047
443 #define EVENT_BW_CHANGE 0x00000048
444 #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
445 #define EVENT_HOSTWAKE_STAIE 0x0000004d
446 #define EVENT_CHANNEL_SWITCH_ANN 0x00000050
447 #define EVENT_EXT_SCAN_REPORT 0x00000058
448 #define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
449
450 #define EVENT_ID_MASK 0xffff
451 #define BSS_NUM_MASK 0xf
452
453 #define EVENT_GET_BSS_NUM(event_cause) \
454 (((event_cause) >> 16) & BSS_NUM_MASK)
455
456 #define EVENT_GET_BSS_TYPE(event_cause) \
457 (((event_cause) >> 24) & 0x00ff)
458
459 #define MWIFIEX_MAX_PATTERN_LEN 20
460 #define MWIFIEX_MAX_OFFSET_LEN 100
461 #define STACK_NBYTES 100
462 #define TYPE_DNUM 1
463 #define TYPE_BYTESEQ 2
464 #define MAX_OPERAND 0x40
465 #define TYPE_EQ (MAX_OPERAND+1)
466 #define TYPE_EQ_DNUM (MAX_OPERAND+2)
467 #define TYPE_EQ_BIT (MAX_OPERAND+3)
468 #define TYPE_AND (MAX_OPERAND+4)
469 #define TYPE_OR (MAX_OPERAND+5)
470 #define MEF_MODE_HOST_SLEEP 1
471 #define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
472 #define MWIFIEX_CRITERIA_BROADCAST BIT(0)
473 #define MWIFIEX_CRITERIA_UNICAST BIT(1)
474 #define MWIFIEX_CRITERIA_MULTICAST BIT(3)
475
476 struct mwifiex_ie_types_header {
477 __le16 type;
478 __le16 len;
479 } __packed;
480
481 struct 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
489 struct 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
502 struct rxpd {
503 u8 bss_type;
504 u8 bss_num;
505 __le16 rx_pkt_length;
506 __le16 rx_pkt_offset;
507 __le16 rx_pkt_type;
508 __le16 seq_num;
509 u8 priority;
510 u8 rx_rate;
511 s8 snr;
512 s8 nf;
513
514 /* For: Non-802.11 AC cards
515 *
516 * Ht Info [Bit 0] RxRate format: LG=0, HT=1
517 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
518 * [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 */
529 u8 ht_info;
530 u8 reserved;
531 } __packed;
532
533 struct 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
547 struct 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
558 enum mwifiex_chan_scan_mode_bitmasks {
559 MWIFIEX_PASSIVE_SCAN = BIT(0),
560 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
561 };
562
563 struct 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
571 struct 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
576 struct chan_band_param_set {
577 u8 radio_type;
578 u8 chan_number;
579 };
580
581 struct 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
586 struct mwifiex_ie_types_rates_param_set {
587 struct mwifiex_ie_types_header header;
588 u8 rates[1];
589 } __packed;
590
591 struct mwifiex_ie_types_ssid_param_set {
592 struct mwifiex_ie_types_header header;
593 u8 ssid[1];
594 } __packed;
595
596 struct mwifiex_ie_types_num_probes {
597 struct mwifiex_ie_types_header header;
598 __le16 num_probes;
599 } __packed;
600
601 struct 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
608 struct mwifiex_ie_types_tsf_timestamp {
609 struct mwifiex_ie_types_header header;
610 u8 tsf_data[1];
611 } __packed;
612
613 struct mwifiex_cf_param_set {
614 u8 cfp_cnt;
615 u8 cfp_period;
616 __le16 cfp_max_duration;
617 __le16 cfp_duration_remaining;
618 } __packed;
619
620 struct mwifiex_ibss_param_set {
621 __le16 atim_window;
622 } __packed;
623
624 struct 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
632 struct mwifiex_fh_param_set {
633 __le16 dwell_time;
634 u8 hop_set;
635 u8 hop_pattern;
636 u8 hop_index;
637 } __packed;
638
639 struct mwifiex_ds_param_set {
640 u8 current_chan;
641 } __packed;
642
643 struct 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
651 struct mwifiex_ie_types_auth_type {
652 struct mwifiex_ie_types_header header;
653 __le16 auth_type;
654 } __packed;
655
656 struct mwifiex_ie_types_vendor_param_set {
657 struct mwifiex_ie_types_header header;
658 u8 ie[MWIFIEX_MAX_VSIE_LEN];
659 };
660
661 struct 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
668 struct 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
677 #define IGTK_PN_LEN 8
678
679 struct mwifiex_cmac_param {
680 u8 ipn[IGTK_PN_LEN];
681 u8 key[WLAN_KEY_LEN_AES_CMAC];
682 } __packed;
683
684 struct host_cmd_ds_802_11_key_material {
685 __le16 action;
686 struct mwifiex_ie_type_key_param_set key_param_set;
687 } __packed;
688
689 struct host_cmd_ds_gen {
690 __le16 command;
691 __le16 size;
692 __le16 seq_num;
693 __le16 result;
694 };
695
696 #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
697
698 enum sleep_resp_ctrl {
699 RESP_NOT_NEEDED = 0,
700 RESP_NEEDED,
701 };
702
703 struct 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
713 #define BITMAP_AUTO_DS 0x01
714 #define BITMAP_STA_PS 0x10
715
716 struct mwifiex_ie_types_auto_ds_param {
717 struct mwifiex_ie_types_header header;
718 __le16 deep_sleep_timeout;
719 } __packed;
720
721 struct mwifiex_ie_types_ps_param {
722 struct mwifiex_ie_types_header header;
723 struct mwifiex_ps_param param;
724 } __packed;
725
726 struct host_cmd_ds_802_11_ps_mode_enh {
727 __le16 action;
728
729 union {
730 struct mwifiex_ps_param opt_ps;
731 __le16 ps_bitmap;
732 } params;
733 } __packed;
734
735 struct 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 */
751 __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;
756 } __packed;
757
758 struct 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
766 struct 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
781 struct host_cmd_ds_802_11_mac_address {
782 __le16 action;
783 u8 mac_addr[ETH_ALEN];
784 };
785
786 struct host_cmd_ds_mac_control {
787 __le16 action;
788 __le16 reserved;
789 };
790
791 struct 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
797 struct host_cmd_ds_802_11_deauthenticate {
798 u8 mac_addr[ETH_ALEN];
799 __le16 reason_code;
800 } __packed;
801
802 struct 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
810 struct 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
817 struct host_cmd_ds_802_11_associate_rsp {
818 struct ieee_types_assoc_rsp assoc_rsp;
819 } __packed;
820
821 struct ieee_types_cf_param_set {
822 u8 element_id;
823 u8 len;
824 u8 cfp_cnt;
825 u8 cfp_period;
826 __le16 cfp_max_duration;
827 __le16 cfp_duration_remaining;
828 } __packed;
829
830 struct ieee_types_ibss_param_set {
831 u8 element_id;
832 u8 len;
833 __le16 atim_window;
834 } __packed;
835
836 union 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
841 struct 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
850 struct ieee_types_ds_param_set {
851 u8 element_id;
852 u8 len;
853 u8 current_chan;
854 } __packed;
855
856 union 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
861 struct ieee_types_oper_mode_ntf {
862 u8 element_id;
863 u8 len;
864 u8 oper_mode;
865 } __packed;
866
867 struct 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;
876 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
877 } __packed;
878
879 struct host_cmd_ds_802_11_ad_hoc_result {
880 u8 pad[3];
881 u8 bssid[ETH_ALEN];
882 } __packed;
883
884 struct 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
904 struct host_cmd_ds_802_11_ad_hoc_join {
905 struct adhoc_bss_desc bss_descriptor;
906 u16 reserved1;
907 u16 reserved2;
908 } __packed;
909
910 struct 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
927 /* Enumeration for rate format */
928 enum _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
935 struct host_cmd_ds_tx_rate_query {
936 u8 tx_rate;
937 /* 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
945 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
946 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
947 */
948 u8 ht_info;
949 } __packed;
950
951 enum Host_Sleep_Action {
952 HS_CONFIGURE = 0x0001,
953 HS_ACTIVATE = 0x0002,
954 };
955
956 struct mwifiex_hs_config_param {
957 __le32 conditions;
958 u8 gpio;
959 u8 gap;
960 } __packed;
961
962 struct hs_activate_param {
963 __le16 resp_ctrl;
964 } __packed;
965
966 struct 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
975 enum 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 DOT11H_I = 10,
984 };
985
986 #define MAX_SNMP_BUF_SIZE 128
987
988 struct host_cmd_ds_802_11_snmp_mib {
989 __le16 query_type;
990 __le16 oid;
991 __le16 buf_size;
992 u8 value[1];
993 } __packed;
994
995 struct mwifiex_rate_scope {
996 __le16 type;
997 __le16 length;
998 __le16 hr_dsss_rate_bitmap;
999 __le16 ofdm_rate_bitmap;
1000 __le16 ht_mcs_rate_bitmap[8];
1001 } __packed;
1002
1003 struct mwifiex_rate_drop_pattern {
1004 __le16 type;
1005 __le16 length;
1006 __le32 rate_drop_mode;
1007 } __packed;
1008
1009 struct host_cmd_ds_tx_rate_cfg {
1010 __le16 action;
1011 __le16 cfg_index;
1012 } __packed;
1013
1014 struct mwifiex_power_group {
1015 u8 modulation_class;
1016 u8 first_rate_code;
1017 u8 last_rate_code;
1018 s8 power_step;
1019 s8 power_min;
1020 s8 power_max;
1021 u8 ht_bandwidth;
1022 u8 reserved;
1023 } __packed;
1024
1025 struct mwifiex_types_power_group {
1026 __le16 type;
1027 __le16 length;
1028 } __packed;
1029
1030 struct host_cmd_ds_txpwr_cfg {
1031 __le16 action;
1032 __le16 cfg_index;
1033 __le32 mode;
1034 } __packed;
1035
1036 struct host_cmd_ds_rf_tx_pwr {
1037 __le16 action;
1038 __le16 cur_level;
1039 u8 max_power;
1040 u8 min_power;
1041 } __packed;
1042
1043 struct host_cmd_ds_rf_ant_mimo {
1044 __le16 action_tx;
1045 __le16 tx_ant_mode;
1046 __le16 action_rx;
1047 __le16 rx_ant_mode;
1048 };
1049
1050 struct host_cmd_ds_rf_ant_siso {
1051 __le16 action;
1052 __le16 ant_mode;
1053 };
1054
1055 struct mwifiex_fixed_bcn_param {
1056 __le64 timestamp;
1057 __le16 beacon_period;
1058 __le16 cap_info_bitmap;
1059 } __packed;
1060
1061 struct mwifiex_event_scan_result {
1062 __le16 event_id;
1063 u8 bss_index;
1064 u8 bss_type;
1065 u8 more_event;
1066 u8 reserved[3];
1067 __le16 buf_size;
1068 u8 num_of_set;
1069 } __packed;
1070
1071 #define MWIFIEX_USER_SCAN_CHAN_MAX 50
1072
1073 #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
1074
1075 struct mwifiex_scan_cmd_config {
1076 /*
1077 * BSS mode to be sent in the firmware command
1078 */
1079 u8 bss_mode;
1080
1081 /* Specific BSSID used to filter scan results in the firmware */
1082 u8 specific_bssid[ETH_ALEN];
1083
1084 /* Length of TLVs sent in command starting at tlvBuffer */
1085 u32 tlv_buf_len;
1086
1087 /*
1088 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
1089 *
1090 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
1091 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
1092 */
1093 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
1094 here */
1095 } __packed;
1096
1097 struct mwifiex_user_scan_chan {
1098 u8 chan_number;
1099 u8 radio_type;
1100 u8 scan_type;
1101 u8 reserved;
1102 u32 scan_time;
1103 } __packed;
1104
1105 struct mwifiex_user_scan_cfg {
1106 /*
1107 * BSS mode to be sent in the firmware command
1108 */
1109 u8 bss_mode;
1110 /* Configure the number of probe requests for active chan scans */
1111 u8 num_probes;
1112 u8 reserved;
1113 /* BSSID filter sent in the firmware command to limit the results */
1114 u8 specific_bssid[ETH_ALEN];
1115 /* SSID filter list used in the firmware to limit the scan results */
1116 struct cfg80211_ssid *ssid_list;
1117 u8 num_ssids;
1118 /* Variable number (fixed maximum) of channels to scan up */
1119 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
1120 } __packed;
1121
1122 struct ie_body {
1123 u8 grp_key_oui[4];
1124 u8 ptk_cnt[2];
1125 u8 ptk_body[4];
1126 } __packed;
1127
1128 struct host_cmd_ds_802_11_scan {
1129 u8 bss_mode;
1130 u8 bssid[ETH_ALEN];
1131 u8 tlv_buffer[1];
1132 } __packed;
1133
1134 struct host_cmd_ds_802_11_scan_rsp {
1135 __le16 bss_descript_size;
1136 u8 number_of_sets;
1137 u8 bss_desc_and_tlv_buffer[1];
1138 } __packed;
1139
1140 struct host_cmd_ds_802_11_scan_ext {
1141 u32 reserved;
1142 u8 tlv_buffer[1];
1143 } __packed;
1144
1145 struct mwifiex_ie_types_bss_scan_rsp {
1146 struct mwifiex_ie_types_header header;
1147 u8 bssid[ETH_ALEN];
1148 u8 frame_body[1];
1149 } __packed;
1150
1151 struct mwifiex_ie_types_bss_scan_info {
1152 struct mwifiex_ie_types_header header;
1153 __le16 rssi;
1154 __le16 anpi;
1155 u8 cca_busy_fraction;
1156 u8 radio_type;
1157 u8 channel;
1158 u8 reserved;
1159 __le64 tsf;
1160 } __packed;
1161
1162 struct host_cmd_ds_802_11_bg_scan_query {
1163 u8 flush;
1164 } __packed;
1165
1166 struct host_cmd_ds_802_11_bg_scan_query_rsp {
1167 __le32 report_condition;
1168 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1169 } __packed;
1170
1171 struct mwifiex_ietypes_domain_param_set {
1172 struct mwifiex_ie_types_header header;
1173 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1174 struct ieee80211_country_ie_triplet triplet[1];
1175 } __packed;
1176
1177 struct host_cmd_ds_802_11d_domain_info {
1178 __le16 action;
1179 struct mwifiex_ietypes_domain_param_set domain;
1180 } __packed;
1181
1182 struct host_cmd_ds_802_11d_domain_info_rsp {
1183 __le16 action;
1184 struct mwifiex_ietypes_domain_param_set domain;
1185 } __packed;
1186
1187 struct host_cmd_ds_11n_addba_req {
1188 u8 add_req_result;
1189 u8 peer_mac_addr[ETH_ALEN];
1190 u8 dialog_token;
1191 __le16 block_ack_param_set;
1192 __le16 block_ack_tmo;
1193 __le16 ssn;
1194 } __packed;
1195
1196 struct host_cmd_ds_11n_addba_rsp {
1197 u8 add_rsp_result;
1198 u8 peer_mac_addr[ETH_ALEN];
1199 u8 dialog_token;
1200 __le16 status_code;
1201 __le16 block_ack_param_set;
1202 __le16 block_ack_tmo;
1203 __le16 ssn;
1204 } __packed;
1205
1206 struct host_cmd_ds_11n_delba {
1207 u8 del_result;
1208 u8 peer_mac_addr[ETH_ALEN];
1209 __le16 del_ba_param_set;
1210 __le16 reason_code;
1211 u8 reserved;
1212 } __packed;
1213
1214 struct host_cmd_ds_11n_batimeout {
1215 u8 tid;
1216 u8 peer_mac_addr[ETH_ALEN];
1217 u8 origninator;
1218 } __packed;
1219
1220 struct host_cmd_ds_11n_cfg {
1221 __le16 action;
1222 __le16 ht_tx_cap;
1223 __le16 ht_tx_info;
1224 __le16 misc_config; /* Needed for 802.11AC cards only */
1225 } __packed;
1226
1227 struct host_cmd_ds_txbuf_cfg {
1228 __le16 action;
1229 __le16 buff_size;
1230 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
1231 __le16 reserved3;
1232 } __packed;
1233
1234 struct host_cmd_ds_amsdu_aggr_ctrl {
1235 __le16 action;
1236 __le16 enable;
1237 __le16 curr_buf_size;
1238 } __packed;
1239
1240 struct host_cmd_ds_sta_deauth {
1241 u8 mac[ETH_ALEN];
1242 __le16 reason;
1243 } __packed;
1244
1245 struct mwifiex_ie_types_pwr_capability {
1246 struct mwifiex_ie_types_header header;
1247 s8 min_pwr;
1248 s8 max_pwr;
1249 };
1250
1251 struct mwifiex_ie_types_local_pwr_constraint {
1252 struct mwifiex_ie_types_header header;
1253 u8 chan;
1254 u8 constraint;
1255 };
1256
1257 struct mwifiex_ie_types_wmm_param_set {
1258 struct mwifiex_ie_types_header header;
1259 u8 wmm_ie[1];
1260 };
1261
1262 struct mwifiex_ie_types_wmm_queue_status {
1263 struct mwifiex_ie_types_header header;
1264 u8 queue_index;
1265 u8 disabled;
1266 __le16 medium_time;
1267 u8 flow_required;
1268 u8 flow_created;
1269 u32 reserved;
1270 };
1271
1272 struct ieee_types_vendor_header {
1273 u8 element_id;
1274 u8 len;
1275 u8 oui[4]; /* 0~2: oui, 3: oui_type */
1276 u8 oui_subtype;
1277 u8 version;
1278 } __packed;
1279
1280 struct ieee_types_wmm_parameter {
1281 /*
1282 * WMM Parameter IE - Vendor Specific Header:
1283 * element_id [221/0xdd]
1284 * Len [24]
1285 * Oui [00:50:f2]
1286 * OuiType [2]
1287 * OuiSubType [1]
1288 * Version [1]
1289 */
1290 struct ieee_types_vendor_header vend_hdr;
1291 u8 qos_info_bitmap;
1292 u8 reserved;
1293 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
1294 } __packed;
1295
1296 struct ieee_types_wmm_info {
1297
1298 /*
1299 * WMM Info IE - Vendor Specific Header:
1300 * element_id [221/0xdd]
1301 * Len [7]
1302 * Oui [00:50:f2]
1303 * OuiType [2]
1304 * OuiSubType [0]
1305 * Version [1]
1306 */
1307 struct ieee_types_vendor_header vend_hdr;
1308
1309 u8 qos_info_bitmap;
1310 } __packed;
1311
1312 struct host_cmd_ds_wmm_get_status {
1313 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
1314 IEEE80211_NUM_ACS];
1315 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1316 } __packed;
1317
1318 struct mwifiex_wmm_ac_status {
1319 u8 disabled;
1320 u8 flow_required;
1321 u8 flow_created;
1322 };
1323
1324 struct mwifiex_ie_types_htcap {
1325 struct mwifiex_ie_types_header header;
1326 struct ieee80211_ht_cap ht_cap;
1327 } __packed;
1328
1329 struct mwifiex_ie_types_vhtcap {
1330 struct mwifiex_ie_types_header header;
1331 struct ieee80211_vht_cap vht_cap;
1332 } __packed;
1333
1334 struct mwifiex_ie_types_oper_mode_ntf {
1335 struct mwifiex_ie_types_header header;
1336 u8 oper_mode;
1337 } __packed;
1338
1339 /* VHT Operations IE */
1340 struct mwifiex_ie_types_vht_oper {
1341 struct mwifiex_ie_types_header header;
1342 u8 chan_width;
1343 u8 chan_center_freq_1;
1344 u8 chan_center_freq_2;
1345 /* Basic MCS set map, each 2 bits stands for a NSS */
1346 __le16 basic_mcs_map;
1347 } __packed;
1348
1349 struct mwifiex_ie_types_wmmcap {
1350 struct mwifiex_ie_types_header header;
1351 struct mwifiex_types_wmm_info wmm_info;
1352 } __packed;
1353
1354 struct mwifiex_ie_types_htinfo {
1355 struct mwifiex_ie_types_header header;
1356 struct ieee80211_ht_operation ht_oper;
1357 } __packed;
1358
1359 struct mwifiex_ie_types_2040bssco {
1360 struct mwifiex_ie_types_header header;
1361 u8 bss_co_2040;
1362 } __packed;
1363
1364 struct mwifiex_ie_types_extcap {
1365 struct mwifiex_ie_types_header header;
1366 u8 ext_capab[0];
1367 } __packed;
1368
1369 struct host_cmd_ds_mac_reg_access {
1370 __le16 action;
1371 __le16 offset;
1372 __le32 value;
1373 } __packed;
1374
1375 struct host_cmd_ds_bbp_reg_access {
1376 __le16 action;
1377 __le16 offset;
1378 u8 value;
1379 u8 reserved[3];
1380 } __packed;
1381
1382 struct host_cmd_ds_rf_reg_access {
1383 __le16 action;
1384 __le16 offset;
1385 u8 value;
1386 u8 reserved[3];
1387 } __packed;
1388
1389 struct host_cmd_ds_pmic_reg_access {
1390 __le16 action;
1391 __le16 offset;
1392 u8 value;
1393 u8 reserved[3];
1394 } __packed;
1395
1396 struct host_cmd_ds_802_11_eeprom_access {
1397 __le16 action;
1398
1399 __le16 offset;
1400 __le16 byte_count;
1401 u8 value;
1402 } __packed;
1403
1404 struct mwifiex_assoc_event {
1405 u8 sta_addr[ETH_ALEN];
1406 __le16 type;
1407 __le16 len;
1408 __le16 frame_control;
1409 __le16 cap_info;
1410 __le16 listen_interval;
1411 u8 data[0];
1412 } __packed;
1413
1414 struct host_cmd_ds_sys_config {
1415 __le16 action;
1416 u8 tlv[0];
1417 };
1418
1419 struct host_cmd_11ac_vht_cfg {
1420 __le16 action;
1421 u8 band_config;
1422 u8 misc_config;
1423 __le32 cap_info;
1424 __le32 mcs_tx_set;
1425 __le32 mcs_rx_set;
1426 } __packed;
1427
1428 struct host_cmd_tlv_akmp {
1429 struct mwifiex_ie_types_header header;
1430 __le16 key_mgmt;
1431 __le16 key_mgmt_operation;
1432 } __packed;
1433
1434 struct host_cmd_tlv_pwk_cipher {
1435 struct mwifiex_ie_types_header header;
1436 __le16 proto;
1437 u8 cipher;
1438 u8 reserved;
1439 } __packed;
1440
1441 struct host_cmd_tlv_gwk_cipher {
1442 struct mwifiex_ie_types_header header;
1443 u8 cipher;
1444 u8 reserved;
1445 } __packed;
1446
1447 struct host_cmd_tlv_passphrase {
1448 struct mwifiex_ie_types_header header;
1449 u8 passphrase[0];
1450 } __packed;
1451
1452 struct host_cmd_tlv_wep_key {
1453 struct mwifiex_ie_types_header header;
1454 u8 key_index;
1455 u8 is_default;
1456 u8 key[1];
1457 };
1458
1459 struct host_cmd_tlv_auth_type {
1460 struct mwifiex_ie_types_header header;
1461 u8 auth_type;
1462 } __packed;
1463
1464 struct host_cmd_tlv_encrypt_protocol {
1465 struct mwifiex_ie_types_header header;
1466 __le16 proto;
1467 } __packed;
1468
1469 struct host_cmd_tlv_ssid {
1470 struct mwifiex_ie_types_header header;
1471 u8 ssid[0];
1472 } __packed;
1473
1474 struct host_cmd_tlv_rates {
1475 struct mwifiex_ie_types_header header;
1476 u8 rates[0];
1477 } __packed;
1478
1479 struct mwifiex_ie_types_bssid_list {
1480 struct mwifiex_ie_types_header header;
1481 u8 bssid[ETH_ALEN];
1482 } __packed;
1483
1484 struct host_cmd_tlv_bcast_ssid {
1485 struct mwifiex_ie_types_header header;
1486 u8 bcast_ctl;
1487 } __packed;
1488
1489 struct host_cmd_tlv_beacon_period {
1490 struct mwifiex_ie_types_header header;
1491 __le16 period;
1492 } __packed;
1493
1494 struct host_cmd_tlv_dtim_period {
1495 struct mwifiex_ie_types_header header;
1496 u8 period;
1497 } __packed;
1498
1499 struct host_cmd_tlv_frag_threshold {
1500 struct mwifiex_ie_types_header header;
1501 __le16 frag_thr;
1502 } __packed;
1503
1504 struct host_cmd_tlv_rts_threshold {
1505 struct mwifiex_ie_types_header header;
1506 __le16 rts_thr;
1507 } __packed;
1508
1509 struct host_cmd_tlv_retry_limit {
1510 struct mwifiex_ie_types_header header;
1511 u8 limit;
1512 } __packed;
1513
1514 struct host_cmd_tlv_mac_addr {
1515 struct mwifiex_ie_types_header header;
1516 u8 mac_addr[ETH_ALEN];
1517 } __packed;
1518
1519 struct host_cmd_tlv_channel_band {
1520 struct mwifiex_ie_types_header header;
1521 u8 band_config;
1522 u8 channel;
1523 } __packed;
1524
1525 struct host_cmd_tlv_ageout_timer {
1526 struct mwifiex_ie_types_header header;
1527 __le32 sta_ao_timer;
1528 } __packed;
1529
1530 struct host_cmd_ds_version_ext {
1531 u8 version_str_sel;
1532 char version_str[128];
1533 } __packed;
1534
1535 struct host_cmd_ds_mgmt_frame_reg {
1536 __le16 action;
1537 __le32 mask;
1538 } __packed;
1539
1540 struct host_cmd_ds_p2p_mode_cfg {
1541 __le16 action;
1542 __le16 mode;
1543 } __packed;
1544
1545 struct host_cmd_ds_remain_on_chan {
1546 __le16 action;
1547 u8 status;
1548 u8 reserved;
1549 u8 band_cfg;
1550 u8 channel;
1551 __le32 duration;
1552 } __packed;
1553
1554 struct host_cmd_ds_802_11_ibss_status {
1555 __le16 action;
1556 __le16 enable;
1557 u8 bssid[ETH_ALEN];
1558 __le16 beacon_interval;
1559 __le16 atim_window;
1560 __le16 use_g_rate_protect;
1561 } __packed;
1562
1563 struct mwifiex_fw_mef_entry {
1564 u8 mode;
1565 u8 action;
1566 __le16 exprsize;
1567 u8 expr[0];
1568 } __packed;
1569
1570 struct host_cmd_ds_mef_cfg {
1571 __le32 criteria;
1572 __le16 num_entries;
1573 struct mwifiex_fw_mef_entry mef_entry[0];
1574 } __packed;
1575
1576 #define CONNECTION_TYPE_INFRA 0
1577 #define CONNECTION_TYPE_ADHOC 1
1578 #define CONNECTION_TYPE_AP 2
1579
1580 struct host_cmd_ds_set_bss_mode {
1581 u8 con_type;
1582 } __packed;
1583
1584 struct host_cmd_ds_pcie_details {
1585 /* TX buffer descriptor ring address */
1586 u32 txbd_addr_lo;
1587 u32 txbd_addr_hi;
1588 /* TX buffer descriptor ring count */
1589 u32 txbd_count;
1590
1591 /* RX buffer descriptor ring address */
1592 u32 rxbd_addr_lo;
1593 u32 rxbd_addr_hi;
1594 /* RX buffer descriptor ring count */
1595 u32 rxbd_count;
1596
1597 /* Event buffer descriptor ring address */
1598 u32 evtbd_addr_lo;
1599 u32 evtbd_addr_hi;
1600 /* Event buffer descriptor ring count */
1601 u32 evtbd_count;
1602
1603 /* Sleep cookie buffer physical address */
1604 u32 sleep_cookie_addr_lo;
1605 u32 sleep_cookie_addr_hi;
1606 } __packed;
1607
1608 struct mwifiex_ie_types_rssi_threshold {
1609 struct mwifiex_ie_types_header header;
1610 u8 abs_value;
1611 u8 evt_freq;
1612 } __packed;
1613
1614 struct host_cmd_ds_802_11_subsc_evt {
1615 __le16 action;
1616 __le16 events;
1617 } __packed;
1618
1619 struct mwifiex_ie {
1620 __le16 ie_index;
1621 __le16 mgmt_subtype_mask;
1622 __le16 ie_length;
1623 u8 ie_buffer[IEEE_MAX_IE_SIZE];
1624 } __packed;
1625
1626 #define MAX_MGMT_IE_INDEX 16
1627 struct mwifiex_ie_list {
1628 __le16 type;
1629 __le16 len;
1630 struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
1631 } __packed;
1632
1633 struct coalesce_filt_field_param {
1634 u8 operation;
1635 u8 operand_len;
1636 __le16 offset;
1637 u8 operand_byte_stream[4];
1638 };
1639
1640 struct coalesce_receive_filt_rule {
1641 struct mwifiex_ie_types_header header;
1642 u8 num_of_fields;
1643 u8 pkt_type;
1644 __le16 max_coalescing_delay;
1645 struct coalesce_filt_field_param params[0];
1646 } __packed;
1647
1648 struct host_cmd_ds_coalesce_cfg {
1649 __le16 action;
1650 __le16 num_of_rules;
1651 struct coalesce_receive_filt_rule rule[0];
1652 } __packed;
1653
1654 struct host_cmd_ds_command {
1655 __le16 command;
1656 __le16 size;
1657 __le16 seq_num;
1658 __le16 result;
1659 union {
1660 struct host_cmd_ds_get_hw_spec hw_spec;
1661 struct host_cmd_ds_mac_control mac_ctrl;
1662 struct host_cmd_ds_802_11_mac_address mac_addr;
1663 struct host_cmd_ds_mac_multicast_adr mc_addr;
1664 struct host_cmd_ds_802_11_get_log get_log;
1665 struct host_cmd_ds_802_11_rssi_info rssi_info;
1666 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1667 struct host_cmd_ds_802_11_snmp_mib smib;
1668 struct host_cmd_ds_tx_rate_query tx_rate;
1669 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1670 struct host_cmd_ds_txpwr_cfg txp_cfg;
1671 struct host_cmd_ds_rf_tx_pwr txp;
1672 struct host_cmd_ds_rf_ant_mimo ant_mimo;
1673 struct host_cmd_ds_rf_ant_siso ant_siso;
1674 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1675 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1676 struct host_cmd_ds_802_11_scan scan;
1677 struct host_cmd_ds_802_11_scan_ext ext_scan;
1678 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1679 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1680 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1681 struct host_cmd_ds_802_11_associate associate;
1682 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1683 struct host_cmd_ds_802_11_deauthenticate deauth;
1684 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1685 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1686 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1687 struct host_cmd_ds_802_11d_domain_info domain_info;
1688 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1689 struct host_cmd_ds_11n_addba_req add_ba_req;
1690 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1691 struct host_cmd_ds_11n_delba del_ba;
1692 struct host_cmd_ds_txbuf_cfg tx_buf;
1693 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1694 struct host_cmd_ds_11n_cfg htcfg;
1695 struct host_cmd_ds_wmm_get_status get_wmm_status;
1696 struct host_cmd_ds_802_11_key_material key_material;
1697 struct host_cmd_ds_version_ext verext;
1698 struct host_cmd_ds_mgmt_frame_reg reg_mask;
1699 struct host_cmd_ds_remain_on_chan roc_cfg;
1700 struct host_cmd_ds_p2p_mode_cfg mode_cfg;
1701 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1702 struct host_cmd_ds_mef_cfg mef_cfg;
1703 struct host_cmd_ds_mac_reg_access mac_reg;
1704 struct host_cmd_ds_bbp_reg_access bbp_reg;
1705 struct host_cmd_ds_rf_reg_access rf_reg;
1706 struct host_cmd_ds_pmic_reg_access pmic_reg;
1707 struct host_cmd_ds_set_bss_mode bss_mode;
1708 struct host_cmd_ds_pcie_details pcie_host_spec;
1709 struct host_cmd_ds_802_11_eeprom_access eeprom;
1710 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
1711 struct host_cmd_ds_sys_config uap_sys_config;
1712 struct host_cmd_ds_sta_deauth sta_deauth;
1713 struct host_cmd_11ac_vht_cfg vht_cfg;
1714 struct host_cmd_ds_coalesce_cfg coalesce_cfg;
1715 } params;
1716 } __packed;
1717
1718 struct mwifiex_opt_sleep_confirm {
1719 __le16 command;
1720 __le16 size;
1721 __le16 seq_num;
1722 __le16 result;
1723 __le16 action;
1724 __le16 resp_ctrl;
1725 } __packed;
1726 #endif /* !_MWIFIEX_FW_H_ */
This page took 0.128871 seconds and 6 git commands to generate.