2 * Marvell Wireless LAN device driver: Firmware specific macros & structures
4 * Copyright (C) 2011, Marvell International Ltd.
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.
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.
20 #ifndef _MWIFIEX_FW_H_
21 #define _MWIFIEX_FW_H_
23 #include <linux/if_ether.h>
26 #define INTF_HEADER_LEN 4
36 struct rx_packet_hdr
{
37 struct ethhdr eth803_hdr
;
38 struct rfc_1042_hdr rfc1042_hdr
;
41 struct tx_packet_hdr
{
42 struct ethhdr eth803_hdr
;
43 struct rfc_1042_hdr rfc1042_hdr
;
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)
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)
60 #define SHORT_SLOT_TIME_DISABLED(CapInfo) (CapInfo &= ~BIT(10))
61 #define SHORT_SLOT_TIME_ENABLED(CapInfo) (CapInfo |= BIT(10))
63 extern u8 supported_rates_b
[B_SUPPORTED_RATES
];
64 extern u8 supported_rates_g
[G_SUPPORTED_RATES
];
65 extern u8 supported_rates_bg
[BG_SUPPORTED_RATES
];
66 extern u8 supported_rates_a
[A_SUPPORTED_RATES
];
67 extern u8 supported_rates_n
[N_SUPPORTED_RATES
];
69 #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
71 #define KEY_INFO_ENABLED 0x01
80 KEY_INFO_WEP_MCAST
= 0x01,
81 KEY_INFO_WEP_UNICAST
= 0x02,
82 KEY_INFO_WEP_ENABLED
= 0x04
86 KEY_INFO_TKIP_MCAST
= 0x01,
87 KEY_INFO_TKIP_UNICAST
= 0x02,
88 KEY_INFO_TKIP_ENABLED
= 0x04
92 KEY_INFO_AES_MCAST
= 0x01,
93 KEY_INFO_AES_UNICAST
= 0x02,
94 KEY_INFO_AES_ENABLED
= 0x04
97 #define WAPI_KEY_LEN 50
100 KEY_INFO_WAPI_MCAST
= 0x01,
101 KEY_INFO_WAPI_UNICAST
= 0x02,
102 KEY_INFO_WAPI_ENABLED
= 0x04
105 #define MAX_POLL_TRIES 100
107 #define MAX_MULTI_INTERFACE_POLL_TRIES 1000
109 #define MAX_FIRMWARE_POLL_TRIES 100
111 #define FIRMWARE_READY 0xfedc
113 #define FIRMWARE_TRANSFER_NBLOCK 2
115 enum MWIFIEX_802_11_PRIVACY_FILTER
{
116 MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL
,
117 MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
120 enum MWIFIEX_802_11_WEP_STATUS
{
121 MWIFIEX_802_11_WEP_ENABLED
,
122 MWIFIEX_802_11_WEP_DISABLED
,
125 #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
127 #define PROPRIETARY_TLV_BASE_ID 0x0100
128 #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
129 #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
130 #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
131 #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
132 #define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 5)
133 #define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 6)
134 #define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 7)
135 #define TLV_TYPE_LEDBEHAVIOR (PROPRIETARY_TLV_BASE_ID + 9)
136 #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
137 #define TLV_TYPE_POWER_TBL_2_4GHZ (PROPRIETARY_TLV_BASE_ID + 12)
138 #define TLV_TYPE_POWER_TBL_5GHZ (PROPRIETARY_TLV_BASE_ID + 13)
139 #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
140 #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
141 #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
142 #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
143 #define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 23)
145 #define TLV_TYPE_STARTBGSCANLATER (PROPRIETARY_TLV_BASE_ID + 30)
146 #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
147 #define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 36)
148 #define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 38)
149 #define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 39)
150 #define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 40)
151 #define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 41)
153 #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
154 #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
155 #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
157 #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
159 #define TLV_TYPE_HT_CAP (PROPRIETARY_TLV_BASE_ID + 74)
160 #define TLV_TYPE_HT_INFO (PROPRIETARY_TLV_BASE_ID + 75)
161 #define TLV_SECONDARY_CHANNEL_OFFSET (PROPRIETARY_TLV_BASE_ID + 76)
162 #define TLV_TYPE_2040BSS_COEXISTENCE (PROPRIETARY_TLV_BASE_ID + 77)
163 #define TLV_TYPE_OVERLAP_BSS_SCAN_PARAM (PROPRIETARY_TLV_BASE_ID + 78)
164 #define TLV_TYPE_EXTCAP (PROPRIETARY_TLV_BASE_ID + 79)
165 #define TLV_TYPE_HT_OPERATIONAL_MCS_SET (PROPRIETARY_TLV_BASE_ID + 80)
167 #define ADDBA_TID_MASK (BIT(2) | BIT(3) | BIT(4) | BIT(5))
168 #define DELBA_TID_MASK (BIT(12) | BIT(13) | BIT(14) | BIT(15))
169 #define SSN_MASK 0xfff0
171 #define BA_RESULT_SUCCESS 0x0
172 #define BA_RESULT_FAILURE 0x1
173 #define BA_RESULT_TIMEOUT 0x2
174 #define BA_RESULT_DATA_INVALID 0x3
176 #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
178 #define BA_STREAM_NOT_ALLOWED 0xff
180 #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
181 priv->adapter->config_bands & BAND_AN) \
182 && priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
183 #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
184 BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
186 #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
187 #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
188 #define MAX_RX_AMPDU_SIZE_64K 0x03
189 #define NON_GREENFIELD_STAS 0x04
191 #define HWSPEC_GREENFIELD_SUPP BIT(29)
192 #define HWSPEC_RXSTBC_SUPP BIT(26)
193 #define HWSPEC_SHORTGI40_SUPP BIT(24)
194 #define HWSPEC_SHORTGI20_SUPP BIT(23)
195 #define HWSPEC_CHANBW40_SUPP BIT(17)
197 #define DEFAULT_11N_CAP_MASK (HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP)
198 #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
199 #define ISSUPP_MAXAMSDU(Dot11nDevCap) (Dot11nDevCap & BIT(31))
200 #define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & BIT(30))
201 #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
202 #define ISSUPP_AMPDU(Dot11nDevCap) (Dot11nDevCap & BIT(28))
203 #define ISSUPP_MIMOPS(Dot11nDevCap) (Dot11nDevCap & BIT(27))
204 #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
205 #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
206 #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
207 #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
208 #define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
209 #define GET_DELAYEDBACK(Dot11nDevCap) (((Dot11nDevCap >> 20) & 0x03))
210 #define GET_IMMEDIATEBACK(Dot11nDevCap) (((Dot11nDevCap >> 18) & 0x03))
211 #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
212 #define ISSUPP_CHANWIDTH20(Dot11nDevCap) (Dot11nDevCap & BIT(16))
213 #define ISSUPP_CHANWIDTH10(Dot11nDevCap) (Dot11nDevCap & BIT(15))
214 #define ISENABLED_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
215 #define ISSUPP_RXANTENNAD(Dot11nDevCap) (Dot11nDevCap & BIT(7))
216 #define ISSUPP_RXANTENNAC(Dot11nDevCap) (Dot11nDevCap & BIT(6))
217 #define ISSUPP_RXANTENNAB(Dot11nDevCap) (Dot11nDevCap & BIT(5))
218 #define ISSUPP_RXANTENNAA(Dot11nDevCap) (Dot11nDevCap & BIT(4))
219 #define ISSUPP_TXANTENNAD(Dot11nDevCap) (Dot11nDevCap & BIT(3))
220 #define ISSUPP_TXANTENNAC(Dot11nDevCap) (Dot11nDevCap & BIT(2))
221 #define ISSUPP_TXANTENNAB(Dot11nDevCap) (Dot11nDevCap & BIT(1))
222 #define ISSUPP_TXANTENNAA(Dot11nDevCap) (Dot11nDevCap & BIT(0))
223 #define SETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap |= BIT(17))
224 #define RESETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap &= ~BIT(17))
225 #define GET_TXMCSSUPP(DevMCSSupported) (DevMCSSupported >> 4)
226 #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
227 #define GETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo & BIT(1))
228 #define GETHT_GREENFIELD(HTCapInfo) (HTCapInfo & BIT(4))
229 #define GETHT_SHORTGI20(HTCapInfo) (HTCapInfo & BIT(5))
230 #define GETHT_SHORTGI40(HTCapInfo) (HTCapInfo & BIT(6))
231 #define GETHT_TXSTBC(HTCapInfo) (HTCapInfo & BIT(7))
232 #define GETHT_RXSTBC(HTCapInfo) ((HTCapInfo >> 8) & 0x03)
233 #define GETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo & BIT(10))
234 #define GETHT_MAXAMSDU(HTCapInfo) (HTCapInfo & BIT(11))
235 #define SETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo |= BIT(1))
236 #define SETHT_GREENFIELD(HTCapInfo) (HTCapInfo |= BIT(4))
237 #define SETHT_SHORTGI20(HTCapInfo) (HTCapInfo |= BIT(5))
238 #define SETHT_SHORTGI40(HTCapInfo) (HTCapInfo |= BIT(6))
239 #define SETHT_TXSTBC(HTCapInfo) (HTCapInfo |= BIT(7))
240 #define SETHT_RXSTBC(HTCapInfo, value) (HTCapInfo |= (value << 8))
241 #define SETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo |= BIT(10))
242 #define SETHT_MAXAMSDU(HTCapInfo) (HTCapInfo |= BIT(11))
243 #define SETHT_DSSSCCK40(HTCapInfo) (HTCapInfo |= BIT(12))
244 #define SETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo |= BIT(14))
245 #define RESETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo &= ~BIT(1))
246 #define RESETHT_GREENFIELD(HTCapInfo) (HTCapInfo &= ~BIT(4))
247 #define RESETHT_SHORTGI20(HTCapInfo) (HTCapInfo &= ~BIT(5))
248 #define RESETHT_SHORTGI40(HTCapInfo) (HTCapInfo &= ~BIT(6))
249 #define RESETHT_TXSTBC(HTCapInfo) (HTCapInfo &= ~BIT(7))
250 #define RESETHT_RXSTBC(HTCapInfo) (HTCapInfo &= ~(0x03 << 8))
251 #define RESETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo &= ~BIT(10))
252 #define RESETHT_MAXAMSDU(HTCapInfo) (HTCapInfo &= ~BIT(11))
253 #define RESETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo &= ~BIT(14))
254 #define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11))
255 #define SETHT_MCS32(x) (x[4] |= 1)
256 #define SETHT_MCS_SET_DEFINED(x) (x[12] |= 1)
257 #define SETHT_RX_HIGHEST_DT_SUPP(x, y) ((*(u16 *) (x + 10)) = y)
258 #define AMPDU_FACTOR_64K 0x03
259 #define SETAMPDU_SIZE(x, y) do { \
264 #define SETAMPDU_SPACING(x, y) do { \
266 x |= (y & 0x07) << 2; \
269 #define ISSUPP_BANDA(FwCapInfo) (FwCapInfo & BIT(10))
270 #define ISALLOWED_CHANWIDTH40(Field2) (Field2 & BIT(2))
271 #define SET_CHANWIDTH40(Field2) (Field2 |= BIT(2))
272 #define RESET_CHANWIDTH40(Field2) (Field2 &= ~(BIT(0) | BIT(1) | BIT(2)))
273 #define GET_SECONDARYCHAN(Field2) (Field2 & (BIT(0) | BIT(1)))
274 #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
276 #define LLC_SNAP_LEN 8
278 #define TLV_TYPE_RATE_DROP_PATTERN (PROPRIETARY_TLV_BASE_ID + 81)
279 #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
280 #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
282 #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
284 #define MOD_CLASS_HR_DSSS 0x03
285 #define MOD_CLASS_OFDM 0x07
286 #define MOD_CLASS_HT 0x08
290 #define HostCmd_CMD_GET_HW_SPEC 0x0003
291 #define HostCmd_CMD_802_11_SCAN 0x0006
292 #define HostCmd_CMD_802_11_GET_LOG 0x000b
293 #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
294 #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
295 #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
296 #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
297 #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
298 #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
299 #define HostCmd_CMD_RF_REG_ACCESS 0x001b
300 #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
301 #define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
302 #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
303 #define HostCmd_CMD_MAC_CONTROL 0x0028
304 #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
305 #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
306 #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
307 #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
308 #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
309 #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
310 #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
311 #define HostCmd_CMD_WMM_GET_STATUS 0x0071
312 #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
313 #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
314 #define HostCmd_CMD_VERSION_EXT 0x0097
315 #define HostCmd_CMD_RSSI_INFO 0x00a4
316 #define HostCmd_CMD_FUNC_INIT 0x00a9
317 #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
318 #define HostCmd_CMD_11N_CFG 0x00cd
319 #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
320 #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
321 #define HostCmd_CMD_11N_DELBA 0x00d0
322 #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
323 #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
324 #define HostCmd_CMD_TXPWR_CFG 0x00d1
325 #define HostCmd_CMD_TX_RATE_CFG 0x00d6
326 #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
327 #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
328 #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
329 #define HostCmd_CMD_SET_BSS_MODE 0x00f7
343 #define HostCmd_RET_BIT 0x8000
344 #define HostCmd_ACT_GEN_GET 0x0000
345 #define HostCmd_ACT_GEN_SET 0x0001
346 #define HostCmd_ACT_GEN_REMOVE 0x0004
347 #define HostCmd_ACT_SET_BOTH 0x0003
348 #define HostCmd_ACT_GET_BOTH 0x000c
349 #define HostCmd_RESULT_OK 0x0000
350 #define HostCmd_RESULT_ERROR 0x0001
351 #define HostCmd_RESULT_NOT_SUPPORT 0x0002
352 #define HostCmd_RESULT_PENDING 0x0003
353 #define HostCmd_RESULT_BUSY 0x0004
354 #define HostCmd_RESULT_PARTIAL_DATA 0x0005
356 #define HostCmd_ACT_MAC_RX_ON 0x0001
357 #define HostCmd_ACT_MAC_TX_ON 0x0002
358 #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
359 #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
360 #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
361 #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
362 #define HostCmd_ACT_MAC_RTS_CTS_ENABLE 0x0200
363 #define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
364 #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
366 #define HostCmd_BSS_MODE_BSS 0x0001
367 #define HostCmd_BSS_MODE_IBSS 0x0002
368 #define HostCmd_BSS_MODE_ANY 0x0003
370 #define HostCmd_SCAN_RADIO_TYPE_BG 0
371 #define HostCmd_SCAN_RADIO_TYPE_A 1
373 #define HOST_SLEEP_CFG_CANCEL 0xffffffff
374 #define HOST_SLEEP_CFG_COND_DEF 0x0000000f
375 #define HOST_SLEEP_CFG_GPIO_DEF 0xff
376 #define HOST_SLEEP_CFG_GAP_DEF 0
378 #define CMD_F_HOSTCMD (1 << 0)
379 #define CMD_F_CANCELED (1 << 1)
381 #define HostCmd_CMD_ID_MASK 0x0fff
383 #define HostCmd_SEQ_NUM_MASK 0x00ff
385 #define HostCmd_BSS_NUM_MASK 0x0f00
387 #define HostCmd_BSS_TYPE_MASK 0xf000
389 #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
390 (((seq) & 0x00ff) | \
391 (((num) & 0x000f) << 8)) | \
392 (((type) & 0x000f) << 12); }
394 #define HostCmd_GET_SEQ_NO(seq) \
395 ((seq) & HostCmd_SEQ_NUM_MASK)
397 #define HostCmd_GET_BSS_NO(seq) \
398 (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
400 #define HostCmd_GET_BSS_TYPE(seq) \
401 (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
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
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_PRE_BEACON_LOST 0x00000031
432 #define EVENT_ADDBA 0x00000033
433 #define EVENT_DELBA 0x00000034
434 #define EVENT_BA_STREAM_TIEMOUT 0x00000037
435 #define EVENT_AMSDU_AGGR_CTRL 0x00000042
436 #define EVENT_WEP_ICV_ERR 0x00000046
437 #define EVENT_HS_ACT_REQ 0x00000047
438 #define EVENT_BW_CHANGE 0x00000048
440 #define EVENT_HOSTWAKE_STAIE 0x0000004d
442 #define EVENT_ID_MASK 0xffff
443 #define BSS_NUM_MASK 0xf
445 #define EVENT_GET_BSS_NUM(event_cause) \
446 (((event_cause) >> 16) & BSS_NUM_MASK)
448 #define EVENT_GET_BSS_TYPE(event_cause) \
449 (((event_cause) >> 24) & 0x00ff)
451 struct mwifiex_event_wep_icv_err
{
453 u8 src_mac_addr
[ETH_ALEN
];
456 u8 key
[WLAN_KEY_LEN_WEP104
];
459 struct mwifiex_802_11_fixed_ies
{
461 __le16 beacon_interval
;
465 struct mwifiex_ie_types_header
{
470 struct mwifiex_ie_types_data
{
471 struct mwifiex_ie_types_header header
;
475 #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
476 #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
481 __le16 tx_pkt_length
;
482 __le16 tx_pkt_offset
;
502 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
503 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
504 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
509 enum mwifiex_chan_scan_mode_bitmasks
{
510 MWIFIEX_PASSIVE_SCAN
= BIT(0),
511 MWIFIEX_DISABLE_CHAN_FILT
= BIT(1),
514 #define SECOND_CHANNEL_BELOW 0x30
515 #define SECOND_CHANNEL_ABOVE 0x10
516 struct mwifiex_chan_scan_param_set
{
519 u8 chan_scan_mode_bitmap
;
520 __le16 min_scan_time
;
521 __le16 max_scan_time
;
524 struct mwifiex_ie_types_chan_list_param_set
{
525 struct mwifiex_ie_types_header header
;
526 struct mwifiex_chan_scan_param_set chan_scan_param
[1];
529 struct chan_band_param_set
{
534 struct mwifiex_ie_types_chan_band_list_param_set
{
535 struct mwifiex_ie_types_header header
;
536 struct chan_band_param_set chan_band_param
[1];
539 struct mwifiex_ie_types_rates_param_set
{
540 struct mwifiex_ie_types_header header
;
544 struct mwifiex_ie_types_ssid_param_set
{
545 struct mwifiex_ie_types_header header
;
549 struct mwifiex_ie_types_num_probes
{
550 struct mwifiex_ie_types_header header
;
554 struct mwifiex_ie_types_wildcard_ssid_params
{
555 struct mwifiex_ie_types_header header
;
560 #define TSF_DATA_SIZE 8
561 struct mwifiex_ie_types_tsf_timestamp
{
562 struct mwifiex_ie_types_header header
;
566 struct mwifiex_cf_param_set
{
569 u16 cfp_max_duration
;
570 u16 cfp_duration_remaining
;
573 struct mwifiex_ibss_param_set
{
577 struct mwifiex_ie_types_ss_param_set
{
578 struct mwifiex_ie_types_header header
;
580 struct mwifiex_cf_param_set cf_param_set
[1];
581 struct mwifiex_ibss_param_set ibss_param_set
[1];
585 struct mwifiex_fh_param_set
{
592 struct mwifiex_ds_param_set
{
596 struct mwifiex_ie_types_phy_param_set
{
597 struct mwifiex_ie_types_header header
;
599 struct mwifiex_fh_param_set fh_param_set
[1];
600 struct mwifiex_ds_param_set ds_param_set
[1];
604 struct mwifiex_ie_types_auth_type
{
605 struct mwifiex_ie_types_header header
;
609 struct mwifiex_ie_types_vendor_param_set
{
610 struct mwifiex_ie_types_header header
;
611 u8 ie
[MWIFIEX_MAX_VSIE_LEN
];
614 struct mwifiex_ie_types_rsn_param_set
{
615 struct mwifiex_ie_types_header header
;
619 #define KEYPARAMSET_FIXED_LEN 6
621 struct mwifiex_ie_type_key_param_set
{
630 struct host_cmd_ds_802_11_key_material
{
632 struct mwifiex_ie_type_key_param_set key_param_set
;
635 struct host_cmd_ds_gen
{
642 #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
644 enum sleep_resp_ctrl
{
649 struct mwifiex_ps_param
{
650 __le16 null_pkt_interval
;
651 __le16 multiple_dtims
;
652 __le16 bcn_miss_timeout
;
653 __le16 local_listen_interval
;
654 __le16 adhoc_wake_period
;
659 struct mwifiex_auto_ds_param
{
660 __le16 deep_sleep_timeout
;
663 struct sleep_confirm_param
{
667 #define BITMAP_AUTO_DS 0x01
668 #define BITMAP_STA_PS 0x10
669 #define BITMAP_UAP_INACT_PS 0x100
670 #define BITMAP_UAP_DTIM_PS 0x200
671 struct auto_ps_param
{
673 /* auto deep sleep parameter,
674 * sta power save parameter
675 * uap inactivity parameter
676 * uap DTIM parameter */
679 #define AUTO_PS_FIX_SIZE 4
681 #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
682 #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
684 struct mwifiex_ie_types_auto_ds_param
{
685 struct mwifiex_ie_types_header header
;
686 struct mwifiex_auto_ds_param param
;
689 struct mwifiex_ie_types_ps_param
{
690 struct mwifiex_ie_types_header header
;
691 struct mwifiex_ps_param param
;
694 struct host_cmd_ds_802_11_ps_mode_enh
{
698 struct mwifiex_ps_param opt_ps
;
699 struct mwifiex_auto_ds_param auto_ds
;
700 struct sleep_confirm_param sleep_cfm
;
702 struct auto_ps_param auto_ps
;
706 struct host_cmd_ds_get_hw_spec
{
707 __le16 hw_if_version
;
710 __le16 num_of_mcast_adr
;
711 u8 permanent_addr
[ETH_ALEN
];
713 __le16 number_of_antenna
;
714 __le32 fw_release_number
;
719 __le32 dot_11n_dev_cap
;
721 __le16 mp_end_port
; /* SDIO only, reserved for other interfacces */
725 struct host_cmd_ds_802_11_rssi_info
{
730 long long reserved_1
;
733 struct host_cmd_ds_802_11_rssi_info_rsp
{
737 __le16 data_rssi_last
;
739 __le16 data_rssi_avg
;
741 __le16 bcn_rssi_last
;
748 struct host_cmd_ds_802_11_mac_address
{
750 u8 mac_addr
[ETH_ALEN
];
753 struct host_cmd_ds_mac_control
{
758 struct host_cmd_ds_mac_multicast_adr
{
761 u8 mac_list
[MWIFIEX_MAX_MULTICAST_LIST_SIZE
][ETH_ALEN
];
764 struct host_cmd_ds_802_11_deauthenticate
{
765 u8 mac_addr
[ETH_ALEN
];
769 struct host_cmd_ds_802_11_associate
{
770 u8 peer_sta_addr
[ETH_ALEN
];
771 __le16 cap_info_bitmap
;
772 __le16 listen_interval
;
773 __le16 beacon_period
;
777 struct ieee_types_assoc_rsp
{
778 __le16 cap_info_bitmap
;
784 struct host_cmd_ds_802_11_associate_rsp
{
785 struct ieee_types_assoc_rsp assoc_rsp
;
788 struct ieee_types_cf_param_set
{
793 u16 cfp_max_duration
;
794 u16 cfp_duration_remaining
;
797 struct ieee_types_ibss_param_set
{
803 union ieee_types_ss_param_set
{
804 struct ieee_types_cf_param_set cf_param_set
;
805 struct ieee_types_ibss_param_set ibss_param_set
;
808 struct ieee_types_fh_param_set
{
817 struct ieee_types_ds_param_set
{
823 union ieee_types_phy_param_set
{
824 struct ieee_types_fh_param_set fh_param_set
;
825 struct ieee_types_ds_param_set ds_param_set
;
828 struct host_cmd_ds_802_11_ad_hoc_start
{
829 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
831 __le16 beacon_period
;
833 union ieee_types_ss_param_set ss_param_set
;
834 union ieee_types_phy_param_set phy_param_set
;
836 __le16 cap_info_bitmap
;
837 u8 DataRate
[HOSTCMD_SUPPORTED_RATES
];
840 struct host_cmd_ds_802_11_ad_hoc_result
{
845 struct adhoc_bss_desc
{
847 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
849 __le16 beacon_period
;
853 union ieee_types_phy_param_set phy_param_set
;
854 union ieee_types_ss_param_set ss_param_set
;
855 __le16 cap_info_bitmap
;
856 u8 data_rates
[HOSTCMD_SUPPORTED_RATES
];
859 * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
860 * It is used in the Adhoc join command and will cause a
861 * binary layout mismatch with the firmware
865 struct host_cmd_ds_802_11_ad_hoc_join
{
866 struct adhoc_bss_desc bss_descriptor
;
871 struct host_cmd_ds_802_11_get_log
{
872 __le32 mcast_tx_frame
;
881 __le32 mcast_rx_frame
;
885 __le32 wep_icv_err_cnt
[4];
888 struct host_cmd_ds_tx_rate_query
{
890 /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
891 * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
892 * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
896 enum Host_Sleep_Action
{
897 HS_CONFIGURE
= 0x0001,
898 HS_ACTIVATE
= 0x0002,
901 struct mwifiex_hs_config_param
{
907 struct hs_activate_param
{
911 struct host_cmd_ds_802_11_hs_cfg_enh
{
915 struct mwifiex_hs_config_param hs_config
;
916 struct hs_activate_param hs_activate
;
920 enum SNMP_MIB_INDEX
{
924 SHORT_RETRY_LIM_I
= 6,
925 LONG_RETRY_LIM_I
= 7,
930 #define MAX_SNMP_BUF_SIZE 128
932 struct host_cmd_ds_802_11_snmp_mib
{
939 #define RADIO_ON 0x01
940 #define RADIO_OFF 0x00
942 struct mwifiex_rate_scope
{
945 __le16 hr_dsss_rate_bitmap
;
946 __le16 ofdm_rate_bitmap
;
947 __le16 ht_mcs_rate_bitmap
[8];
950 struct mwifiex_rate_drop_pattern
{
953 __le32 rate_drop_mode
;
956 struct host_cmd_ds_tx_rate_cfg
{
961 struct mwifiex_power_group
{
972 struct mwifiex_types_power_group
{
977 struct host_cmd_ds_txpwr_cfg
{
983 #define MWIFIEX_USER_SCAN_CHAN_MAX 50
985 #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
987 struct mwifiex_scan_cmd_config
{
989 * BSS Type to be sent in the firmware command
991 * Field can be used to restrict the types of networks returned in the
992 * scan. Valid settings are:
994 * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
995 * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
996 * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
1000 /* Specific BSSID used to filter scan results in the firmware */
1001 u8 specific_bssid
[ETH_ALEN
];
1003 /* Length of TLVs sent in command starting at tlvBuffer */
1007 * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
1009 * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
1010 * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
1012 u8 tlv_buf
[1]; /* SSID TLV(s) and ChanList TLVs are stored
1016 struct mwifiex_user_scan_chan
{
1024 struct mwifiex_user_scan_ssid
{
1025 u8 ssid
[IEEE80211_MAX_SSID_LEN
+ 1];
1029 struct mwifiex_user_scan_cfg
{
1031 * Flag set to keep the previous scan table intact
1033 * If set, the scan results will accumulate, replacing any previous
1034 * matched entries for a BSS with the new scan data
1036 u8 keep_previous_scan
;
1038 * BSS mode to be sent in the firmware command
1040 * Field can be used to restrict the types of networks returned in the
1041 * scan. Valid settings are:
1043 * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
1044 * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
1045 * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
1048 /* Configure the number of probe requests for active chan scans */
1051 /* BSSID filter sent in the firmware command to limit the results */
1052 u8 specific_bssid
[ETH_ALEN
];
1053 /* SSID filter list used in the to limit the scan results */
1054 struct mwifiex_user_scan_ssid ssid_list
[MWIFIEX_MAX_SSID_LIST_LENGTH
];
1055 /* Variable number (fixed maximum) of channels to scan up */
1056 struct mwifiex_user_scan_chan chan_list
[MWIFIEX_USER_SCAN_CHAN_MAX
];
1065 struct host_cmd_ds_802_11_scan
{
1071 struct host_cmd_ds_802_11_scan_rsp
{
1072 __le16 bss_descript_size
;
1074 u8 bss_desc_and_tlv_buffer
[1];
1077 struct host_cmd_ds_802_11_bg_scan_query
{
1081 struct host_cmd_ds_802_11_bg_scan_query_rsp
{
1082 u32 report_condition
;
1083 struct host_cmd_ds_802_11_scan_rsp scan_resp
;
1086 struct mwifiex_ietypes_domain_param_set
{
1087 struct mwifiex_ie_types_header header
;
1088 u8 country_code
[IEEE80211_COUNTRY_STRING_LEN
];
1089 struct ieee80211_country_ie_triplet triplet
[1];
1092 struct host_cmd_ds_802_11d_domain_info
{
1094 struct mwifiex_ietypes_domain_param_set domain
;
1097 struct host_cmd_ds_802_11d_domain_info_rsp
{
1099 struct mwifiex_ietypes_domain_param_set domain
;
1102 struct host_cmd_ds_11n_addba_req
{
1104 u8 peer_mac_addr
[ETH_ALEN
];
1106 __le16 block_ack_param_set
;
1107 __le16 block_ack_tmo
;
1111 struct host_cmd_ds_11n_addba_rsp
{
1113 u8 peer_mac_addr
[ETH_ALEN
];
1116 __le16 block_ack_param_set
;
1117 __le16 block_ack_tmo
;
1121 struct host_cmd_ds_11n_delba
{
1123 u8 peer_mac_addr
[ETH_ALEN
];
1124 __le16 del_ba_param_set
;
1129 struct host_cmd_ds_11n_batimeout
{
1131 u8 peer_mac_addr
[ETH_ALEN
];
1135 struct host_cmd_ds_11n_cfg
{
1141 struct host_cmd_ds_txbuf_cfg
{
1144 __le16 mp_end_port
; /* SDIO only, reserved for other interfacces */
1148 struct host_cmd_ds_amsdu_aggr_ctrl
{
1151 __le16 curr_buf_size
;
1154 struct mwifiex_ie_types_wmm_param_set
{
1155 struct mwifiex_ie_types_header header
;
1159 struct mwifiex_ie_types_wmm_queue_status
{
1160 struct mwifiex_ie_types_header header
;
1169 struct ieee_types_vendor_header
{
1178 struct ieee_types_wmm_ac_parameters
{
1179 u8 aci_aifsn_bitmap
;
1184 struct ieee_types_wmm_parameter
{
1186 * WMM Parameter IE - Vendor Specific Header:
1187 * element_id [221/0xdd]
1194 struct ieee_types_vendor_header vend_hdr
;
1197 struct ieee_types_wmm_ac_parameters ac_params
[IEEE80211_MAX_QUEUES
];
1200 struct ieee_types_wmm_info
{
1203 * WMM Info IE - Vendor Specific Header:
1204 * element_id [221/0xdd]
1211 struct ieee_types_vendor_header vend_hdr
;
1216 struct host_cmd_ds_wmm_get_status
{
1217 u8 queue_status_tlv
[sizeof(struct mwifiex_ie_types_wmm_queue_status
) *
1218 IEEE80211_MAX_QUEUES
];
1219 u8 wmm_param_tlv
[sizeof(struct ieee_types_wmm_parameter
) + 2];
1222 struct mwifiex_wmm_ac_status
{
1228 struct mwifiex_ie_types_htcap
{
1229 struct mwifiex_ie_types_header header
;
1230 struct ieee80211_ht_cap ht_cap
;
1233 struct mwifiex_ie_types_htinfo
{
1234 struct mwifiex_ie_types_header header
;
1235 struct ieee80211_ht_info ht_info
;
1238 struct mwifiex_ie_types_2040bssco
{
1239 struct mwifiex_ie_types_header header
;
1243 struct mwifiex_ie_types_extcap
{
1244 struct mwifiex_ie_types_header header
;
1248 struct host_cmd_ds_mac_reg_access
{
1254 struct host_cmd_ds_bbp_reg_access
{
1261 struct host_cmd_ds_rf_reg_access
{
1268 struct host_cmd_ds_pmic_reg_access
{
1275 struct host_cmd_ds_802_11_eeprom_access
{
1283 struct host_cmd_ds_802_11_rf_channel
{
1285 __le16 current_channel
;
1291 struct host_cmd_ds_version_ext
{
1293 char version_str
[128];
1296 struct host_cmd_ds_802_11_ibss_status
{
1300 __le16 beacon_interval
;
1302 __le16 use_g_rate_protect
;
1305 #define CONNECTION_TYPE_INFRA 0
1306 #define CONNECTION_TYPE_ADHOC 1
1308 struct host_cmd_ds_set_bss_mode
{
1312 struct host_cmd_ds_command
{
1318 struct host_cmd_ds_get_hw_spec hw_spec
;
1319 struct host_cmd_ds_mac_control mac_ctrl
;
1320 struct host_cmd_ds_802_11_mac_address mac_addr
;
1321 struct host_cmd_ds_mac_multicast_adr mc_addr
;
1322 struct host_cmd_ds_802_11_get_log get_log
;
1323 struct host_cmd_ds_802_11_rssi_info rssi_info
;
1324 struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp
;
1325 struct host_cmd_ds_802_11_snmp_mib smib
;
1326 struct host_cmd_ds_802_11_rf_channel rf_channel
;
1327 struct host_cmd_ds_tx_rate_query tx_rate
;
1328 struct host_cmd_ds_tx_rate_cfg tx_rate_cfg
;
1329 struct host_cmd_ds_txpwr_cfg txp_cfg
;
1330 struct host_cmd_ds_802_11_ps_mode_enh psmode_enh
;
1331 struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg
;
1332 struct host_cmd_ds_802_11_scan scan
;
1333 struct host_cmd_ds_802_11_scan_rsp scan_resp
;
1334 struct host_cmd_ds_802_11_bg_scan_query bg_scan_query
;
1335 struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp
;
1336 struct host_cmd_ds_802_11_associate associate
;
1337 struct host_cmd_ds_802_11_associate_rsp associate_rsp
;
1338 struct host_cmd_ds_802_11_deauthenticate deauth
;
1339 struct host_cmd_ds_802_11_ad_hoc_start adhoc_start
;
1340 struct host_cmd_ds_802_11_ad_hoc_result adhoc_result
;
1341 struct host_cmd_ds_802_11_ad_hoc_join adhoc_join
;
1342 struct host_cmd_ds_802_11d_domain_info domain_info
;
1343 struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp
;
1344 struct host_cmd_ds_11n_addba_req add_ba_req
;
1345 struct host_cmd_ds_11n_addba_rsp add_ba_rsp
;
1346 struct host_cmd_ds_11n_delba del_ba
;
1347 struct host_cmd_ds_txbuf_cfg tx_buf
;
1348 struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl
;
1349 struct host_cmd_ds_11n_cfg htcfg
;
1350 struct host_cmd_ds_wmm_get_status get_wmm_status
;
1351 struct host_cmd_ds_802_11_key_material key_material
;
1352 struct host_cmd_ds_version_ext verext
;
1353 struct host_cmd_ds_802_11_ibss_status ibss_coalescing
;
1354 struct host_cmd_ds_mac_reg_access mac_reg
;
1355 struct host_cmd_ds_bbp_reg_access bbp_reg
;
1356 struct host_cmd_ds_rf_reg_access rf_reg
;
1357 struct host_cmd_ds_pmic_reg_access pmic_reg
;
1358 struct host_cmd_ds_set_bss_mode bss_mode
;
1359 struct host_cmd_ds_802_11_eeprom_access eeprom
;
1363 struct mwifiex_opt_sleep_confirm
{
1369 struct sleep_confirm_param sleep_cfm
;
1372 struct mwifiex_opt_sleep_confirm_buffer
{
1374 struct mwifiex_opt_sleep_confirm ps_cfm_sleep
;
1376 #endif /* !_MWIFIEX_FW_H_ */