blob: 77f82fc811e23dfcae244dd981b49efe282e27d9 [file] [log] [blame]
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001/*
2 * Marvell Wireless LAN device driver: Firmware specific macros & structures
3 *
4 * Copyright (C) 2011, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13 *
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
18 */
19
20#ifndef _MWIFIEX_FW_H_
21#define _MWIFIEX_FW_H_
22
23#include <linux/if_ether.h>
24
25
26#define INTF_HEADER_LEN 4
27
28struct rfc_1042_hdr {
29 u8 llc_dsap;
30 u8 llc_ssap;
31 u8 llc_ctrl;
32 u8 snap_oui[3];
33 u16 snap_type;
34};
35
36struct rx_packet_hdr {
37 struct ethhdr eth803_hdr;
38 struct rfc_1042_hdr rfc1042_hdr;
39};
40
41struct tx_packet_hdr {
42 struct ethhdr eth803_hdr;
43 struct rfc_1042_hdr rfc1042_hdr;
44};
45
46#define B_SUPPORTED_RATES 5
47#define G_SUPPORTED_RATES 9
48#define BG_SUPPORTED_RATES 13
49#define A_SUPPORTED_RATES 9
50#define HOSTCMD_SUPPORTED_RATES 14
51#define N_SUPPORTED_RATES 3
52#define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN)
53
54#define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11))
55#define IS_SUPPORT_MULTI_BANDS(adapter) \
56 (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
57#define GET_FW_DEFAULT_BANDS(adapter) \
58 ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
59
Bing Zhao5e6e3a92011-03-21 18:00:50 -070060#define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
61
62#define KEY_INFO_ENABLED 0x01
63enum KEY_TYPE_ID {
64 KEY_TYPE_ID_WEP = 0,
65 KEY_TYPE_ID_TKIP,
66 KEY_TYPE_ID_AES,
67 KEY_TYPE_ID_WAPI,
68};
Yogesh Ashok Powar6a35a0a2011-04-06 16:46:56 -070069#define KEY_MCAST BIT(0)
70#define KEY_UNICAST BIT(1)
71#define KEY_ENABLED BIT(2)
Bing Zhao5e6e3a92011-03-21 18:00:50 -070072
73#define WAPI_KEY_LEN 50
74
Bing Zhao5e6e3a92011-03-21 18:00:50 -070075#define MAX_POLL_TRIES 100
76
77#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
78
79#define MAX_FIRMWARE_POLL_TRIES 100
80
Amitkumar Karward930fae2011-10-11 17:41:21 -070081#define FIRMWARE_READY_SDIO 0xfedc
82#define FIRMWARE_READY_PCIE 0xfedcba00
Bing Zhao5e6e3a92011-03-21 18:00:50 -070083
Amitkumar Karwar4daffe32012-04-18 20:08:28 -070084enum mwifiex_usb_ep {
85 MWIFIEX_USB_EP_CMD_EVENT = 1,
86 MWIFIEX_USB_EP_DATA = 2,
87};
88
Bing Zhao5e6e3a92011-03-21 18:00:50 -070089enum MWIFIEX_802_11_PRIVACY_FILTER {
90 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
91 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
92};
93
Bing Zhao5e6e3a92011-03-21 18:00:50 -070094#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
95
Avinash Patil12190c52012-05-08 18:30:24 -070096#define TLV_TYPE_UAP_SSID 0x0000
97
Bing Zhao5e6e3a92011-03-21 18:00:50 -070098#define PROPRIETARY_TLV_BASE_ID 0x0100
99#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
100#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
101#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700102#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700103#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700104#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
105#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
106#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700107#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700108#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Avinash Patil75edd2c2012-05-08 18:30:18 -0700109#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700110#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
Avinash Patil12190c52012-05-08 18:30:24 -0700111#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
112#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700113#define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
114#define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700115#define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
116#define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
117#define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
Avinash Patil9b930ea2012-05-08 18:30:23 -0700118#define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700119#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
Avinash Patile5686342012-05-08 18:30:25 -0700120#define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700121#define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
Marc Yang2b06bdb2011-03-30 18:12:44 -0700122#define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
123#define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700124
125#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
126
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700127#define SSN_MASK 0xfff0
128
129#define BA_RESULT_SUCCESS 0x0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700130#define BA_RESULT_TIMEOUT 0x2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700131
132#define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
133
134#define BA_STREAM_NOT_ALLOWED 0xff
135
136#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
Yogesh Ashok Powar931f1582012-03-13 19:22:36 -0700137 priv->adapter->config_bands & BAND_AN) && \
138 priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700139#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
140 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
141
142#define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
143#define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700144
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700145#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
Marc Yang6d2bd912011-03-25 19:47:02 -0700146
147/* dev_cap bitmap
148 * BIT
149 * 0-16 reserved
150 * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
151 * 18-22 reserved
152 * 23 IEEE80211_HT_CAP_SGI_20
153 * 24 IEEE80211_HT_CAP_SGI_40
154 * 25 IEEE80211_HT_CAP_TX_STBC
155 * 26 IEEE80211_HT_CAP_RX_STBC
156 * 27-28 reserved
157 * 29 IEEE80211_HT_CAP_GRN_FLD
158 * 30-31 reserved
159 */
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700160#define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
Marc Yang6d2bd912011-03-25 19:47:02 -0700161#define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
162#define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
163#define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
164#define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
165#define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
166
Amitkumar Karwarcd27bc32011-07-08 20:40:30 -0700167/* httxcfg bitmap
168 * 0 reserved
169 * 1 20/40 Mhz enable(1)/disable(0)
170 * 2-3 reserved
171 * 4 green field enable(1)/disable(0)
172 * 5 short GI in 20 Mhz enable(1)/disable(0)
173 * 6 short GI in 40 Mhz enable(1)/disable(0)
174 * 7-15 reserved
175 */
176#define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
177
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700178#define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700179#define SETHT_MCS32(x) (x[4] |= 1)
Bing Zhaoe3bea1c2011-11-16 20:40:35 -0800180#define HT_STREAM_2X2 0x22
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700181
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700182#define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
183
184#define LLC_SNAP_LEN 8
185
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700186#define MOD_CLASS_HR_DSSS 0x03
187#define MOD_CLASS_OFDM 0x07
188#define MOD_CLASS_HT 0x08
189#define HT_BW_20 0
190#define HT_BW_40 1
191
192#define HostCmd_CMD_GET_HW_SPEC 0x0003
193#define HostCmd_CMD_802_11_SCAN 0x0006
194#define HostCmd_CMD_802_11_GET_LOG 0x000b
195#define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
196#define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
197#define HostCmd_CMD_802_11_ASSOCIATE 0x0012
198#define HostCmd_CMD_802_11_SNMP_MIB 0x0016
199#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
200#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
201#define HostCmd_CMD_RF_REG_ACCESS 0x001b
202#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
203#define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
204#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
205#define HostCmd_CMD_MAC_CONTROL 0x0028
206#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
207#define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
208#define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
209#define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
210#define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
211#define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
212#define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
213#define HostCmd_CMD_WMM_GET_STATUS 0x0071
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700214#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700215#define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
216#define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
217#define HostCmd_CMD_VERSION_EXT 0x0097
218#define HostCmd_CMD_RSSI_INFO 0x00a4
219#define HostCmd_CMD_FUNC_INIT 0x00a9
220#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
Avinash Patil40d07032012-05-08 18:30:19 -0700221#define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
222#define HostCmd_CMD_UAP_BSS_START 0x00b1
223#define HostCmd_CMD_UAP_BSS_STOP 0x00b2
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700224#define HostCmd_CMD_11N_CFG 0x00cd
225#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
226#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
227#define HostCmd_CMD_11N_DELBA 0x00d0
228#define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
229#define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
230#define HostCmd_CMD_TXPWR_CFG 0x00d1
231#define HostCmd_CMD_TX_RATE_CFG 0x00d6
232#define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
233#define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
234#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
235#define HostCmd_CMD_SET_BSS_MODE 0x00f7
Amitkumar Karward930fae2011-10-11 17:41:21 -0700236#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700237
238enum ENH_PS_MODES {
239 EN_PS = 1,
240 DIS_PS = 2,
241 EN_AUTO_DS = 3,
242 DIS_AUTO_DS = 4,
243 SLEEP_CONFIRM = 5,
244 GET_PS = 0,
245 EN_AUTO_PS = 0xff,
246 DIS_AUTO_PS = 0xfe,
247};
248
249#define HostCmd_RET_BIT 0x8000
250#define HostCmd_ACT_GEN_GET 0x0000
251#define HostCmd_ACT_GEN_SET 0x0001
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700252#define HostCmd_ACT_BITWISE_SET 0x0002
253#define HostCmd_ACT_BITWISE_CLR 0x0003
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700254#define HostCmd_RESULT_OK 0x0000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700255
256#define HostCmd_ACT_MAC_RX_ON 0x0001
257#define HostCmd_ACT_MAC_TX_ON 0x0002
258#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
259#define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
260#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
261#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700262#define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
263
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700264#define HostCmd_BSS_MODE_IBSS 0x0002
265#define HostCmd_BSS_MODE_ANY 0x0003
266
267#define HostCmd_SCAN_RADIO_TYPE_BG 0
268#define HostCmd_SCAN_RADIO_TYPE_A 1
269
270#define HOST_SLEEP_CFG_CANCEL 0xffffffff
271#define HOST_SLEEP_CFG_COND_DEF 0x0000000f
272#define HOST_SLEEP_CFG_GPIO_DEF 0xff
273#define HOST_SLEEP_CFG_GAP_DEF 0
274
275#define CMD_F_HOSTCMD (1 << 0)
276#define CMD_F_CANCELED (1 << 1)
277
278#define HostCmd_CMD_ID_MASK 0x0fff
279
280#define HostCmd_SEQ_NUM_MASK 0x00ff
281
282#define HostCmd_BSS_NUM_MASK 0x0f00
283
284#define HostCmd_BSS_TYPE_MASK 0xf000
285
286#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
287 (((seq) & 0x00ff) | \
288 (((num) & 0x000f) << 8)) | \
289 (((type) & 0x000f) << 12); }
290
291#define HostCmd_GET_SEQ_NO(seq) \
292 ((seq) & HostCmd_SEQ_NUM_MASK)
293
294#define HostCmd_GET_BSS_NO(seq) \
295 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
296
297#define HostCmd_GET_BSS_TYPE(seq) \
298 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
299
300#define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
301#define EVENT_LINK_LOST 0x00000003
302#define EVENT_LINK_SENSED 0x00000004
303#define EVENT_MIB_CHANGED 0x00000006
304#define EVENT_INIT_DONE 0x00000007
305#define EVENT_DEAUTHENTICATED 0x00000008
306#define EVENT_DISASSOCIATED 0x00000009
307#define EVENT_PS_AWAKE 0x0000000a
308#define EVENT_PS_SLEEP 0x0000000b
309#define EVENT_MIC_ERR_MULTICAST 0x0000000d
310#define EVENT_MIC_ERR_UNICAST 0x0000000e
311#define EVENT_DEEP_SLEEP_AWAKE 0x00000010
312#define EVENT_ADHOC_BCN_LOST 0x00000011
313
314#define EVENT_WMM_STATUS_CHANGE 0x00000017
315#define EVENT_BG_SCAN_REPORT 0x00000018
316#define EVENT_RSSI_LOW 0x00000019
317#define EVENT_SNR_LOW 0x0000001a
318#define EVENT_MAX_FAIL 0x0000001b
319#define EVENT_RSSI_HIGH 0x0000001c
320#define EVENT_SNR_HIGH 0x0000001d
321#define EVENT_IBSS_COALESCED 0x0000001e
322#define EVENT_DATA_RSSI_LOW 0x00000024
323#define EVENT_DATA_SNR_LOW 0x00000025
324#define EVENT_DATA_RSSI_HIGH 0x00000026
325#define EVENT_DATA_SNR_HIGH 0x00000027
326#define EVENT_LINK_QUALITY 0x00000028
327#define EVENT_PORT_RELEASE 0x0000002b
Avinash Patile5686342012-05-08 18:30:25 -0700328#define EVENT_UAP_STA_DEAUTH 0x0000002c
329#define EVENT_UAP_STA_ASSOC 0x0000002d
330#define EVENT_UAP_BSS_START 0x0000002e
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700331#define EVENT_PRE_BEACON_LOST 0x00000031
332#define EVENT_ADDBA 0x00000033
333#define EVENT_DELBA 0x00000034
334#define EVENT_BA_STREAM_TIEMOUT 0x00000037
335#define EVENT_AMSDU_AGGR_CTRL 0x00000042
Avinash Patile5686342012-05-08 18:30:25 -0700336#define EVENT_UAP_BSS_IDLE 0x00000043
337#define EVENT_UAP_BSS_ACTIVE 0x00000044
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700338#define EVENT_WEP_ICV_ERR 0x00000046
339#define EVENT_HS_ACT_REQ 0x00000047
340#define EVENT_BW_CHANGE 0x00000048
Avinash Patile5686342012-05-08 18:30:25 -0700341#define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700342#define EVENT_HOSTWAKE_STAIE 0x0000004d
343
344#define EVENT_ID_MASK 0xffff
345#define BSS_NUM_MASK 0xf
346
347#define EVENT_GET_BSS_NUM(event_cause) \
348 (((event_cause) >> 16) & BSS_NUM_MASK)
349
350#define EVENT_GET_BSS_TYPE(event_cause) \
351 (((event_cause) >> 24) & 0x00ff)
352
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700353struct mwifiex_ie_types_header {
354 __le16 type;
355 __le16 len;
356} __packed;
357
358struct mwifiex_ie_types_data {
359 struct mwifiex_ie_types_header header;
360 u8 data[1];
361} __packed;
362
363#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
364#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
365
366struct txpd {
367 u8 bss_type;
368 u8 bss_num;
369 __le16 tx_pkt_length;
370 __le16 tx_pkt_offset;
371 __le16 tx_pkt_type;
372 __le32 tx_control;
373 u8 priority;
374 u8 flags;
375 u8 pkt_delay_2ms;
376 u8 reserved1;
377} __packed;
378
379struct rxpd {
380 u8 bss_type;
381 u8 bss_num;
382 u16 rx_pkt_length;
383 u16 rx_pkt_offset;
384 u16 rx_pkt_type;
385 u16 seq_num;
386 u8 priority;
387 u8 rx_rate;
388 s8 snr;
389 s8 nf;
390 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
391 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
392 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
393 u8 ht_info;
394 u8 reserved;
395} __packed;
396
397enum mwifiex_chan_scan_mode_bitmasks {
398 MWIFIEX_PASSIVE_SCAN = BIT(0),
399 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
400};
401
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700402struct mwifiex_chan_scan_param_set {
403 u8 radio_type;
404 u8 chan_number;
405 u8 chan_scan_mode_bitmap;
406 __le16 min_scan_time;
407 __le16 max_scan_time;
408} __packed;
409
410struct mwifiex_ie_types_chan_list_param_set {
411 struct mwifiex_ie_types_header header;
412 struct mwifiex_chan_scan_param_set chan_scan_param[1];
413} __packed;
414
415struct chan_band_param_set {
416 u8 radio_type;
417 u8 chan_number;
418};
419
420struct mwifiex_ie_types_chan_band_list_param_set {
421 struct mwifiex_ie_types_header header;
422 struct chan_band_param_set chan_band_param[1];
423} __packed;
424
425struct mwifiex_ie_types_rates_param_set {
426 struct mwifiex_ie_types_header header;
427 u8 rates[1];
428} __packed;
429
430struct mwifiex_ie_types_ssid_param_set {
431 struct mwifiex_ie_types_header header;
432 u8 ssid[1];
433} __packed;
434
435struct mwifiex_ie_types_num_probes {
436 struct mwifiex_ie_types_header header;
437 __le16 num_probes;
438} __packed;
439
440struct mwifiex_ie_types_wildcard_ssid_params {
441 struct mwifiex_ie_types_header header;
442 u8 max_ssid_length;
443 u8 ssid[1];
444} __packed;
445
446#define TSF_DATA_SIZE 8
447struct mwifiex_ie_types_tsf_timestamp {
448 struct mwifiex_ie_types_header header;
449 u8 tsf_data[1];
450} __packed;
451
452struct mwifiex_cf_param_set {
453 u8 cfp_cnt;
454 u8 cfp_period;
455 u16 cfp_max_duration;
456 u16 cfp_duration_remaining;
457} __packed;
458
459struct mwifiex_ibss_param_set {
460 u16 atim_window;
461} __packed;
462
463struct mwifiex_ie_types_ss_param_set {
464 struct mwifiex_ie_types_header header;
465 union {
466 struct mwifiex_cf_param_set cf_param_set[1];
467 struct mwifiex_ibss_param_set ibss_param_set[1];
468 } cf_ibss;
469} __packed;
470
471struct mwifiex_fh_param_set {
472 u16 dwell_time;
473 u8 hop_set;
474 u8 hop_pattern;
475 u8 hop_index;
476} __packed;
477
478struct mwifiex_ds_param_set {
479 u8 current_chan;
480} __packed;
481
482struct mwifiex_ie_types_phy_param_set {
483 struct mwifiex_ie_types_header header;
484 union {
485 struct mwifiex_fh_param_set fh_param_set[1];
486 struct mwifiex_ds_param_set ds_param_set[1];
487 } fh_ds;
488} __packed;
489
490struct mwifiex_ie_types_auth_type {
491 struct mwifiex_ie_types_header header;
492 __le16 auth_type;
493} __packed;
494
495struct mwifiex_ie_types_vendor_param_set {
496 struct mwifiex_ie_types_header header;
497 u8 ie[MWIFIEX_MAX_VSIE_LEN];
498};
499
500struct mwifiex_ie_types_rsn_param_set {
501 struct mwifiex_ie_types_header header;
502 u8 rsn_ie[1];
503} __packed;
504
505#define KEYPARAMSET_FIXED_LEN 6
506
507struct mwifiex_ie_type_key_param_set {
508 __le16 type;
509 __le16 length;
510 __le16 key_type_id;
511 __le16 key_info;
512 __le16 key_len;
513 u8 key[50];
514} __packed;
515
516struct host_cmd_ds_802_11_key_material {
517 __le16 action;
518 struct mwifiex_ie_type_key_param_set key_param_set;
519} __packed;
520
521struct host_cmd_ds_gen {
522 u16 command;
523 u16 size;
524 u16 seq_num;
525 u16 result;
526};
527
528#define S_DS_GEN sizeof(struct host_cmd_ds_gen)
529
530enum sleep_resp_ctrl {
531 RESP_NOT_NEEDED = 0,
532 RESP_NEEDED,
533};
534
535struct mwifiex_ps_param {
536 __le16 null_pkt_interval;
537 __le16 multiple_dtims;
538 __le16 bcn_miss_timeout;
539 __le16 local_listen_interval;
540 __le16 adhoc_wake_period;
541 __le16 mode;
542 __le16 delay_to_ps;
543};
544
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700545#define BITMAP_AUTO_DS 0x01
546#define BITMAP_STA_PS 0x10
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700547
548struct mwifiex_ie_types_auto_ds_param {
549 struct mwifiex_ie_types_header header;
Marc Yang2b06bdb2011-03-30 18:12:44 -0700550 __le16 deep_sleep_timeout;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700551} __packed;
552
553struct mwifiex_ie_types_ps_param {
554 struct mwifiex_ie_types_header header;
555 struct mwifiex_ps_param param;
556} __packed;
557
558struct host_cmd_ds_802_11_ps_mode_enh {
559 __le16 action;
560
561 union {
562 struct mwifiex_ps_param opt_ps;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700563 __le16 ps_bitmap;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700564 } params;
565} __packed;
566
567struct host_cmd_ds_get_hw_spec {
568 __le16 hw_if_version;
569 __le16 version;
570 __le16 reserved;
571 __le16 num_of_mcast_adr;
572 u8 permanent_addr[ETH_ALEN];
573 __le16 region_code;
574 __le16 number_of_antenna;
575 __le32 fw_release_number;
576 __le32 reserved_1;
577 __le32 reserved_2;
578 __le32 reserved_3;
579 __le32 fw_cap_info;
580 __le32 dot_11n_dev_cap;
581 u8 dev_mcs_support;
582 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
583 __le16 reserved_4;
584} __packed;
585
586struct host_cmd_ds_802_11_rssi_info {
587 __le16 action;
588 __le16 ndata;
589 __le16 nbcn;
590 __le16 reserved[9];
591 long long reserved_1;
592};
593
594struct host_cmd_ds_802_11_rssi_info_rsp {
595 __le16 action;
596 __le16 ndata;
597 __le16 nbcn;
598 __le16 data_rssi_last;
599 __le16 data_nf_last;
600 __le16 data_rssi_avg;
601 __le16 data_nf_avg;
602 __le16 bcn_rssi_last;
603 __le16 bcn_nf_last;
604 __le16 bcn_rssi_avg;
605 __le16 bcn_nf_avg;
606 long long tsf_bcn;
607};
608
609struct host_cmd_ds_802_11_mac_address {
610 __le16 action;
611 u8 mac_addr[ETH_ALEN];
612};
613
614struct host_cmd_ds_mac_control {
615 __le16 action;
616 __le16 reserved;
617};
618
619struct host_cmd_ds_mac_multicast_adr {
620 __le16 action;
621 __le16 num_of_adrs;
622 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
623} __packed;
624
625struct host_cmd_ds_802_11_deauthenticate {
626 u8 mac_addr[ETH_ALEN];
627 __le16 reason_code;
628} __packed;
629
630struct host_cmd_ds_802_11_associate {
631 u8 peer_sta_addr[ETH_ALEN];
632 __le16 cap_info_bitmap;
633 __le16 listen_interval;
634 __le16 beacon_period;
635 u8 dtim_period;
636} __packed;
637
638struct ieee_types_assoc_rsp {
639 __le16 cap_info_bitmap;
640 __le16 status_code;
641 __le16 a_id;
642 u8 ie_buffer[1];
643} __packed;
644
645struct host_cmd_ds_802_11_associate_rsp {
646 struct ieee_types_assoc_rsp assoc_rsp;
647} __packed;
648
649struct ieee_types_cf_param_set {
650 u8 element_id;
651 u8 len;
652 u8 cfp_cnt;
653 u8 cfp_period;
654 u16 cfp_max_duration;
655 u16 cfp_duration_remaining;
656} __packed;
657
658struct ieee_types_ibss_param_set {
659 u8 element_id;
660 u8 len;
661 __le16 atim_window;
662} __packed;
663
664union ieee_types_ss_param_set {
665 struct ieee_types_cf_param_set cf_param_set;
666 struct ieee_types_ibss_param_set ibss_param_set;
667} __packed;
668
669struct ieee_types_fh_param_set {
670 u8 element_id;
671 u8 len;
672 __le16 dwell_time;
673 u8 hop_set;
674 u8 hop_pattern;
675 u8 hop_index;
676} __packed;
677
678struct ieee_types_ds_param_set {
679 u8 element_id;
680 u8 len;
681 u8 current_chan;
682} __packed;
683
684union ieee_types_phy_param_set {
685 struct ieee_types_fh_param_set fh_param_set;
686 struct ieee_types_ds_param_set ds_param_set;
687} __packed;
688
689struct host_cmd_ds_802_11_ad_hoc_start {
690 u8 ssid[IEEE80211_MAX_SSID_LEN];
691 u8 bss_mode;
692 __le16 beacon_period;
693 u8 dtim_period;
694 union ieee_types_ss_param_set ss_param_set;
695 union ieee_types_phy_param_set phy_param_set;
696 u16 reserved1;
697 __le16 cap_info_bitmap;
Yogesh Ashok Powar63af6332011-11-07 21:41:09 -0800698 u8 data_rate[HOSTCMD_SUPPORTED_RATES];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700699} __packed;
700
701struct host_cmd_ds_802_11_ad_hoc_result {
702 u8 pad[3];
703 u8 bssid[ETH_ALEN];
704} __packed;
705
706struct adhoc_bss_desc {
707 u8 bssid[ETH_ALEN];
708 u8 ssid[IEEE80211_MAX_SSID_LEN];
709 u8 bss_mode;
710 __le16 beacon_period;
711 u8 dtim_period;
712 u8 time_stamp[8];
713 u8 local_time[8];
714 union ieee_types_phy_param_set phy_param_set;
715 union ieee_types_ss_param_set ss_param_set;
716 __le16 cap_info_bitmap;
717 u8 data_rates[HOSTCMD_SUPPORTED_RATES];
718
719 /*
720 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
721 * It is used in the Adhoc join command and will cause a
722 * binary layout mismatch with the firmware
723 */
724} __packed;
725
726struct host_cmd_ds_802_11_ad_hoc_join {
727 struct adhoc_bss_desc bss_descriptor;
728 u16 reserved1;
729 u16 reserved2;
730} __packed;
731
732struct host_cmd_ds_802_11_get_log {
733 __le32 mcast_tx_frame;
734 __le32 failed;
735 __le32 retry;
736 __le32 multi_retry;
737 __le32 frame_dup;
738 __le32 rts_success;
739 __le32 rts_failure;
740 __le32 ack_failure;
741 __le32 rx_frag;
742 __le32 mcast_rx_frame;
743 __le32 fcs_error;
744 __le32 tx_frame;
745 __le32 reserved;
746 __le32 wep_icv_err_cnt[4];
747};
748
749struct host_cmd_ds_tx_rate_query {
750 u8 tx_rate;
751 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
752 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
753 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
754 u8 ht_info;
755} __packed;
756
757enum Host_Sleep_Action {
758 HS_CONFIGURE = 0x0001,
759 HS_ACTIVATE = 0x0002,
760};
761
762struct mwifiex_hs_config_param {
763 __le32 conditions;
764 u8 gpio;
765 u8 gap;
766} __packed;
767
768struct hs_activate_param {
769 u16 resp_ctrl;
770} __packed;
771
772struct host_cmd_ds_802_11_hs_cfg_enh {
773 __le16 action;
774
775 union {
776 struct mwifiex_hs_config_param hs_config;
777 struct hs_activate_param hs_activate;
778 } params;
779} __packed;
780
781enum SNMP_MIB_INDEX {
782 OP_RATE_SET_I = 1,
783 DTIM_PERIOD_I = 3,
784 RTS_THRESH_I = 5,
785 SHORT_RETRY_LIM_I = 6,
786 LONG_RETRY_LIM_I = 7,
787 FRAG_THRESH_I = 8,
788 DOT11D_I = 9,
789};
790
791#define MAX_SNMP_BUF_SIZE 128
792
793struct host_cmd_ds_802_11_snmp_mib {
794 __le16 query_type;
795 __le16 oid;
796 __le16 buf_size;
797 u8 value[1];
798} __packed;
799
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700800struct mwifiex_rate_scope {
801 __le16 type;
802 __le16 length;
803 __le16 hr_dsss_rate_bitmap;
804 __le16 ofdm_rate_bitmap;
805 __le16 ht_mcs_rate_bitmap[8];
806} __packed;
807
808struct mwifiex_rate_drop_pattern {
809 __le16 type;
810 __le16 length;
811 __le32 rate_drop_mode;
812} __packed;
813
814struct host_cmd_ds_tx_rate_cfg {
815 __le16 action;
816 __le16 cfg_index;
817} __packed;
818
819struct mwifiex_power_group {
820 u8 modulation_class;
821 u8 first_rate_code;
822 u8 last_rate_code;
823 s8 power_step;
824 s8 power_min;
825 s8 power_max;
826 u8 ht_bandwidth;
827 u8 reserved;
828} __packed;
829
830struct mwifiex_types_power_group {
831 u16 type;
832 u16 length;
833} __packed;
834
835struct host_cmd_ds_txpwr_cfg {
836 __le16 action;
837 __le16 cfg_index;
838 __le32 mode;
839} __packed;
840
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700841struct mwifiex_bcn_param {
842 u8 bssid[ETH_ALEN];
843 u8 rssi;
Amitkumar Karwarb5abcf02012-04-16 21:36:52 -0700844 __le64 timestamp;
Amitkumar Karwar7c6fa2a2011-08-10 18:53:57 -0700845 __le16 beacon_period;
846 __le16 cap_info_bitmap;
847} __packed;
848
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700849#define MWIFIEX_USER_SCAN_CHAN_MAX 50
850
851#define MWIFIEX_MAX_SSID_LIST_LENGTH 10
852
853struct mwifiex_scan_cmd_config {
854 /*
Bing Zhaoa8c48562011-05-10 20:47:36 -0700855 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700856 */
857 u8 bss_mode;
858
859 /* Specific BSSID used to filter scan results in the firmware */
860 u8 specific_bssid[ETH_ALEN];
861
862 /* Length of TLVs sent in command starting at tlvBuffer */
863 u32 tlv_buf_len;
864
865 /*
866 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
867 *
868 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
869 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
870 */
871 u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
872 here */
873} __packed;
874
875struct mwifiex_user_scan_chan {
876 u8 chan_number;
877 u8 radio_type;
878 u8 scan_type;
879 u8 reserved;
880 u32 scan_time;
881} __packed;
882
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700883struct mwifiex_user_scan_cfg {
884 /*
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700885 * BSS mode to be sent in the firmware command
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700886 */
887 u8 bss_mode;
888 /* Configure the number of probe requests for active chan scans */
889 u8 num_probes;
890 u8 reserved;
891 /* BSSID filter sent in the firmware command to limit the results */
892 u8 specific_bssid[ETH_ALEN];
Amitkumar Karwarbe0b2812012-02-27 22:04:15 -0800893 /* SSID filter list used in the firmware to limit the scan results */
894 struct cfg80211_ssid *ssid_list;
895 u8 num_ssids;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700896 /* Variable number (fixed maximum) of channels to scan up */
897 struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
898} __packed;
899
900struct ie_body {
901 u8 grp_key_oui[4];
902 u8 ptk_cnt[2];
903 u8 ptk_body[4];
904} __packed;
905
906struct host_cmd_ds_802_11_scan {
907 u8 bss_mode;
908 u8 bssid[ETH_ALEN];
909 u8 tlv_buffer[1];
910} __packed;
911
912struct host_cmd_ds_802_11_scan_rsp {
913 __le16 bss_descript_size;
914 u8 number_of_sets;
915 u8 bss_desc_and_tlv_buffer[1];
916} __packed;
917
918struct host_cmd_ds_802_11_bg_scan_query {
919 u8 flush;
920} __packed;
921
922struct host_cmd_ds_802_11_bg_scan_query_rsp {
923 u32 report_condition;
924 struct host_cmd_ds_802_11_scan_rsp scan_resp;
925} __packed;
926
927struct mwifiex_ietypes_domain_param_set {
928 struct mwifiex_ie_types_header header;
929 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
930 struct ieee80211_country_ie_triplet triplet[1];
931} __packed;
932
933struct host_cmd_ds_802_11d_domain_info {
934 __le16 action;
935 struct mwifiex_ietypes_domain_param_set domain;
936} __packed;
937
938struct host_cmd_ds_802_11d_domain_info_rsp {
939 __le16 action;
940 struct mwifiex_ietypes_domain_param_set domain;
941} __packed;
942
943struct host_cmd_ds_11n_addba_req {
944 u8 add_req_result;
945 u8 peer_mac_addr[ETH_ALEN];
946 u8 dialog_token;
947 __le16 block_ack_param_set;
948 __le16 block_ack_tmo;
949 __le16 ssn;
950} __packed;
951
952struct host_cmd_ds_11n_addba_rsp {
953 u8 add_rsp_result;
954 u8 peer_mac_addr[ETH_ALEN];
955 u8 dialog_token;
956 __le16 status_code;
957 __le16 block_ack_param_set;
958 __le16 block_ack_tmo;
959 __le16 ssn;
960} __packed;
961
962struct host_cmd_ds_11n_delba {
963 u8 del_result;
964 u8 peer_mac_addr[ETH_ALEN];
965 __le16 del_ba_param_set;
966 __le16 reason_code;
967 u8 reserved;
968} __packed;
969
970struct host_cmd_ds_11n_batimeout {
971 u8 tid;
972 u8 peer_mac_addr[ETH_ALEN];
973 u8 origninator;
974} __packed;
975
976struct host_cmd_ds_11n_cfg {
977 __le16 action;
978 __le16 ht_tx_cap;
979 __le16 ht_tx_info;
980} __packed;
981
982struct host_cmd_ds_txbuf_cfg {
983 __le16 action;
984 __le16 buff_size;
985 __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
986 __le16 reserved3;
987} __packed;
988
989struct host_cmd_ds_amsdu_aggr_ctrl {
990 __le16 action;
991 __le16 enable;
992 __le16 curr_buf_size;
993} __packed;
994
995struct mwifiex_ie_types_wmm_param_set {
996 struct mwifiex_ie_types_header header;
997 u8 wmm_ie[1];
998};
999
1000struct mwifiex_ie_types_wmm_queue_status {
1001 struct mwifiex_ie_types_header header;
1002 u8 queue_index;
1003 u8 disabled;
1004 u16 medium_time;
1005 u8 flow_required;
1006 u8 flow_created;
1007 u32 reserved;
1008};
1009
1010struct ieee_types_vendor_header {
1011 u8 element_id;
1012 u8 len;
Amitkumar Karwar2e4c14a2012-04-26 13:02:57 -07001013 u8 oui[4]; /* 0~2: oui, 3: oui_type */
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001014 u8 oui_subtype;
1015 u8 version;
1016} __packed;
1017
1018struct ieee_types_wmm_ac_parameters {
1019 u8 aci_aifsn_bitmap;
1020 u8 ecw_bitmap;
1021 __le16 tx_op_limit;
1022} __packed;
1023
1024struct ieee_types_wmm_parameter {
1025 /*
1026 * WMM Parameter IE - Vendor Specific Header:
1027 * element_id [221/0xdd]
1028 * Len [24]
1029 * Oui [00:50:f2]
1030 * OuiType [2]
1031 * OuiSubType [1]
1032 * Version [1]
1033 */
1034 struct ieee_types_vendor_header vend_hdr;
1035 u8 qos_info_bitmap;
1036 u8 reserved;
Johannes Berg99fec5d2012-03-27 14:07:59 +02001037 struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001038} __packed;
1039
1040struct ieee_types_wmm_info {
1041
1042 /*
1043 * WMM Info IE - Vendor Specific Header:
1044 * element_id [221/0xdd]
1045 * Len [7]
1046 * Oui [00:50:f2]
1047 * OuiType [2]
1048 * OuiSubType [0]
1049 * Version [1]
1050 */
1051 struct ieee_types_vendor_header vend_hdr;
1052
1053 u8 qos_info_bitmap;
1054} __packed;
1055
1056struct host_cmd_ds_wmm_get_status {
1057 u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
Johannes Berg99fec5d2012-03-27 14:07:59 +02001058 IEEE80211_NUM_ACS];
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001059 u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1060} __packed;
1061
1062struct mwifiex_wmm_ac_status {
1063 u8 disabled;
1064 u8 flow_required;
1065 u8 flow_created;
1066};
1067
1068struct mwifiex_ie_types_htcap {
1069 struct mwifiex_ie_types_header header;
1070 struct ieee80211_ht_cap ht_cap;
1071} __packed;
1072
1073struct mwifiex_ie_types_htinfo {
1074 struct mwifiex_ie_types_header header;
Johannes Berg074d46d2012-03-15 19:45:16 +01001075 struct ieee80211_ht_operation ht_oper;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001076} __packed;
1077
1078struct mwifiex_ie_types_2040bssco {
1079 struct mwifiex_ie_types_header header;
1080 u8 bss_co_2040;
1081} __packed;
1082
1083struct mwifiex_ie_types_extcap {
1084 struct mwifiex_ie_types_header header;
1085 u8 ext_cap;
1086} __packed;
1087
1088struct host_cmd_ds_mac_reg_access {
1089 __le16 action;
1090 __le16 offset;
1091 __le32 value;
1092} __packed;
1093
1094struct host_cmd_ds_bbp_reg_access {
1095 __le16 action;
1096 __le16 offset;
1097 u8 value;
1098 u8 reserved[3];
1099} __packed;
1100
1101struct host_cmd_ds_rf_reg_access {
1102 __le16 action;
1103 __le16 offset;
1104 u8 value;
1105 u8 reserved[3];
1106} __packed;
1107
1108struct host_cmd_ds_pmic_reg_access {
1109 __le16 action;
1110 __le16 offset;
1111 u8 value;
1112 u8 reserved[3];
1113} __packed;
1114
1115struct host_cmd_ds_802_11_eeprom_access {
1116 __le16 action;
1117
1118 __le16 offset;
1119 __le16 byte_count;
1120 u8 value;
1121} __packed;
1122
Avinash Patil75edd2c2012-05-08 18:30:18 -07001123struct host_cmd_tlv {
1124 __le16 type;
1125 __le16 len;
1126} __packed;
1127
Avinash Patile5686342012-05-08 18:30:25 -07001128struct mwifiex_assoc_event {
1129 u8 sta_addr[ETH_ALEN];
1130 __le16 type;
1131 __le16 len;
1132 __le16 frame_control;
1133 __le16 cap_info;
1134 __le16 listen_interval;
1135 u8 data[0];
1136} __packed;
1137
Avinash Patil4db16a12012-05-08 18:30:20 -07001138struct host_cmd_ds_sys_config {
1139 __le16 action;
1140 u8 tlv[0];
1141};
Avinash Patil12190c52012-05-08 18:30:24 -07001142struct host_cmd_tlv_ssid {
1143 struct host_cmd_tlv tlv;
1144 u8 ssid[0];
1145} __packed;
1146
1147struct host_cmd_tlv_beacon_period {
1148 struct host_cmd_tlv tlv;
1149 __le16 period;
1150} __packed;
1151
1152struct host_cmd_tlv_dtim_period {
1153 struct host_cmd_tlv tlv;
1154 u8 period;
1155} __packed;
Avinash Patil4db16a12012-05-08 18:30:20 -07001156
Avinash Patil9b930ea2012-05-08 18:30:23 -07001157struct host_cmd_tlv_frag_threshold {
1158 struct host_cmd_tlv tlv;
1159 __le16 frag_thr;
1160} __packed;
1161
1162struct host_cmd_tlv_rts_threshold {
1163 struct host_cmd_tlv tlv;
1164 __le16 rts_thr;
1165} __packed;
1166
1167struct host_cmd_tlv_retry_limit {
1168 struct host_cmd_tlv tlv;
1169 u8 limit;
1170} __packed;
1171
Avinash Patil75edd2c2012-05-08 18:30:18 -07001172struct host_cmd_tlv_mac_addr {
1173 struct host_cmd_tlv tlv;
1174 u8 mac_addr[ETH_ALEN];
1175} __packed;
1176
Avinash Patil4db16a12012-05-08 18:30:20 -07001177struct host_cmd_tlv_channel_band {
1178 struct host_cmd_tlv tlv;
1179 u8 band_config;
1180 u8 channel;
1181} __packed;
1182
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001183struct host_cmd_ds_802_11_rf_channel {
1184 __le16 action;
1185 __le16 current_channel;
1186 __le16 rf_type;
1187 __le16 reserved;
1188 u8 reserved_1[32];
1189} __packed;
1190
1191struct host_cmd_ds_version_ext {
1192 u8 version_str_sel;
1193 char version_str[128];
1194} __packed;
1195
1196struct host_cmd_ds_802_11_ibss_status {
1197 __le16 action;
1198 __le16 enable;
1199 u8 bssid[ETH_ALEN];
1200 __le16 beacon_interval;
1201 __le16 atim_window;
1202 __le16 use_g_rate_protect;
1203} __packed;
1204
1205#define CONNECTION_TYPE_INFRA 0
1206#define CONNECTION_TYPE_ADHOC 1
1207
1208struct host_cmd_ds_set_bss_mode {
1209 u8 con_type;
1210} __packed;
1211
Amitkumar Karward930fae2011-10-11 17:41:21 -07001212struct host_cmd_ds_pcie_details {
1213 /* TX buffer descriptor ring address */
1214 u32 txbd_addr_lo;
1215 u32 txbd_addr_hi;
1216 /* TX buffer descriptor ring count */
1217 u32 txbd_count;
1218
1219 /* RX buffer descriptor ring address */
1220 u32 rxbd_addr_lo;
1221 u32 rxbd_addr_hi;
1222 /* RX buffer descriptor ring count */
1223 u32 rxbd_count;
1224
1225 /* Event buffer descriptor ring address */
1226 u32 evtbd_addr_lo;
1227 u32 evtbd_addr_hi;
1228 /* Event buffer descriptor ring count */
1229 u32 evtbd_count;
1230
1231 /* Sleep cookie buffer physical address */
1232 u32 sleep_cookie_addr_lo;
1233 u32 sleep_cookie_addr_hi;
1234} __packed;
1235
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001236struct mwifiex_ie_types_rssi_threshold {
1237 struct mwifiex_ie_types_header header;
1238 u8 abs_value;
1239 u8 evt_freq;
1240} __packed;
1241
1242struct host_cmd_ds_802_11_subsc_evt {
1243 __le16 action;
1244 __le16 events;
1245} __packed;
1246
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001247struct host_cmd_ds_command {
1248 __le16 command;
1249 __le16 size;
1250 __le16 seq_num;
1251 __le16 result;
1252 union {
1253 struct host_cmd_ds_get_hw_spec hw_spec;
1254 struct host_cmd_ds_mac_control mac_ctrl;
1255 struct host_cmd_ds_802_11_mac_address mac_addr;
1256 struct host_cmd_ds_mac_multicast_adr mc_addr;
1257 struct host_cmd_ds_802_11_get_log get_log;
1258 struct host_cmd_ds_802_11_rssi_info rssi_info;
1259 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1260 struct host_cmd_ds_802_11_snmp_mib smib;
1261 struct host_cmd_ds_802_11_rf_channel rf_channel;
1262 struct host_cmd_ds_tx_rate_query tx_rate;
1263 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1264 struct host_cmd_ds_txpwr_cfg txp_cfg;
1265 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1266 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1267 struct host_cmd_ds_802_11_scan scan;
1268 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1269 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1270 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1271 struct host_cmd_ds_802_11_associate associate;
1272 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1273 struct host_cmd_ds_802_11_deauthenticate deauth;
1274 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1275 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1276 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1277 struct host_cmd_ds_802_11d_domain_info domain_info;
1278 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1279 struct host_cmd_ds_11n_addba_req add_ba_req;
1280 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1281 struct host_cmd_ds_11n_delba del_ba;
1282 struct host_cmd_ds_txbuf_cfg tx_buf;
1283 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1284 struct host_cmd_ds_11n_cfg htcfg;
1285 struct host_cmd_ds_wmm_get_status get_wmm_status;
1286 struct host_cmd_ds_802_11_key_material key_material;
1287 struct host_cmd_ds_version_ext verext;
1288 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1289 struct host_cmd_ds_mac_reg_access mac_reg;
1290 struct host_cmd_ds_bbp_reg_access bbp_reg;
1291 struct host_cmd_ds_rf_reg_access rf_reg;
1292 struct host_cmd_ds_pmic_reg_access pmic_reg;
1293 struct host_cmd_ds_set_bss_mode bss_mode;
Amitkumar Karward930fae2011-10-11 17:41:21 -07001294 struct host_cmd_ds_pcie_details pcie_host_spec;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001295 struct host_cmd_ds_802_11_eeprom_access eeprom;
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -07001296 struct host_cmd_ds_802_11_subsc_evt subsc_evt;
Avinash Patil4db16a12012-05-08 18:30:20 -07001297 struct host_cmd_ds_sys_config uap_sys_config;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001298 } params;
1299} __packed;
1300
1301struct mwifiex_opt_sleep_confirm {
1302 __le16 command;
1303 __le16 size;
1304 __le16 seq_num;
1305 __le16 result;
1306 __le16 action;
Marc Yang2b06bdb2011-03-30 18:12:44 -07001307 __le16 resp_ctrl;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001308} __packed;
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001309#endif /* !_MWIFIEX_FW_H_ */