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
{
59 } __attribute__ ((packed
));
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_VALID_ANTENNA
,
106 CFG_TLC_SPATIAL_STREAM_SUPPORTED
,
107 CFG_TLC_RETRY_PER_RATE
,
108 CFG_TLC_RETRY_PER_HT_RATE
,
110 CFG_TLC_CONTROL_FLAGS
,
113 CFG_TLC_HT_STAY_IN_COL_PASS_THRESH
,
114 CFG_TLC_HT_STAY_IN_COL_FAIL_THRESH
,
115 CFG_TLC_LEGACY_STAY_IN_COL_PASS_THRESH
,
116 CFG_TLC_LEGACY_STAY_IN_COL_FAIL_THRESH
,
117 CFG_TLC_HT_FLUSH_STATS_PACKETS
,
118 CFG_TLC_LEGACY_FLUSH_STATS_PACKETS
,
119 CFG_TLC_LEGACY_FLUSH_STATS_MS
,
120 CFG_TLC_HT_FLUSH_STATS_MS
,
121 CFG_TLC_STAY_IN_COL_TIME_OUT
,
122 CFG_TLC_AGG_SHORT_LIM
,
123 CFG_TLC_AGG_LONG_LIM
,
124 CFG_TLC_HT_SR_NO_DECREASE
,
125 CFG_TLC_LEGACY_SR_NO_DECREASE
,
126 CFG_TLC_SR_FORCE_DECREASE
,
127 CFG_TLC_SR_ALLOW_INCREASE
,
128 CFG_TLC_AGG_SET_LONG
,
129 CFG_TLC_AUTO_AGGREGATION
,
130 CFG_TLC_AGG_THRESHOLD
,
131 CFG_TLC_TID_LOAD_THRESHOLD
,
132 CFG_TLC_BLOCK_ACK_TIMEOUT
,
133 CFG_TLC_NO_BA_COUNTED_AS_ONE
,
134 CFG_TLC_NUM_BA_STREAMS_ALLOWED
,
135 CFG_TLC_NUM_BA_STREAMS_PRESENT
,
136 CFG_TLC_RENEW_ADDBA_DELAY
,
137 CFG_TLC_NUM_OF_MULTISEC_TO_COUN_LOAD
,
138 CFG_TLC_IS_STABLE_IN_HT
,
140 CFG_TRK_TABLE_OP_MODE
,
141 CFG_TRK_TABLE_RSSI_THRESHOLD
,
142 CFG_TX_PWR_TARGET
, /* Used By xVT */
143 CFG_TX_PWR_LIMIT_USR
,
144 CFG_TX_PWR_LIMIT_BSS
, /* 11d limit */
145 CFG_TX_PWR_LIMIT_BSS_CONSTRAINT
, /* 11h constraint */
147 CFG_MLME_DBG_NOTIF_BLOCK
,
148 CFG_BT_OFF_BECONS_INTERVALS
,
149 CFG_BT_FRAG_DURATION
,
155 /* variable size table */
163 struct iwm_umac_cmd_set_param_fix
{
167 } __attribute__ ((packed
));
169 struct iwm_umac_cmd_set_param_var
{
174 } __attribute__ ((packed
));
176 struct iwm_umac_cmd_get_param
{
179 } __attribute__ ((packed
));
181 struct iwm_umac_cmd_get_param_resp
{
186 } __attribute__ ((packed
));
188 struct iwm_umac_cmd_eeprom_proxy_hdr
{
192 } __attribute__ ((packed
));
194 struct iwm_umac_cmd_eeprom_proxy
{
195 struct iwm_umac_cmd_eeprom_proxy_hdr hdr
;
197 } __attribute__ ((packed
));
199 #define IWM_UMAC_CMD_EEPROM_TYPE_READ 0x1
200 #define IWM_UMAC_CMD_EEPROM_TYPE_WRITE 0x2
202 #define UMAC_CHANNEL_FLAG_VALID BIT(0)
203 #define UMAC_CHANNEL_FLAG_IBSS BIT(1)
204 #define UMAC_CHANNEL_FLAG_ACTIVE BIT(3)
205 #define UMAC_CHANNEL_FLAG_RADAR BIT(4)
206 #define UMAC_CHANNEL_FLAG_DFS BIT(7)
208 struct iwm_umac_channel_info
{
213 __le32 channels_mask
;
214 } __attribute__ ((packed
));
216 struct iwm_umac_cmd_get_channel_list
{
219 struct iwm_umac_channel_info ch
[0];
220 } __attribute__ ((packed
));
223 /* UMAC WiFi interface commands */
225 /* Coexistence mode */
226 #define COEX_MODE_SA 0x1
227 #define COEX_MODE_XOR 0x2
228 #define COEX_MODE_CM 0x3
229 #define COEX_MODE_MAX 0x4
232 #define WIRELESS_MODE_11A 0x1
233 #define WIRELESS_MODE_11G 0x2
234 #define WIRELESS_MODE_11N 0x4
236 #define UMAC_PROFILE_EX_IE_REQUIRED 0x1
237 #define UMAC_PROFILE_QOS_ALLOWED 0x2
240 #define UMAC_WIFI_IF_PROBE_OPTION_MAX 10
242 #define UMAC_WIFI_IF_SCAN_TYPE_USER 0x0
243 #define UMAC_WIFI_IF_SCAN_TYPE_UMAC_RESERVED 0x1
244 #define UMAC_WIFI_IF_SCAN_TYPE_HOST_PERIODIC 0x2
245 #define UMAC_WIFI_IF_SCAN_TYPE_MAX 0x3
247 struct iwm_umac_ssid
{
249 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
251 } __attribute__ ((packed
));
253 struct iwm_umac_cmd_scan_request
{
254 struct iwm_umac_wifi_if hdr
;
255 __le32 type
; /* UMAC_WIFI_IF_SCAN_TYPE_* */
258 u8 timeout
; /* In seconds */
260 struct iwm_umac_ssid ssids
[UMAC_WIFI_IF_PROBE_OPTION_MAX
];
261 } __attribute__ ((packed
));
263 #define UMAC_CIPHER_TYPE_NONE 0xFF
264 #define UMAC_CIPHER_TYPE_USE_GROUPCAST 0x00
265 #define UMAC_CIPHER_TYPE_WEP_40 0x01
266 #define UMAC_CIPHER_TYPE_WEP_104 0x02
267 #define UMAC_CIPHER_TYPE_TKIP 0x04
268 #define UMAC_CIPHER_TYPE_CCMP 0x08
270 /* Supported authentication types - bitmap */
271 #define UMAC_AUTH_TYPE_OPEN 0x00
272 #define UMAC_AUTH_TYPE_LEGACY_PSK 0x01
273 #define UMAC_AUTH_TYPE_8021X 0x02
274 #define UMAC_AUTH_TYPE_RSNA_PSK 0x04
276 /* iwm_umac_security.flag is WPA supported -- bits[0:0] */
277 #define UMAC_SEC_FLG_WPA_ON_POS 0
278 #define UMAC_SEC_FLG_WPA_ON_SEED 1
279 #define UMAC_SEC_FLG_WPA_ON_MSK (UMAC_SEC_FLG_WPA_ON_SEED << \
280 UMAC_SEC_FLG_WPA_ON_POS)
282 /* iwm_umac_security.flag is WPA2 supported -- bits [1:1] */
283 #define UMAC_SEC_FLG_RSNA_ON_POS 1
284 #define UMAC_SEC_FLG_RSNA_ON_SEED 1
285 #define UMAC_SEC_FLG_RSNA_ON_MSK (UMAC_SEC_FLG_RSNA_ON_SEED << \
286 UMAC_SEC_FLG_RSNA_ON_POS)
288 /* iwm_umac_security.flag is WSC mode on -- bits [2:2] */
289 #define UMAC_SEC_FLG_WSC_ON_POS 2
290 #define UMAC_SEC_FLG_WSC_ON_SEED 1
292 /* Legacy profile can use only WEP40 and WEP104 for encryption and
293 * OPEN or PSK for authentication */
294 #define UMAC_SEC_FLG_LEGACY_PROFILE 0
296 struct iwm_umac_security
{
301 } __attribute__ ((packed
));
303 struct iwm_umac_ibss
{
304 u8 beacon_interval
; /* in millisecond */
305 u8 atim
; /* in millisecond */
310 } __attribute__ ((packed
));
312 #define UMAC_MODE_BSS 0
313 #define UMAC_MODE_IBSS 1
315 #define UMAC_BSSID_MAX 4
317 struct iwm_umac_profile
{
318 struct iwm_umac_wifi_if hdr
;
320 struct iwm_umac_ssid ssid
;
321 u8 bssid
[UMAC_BSSID_MAX
][ETH_ALEN
];
322 struct iwm_umac_security sec
;
323 struct iwm_umac_ibss ibss
;
329 } __attribute__ ((packed
));
331 struct iwm_umac_invalidate_profile
{
332 struct iwm_umac_wifi_if hdr
;
335 } __attribute__ ((packed
));
337 /* Encryption key commands */
338 struct iwm_umac_key_wep40
{
339 struct iwm_umac_wifi_if hdr
;
340 struct iwm_umac_key_hdr key_hdr
;
341 u8 key
[WLAN_KEY_LEN_WEP40
];
344 } __attribute__ ((packed
));
346 struct iwm_umac_key_wep104
{
347 struct iwm_umac_wifi_if hdr
;
348 struct iwm_umac_key_hdr key_hdr
;
349 u8 key
[WLAN_KEY_LEN_WEP104
];
352 } __attribute__ ((packed
));
354 #define IWM_TKIP_KEY_SIZE 16
355 #define IWM_TKIP_MIC_SIZE 8
356 struct iwm_umac_key_tkip
{
357 struct iwm_umac_wifi_if hdr
;
358 struct iwm_umac_key_hdr key_hdr
;
361 u8 tkip_key
[IWM_TKIP_KEY_SIZE
];
362 u8 mic_rx_key
[IWM_TKIP_MIC_SIZE
];
363 u8 mic_tx_key
[IWM_TKIP_MIC_SIZE
];
364 } __attribute__ ((packed
));
366 struct iwm_umac_key_ccmp
{
367 struct iwm_umac_wifi_if hdr
;
368 struct iwm_umac_key_hdr key_hdr
;
371 u8 key
[WLAN_KEY_LEN_CCMP
];
372 } __attribute__ ((packed
));
374 struct iwm_umac_key_remove
{
375 struct iwm_umac_wifi_if hdr
;
376 struct iwm_umac_key_hdr key_hdr
;
377 } __attribute__ ((packed
));
379 struct iwm_umac_tx_key_id
{
380 struct iwm_umac_wifi_if hdr
;
383 } __attribute__ ((packed
));
385 struct iwm_umac_cmd_stats_req
{
387 } __attribute__ ((packed
));
390 int iwm_read_mac(struct iwm_priv
*iwm
, u8
*mac
);
391 int iwm_send_prio_table(struct iwm_priv
*iwm
);
392 int iwm_send_init_calib_cfg(struct iwm_priv
*iwm
, u8 calib_requested
);
393 int iwm_send_periodic_calib_cfg(struct iwm_priv
*iwm
, u8 calib_requested
);
394 int iwm_send_calib_results(struct iwm_priv
*iwm
);
395 int iwm_store_rxiq_calib_result(struct iwm_priv
*iwm
);
398 int iwm_send_wifi_if_cmd(struct iwm_priv
*iwm
, void *payload
, u16 payload_size
,
400 int iwm_send_umac_reset(struct iwm_priv
*iwm
, __le32 reset_flags
, bool resp
);
401 int iwm_umac_set_config_fix(struct iwm_priv
*iwm
, u16 tbl
, u16 key
, u32 value
);
402 int iwm_umac_set_config_var(struct iwm_priv
*iwm
, u16 key
,
403 void *payload
, u16 payload_size
);
404 int iwm_send_umac_config(struct iwm_priv
*iwm
, __le32 reset_flags
);
405 int iwm_send_mlme_profile(struct iwm_priv
*iwm
);
406 int iwm_invalidate_mlme_profile(struct iwm_priv
*iwm
);
407 int iwm_send_packet(struct iwm_priv
*iwm
, struct sk_buff
*skb
, int pool_id
);
408 int iwm_set_tx_key(struct iwm_priv
*iwm
, u8 key_idx
);
409 int iwm_set_key(struct iwm_priv
*iwm
, bool remove
, struct iwm_key
*key
);
410 int iwm_send_umac_stats_req(struct iwm_priv
*iwm
, u32 flags
);
411 int iwm_send_umac_channel_list(struct iwm_priv
*iwm
);
412 int iwm_scan_ssids(struct iwm_priv
*iwm
, struct cfg80211_ssid
*ssids
,
414 int iwm_scan_one_ssid(struct iwm_priv
*iwm
, u8
*ssid
, int ssid_len
);
417 int iwm_target_reset(struct iwm_priv
*iwm
);