2 * Intel Wireless Multicomm 3200 WiFi driver
4 * Copyright (C) 2009 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Intel Corporation nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Intel Corporation <ilw@linux.intel.com>
34 * Samuel Ortiz <samuel.ortiz@intel.com>
35 * Zhu Yi <yi.zhu@intel.com>
39 #ifndef __IWM_COMMANDS_H__
40 #define __IWM_COMMANDS_H__
42 #include <linux/ieee80211.h>
44 #define IWM_BARKER_REBOOT_NOTIFICATION 0xF
45 #define IWM_ACK_BARKER_NOTIFICATION 0x10
48 #define UMAC_RST_CTRL_FLG_LARC_CLK_EN 0x0001
49 #define UMAC_RST_CTRL_FLG_LARC_RESET 0x0002
50 #define UMAC_RST_CTRL_FLG_FUNC_RESET 0x0004
51 #define UMAC_RST_CTRL_FLG_DEV_RESET 0x0008
52 #define UMAC_RST_CTRL_FLG_WIFI_CORE_EN 0x0010
53 #define UMAC_RST_CTRL_FLG_WIFI_LINK_EN 0x0040
54 #define UMAC_RST_CTRL_FLG_WIFI_MLME_EN 0x0080
55 #define UMAC_RST_CTRL_FLG_NVM_RELOAD 0x0100
57 struct iwm_umac_cmd_reset
{
61 #define UMAC_PARAM_TBL_ORD_FIX 0x0
62 #define UMAC_PARAM_TBL_ORD_VAR 0x1
63 #define UMAC_PARAM_TBL_CFG_FIX 0x2
64 #define UMAC_PARAM_TBL_CFG_VAR 0x3
65 #define UMAC_PARAM_TBL_BSS_TRK 0x4
66 #define UMAC_PARAM_TBL_FA_CFG_FIX 0x5
67 #define UMAC_PARAM_TBL_STA 0x6
68 #define UMAC_PARAM_TBL_CHN 0x7
69 #define UMAC_PARAM_TBL_STATISTICS 0x8
71 /* fast access table */
73 CFG_FRAG_THRESHOLD
= 0,
74 CFG_FRAME_RETRY_LIMIT
,
78 FAST_ACCESS_CFG_TBL_FIX_LAST
81 /* fixed size table */
84 CFG_PM_LEGACY_RX_TIMEOUT
,
85 CFG_PM_LEGACY_TX_TIMEOUT
,
87 CFG_PM_KEEP_ALIVE_IN_BEACONS
,
93 CFG_ASSOCIATION_TIMEOUT
,
95 CFG_CAPABILITY_SUPPORTED_RATES
,
96 CFG_SCAN_ALLOWED_UNASSOC_FLAGS
,
97 CFG_SCAN_ALLOWED_MAIN_ASSOC_FLAGS
,
98 CFG_SCAN_ALLOWED_PAN_ASSOC_FLAGS
,
99 CFG_SCAN_INTERNAL_PERIODIC_ENABLED
,
100 CFG_SCAN_IMM_INTERNAL_PERIODIC_SCAN_ON_INIT
,
101 CFG_SCAN_DEFAULT_PERIODIC_FREQ_SEC
,
102 CFG_SCAN_NUM_PASSIVE_CHAN_PER_PARTIAL_SCAN
,
103 CFG_TLC_SUPPORTED_TX_HT_RATES
,
104 CFG_TLC_SUPPORTED_TX_RATES
,
105 CFG_TLC_SPATIAL_STREAM_SUPPORTED
,
106 CFG_TLC_RETRY_PER_RATE
,
107 CFG_TLC_RETRY_PER_HT_RATE
,
109 CFG_TLC_CONTROL_FLAGS
,
112 CFG_TLC_HT_STAY_IN_COL_PASS_THRESH
,
113 CFG_TLC_HT_STAY_IN_COL_FAIL_THRESH
,
114 CFG_TLC_LEGACY_STAY_IN_COL_PASS_THRESH
,
115 CFG_TLC_LEGACY_STAY_IN_COL_FAIL_THRESH
,
116 CFG_TLC_HT_FLUSH_STATS_PACKETS
,
117 CFG_TLC_LEGACY_FLUSH_STATS_PACKETS
,
118 CFG_TLC_LEGACY_FLUSH_STATS_MS
,
119 CFG_TLC_HT_FLUSH_STATS_MS
,
120 CFG_TLC_STAY_IN_COL_TIME_OUT
,
121 CFG_TLC_AGG_SHORT_LIM
,
122 CFG_TLC_AGG_LONG_LIM
,
123 CFG_TLC_HT_SR_NO_DECREASE
,
124 CFG_TLC_LEGACY_SR_NO_DECREASE
,
125 CFG_TLC_SR_FORCE_DECREASE
,
126 CFG_TLC_SR_ALLOW_INCREASE
,
127 CFG_TLC_AGG_SET_LONG
,
128 CFG_TLC_AUTO_AGGREGATION
,
129 CFG_TLC_AGG_THRESHOLD
,
130 CFG_TLC_TID_LOAD_THRESHOLD
,
131 CFG_TLC_BLOCK_ACK_TIMEOUT
,
132 CFG_TLC_NO_BA_COUNTED_AS_ONE
,
133 CFG_TLC_NUM_BA_STREAMS_ALLOWED
,
134 CFG_TLC_NUM_BA_STREAMS_PRESENT
,
135 CFG_TLC_RENEW_ADDBA_DELAY
,
136 CFG_TLC_NUM_OF_MULTISEC_TO_COUN_LOAD
,
137 CFG_TLC_IS_STABLE_IN_HT
,
138 CFG_TLC_SR_SIC_1ST_FAIL
,
139 CFG_TLC_SR_SIC_1ST_PASS
,
140 CFG_TLC_SR_SIC_TOTAL_FAIL
,
141 CFG_TLC_SR_SIC_TOTAL_PASS
,
143 CFG_TRK_TABLE_OP_MODE
,
144 CFG_TRK_TABLE_RSSI_THRESHOLD
,
145 CFG_TX_PWR_TARGET
, /* Used By xVT */
146 CFG_TX_PWR_LIMIT_USR
,
147 CFG_TX_PWR_LIMIT_BSS
, /* 11d limit */
148 CFG_TX_PWR_LIMIT_BSS_CONSTRAINT
, /* 11h constraint */
150 CFG_MLME_DBG_NOTIF_BLOCK
,
151 CFG_BT_OFF_BECONS_INTERVALS
,
152 CFG_BT_FRAG_DURATION
,
155 CFG_CAPABILITY_SUPPORTED_HT_RATES
,
156 CFG_HT_MAC_PARAM_INFO
,
158 CFG_HT_DEFAULT_CAPABILIES_INFO
,
159 CFG_LED_SC_RESOLUTION_FACTOR
,
160 CFG_PTAM_ENERGY_CCK_DET_DEFAULT
,
161 CFG_PTAM_CORR40_4_TH_ADD_MIN_MRC_DEFAULT
,
162 CFG_PTAM_CORR40_4_TH_ADD_MIN_DEFAULT
,
163 CFG_PTAM_CORR32_4_TH_ADD_MIN_MRC_DEFAULT
,
164 CFG_PTAM_CORR32_4_TH_ADD_MIN_DEFAULT
,
165 CFG_PTAM_CORR32_1_TH_ADD_MIN_MRC_DEFAULT
,
166 CFG_PTAM_CORR32_1_TH_ADD_MIN_DEFAULT
,
167 CFG_PTAM_ENERGY_CCK_DET_MIN_VAL
,
168 CFG_PTAM_CORR40_4_TH_ADD_MIN_MRC_MIN_VAL
,
169 CFG_PTAM_CORR40_4_TH_ADD_MIN_MIN_VAL
,
170 CFG_PTAM_CORR32_4_TH_ADD_MIN_MRC_MIN_VAL
,
171 CFG_PTAM_CORR32_4_TH_ADD_MIN_MIN_VAL
,
172 CFG_PTAM_CORR32_1_TH_ADD_MIN_MRC_MIN_VAL
,
173 CFG_PTAM_CORR32_1_TH_ADD_MIN_MIN_VAL
,
174 CFG_PTAM_ENERGY_CCK_DET_MAX_VAL
,
175 CFG_PTAM_CORR40_4_TH_ADD_MIN_MRC_MAX_VAL
,
176 CFG_PTAM_CORR40_4_TH_ADD_MIN_MAX_VAL
,
177 CFG_PTAM_CORR32_4_TH_ADD_MIN_MRC_MAX_VAL
,
178 CFG_PTAM_CORR32_4_TH_ADD_MIN_MAX_VAL
,
179 CFG_PTAM_CORR32_1_TH_ADD_MIN_MRC_MAX_VAL
,
180 CFG_PTAM_CORR32_1_TH_ADD_MIN_MAX_VAL
,
181 CFG_PTAM_ENERGY_CCK_DET_STEP_VAL
,
182 CFG_PTAM_CORR40_4_TH_ADD_MIN_MRC_STEP_VAL
,
183 CFG_PTAM_CORR40_4_TH_ADD_MIN_STEP_VAL
,
184 CFG_PTAM_CORR32_4_TH_ADD_MIN_MRC_STEP_VAL
,
185 CFG_PTAM_CORR32_4_TH_ADD_MIN_STEP_VAL
,
186 CFG_PTAM_CORR32_1_TH_ADD_MIN_MRC_STEP_VAL
,
187 CFG_PTAM_CORR32_1_TH_ADD_MIN_STEP_VAL
,
188 CFG_PTAM_LINK_SENS_FA_OFDM_MAX
,
189 CFG_PTAM_LINK_SENS_FA_OFDM_MIN
,
190 CFG_PTAM_LINK_SENS_FA_CCK_MAX
,
191 CFG_PTAM_LINK_SENS_FA_CCK_MIN
,
192 CFG_PTAM_LINK_SENS_NRG_DIFF
,
193 CFG_PTAM_LINK_SENS_NRG_MARGIN
,
194 CFG_PTAM_LINK_SENS_MAX_NUMBER_OF_TIMES_IN_CCK_NO_FA
,
195 CFG_PTAM_LINK_SENS_AUTO_CORR_MAX_TH_CCK
,
196 CFG_AGG_MGG_TID_LOAD_ADDBA_THRESHOLD
,
197 CFG_AGG_MGG_TID_LOAD_DELBA_THRESHOLD
,
198 CFG_AGG_MGG_ADDBA_BUF_SIZE
,
199 CFG_AGG_MGG_ADDBA_INACTIVE_TIMEOUT
,
200 CFG_AGG_MGG_ADDBA_DEBUG_FLAGS
,
201 CFG_SCAN_PERIODIC_RSSI_HIGH_THRESHOLD
,
202 CFG_SCAN_PERIODIC_COEF_RSSI_HIGH
,
204 CFG_11H_FEATURE_FLAGS
,
210 /* variable size table */
213 CFG_LED_PATTERN_TABLE
,
219 struct iwm_umac_cmd_set_param_fix
{
225 struct iwm_umac_cmd_set_param_var
{
232 struct iwm_umac_cmd_get_param
{
237 struct iwm_umac_cmd_get_param_resp
{
244 struct iwm_umac_cmd_eeprom_proxy_hdr
{
250 struct iwm_umac_cmd_eeprom_proxy
{
251 struct iwm_umac_cmd_eeprom_proxy_hdr hdr
;
255 #define IWM_UMAC_CMD_EEPROM_TYPE_READ 0x1
256 #define IWM_UMAC_CMD_EEPROM_TYPE_WRITE 0x2
258 #define UMAC_CHANNEL_FLAG_VALID BIT(0)
259 #define UMAC_CHANNEL_FLAG_IBSS BIT(1)
260 #define UMAC_CHANNEL_FLAG_ACTIVE BIT(3)
261 #define UMAC_CHANNEL_FLAG_RADAR BIT(4)
262 #define UMAC_CHANNEL_FLAG_DFS BIT(7)
264 struct iwm_umac_channel_info
{
269 __le32 channels_mask
;
272 struct iwm_umac_cmd_get_channel_list
{
275 struct iwm_umac_channel_info ch
[0];
279 /* UMAC WiFi interface commands */
281 /* Coexistence mode */
282 #define COEX_MODE_SA 0x1
283 #define COEX_MODE_XOR 0x2
284 #define COEX_MODE_CM 0x3
285 #define COEX_MODE_MAX 0x4
288 #define WIRELESS_MODE_11A 0x1
289 #define WIRELESS_MODE_11G 0x2
290 #define WIRELESS_MODE_11N 0x4
292 #define UMAC_PROFILE_EX_IE_REQUIRED 0x1
293 #define UMAC_PROFILE_QOS_ALLOWED 0x2
296 #define UMAC_WIFI_IF_PROBE_OPTION_MAX 10
298 #define UMAC_WIFI_IF_SCAN_TYPE_USER 0x0
299 #define UMAC_WIFI_IF_SCAN_TYPE_UMAC_RESERVED 0x1
300 #define UMAC_WIFI_IF_SCAN_TYPE_HOST_PERIODIC 0x2
301 #define UMAC_WIFI_IF_SCAN_TYPE_MAX 0x3
303 struct iwm_umac_ssid
{
305 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
309 struct iwm_umac_cmd_scan_request
{
310 struct iwm_umac_wifi_if hdr
;
311 __le32 type
; /* UMAC_WIFI_IF_SCAN_TYPE_* */
314 u8 timeout
; /* In seconds */
316 struct iwm_umac_ssid ssids
[UMAC_WIFI_IF_PROBE_OPTION_MAX
];
319 #define UMAC_CIPHER_TYPE_NONE 0xFF
320 #define UMAC_CIPHER_TYPE_USE_GROUPCAST 0x00
321 #define UMAC_CIPHER_TYPE_WEP_40 0x01
322 #define UMAC_CIPHER_TYPE_WEP_104 0x02
323 #define UMAC_CIPHER_TYPE_TKIP 0x04
324 #define UMAC_CIPHER_TYPE_CCMP 0x08
326 /* Supported authentication types - bitmap */
327 #define UMAC_AUTH_TYPE_OPEN 0x00
328 #define UMAC_AUTH_TYPE_LEGACY_PSK 0x01
329 #define UMAC_AUTH_TYPE_8021X 0x02
330 #define UMAC_AUTH_TYPE_RSNA_PSK 0x04
332 /* iwm_umac_security.flag is WPA supported -- bits[0:0] */
333 #define UMAC_SEC_FLG_WPA_ON_POS 0
334 #define UMAC_SEC_FLG_WPA_ON_SEED 1
335 #define UMAC_SEC_FLG_WPA_ON_MSK (UMAC_SEC_FLG_WPA_ON_SEED << \
336 UMAC_SEC_FLG_WPA_ON_POS)
338 /* iwm_umac_security.flag is WPA2 supported -- bits [1:1] */
339 #define UMAC_SEC_FLG_RSNA_ON_POS 1
340 #define UMAC_SEC_FLG_RSNA_ON_SEED 1
341 #define UMAC_SEC_FLG_RSNA_ON_MSK (UMAC_SEC_FLG_RSNA_ON_SEED << \
342 UMAC_SEC_FLG_RSNA_ON_POS)
344 /* iwm_umac_security.flag is WSC mode on -- bits [2:2] */
345 #define UMAC_SEC_FLG_WSC_ON_POS 2
346 #define UMAC_SEC_FLG_WSC_ON_SEED 1
347 #define UMAC_SEC_FLG_WSC_ON_MSK (UMAC_SEC_FLG_WSC_ON_SEED << \
348 UMAC_SEC_FLG_WSC_ON_POS)
351 /* Legacy profile can use only WEP40 and WEP104 for encryption and
352 * OPEN or PSK for authentication */
353 #define UMAC_SEC_FLG_LEGACY_PROFILE 0
355 struct iwm_umac_security
{
362 struct iwm_umac_ibss
{
363 u8 beacon_interval
; /* in millisecond */
364 u8 atim
; /* in millisecond */
371 #define UMAC_MODE_BSS 0
372 #define UMAC_MODE_IBSS 1
374 #define UMAC_BSSID_MAX 4
376 struct iwm_umac_profile
{
377 struct iwm_umac_wifi_if hdr
;
379 struct iwm_umac_ssid ssid
;
380 u8 bssid
[UMAC_BSSID_MAX
][ETH_ALEN
];
381 struct iwm_umac_security sec
;
382 struct iwm_umac_ibss ibss
;
390 struct iwm_umac_invalidate_profile
{
391 struct iwm_umac_wifi_if hdr
;
396 /* Encryption key commands */
397 struct iwm_umac_key_wep40
{
398 struct iwm_umac_wifi_if hdr
;
399 struct iwm_umac_key_hdr key_hdr
;
400 u8 key
[WLAN_KEY_LEN_WEP40
];
405 struct iwm_umac_key_wep104
{
406 struct iwm_umac_wifi_if hdr
;
407 struct iwm_umac_key_hdr key_hdr
;
408 u8 key
[WLAN_KEY_LEN_WEP104
];
413 #define IWM_TKIP_KEY_SIZE 16
414 #define IWM_TKIP_MIC_SIZE 8
415 struct iwm_umac_key_tkip
{
416 struct iwm_umac_wifi_if hdr
;
417 struct iwm_umac_key_hdr key_hdr
;
420 u8 tkip_key
[IWM_TKIP_KEY_SIZE
];
421 u8 mic_rx_key
[IWM_TKIP_MIC_SIZE
];
422 u8 mic_tx_key
[IWM_TKIP_MIC_SIZE
];
425 struct iwm_umac_key_ccmp
{
426 struct iwm_umac_wifi_if hdr
;
427 struct iwm_umac_key_hdr key_hdr
;
430 u8 key
[WLAN_KEY_LEN_CCMP
];
433 struct iwm_umac_key_remove
{
434 struct iwm_umac_wifi_if hdr
;
435 struct iwm_umac_key_hdr key_hdr
;
438 struct iwm_umac_tx_key_id
{
439 struct iwm_umac_wifi_if hdr
;
444 struct iwm_umac_pwr_trigger
{
445 struct iwm_umac_wifi_if hdr
;
449 struct iwm_umac_cmd_stats_req
{
453 struct iwm_umac_cmd_stop_resume_tx
{
456 __le16 stop_resume_tid_msk
;
457 __le16 last_seq_num
[IWM_UMAC_TID_NR
];
461 #define IWM_CMD_PMKID_ADD 1
462 #define IWM_CMD_PMKID_DEL 2
463 #define IWM_CMD_PMKID_FLUSH 3
465 struct iwm_umac_pmkid_update
{
466 struct iwm_umac_wifi_if hdr
;
470 u8 pmkid
[WLAN_PMKID_LEN
];
474 int iwm_read_mac(struct iwm_priv
*iwm
, u8
*mac
);
475 int iwm_send_prio_table(struct iwm_priv
*iwm
);
476 int iwm_send_init_calib_cfg(struct iwm_priv
*iwm
, u8 calib_requested
);
477 int iwm_send_periodic_calib_cfg(struct iwm_priv
*iwm
, u8 calib_requested
);
478 int iwm_send_calib_results(struct iwm_priv
*iwm
);
479 int iwm_store_rxiq_calib_result(struct iwm_priv
*iwm
);
480 int iwm_send_ct_kill_cfg(struct iwm_priv
*iwm
, u8 entry
, u8 exit
);
483 int iwm_send_wifi_if_cmd(struct iwm_priv
*iwm
, void *payload
, u16 payload_size
,
485 int iwm_send_umac_reset(struct iwm_priv
*iwm
, __le32 reset_flags
, bool resp
);
486 int iwm_umac_set_config_fix(struct iwm_priv
*iwm
, u16 tbl
, u16 key
, u32 value
);
487 int iwm_umac_set_config_var(struct iwm_priv
*iwm
, u16 key
,
488 void *payload
, u16 payload_size
);
489 int iwm_send_umac_config(struct iwm_priv
*iwm
, __le32 reset_flags
);
490 int iwm_send_mlme_profile(struct iwm_priv
*iwm
);
491 int __iwm_invalidate_mlme_profile(struct iwm_priv
*iwm
);
492 int iwm_invalidate_mlme_profile(struct iwm_priv
*iwm
);
493 int iwm_send_packet(struct iwm_priv
*iwm
, struct sk_buff
*skb
, int pool_id
);
494 int iwm_set_tx_key(struct iwm_priv
*iwm
, u8 key_idx
);
495 int iwm_set_key(struct iwm_priv
*iwm
, bool remove
, struct iwm_key
*key
);
496 int iwm_tx_power_trigger(struct iwm_priv
*iwm
);
497 int iwm_send_umac_stats_req(struct iwm_priv
*iwm
, u32 flags
);
498 int iwm_send_umac_channel_list(struct iwm_priv
*iwm
);
499 int iwm_scan_ssids(struct iwm_priv
*iwm
, struct cfg80211_ssid
*ssids
,
501 int iwm_scan_one_ssid(struct iwm_priv
*iwm
, u8
*ssid
, int ssid_len
);
502 int iwm_send_umac_stop_resume_tx(struct iwm_priv
*iwm
,
503 struct iwm_umac_notif_stop_resume_tx
*ntf
);
504 int iwm_send_pmkid_update(struct iwm_priv
*iwm
,
505 struct cfg80211_pmksa
*pmksa
, u32 command
);
508 int iwm_target_reset(struct iwm_priv
*iwm
);