mwifiex: use IEEE80211_HT_CAP_ macros for 11n cap_info
[pandora-kernel.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         u16 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
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
60 extern u8 supported_rates_b[B_SUPPORTED_RATES];
61 extern u8 supported_rates_g[G_SUPPORTED_RATES];
62 extern u8 supported_rates_bg[BG_SUPPORTED_RATES];
63 extern u8 supported_rates_a[A_SUPPORTED_RATES];
64 extern u8 supported_rates_n[N_SUPPORTED_RATES];
65
66 #define HostCmd_WEP_KEY_INDEX_MASK              0x3fff
67
68 #define KEY_INFO_ENABLED        0x01
69 enum KEY_TYPE_ID {
70         KEY_TYPE_ID_WEP = 0,
71         KEY_TYPE_ID_TKIP,
72         KEY_TYPE_ID_AES,
73         KEY_TYPE_ID_WAPI,
74 };
75
76 enum KEY_INFO_WEP {
77         KEY_INFO_WEP_MCAST = 0x01,
78         KEY_INFO_WEP_UNICAST = 0x02,
79         KEY_INFO_WEP_ENABLED = 0x04
80 };
81
82 enum KEY_INFO_TKIP {
83         KEY_INFO_TKIP_MCAST = 0x01,
84         KEY_INFO_TKIP_UNICAST = 0x02,
85         KEY_INFO_TKIP_ENABLED = 0x04
86 };
87
88 enum KEY_INFO_AES {
89         KEY_INFO_AES_MCAST = 0x01,
90         KEY_INFO_AES_UNICAST = 0x02,
91         KEY_INFO_AES_ENABLED = 0x04
92 };
93
94 #define WAPI_KEY_LEN                    50
95
96 enum KEY_INFO_WAPI {
97         KEY_INFO_WAPI_MCAST = 0x01,
98         KEY_INFO_WAPI_UNICAST = 0x02,
99         KEY_INFO_WAPI_ENABLED = 0x04
100 };
101
102 #define MAX_POLL_TRIES                  100
103
104 #define MAX_MULTI_INTERFACE_POLL_TRIES  1000
105
106 #define MAX_FIRMWARE_POLL_TRIES                 100
107
108 #define FIRMWARE_READY                          0xfedc
109
110 #define FIRMWARE_TRANSFER_NBLOCK                2
111
112 enum MWIFIEX_802_11_PRIVACY_FILTER {
113         MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
114         MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
115 };
116
117 enum MWIFIEX_802_11_WEP_STATUS {
118         MWIFIEX_802_11_WEP_ENABLED,
119         MWIFIEX_802_11_WEP_DISABLED,
120 };
121
122 #define CAL_SNR(RSSI, NF)               ((s16)((s16)(RSSI)-(s16)(NF)))
123
124 #define PROPRIETARY_TLV_BASE_ID                 0x0100
125 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0)
126 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 1)
127 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 2)
128 #define TLV_TYPE_RSSI_LOW           (PROPRIETARY_TLV_BASE_ID + 4)
129 #define TLV_TYPE_SNR_LOW            (PROPRIETARY_TLV_BASE_ID + 5)
130 #define TLV_TYPE_FAILCOUNT          (PROPRIETARY_TLV_BASE_ID + 6)
131 #define TLV_TYPE_BCNMISS            (PROPRIETARY_TLV_BASE_ID + 7)
132 #define TLV_TYPE_LEDBEHAVIOR        (PROPRIETARY_TLV_BASE_ID + 9)
133 #define TLV_TYPE_PASSTHROUGH        (PROPRIETARY_TLV_BASE_ID + 10)
134 #define TLV_TYPE_POWER_TBL_2_4GHZ   (PROPRIETARY_TLV_BASE_ID + 12)
135 #define TLV_TYPE_POWER_TBL_5GHZ     (PROPRIETARY_TLV_BASE_ID + 13)
136 #define TLV_TYPE_WMMQSTATUS         (PROPRIETARY_TLV_BASE_ID + 16)
137 #define TLV_TYPE_WILDCARDSSID       (PROPRIETARY_TLV_BASE_ID + 18)
138 #define TLV_TYPE_TSFTIMESTAMP       (PROPRIETARY_TLV_BASE_ID + 19)
139 #define TLV_TYPE_RSSI_HIGH          (PROPRIETARY_TLV_BASE_ID + 22)
140 #define TLV_TYPE_SNR_HIGH           (PROPRIETARY_TLV_BASE_ID + 23)
141
142 #define TLV_TYPE_STARTBGSCANLATER   (PROPRIETARY_TLV_BASE_ID + 30)
143 #define TLV_TYPE_AUTH_TYPE          (PROPRIETARY_TLV_BASE_ID + 31)
144 #define TLV_TYPE_LINK_QUALITY       (PROPRIETARY_TLV_BASE_ID + 36)
145 #define TLV_TYPE_RSSI_LOW_DATA      (PROPRIETARY_TLV_BASE_ID + 38)
146 #define TLV_TYPE_SNR_LOW_DATA       (PROPRIETARY_TLV_BASE_ID + 39)
147 #define TLV_TYPE_RSSI_HIGH_DATA     (PROPRIETARY_TLV_BASE_ID + 40)
148 #define TLV_TYPE_SNR_HIGH_DATA      (PROPRIETARY_TLV_BASE_ID + 41)
149
150 #define TLV_TYPE_CHANNELBANDLIST    (PROPRIETARY_TLV_BASE_ID + 42)
151 #define TLV_TYPE_WAPI_IE            (PROPRIETARY_TLV_BASE_ID + 94)
152 #define TLV_TYPE_BSSID              (PROPRIETARY_TLV_BASE_ID + 35)
153
154 #define MWIFIEX_TX_DATA_BUF_SIZE_2K        2048
155
156 #define TLV_TYPE_HT_CAP                  (PROPRIETARY_TLV_BASE_ID + 74)
157 #define TLV_TYPE_HT_INFO                 (PROPRIETARY_TLV_BASE_ID + 75)
158 #define TLV_SECONDARY_CHANNEL_OFFSET     (PROPRIETARY_TLV_BASE_ID + 76)
159 #define TLV_TYPE_2040BSS_COEXISTENCE     (PROPRIETARY_TLV_BASE_ID + 77)
160 #define TLV_TYPE_OVERLAP_BSS_SCAN_PARAM  (PROPRIETARY_TLV_BASE_ID + 78)
161 #define TLV_TYPE_EXTCAP                  (PROPRIETARY_TLV_BASE_ID + 79)
162 #define TLV_TYPE_HT_OPERATIONAL_MCS_SET  (PROPRIETARY_TLV_BASE_ID + 80)
163
164 #define ADDBA_TID_MASK   (BIT(2) | BIT(3) | BIT(4) | BIT(5))
165 #define DELBA_TID_MASK   (BIT(12) | BIT(13) | BIT(14) | BIT(15))
166 #define SSN_MASK         0xfff0
167
168 #define BA_RESULT_SUCCESS        0x0
169 #define BA_RESULT_FAILURE        0x1
170 #define BA_RESULT_TIMEOUT        0x2
171 #define BA_RESULT_DATA_INVALID   0x3
172
173 #define IS_BASTREAM_SETUP(ptr)  (ptr->ba_status)
174
175 #define BA_STREAM_NOT_ALLOWED   0xff
176
177 #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
178                         priv->adapter->config_bands & BAND_AN) \
179                         && priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
180 #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
181                         BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
182
183 #define MWIFIEX_TX_DATA_BUF_SIZE_4K        4096
184 #define MWIFIEX_TX_DATA_BUF_SIZE_8K        8192
185 #define NON_GREENFIELD_STAS     0x04
186
187 #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
188
189 /* dev_cap bitmap
190  * BIT
191  * 0-16         reserved
192  * 17           IEEE80211_HT_CAP_SUP_WIDTH_20_40
193  * 18-22        reserved
194  * 23           IEEE80211_HT_CAP_SGI_20
195  * 24           IEEE80211_HT_CAP_SGI_40
196  * 25           IEEE80211_HT_CAP_TX_STBC
197  * 26           IEEE80211_HT_CAP_RX_STBC
198  * 27-28        reserved
199  * 29           IEEE80211_HT_CAP_GRN_FLD
200  * 30-31        reserved
201  */
202 #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
203 #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
204 #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
205 #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
206 #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
207 #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
208
209 #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
210 #define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11))
211 #define SETHT_MCS32(x) (x[4] |= 1)
212
213 #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
214
215 #define LLC_SNAP_LEN    8
216
217 #define TLV_TYPE_RATE_DROP_PATTERN  (PROPRIETARY_TLV_BASE_ID + 81)
218 #define TLV_TYPE_RATE_DROP_CONTROL  (PROPRIETARY_TLV_BASE_ID + 82)
219 #define TLV_TYPE_RATE_SCOPE         (PROPRIETARY_TLV_BASE_ID + 83)
220
221 #define TLV_TYPE_POWER_GROUP        (PROPRIETARY_TLV_BASE_ID + 84)
222
223 #define MOD_CLASS_HR_DSSS       0x03
224 #define MOD_CLASS_OFDM          0x07
225 #define MOD_CLASS_HT            0x08
226 #define HT_BW_20    0
227 #define HT_BW_40    1
228
229 #define HostCmd_CMD_GET_HW_SPEC                       0x0003
230 #define HostCmd_CMD_802_11_SCAN                       0x0006
231 #define HostCmd_CMD_802_11_GET_LOG                    0x000b
232 #define HostCmd_CMD_MAC_MULTICAST_ADR                 0x0010
233 #define HostCmd_CMD_802_11_EEPROM_ACCESS              0x0059
234 #define HostCmd_CMD_802_11_ASSOCIATE                  0x0012
235 #define HostCmd_CMD_802_11_SNMP_MIB                   0x0016
236 #define HostCmd_CMD_MAC_REG_ACCESS                    0x0019
237 #define HostCmd_CMD_BBP_REG_ACCESS                    0x001a
238 #define HostCmd_CMD_RF_REG_ACCESS                     0x001b
239 #define HostCmd_CMD_PMIC_REG_ACCESS                   0x00ad
240 #define HostCmd_CMD_802_11_RF_CHANNEL                 0x001d
241 #define HostCmd_CMD_802_11_DEAUTHENTICATE             0x0024
242 #define HostCmd_CMD_MAC_CONTROL                       0x0028
243 #define HostCmd_CMD_802_11_AD_HOC_START               0x002b
244 #define HostCmd_CMD_802_11_AD_HOC_JOIN                0x002c
245 #define HostCmd_CMD_802_11_AD_HOC_STOP                0x0040
246 #define HostCmd_CMD_802_11_MAC_ADDRESS                0x004D
247 #define HostCmd_CMD_802_11D_DOMAIN_INFO               0x005b
248 #define HostCmd_CMD_802_11_KEY_MATERIAL               0x005e
249 #define HostCmd_CMD_802_11_BG_SCAN_QUERY              0x006c
250 #define HostCmd_CMD_WMM_GET_STATUS                    0x0071
251 #define HostCmd_CMD_802_11_TX_RATE_QUERY              0x007f
252 #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS     0x0083
253 #define HostCmd_CMD_VERSION_EXT                       0x0097
254 #define HostCmd_CMD_RSSI_INFO                         0x00a4
255 #define HostCmd_CMD_FUNC_INIT                         0x00a9
256 #define HostCmd_CMD_FUNC_SHUTDOWN                     0x00aa
257 #define HostCmd_CMD_11N_CFG                           0x00cd
258 #define HostCmd_CMD_11N_ADDBA_REQ                     0x00ce
259 #define HostCmd_CMD_11N_ADDBA_RSP                     0x00cf
260 #define HostCmd_CMD_11N_DELBA                         0x00d0
261 #define HostCmd_CMD_RECONFIGURE_TX_BUFF               0x00d9
262 #define HostCmd_CMD_AMSDU_AGGR_CTRL                   0x00df
263 #define HostCmd_CMD_TXPWR_CFG                         0x00d1
264 #define HostCmd_CMD_TX_RATE_CFG                       0x00d6
265 #define HostCmd_CMD_802_11_PS_MODE_ENH                0x00e4
266 #define HostCmd_CMD_802_11_HS_CFG_ENH                 0x00e5
267 #define HostCmd_CMD_CAU_REG_ACCESS                    0x00ed
268 #define HostCmd_CMD_SET_BSS_MODE                      0x00f7
269
270
271 enum ENH_PS_MODES {
272         EN_PS = 1,
273         DIS_PS = 2,
274         EN_AUTO_DS = 3,
275         DIS_AUTO_DS = 4,
276         SLEEP_CONFIRM = 5,
277         GET_PS = 0,
278         EN_AUTO_PS = 0xff,
279         DIS_AUTO_PS = 0xfe,
280 };
281
282 #define HostCmd_RET_BIT                       0x8000
283 #define HostCmd_ACT_GEN_GET                   0x0000
284 #define HostCmd_ACT_GEN_SET                   0x0001
285 #define HostCmd_ACT_GEN_REMOVE                0x0004
286 #define HostCmd_ACT_SET_BOTH                  0x0003
287 #define HostCmd_ACT_GET_BOTH                  0x000c
288 #define HostCmd_RESULT_OK                     0x0000
289 #define HostCmd_RESULT_ERROR                  0x0001
290 #define HostCmd_RESULT_NOT_SUPPORT            0x0002
291 #define HostCmd_RESULT_PENDING                0x0003
292 #define HostCmd_RESULT_BUSY                   0x0004
293 #define HostCmd_RESULT_PARTIAL_DATA           0x0005
294
295 #define HostCmd_ACT_MAC_RX_ON                 0x0001
296 #define HostCmd_ACT_MAC_TX_ON                 0x0002
297 #define HostCmd_ACT_MAC_WEP_ENABLE            0x0008
298 #define HostCmd_ACT_MAC_ETHERNETII_ENABLE     0x0010
299 #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE    0x0080
300 #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE  0x0100
301 #define HostCmd_ACT_MAC_RTS_CTS_ENABLE        0x0200
302 #define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE  0x0400
303 #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON     0x2000
304
305 #define HostCmd_BSS_MODE_BSS                0x0001
306 #define HostCmd_BSS_MODE_IBSS               0x0002
307 #define HostCmd_BSS_MODE_ANY                0x0003
308
309 #define HostCmd_SCAN_RADIO_TYPE_BG          0
310 #define HostCmd_SCAN_RADIO_TYPE_A           1
311
312 #define HOST_SLEEP_CFG_CANCEL           0xffffffff
313 #define HOST_SLEEP_CFG_COND_DEF         0x0000000f
314 #define HOST_SLEEP_CFG_GPIO_DEF         0xff
315 #define HOST_SLEEP_CFG_GAP_DEF          0
316
317 #define CMD_F_HOSTCMD           (1 << 0)
318 #define CMD_F_CANCELED          (1 << 1)
319
320 #define HostCmd_CMD_ID_MASK             0x0fff
321
322 #define HostCmd_SEQ_NUM_MASK            0x00ff
323
324 #define HostCmd_BSS_NUM_MASK            0x0f00
325
326 #define HostCmd_BSS_TYPE_MASK           0xf000
327
328 #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) {   \
329         (((seq) & 0x00ff) |                             \
330          (((num) & 0x000f) << 8)) |                     \
331         (((type) & 0x000f) << 12);                  }
332
333 #define HostCmd_GET_SEQ_NO(seq)       \
334         ((seq) & HostCmd_SEQ_NUM_MASK)
335
336 #define HostCmd_GET_BSS_NO(seq)         \
337         (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
338
339 #define HostCmd_GET_BSS_TYPE(seq)       \
340         (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
341
342 #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL  0x00000001
343 #define EVENT_LINK_LOST                 0x00000003
344 #define EVENT_LINK_SENSED               0x00000004
345 #define EVENT_MIB_CHANGED               0x00000006
346 #define EVENT_INIT_DONE                 0x00000007
347 #define EVENT_DEAUTHENTICATED           0x00000008
348 #define EVENT_DISASSOCIATED             0x00000009
349 #define EVENT_PS_AWAKE                  0x0000000a
350 #define EVENT_PS_SLEEP                  0x0000000b
351 #define EVENT_MIC_ERR_MULTICAST         0x0000000d
352 #define EVENT_MIC_ERR_UNICAST           0x0000000e
353 #define EVENT_DEEP_SLEEP_AWAKE          0x00000010
354 #define EVENT_ADHOC_BCN_LOST            0x00000011
355
356 #define EVENT_WMM_STATUS_CHANGE         0x00000017
357 #define EVENT_BG_SCAN_REPORT            0x00000018
358 #define EVENT_RSSI_LOW                  0x00000019
359 #define EVENT_SNR_LOW                   0x0000001a
360 #define EVENT_MAX_FAIL                  0x0000001b
361 #define EVENT_RSSI_HIGH                 0x0000001c
362 #define EVENT_SNR_HIGH                  0x0000001d
363 #define EVENT_IBSS_COALESCED            0x0000001e
364 #define EVENT_DATA_RSSI_LOW             0x00000024
365 #define EVENT_DATA_SNR_LOW              0x00000025
366 #define EVENT_DATA_RSSI_HIGH            0x00000026
367 #define EVENT_DATA_SNR_HIGH             0x00000027
368 #define EVENT_LINK_QUALITY              0x00000028
369 #define EVENT_PORT_RELEASE              0x0000002b
370 #define EVENT_PRE_BEACON_LOST           0x00000031
371 #define EVENT_ADDBA                     0x00000033
372 #define EVENT_DELBA                     0x00000034
373 #define EVENT_BA_STREAM_TIEMOUT         0x00000037
374 #define EVENT_AMSDU_AGGR_CTRL           0x00000042
375 #define EVENT_WEP_ICV_ERR               0x00000046
376 #define EVENT_HS_ACT_REQ                0x00000047
377 #define EVENT_BW_CHANGE                 0x00000048
378
379 #define EVENT_HOSTWAKE_STAIE            0x0000004d
380
381 #define EVENT_ID_MASK                   0xffff
382 #define BSS_NUM_MASK                    0xf
383
384 #define EVENT_GET_BSS_NUM(event_cause)          \
385         (((event_cause) >> 16) & BSS_NUM_MASK)
386
387 #define EVENT_GET_BSS_TYPE(event_cause)         \
388         (((event_cause) >> 24) & 0x00ff)
389
390 struct mwifiex_event_wep_icv_err {
391         u16 reason_code;
392         u8 src_mac_addr[ETH_ALEN];
393         u8 wep_key_index;
394         u8 wep_key_length;
395         u8 key[WLAN_KEY_LEN_WEP104];
396 };
397
398 struct mwifiex_802_11_fixed_ies {
399         u8 time_stamp[8];
400         __le16 beacon_interval;
401         __le16 capabilities;
402 };
403
404 struct mwifiex_ie_types_header {
405         __le16 type;
406         __le16 len;
407 } __packed;
408
409 struct mwifiex_ie_types_data {
410         struct mwifiex_ie_types_header header;
411         u8 data[1];
412 } __packed;
413
414 #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
415 #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
416
417 struct txpd {
418         u8 bss_type;
419         u8 bss_num;
420         __le16 tx_pkt_length;
421         __le16 tx_pkt_offset;
422         __le16 tx_pkt_type;
423         __le32 tx_control;
424         u8 priority;
425         u8 flags;
426         u8 pkt_delay_2ms;
427         u8 reserved1;
428 } __packed;
429
430 struct rxpd {
431         u8 bss_type;
432         u8 bss_num;
433         u16 rx_pkt_length;
434         u16 rx_pkt_offset;
435         u16 rx_pkt_type;
436         u16 seq_num;
437         u8 priority;
438         u8 rx_rate;
439         s8 snr;
440         s8 nf;
441         /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
442          * [Bit 1]  HT Bandwidth: BW20 = 0, BW40 = 1
443          * [Bit 2]  HT Guard Interval: LGI = 0, SGI = 1 */
444         u8 ht_info;
445         u8 reserved;
446 } __packed;
447
448 enum mwifiex_chan_scan_mode_bitmasks {
449         MWIFIEX_PASSIVE_SCAN = BIT(0),
450         MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
451 };
452
453 #define SECOND_CHANNEL_BELOW    0x30
454 #define SECOND_CHANNEL_ABOVE    0x10
455 struct mwifiex_chan_scan_param_set {
456         u8 radio_type;
457         u8 chan_number;
458         u8 chan_scan_mode_bitmap;
459         __le16 min_scan_time;
460         __le16 max_scan_time;
461 } __packed;
462
463 struct mwifiex_ie_types_chan_list_param_set {
464         struct mwifiex_ie_types_header header;
465         struct mwifiex_chan_scan_param_set chan_scan_param[1];
466 } __packed;
467
468 struct chan_band_param_set {
469         u8 radio_type;
470         u8 chan_number;
471 };
472
473 struct mwifiex_ie_types_chan_band_list_param_set {
474         struct mwifiex_ie_types_header header;
475         struct chan_band_param_set chan_band_param[1];
476 } __packed;
477
478 struct mwifiex_ie_types_rates_param_set {
479         struct mwifiex_ie_types_header header;
480         u8 rates[1];
481 } __packed;
482
483 struct mwifiex_ie_types_ssid_param_set {
484         struct mwifiex_ie_types_header header;
485         u8 ssid[1];
486 } __packed;
487
488 struct mwifiex_ie_types_num_probes {
489         struct mwifiex_ie_types_header header;
490         __le16 num_probes;
491 } __packed;
492
493 struct mwifiex_ie_types_wildcard_ssid_params {
494         struct mwifiex_ie_types_header header;
495         u8 max_ssid_length;
496         u8 ssid[1];
497 } __packed;
498
499 #define TSF_DATA_SIZE            8
500 struct mwifiex_ie_types_tsf_timestamp {
501         struct mwifiex_ie_types_header header;
502         u8 tsf_data[1];
503 } __packed;
504
505 struct mwifiex_cf_param_set {
506         u8 cfp_cnt;
507         u8 cfp_period;
508         u16 cfp_max_duration;
509         u16 cfp_duration_remaining;
510 } __packed;
511
512 struct mwifiex_ibss_param_set {
513         u16 atim_window;
514 } __packed;
515
516 struct mwifiex_ie_types_ss_param_set {
517         struct mwifiex_ie_types_header header;
518         union {
519                 struct mwifiex_cf_param_set cf_param_set[1];
520                 struct mwifiex_ibss_param_set ibss_param_set[1];
521         } cf_ibss;
522 } __packed;
523
524 struct mwifiex_fh_param_set {
525         u16 dwell_time;
526         u8 hop_set;
527         u8 hop_pattern;
528         u8 hop_index;
529 } __packed;
530
531 struct mwifiex_ds_param_set {
532         u8 current_chan;
533 } __packed;
534
535 struct mwifiex_ie_types_phy_param_set {
536         struct mwifiex_ie_types_header header;
537         union {
538                 struct mwifiex_fh_param_set fh_param_set[1];
539                 struct mwifiex_ds_param_set ds_param_set[1];
540         } fh_ds;
541 } __packed;
542
543 struct mwifiex_ie_types_auth_type {
544         struct mwifiex_ie_types_header header;
545         __le16 auth_type;
546 } __packed;
547
548 struct mwifiex_ie_types_vendor_param_set {
549         struct mwifiex_ie_types_header header;
550         u8 ie[MWIFIEX_MAX_VSIE_LEN];
551 };
552
553 struct mwifiex_ie_types_rsn_param_set {
554         struct mwifiex_ie_types_header header;
555         u8 rsn_ie[1];
556 } __packed;
557
558 #define KEYPARAMSET_FIXED_LEN 6
559
560 struct mwifiex_ie_type_key_param_set {
561         __le16 type;
562         __le16 length;
563         __le16 key_type_id;
564         __le16 key_info;
565         __le16 key_len;
566         u8 key[50];
567 } __packed;
568
569 struct host_cmd_ds_802_11_key_material {
570         __le16 action;
571         struct mwifiex_ie_type_key_param_set key_param_set;
572 } __packed;
573
574 struct host_cmd_ds_gen {
575         u16 command;
576         u16 size;
577         u16 seq_num;
578         u16 result;
579 };
580
581 #define S_DS_GEN        sizeof(struct host_cmd_ds_gen)
582
583 enum sleep_resp_ctrl {
584         RESP_NOT_NEEDED = 0,
585         RESP_NEEDED,
586 };
587
588 struct mwifiex_ps_param {
589         __le16 null_pkt_interval;
590         __le16 multiple_dtims;
591         __le16 bcn_miss_timeout;
592         __le16 local_listen_interval;
593         __le16 adhoc_wake_period;
594         __le16 mode;
595         __le16 delay_to_ps;
596 };
597
598 struct mwifiex_auto_ds_param {
599         __le16 deep_sleep_timeout;
600 };
601
602 struct sleep_confirm_param {
603         __le16 resp_ctrl;
604 };
605
606 #define BITMAP_AUTO_DS         0x01
607 #define BITMAP_STA_PS          0x10
608 #define BITMAP_UAP_INACT_PS    0x100
609 #define BITMAP_UAP_DTIM_PS     0x200
610 struct auto_ps_param {
611         __le16 ps_bitmap;
612         /* auto deep sleep parameter,
613          * sta power save parameter
614          * uap inactivity parameter
615          * uap DTIM parameter */
616 };
617
618 #define AUTO_PS_FIX_SIZE    4
619
620 #define TLV_TYPE_AUTO_DS_PARAM        (PROPRIETARY_TLV_BASE_ID + 113)
621 #define TLV_TYPE_PS_PARAM             (PROPRIETARY_TLV_BASE_ID + 114)
622
623 struct mwifiex_ie_types_auto_ds_param {
624         struct mwifiex_ie_types_header header;
625         struct mwifiex_auto_ds_param param;
626 } __packed;
627
628 struct mwifiex_ie_types_ps_param {
629         struct mwifiex_ie_types_header header;
630         struct mwifiex_ps_param param;
631 } __packed;
632
633 struct host_cmd_ds_802_11_ps_mode_enh {
634         __le16 action;
635
636         union {
637                 struct mwifiex_ps_param opt_ps;
638                 struct mwifiex_auto_ds_param auto_ds;
639                 struct sleep_confirm_param sleep_cfm;
640                 __le16 ps_bitmap;
641                 struct auto_ps_param auto_ps;
642         } params;
643 } __packed;
644
645 struct host_cmd_ds_get_hw_spec {
646         __le16 hw_if_version;
647         __le16 version;
648         __le16 reserved;
649         __le16 num_of_mcast_adr;
650         u8 permanent_addr[ETH_ALEN];
651         __le16 region_code;
652         __le16 number_of_antenna;
653         __le32 fw_release_number;
654         __le32 reserved_1;
655         __le32 reserved_2;
656         __le32 reserved_3;
657         __le32 fw_cap_info;
658         __le32 dot_11n_dev_cap;
659         u8 dev_mcs_support;
660         __le16 mp_end_port;     /* SDIO only, reserved for other interfacces */
661         __le16 reserved_4;
662 } __packed;
663
664 struct host_cmd_ds_802_11_rssi_info {
665         __le16 action;
666         __le16 ndata;
667         __le16 nbcn;
668         __le16 reserved[9];
669         long long reserved_1;
670 };
671
672 struct host_cmd_ds_802_11_rssi_info_rsp {
673         __le16 action;
674         __le16 ndata;
675         __le16 nbcn;
676         __le16 data_rssi_last;
677         __le16 data_nf_last;
678         __le16 data_rssi_avg;
679         __le16 data_nf_avg;
680         __le16 bcn_rssi_last;
681         __le16 bcn_nf_last;
682         __le16 bcn_rssi_avg;
683         __le16 bcn_nf_avg;
684         long long tsf_bcn;
685 };
686
687 struct host_cmd_ds_802_11_mac_address {
688         __le16 action;
689         u8 mac_addr[ETH_ALEN];
690 };
691
692 struct host_cmd_ds_mac_control {
693         __le16 action;
694         __le16 reserved;
695 };
696
697 struct host_cmd_ds_mac_multicast_adr {
698         __le16 action;
699         __le16 num_of_adrs;
700         u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
701 } __packed;
702
703 struct host_cmd_ds_802_11_deauthenticate {
704         u8 mac_addr[ETH_ALEN];
705         __le16 reason_code;
706 } __packed;
707
708 struct host_cmd_ds_802_11_associate {
709         u8 peer_sta_addr[ETH_ALEN];
710         __le16 cap_info_bitmap;
711         __le16 listen_interval;
712         __le16 beacon_period;
713         u8 dtim_period;
714 } __packed;
715
716 struct ieee_types_assoc_rsp {
717         __le16 cap_info_bitmap;
718         __le16 status_code;
719         __le16 a_id;
720         u8 ie_buffer[1];
721 } __packed;
722
723 struct host_cmd_ds_802_11_associate_rsp {
724         struct ieee_types_assoc_rsp assoc_rsp;
725 } __packed;
726
727 struct ieee_types_cf_param_set {
728         u8 element_id;
729         u8 len;
730         u8 cfp_cnt;
731         u8 cfp_period;
732         u16 cfp_max_duration;
733         u16 cfp_duration_remaining;
734 } __packed;
735
736 struct ieee_types_ibss_param_set {
737         u8 element_id;
738         u8 len;
739         __le16 atim_window;
740 } __packed;
741
742 union ieee_types_ss_param_set {
743         struct ieee_types_cf_param_set cf_param_set;
744         struct ieee_types_ibss_param_set ibss_param_set;
745 } __packed;
746
747 struct ieee_types_fh_param_set {
748         u8 element_id;
749         u8 len;
750         __le16 dwell_time;
751         u8 hop_set;
752         u8 hop_pattern;
753         u8 hop_index;
754 } __packed;
755
756 struct ieee_types_ds_param_set {
757         u8 element_id;
758         u8 len;
759         u8 current_chan;
760 } __packed;
761
762 union ieee_types_phy_param_set {
763         struct ieee_types_fh_param_set fh_param_set;
764         struct ieee_types_ds_param_set ds_param_set;
765 } __packed;
766
767 struct host_cmd_ds_802_11_ad_hoc_start {
768         u8 ssid[IEEE80211_MAX_SSID_LEN];
769         u8 bss_mode;
770         __le16 beacon_period;
771         u8 dtim_period;
772         union ieee_types_ss_param_set ss_param_set;
773         union ieee_types_phy_param_set phy_param_set;
774         u16 reserved1;
775         __le16 cap_info_bitmap;
776         u8 DataRate[HOSTCMD_SUPPORTED_RATES];
777 } __packed;
778
779 struct host_cmd_ds_802_11_ad_hoc_result {
780         u8 pad[3];
781         u8 bssid[ETH_ALEN];
782 } __packed;
783
784 struct adhoc_bss_desc {
785         u8 bssid[ETH_ALEN];
786         u8 ssid[IEEE80211_MAX_SSID_LEN];
787         u8 bss_mode;
788         __le16 beacon_period;
789         u8 dtim_period;
790         u8 time_stamp[8];
791         u8 local_time[8];
792         union ieee_types_phy_param_set phy_param_set;
793         union ieee_types_ss_param_set ss_param_set;
794         __le16 cap_info_bitmap;
795         u8 data_rates[HOSTCMD_SUPPORTED_RATES];
796
797         /*
798          *  DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
799          *  It is used in the Adhoc join command and will cause a
800          *  binary layout mismatch with the firmware
801          */
802 } __packed;
803
804 struct host_cmd_ds_802_11_ad_hoc_join {
805         struct adhoc_bss_desc bss_descriptor;
806         u16 reserved1;
807         u16 reserved2;
808 } __packed;
809
810 struct host_cmd_ds_802_11_get_log {
811         __le32 mcast_tx_frame;
812         __le32 failed;
813         __le32 retry;
814         __le32 multi_retry;
815         __le32 frame_dup;
816         __le32 rts_success;
817         __le32 rts_failure;
818         __le32 ack_failure;
819         __le32 rx_frag;
820         __le32 mcast_rx_frame;
821         __le32 fcs_error;
822         __le32 tx_frame;
823         __le32 reserved;
824         __le32 wep_icv_err_cnt[4];
825 };
826
827 struct host_cmd_ds_tx_rate_query {
828         u8 tx_rate;
829         /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
830          * [Bit 1]  HT Bandwidth: BW20 = 0, BW40 = 1
831          * [Bit 2]  HT Guard Interval: LGI = 0, SGI = 1 */
832         u8 ht_info;
833 } __packed;
834
835 enum Host_Sleep_Action {
836         HS_CONFIGURE = 0x0001,
837         HS_ACTIVATE  = 0x0002,
838 };
839
840 struct mwifiex_hs_config_param {
841         __le32 conditions;
842         u8 gpio;
843         u8 gap;
844 } __packed;
845
846 struct hs_activate_param {
847         u16 resp_ctrl;
848 } __packed;
849
850 struct host_cmd_ds_802_11_hs_cfg_enh {
851         __le16 action;
852
853         union {
854                 struct mwifiex_hs_config_param hs_config;
855                 struct hs_activate_param hs_activate;
856         } params;
857 } __packed;
858
859 enum SNMP_MIB_INDEX {
860         OP_RATE_SET_I = 1,
861         DTIM_PERIOD_I = 3,
862         RTS_THRESH_I = 5,
863         SHORT_RETRY_LIM_I = 6,
864         LONG_RETRY_LIM_I = 7,
865         FRAG_THRESH_I = 8,
866         DOT11D_I = 9,
867 };
868
869 #define MAX_SNMP_BUF_SIZE   128
870
871 struct host_cmd_ds_802_11_snmp_mib {
872         __le16 query_type;
873         __le16 oid;
874         __le16 buf_size;
875         u8 value[1];
876 } __packed;
877
878 #define RADIO_ON                                0x01
879 #define RADIO_OFF                               0x00
880
881 struct mwifiex_rate_scope {
882         __le16 type;
883         __le16 length;
884         __le16 hr_dsss_rate_bitmap;
885         __le16 ofdm_rate_bitmap;
886         __le16 ht_mcs_rate_bitmap[8];
887 } __packed;
888
889 struct mwifiex_rate_drop_pattern {
890         __le16 type;
891         __le16 length;
892         __le32 rate_drop_mode;
893 } __packed;
894
895 struct host_cmd_ds_tx_rate_cfg {
896         __le16 action;
897         __le16 cfg_index;
898 } __packed;
899
900 struct mwifiex_power_group {
901         u8 modulation_class;
902         u8 first_rate_code;
903         u8 last_rate_code;
904         s8 power_step;
905         s8 power_min;
906         s8 power_max;
907         u8 ht_bandwidth;
908         u8 reserved;
909 } __packed;
910
911 struct mwifiex_types_power_group {
912         u16 type;
913         u16 length;
914 } __packed;
915
916 struct host_cmd_ds_txpwr_cfg {
917         __le16 action;
918         __le16 cfg_index;
919         __le32 mode;
920 } __packed;
921
922 #define MWIFIEX_USER_SCAN_CHAN_MAX             50
923
924 #define MWIFIEX_MAX_SSID_LIST_LENGTH         10
925
926 struct mwifiex_scan_cmd_config {
927         /*
928          *  BSS Type to be sent in the firmware command
929          *
930          *  Field can be used to restrict the types of networks returned in the
931          *    scan.  Valid settings are:
932          *
933          *   - MWIFIEX_SCAN_MODE_BSS  (infrastructure)
934          *   - MWIFIEX_SCAN_MODE_IBSS (adhoc)
935          *   - MWIFIEX_SCAN_MODE_ANY  (unrestricted, adhoc and infrastructure)
936          */
937         u8 bss_mode;
938
939         /* Specific BSSID used to filter scan results in the firmware */
940         u8 specific_bssid[ETH_ALEN];
941
942         /* Length of TLVs sent in command starting at tlvBuffer */
943         u32 tlv_buf_len;
944
945         /*
946          *  SSID TLV(s) and ChanList TLVs to be sent in the firmware command
947          *
948          *  TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
949          *  WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
950          */
951         u8 tlv_buf[1];  /* SSID TLV(s) and ChanList TLVs are stored
952                                    here */
953 } __packed;
954
955 struct mwifiex_user_scan_chan {
956         u8 chan_number;
957         u8 radio_type;
958         u8 scan_type;
959         u8 reserved;
960         u32 scan_time;
961 } __packed;
962
963 struct mwifiex_user_scan_ssid {
964         u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
965         u8 max_len;
966 } __packed;
967
968 struct mwifiex_user_scan_cfg {
969         /*
970          *  Flag set to keep the previous scan table intact
971          *
972          *  If set, the scan results will accumulate, replacing any previous
973          *   matched entries for a BSS with the new scan data
974          */
975         u8 keep_previous_scan;
976         /*
977          *  BSS mode to be sent in the firmware command
978          *
979          *  Field can be used to restrict the types of networks returned in the
980          *    scan.  Valid settings are:
981          *
982          *   - MWIFIEX_SCAN_MODE_BSS  (infrastructure)
983          *   - MWIFIEX_SCAN_MODE_IBSS (adhoc)
984          *   - MWIFIEX_SCAN_MODE_ANY  (unrestricted, adhoc and infrastructure)
985          */
986         u8 bss_mode;
987         /* Configure the number of probe requests for active chan scans */
988         u8 num_probes;
989         u8 reserved;
990         /* BSSID filter sent in the firmware command to limit the results */
991         u8 specific_bssid[ETH_ALEN];
992         /* SSID filter list used in the to limit the scan results */
993         struct mwifiex_user_scan_ssid ssid_list[MWIFIEX_MAX_SSID_LIST_LENGTH];
994         /* Variable number (fixed maximum) of channels to scan up */
995         struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
996 } __packed;
997
998 struct ie_body {
999         u8 grp_key_oui[4];
1000         u8 ptk_cnt[2];
1001         u8 ptk_body[4];
1002 } __packed;
1003
1004 struct host_cmd_ds_802_11_scan {
1005         u8 bss_mode;
1006         u8 bssid[ETH_ALEN];
1007         u8 tlv_buffer[1];
1008 } __packed;
1009
1010 struct host_cmd_ds_802_11_scan_rsp {
1011         __le16 bss_descript_size;
1012         u8 number_of_sets;
1013         u8 bss_desc_and_tlv_buffer[1];
1014 } __packed;
1015
1016 struct host_cmd_ds_802_11_bg_scan_query {
1017         u8 flush;
1018 } __packed;
1019
1020 struct host_cmd_ds_802_11_bg_scan_query_rsp {
1021         u32 report_condition;
1022         struct host_cmd_ds_802_11_scan_rsp scan_resp;
1023 } __packed;
1024
1025 struct mwifiex_ietypes_domain_param_set {
1026         struct mwifiex_ie_types_header header;
1027         u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
1028         struct ieee80211_country_ie_triplet triplet[1];
1029 } __packed;
1030
1031 struct host_cmd_ds_802_11d_domain_info {
1032         __le16 action;
1033         struct mwifiex_ietypes_domain_param_set domain;
1034 } __packed;
1035
1036 struct host_cmd_ds_802_11d_domain_info_rsp {
1037         __le16 action;
1038         struct mwifiex_ietypes_domain_param_set domain;
1039 } __packed;
1040
1041 struct host_cmd_ds_11n_addba_req {
1042         u8 add_req_result;
1043         u8 peer_mac_addr[ETH_ALEN];
1044         u8 dialog_token;
1045         __le16 block_ack_param_set;
1046         __le16 block_ack_tmo;
1047         __le16 ssn;
1048 } __packed;
1049
1050 struct host_cmd_ds_11n_addba_rsp {
1051         u8 add_rsp_result;
1052         u8 peer_mac_addr[ETH_ALEN];
1053         u8 dialog_token;
1054         __le16 status_code;
1055         __le16 block_ack_param_set;
1056         __le16 block_ack_tmo;
1057         __le16 ssn;
1058 } __packed;
1059
1060 struct host_cmd_ds_11n_delba {
1061         u8 del_result;
1062         u8 peer_mac_addr[ETH_ALEN];
1063         __le16 del_ba_param_set;
1064         __le16 reason_code;
1065         u8 reserved;
1066 } __packed;
1067
1068 struct host_cmd_ds_11n_batimeout {
1069         u8 tid;
1070         u8 peer_mac_addr[ETH_ALEN];
1071         u8 origninator;
1072 } __packed;
1073
1074 struct host_cmd_ds_11n_cfg {
1075         __le16 action;
1076         __le16 ht_tx_cap;
1077         __le16 ht_tx_info;
1078 } __packed;
1079
1080 struct host_cmd_ds_txbuf_cfg {
1081         __le16 action;
1082         __le16 buff_size;
1083         __le16 mp_end_port;     /* SDIO only, reserved for other interfacces */
1084         __le16 reserved3;
1085 } __packed;
1086
1087 struct host_cmd_ds_amsdu_aggr_ctrl {
1088         __le16 action;
1089         __le16 enable;
1090         __le16 curr_buf_size;
1091 } __packed;
1092
1093 struct mwifiex_ie_types_wmm_param_set {
1094         struct mwifiex_ie_types_header header;
1095         u8 wmm_ie[1];
1096 };
1097
1098 struct mwifiex_ie_types_wmm_queue_status {
1099         struct mwifiex_ie_types_header header;
1100         u8 queue_index;
1101         u8 disabled;
1102         u16 medium_time;
1103         u8 flow_required;
1104         u8 flow_created;
1105         u32 reserved;
1106 };
1107
1108 struct ieee_types_vendor_header {
1109         u8 element_id;
1110         u8 len;
1111         u8 oui[3];
1112         u8 oui_type;
1113         u8 oui_subtype;
1114         u8 version;
1115 } __packed;
1116
1117 struct ieee_types_wmm_ac_parameters {
1118         u8 aci_aifsn_bitmap;
1119         u8 ecw_bitmap;
1120         __le16 tx_op_limit;
1121 } __packed;
1122
1123 struct ieee_types_wmm_parameter {
1124         /*
1125          * WMM Parameter IE - Vendor Specific Header:
1126          *   element_id  [221/0xdd]
1127          *   Len         [24]
1128          *   Oui         [00:50:f2]
1129          *   OuiType     [2]
1130          *   OuiSubType  [1]
1131          *   Version     [1]
1132          */
1133         struct ieee_types_vendor_header vend_hdr;
1134         u8 qos_info_bitmap;
1135         u8 reserved;
1136         struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_MAX_QUEUES];
1137 } __packed;
1138
1139 struct ieee_types_wmm_info {
1140
1141         /*
1142          * WMM Info IE - Vendor Specific Header:
1143          *   element_id  [221/0xdd]
1144          *   Len         [7]
1145          *   Oui         [00:50:f2]
1146          *   OuiType     [2]
1147          *   OuiSubType  [0]
1148          *   Version     [1]
1149          */
1150         struct ieee_types_vendor_header vend_hdr;
1151
1152         u8 qos_info_bitmap;
1153 } __packed;
1154
1155 struct host_cmd_ds_wmm_get_status {
1156         u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
1157                               IEEE80211_MAX_QUEUES];
1158         u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
1159 } __packed;
1160
1161 struct mwifiex_wmm_ac_status {
1162         u8 disabled;
1163         u8 flow_required;
1164         u8 flow_created;
1165 };
1166
1167 struct mwifiex_ie_types_htcap {
1168         struct mwifiex_ie_types_header header;
1169         struct ieee80211_ht_cap ht_cap;
1170 } __packed;
1171
1172 struct mwifiex_ie_types_htinfo {
1173         struct mwifiex_ie_types_header header;
1174         struct ieee80211_ht_info ht_info;
1175 } __packed;
1176
1177 struct mwifiex_ie_types_2040bssco {
1178         struct mwifiex_ie_types_header header;
1179         u8 bss_co_2040;
1180 } __packed;
1181
1182 struct mwifiex_ie_types_extcap {
1183         struct mwifiex_ie_types_header header;
1184         u8 ext_cap;
1185 } __packed;
1186
1187 struct host_cmd_ds_mac_reg_access {
1188         __le16 action;
1189         __le16 offset;
1190         __le32 value;
1191 } __packed;
1192
1193 struct host_cmd_ds_bbp_reg_access {
1194         __le16 action;
1195         __le16 offset;
1196         u8 value;
1197         u8 reserved[3];
1198 } __packed;
1199
1200 struct host_cmd_ds_rf_reg_access {
1201         __le16 action;
1202         __le16 offset;
1203         u8 value;
1204         u8 reserved[3];
1205 } __packed;
1206
1207 struct host_cmd_ds_pmic_reg_access {
1208         __le16 action;
1209         __le16 offset;
1210         u8 value;
1211         u8 reserved[3];
1212 } __packed;
1213
1214 struct host_cmd_ds_802_11_eeprom_access {
1215         __le16 action;
1216
1217         __le16 offset;
1218         __le16 byte_count;
1219         u8 value;
1220 } __packed;
1221
1222 struct host_cmd_ds_802_11_rf_channel {
1223         __le16 action;
1224         __le16 current_channel;
1225         __le16 rf_type;
1226         __le16 reserved;
1227         u8 reserved_1[32];
1228 } __packed;
1229
1230 struct host_cmd_ds_version_ext {
1231         u8 version_str_sel;
1232         char version_str[128];
1233 } __packed;
1234
1235 struct host_cmd_ds_802_11_ibss_status {
1236         __le16 action;
1237         __le16 enable;
1238         u8 bssid[ETH_ALEN];
1239         __le16 beacon_interval;
1240         __le16 atim_window;
1241         __le16 use_g_rate_protect;
1242 } __packed;
1243
1244 #define CONNECTION_TYPE_INFRA   0
1245 #define CONNECTION_TYPE_ADHOC   1
1246
1247 struct host_cmd_ds_set_bss_mode {
1248         u8 con_type;
1249 } __packed;
1250
1251 struct host_cmd_ds_command {
1252         __le16 command;
1253         __le16 size;
1254         __le16 seq_num;
1255         __le16 result;
1256         union {
1257                 struct host_cmd_ds_get_hw_spec hw_spec;
1258                 struct host_cmd_ds_mac_control mac_ctrl;
1259                 struct host_cmd_ds_802_11_mac_address mac_addr;
1260                 struct host_cmd_ds_mac_multicast_adr mc_addr;
1261                 struct host_cmd_ds_802_11_get_log get_log;
1262                 struct host_cmd_ds_802_11_rssi_info rssi_info;
1263                 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
1264                 struct host_cmd_ds_802_11_snmp_mib smib;
1265                 struct host_cmd_ds_802_11_rf_channel rf_channel;
1266                 struct host_cmd_ds_tx_rate_query tx_rate;
1267                 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
1268                 struct host_cmd_ds_txpwr_cfg txp_cfg;
1269                 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
1270                 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
1271                 struct host_cmd_ds_802_11_scan scan;
1272                 struct host_cmd_ds_802_11_scan_rsp scan_resp;
1273                 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
1274                 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
1275                 struct host_cmd_ds_802_11_associate associate;
1276                 struct host_cmd_ds_802_11_associate_rsp associate_rsp;
1277                 struct host_cmd_ds_802_11_deauthenticate deauth;
1278                 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
1279                 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
1280                 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
1281                 struct host_cmd_ds_802_11d_domain_info domain_info;
1282                 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
1283                 struct host_cmd_ds_11n_addba_req add_ba_req;
1284                 struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
1285                 struct host_cmd_ds_11n_delba del_ba;
1286                 struct host_cmd_ds_txbuf_cfg tx_buf;
1287                 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
1288                 struct host_cmd_ds_11n_cfg htcfg;
1289                 struct host_cmd_ds_wmm_get_status get_wmm_status;
1290                 struct host_cmd_ds_802_11_key_material key_material;
1291                 struct host_cmd_ds_version_ext verext;
1292                 struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
1293                 struct host_cmd_ds_mac_reg_access mac_reg;
1294                 struct host_cmd_ds_bbp_reg_access bbp_reg;
1295                 struct host_cmd_ds_rf_reg_access rf_reg;
1296                 struct host_cmd_ds_pmic_reg_access pmic_reg;
1297                 struct host_cmd_ds_set_bss_mode bss_mode;
1298                 struct host_cmd_ds_802_11_eeprom_access eeprom;
1299         } params;
1300 } __packed;
1301
1302 struct mwifiex_opt_sleep_confirm {
1303         __le16 command;
1304         __le16 size;
1305         __le16 seq_num;
1306         __le16 result;
1307         __le16 action;
1308         struct sleep_confirm_param sleep_cfm;
1309 } __packed;
1310
1311 struct mwifiex_opt_sleep_confirm_buffer {
1312         u8 hdr[4];
1313         struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
1314 } __packed;
1315 #endif /* !_MWIFIEX_FW_H_ */