blob: 421b9dd1fb66c557e6e552059a3fd5c62a0503e2 [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02008 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Johannes Berg8b4139d2014-07-24 14:05:26 +02009 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
Sara Sharon45c458b2016-11-09 15:43:26 +020010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010011 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020027 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010028 *
29 * Contact Information:
Emmanuel Grumbachd01c5362015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Berg8ca151b2013-01-24 14:25:36 +010031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020035 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Johannes Berg8b4139d2014-07-24 14:05:26 +020036 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
Sara Sharon45c458b2016-11-09 15:43:26 +020037 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010038 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *****************************************************************************/
66
67#ifndef __fw_api_sta_h__
68#define __fw_api_sta_h__
69
70/**
71 * enum iwl_sta_flags - flags for the ADD_STA host command
72 * @STA_FLG_REDUCED_TX_PWR_CTRL:
73 * @STA_FLG_REDUCED_TX_PWR_DATA:
Andrei Otcheretianski09b0ce12014-05-25 17:07:38 +030074 * @STA_FLG_DISABLE_TX: set if TX should be disabled
Johannes Berg8ca151b2013-01-24 14:25:36 +010075 * @STA_FLG_PS: set if STA is in Power Save
76 * @STA_FLG_INVALID: set if STA is invalid
77 * @STA_FLG_DLP_EN: Direct Link Protocol is enabled
78 * @STA_FLG_SET_ALL_KEYS: the current key applies to all key IDs
79 * @STA_FLG_DRAIN_FLOW: drain flow
80 * @STA_FLG_PAN: STA is for PAN interface
81 * @STA_FLG_CLASS_AUTH:
82 * @STA_FLG_CLASS_ASSOC:
83 * @STA_FLG_CLASS_MIMO_PROT:
84 * @STA_FLG_MAX_AGG_SIZE_MSK: maximal size for A-MPDU
85 * @STA_FLG_AGG_MPDU_DENS_MSK: maximal MPDU density for Tx aggregation
86 * @STA_FLG_FAT_EN_MSK: support for channel width (for Tx). This flag is
87 * initialised by driver and can be updated by fw upon reception of
88 * action frames that can change the channel width. When cleared the fw
89 * will send all the frames in 20MHz even when FAT channel is requested.
90 * @STA_FLG_MIMO_EN_MSK: support for MIMO. This flag is initialised by the
91 * driver and can be updated by fw upon reception of action frames.
92 * @STA_FLG_MFP_EN: Management Frame Protection
93 */
94enum iwl_sta_flags {
95 STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3),
96 STA_FLG_REDUCED_TX_PWR_DATA = BIT(6),
97
Andrei Otcheretianski09b0ce12014-05-25 17:07:38 +030098 STA_FLG_DISABLE_TX = BIT(4),
Johannes Berg8ca151b2013-01-24 14:25:36 +010099
100 STA_FLG_PS = BIT(8),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100101 STA_FLG_DRAIN_FLOW = BIT(12),
102 STA_FLG_PAN = BIT(13),
103 STA_FLG_CLASS_AUTH = BIT(14),
104 STA_FLG_CLASS_ASSOC = BIT(15),
105 STA_FLG_RTS_MIMO_PROT = BIT(17),
106
107 STA_FLG_MAX_AGG_SIZE_SHIFT = 19,
108 STA_FLG_MAX_AGG_SIZE_8K = (0 << STA_FLG_MAX_AGG_SIZE_SHIFT),
109 STA_FLG_MAX_AGG_SIZE_16K = (1 << STA_FLG_MAX_AGG_SIZE_SHIFT),
110 STA_FLG_MAX_AGG_SIZE_32K = (2 << STA_FLG_MAX_AGG_SIZE_SHIFT),
111 STA_FLG_MAX_AGG_SIZE_64K = (3 << STA_FLG_MAX_AGG_SIZE_SHIFT),
112 STA_FLG_MAX_AGG_SIZE_128K = (4 << STA_FLG_MAX_AGG_SIZE_SHIFT),
113 STA_FLG_MAX_AGG_SIZE_256K = (5 << STA_FLG_MAX_AGG_SIZE_SHIFT),
114 STA_FLG_MAX_AGG_SIZE_512K = (6 << STA_FLG_MAX_AGG_SIZE_SHIFT),
115 STA_FLG_MAX_AGG_SIZE_1024K = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
116 STA_FLG_MAX_AGG_SIZE_MSK = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
117
118 STA_FLG_AGG_MPDU_DENS_SHIFT = 23,
119 STA_FLG_AGG_MPDU_DENS_2US = (4 << STA_FLG_AGG_MPDU_DENS_SHIFT),
120 STA_FLG_AGG_MPDU_DENS_4US = (5 << STA_FLG_AGG_MPDU_DENS_SHIFT),
121 STA_FLG_AGG_MPDU_DENS_8US = (6 << STA_FLG_AGG_MPDU_DENS_SHIFT),
122 STA_FLG_AGG_MPDU_DENS_16US = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
123 STA_FLG_AGG_MPDU_DENS_MSK = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
124
125 STA_FLG_FAT_EN_20MHZ = (0 << 26),
126 STA_FLG_FAT_EN_40MHZ = (1 << 26),
127 STA_FLG_FAT_EN_80MHZ = (2 << 26),
128 STA_FLG_FAT_EN_160MHZ = (3 << 26),
129 STA_FLG_FAT_EN_MSK = (3 << 26),
130
131 STA_FLG_MIMO_EN_SISO = (0 << 28),
132 STA_FLG_MIMO_EN_MIMO2 = (1 << 28),
133 STA_FLG_MIMO_EN_MIMO3 = (2 << 28),
134 STA_FLG_MIMO_EN_MSK = (3 << 28),
135};
136
137/**
138 * enum iwl_sta_key_flag - key flags for the ADD_STA host command
Max Stepanove36e5432013-08-27 19:56:13 +0300139 * @STA_KEY_FLG_NO_ENC: no encryption
140 * @STA_KEY_FLG_WEP: WEP encryption algorithm
141 * @STA_KEY_FLG_CCM: CCMP encryption algorithm
142 * @STA_KEY_FLG_TKIP: TKIP encryption algorithm
143 * @STA_KEY_FLG_EXT: extended cipher algorithm (depends on the FW support)
Ayala Beker2a53d162016-04-07 16:21:57 +0300144 * @STA_KEY_FLG_GCMP: GCMP encryption algorithm
Max Stepanove36e5432013-08-27 19:56:13 +0300145 * @STA_KEY_FLG_CMAC: CMAC encryption algorithm
146 * @STA_KEY_FLG_ENC_UNKNOWN: unknown encryption algorithm
147 * @STA_KEY_FLG_EN_MSK: mask for encryption algorithmi value
Johannes Berg8ca151b2013-01-24 14:25:36 +0100148 * @STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
149 * station info array (1 - n 1X mode)
150 * @STA_KEY_FLG_KEYID_MSK: the index of the key
151 * @STA_KEY_NOT_VALID: key is invalid
152 * @STA_KEY_FLG_WEP_13BYTES: set for 13 bytes WEP key
Ayala Beker2a53d162016-04-07 16:21:57 +0300153 * @STA_KEY_FLG_KEY_32BYTES for non-wep key set for 32 bytes key
Johannes Berg8ca151b2013-01-24 14:25:36 +0100154 * @STA_KEY_MULTICAST: set for multical key
155 * @STA_KEY_MFP: key is used for Management Frame Protection
156 */
157enum iwl_sta_key_flag {
158 STA_KEY_FLG_NO_ENC = (0 << 0),
159 STA_KEY_FLG_WEP = (1 << 0),
160 STA_KEY_FLG_CCM = (2 << 0),
161 STA_KEY_FLG_TKIP = (3 << 0),
Max Stepanove36e5432013-08-27 19:56:13 +0300162 STA_KEY_FLG_EXT = (4 << 0),
Ayala Beker2a53d162016-04-07 16:21:57 +0300163 STA_KEY_FLG_GCMP = (5 << 0),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100164 STA_KEY_FLG_CMAC = (6 << 0),
165 STA_KEY_FLG_ENC_UNKNOWN = (7 << 0),
166 STA_KEY_FLG_EN_MSK = (7 << 0),
167
168 STA_KEY_FLG_WEP_KEY_MAP = BIT(3),
169 STA_KEY_FLG_KEYID_POS = 8,
170 STA_KEY_FLG_KEYID_MSK = (3 << STA_KEY_FLG_KEYID_POS),
171 STA_KEY_NOT_VALID = BIT(11),
172 STA_KEY_FLG_WEP_13BYTES = BIT(12),
Ayala Beker2a53d162016-04-07 16:21:57 +0300173 STA_KEY_FLG_KEY_32BYTES = BIT(12),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100174 STA_KEY_MULTICAST = BIT(14),
175 STA_KEY_MFP = BIT(15),
176};
177
178/**
179 * enum iwl_sta_modify_flag - indicate to the fw what flag are being changed
Liad Kaufman2b1ba3e2015-09-21 14:14:23 +0200180 * @STA_MODIFY_QUEUE_REMOVAL: this command removes a queue
Johannes Berg8ca151b2013-01-24 14:25:36 +0100181 * @STA_MODIFY_TID_DISABLE_TX: this command modifies %tid_disable_tx
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200182 * @STA_MODIFY_UAPSD_ACS: this command modifies %uapsd_acs
Johannes Berg8ca151b2013-01-24 14:25:36 +0100183 * @STA_MODIFY_ADD_BA_TID: this command modifies %add_immediate_ba_tid
184 * @STA_MODIFY_REMOVE_BA_TID: this command modifies %remove_immediate_ba_tid
185 * @STA_MODIFY_SLEEPING_STA_TX_COUNT: this command modifies %sleep_tx_count
186 * @STA_MODIFY_PROT_TH:
187 * @STA_MODIFY_QUEUES: modify the queues used by this station
188 */
189enum iwl_sta_modify_flag {
Liad Kaufman2b1ba3e2015-09-21 14:14:23 +0200190 STA_MODIFY_QUEUE_REMOVAL = BIT(0),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100191 STA_MODIFY_TID_DISABLE_TX = BIT(1),
Johannes Berg65e25482016-04-13 14:24:22 +0200192 STA_MODIFY_UAPSD_ACS = BIT(2),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100193 STA_MODIFY_ADD_BA_TID = BIT(3),
194 STA_MODIFY_REMOVE_BA_TID = BIT(4),
195 STA_MODIFY_SLEEPING_STA_TX_COUNT = BIT(5),
196 STA_MODIFY_PROT_TH = BIT(6),
197 STA_MODIFY_QUEUES = BIT(7),
198};
199
200#define STA_MODE_MODIFY 1
201
202/**
203 * enum iwl_sta_sleep_flag - type of sleep of the station
204 * @STA_SLEEP_STATE_AWAKE:
205 * @STA_SLEEP_STATE_PS_POLL:
206 * @STA_SLEEP_STATE_UAPSD:
Johannes Berg3e56ead2013-02-15 22:23:18 +0100207 * @STA_SLEEP_STATE_MOREDATA: set more-data bit on
208 * (last) released frame
Johannes Berg8ca151b2013-01-24 14:25:36 +0100209 */
210enum iwl_sta_sleep_flag {
Johannes Berg3e56ead2013-02-15 22:23:18 +0100211 STA_SLEEP_STATE_AWAKE = 0,
212 STA_SLEEP_STATE_PS_POLL = BIT(0),
213 STA_SLEEP_STATE_UAPSD = BIT(1),
214 STA_SLEEP_STATE_MOREDATA = BIT(2),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100215};
216
Johannes Berg8ca151b2013-01-24 14:25:36 +0100217#define STA_KEY_MAX_NUM (16)
218#define STA_KEY_IDX_INVALID (0xff)
219#define STA_KEY_MAX_DATA_KEY_NUM (4)
220#define IWL_MAX_GLOBAL_KEYS (4)
221#define STA_KEY_LEN_WEP40 (5)
222#define STA_KEY_LEN_WEP104 (13)
223
224/**
225 * struct iwl_mvm_keyinfo - key information
226 * @key_flags: type %iwl_sta_key_flag
227 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
228 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
229 * @key_offset: key offset in the fw's key table
230 * @key: 16-byte unicast decryption key
231 * @tx_secur_seq_cnt: initial RSC / PN needed for replay check
232 * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
233 * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
234 */
235struct iwl_mvm_keyinfo {
236 __le16 key_flags;
237 u8 tkip_rx_tsc_byte2;
238 u8 reserved1;
239 __le16 tkip_rx_ttak[5];
240 u8 key_offset;
241 u8 reserved2;
242 u8 key[16];
243 __le64 tx_secur_seq_cnt;
244 __le64 hw_tkip_mic_rx_key;
245 __le64 hw_tkip_mic_tx_key;
246} __packed;
247
Sara Sharon10b2b202016-03-20 16:23:41 +0200248#define IWL_ADD_STA_STATUS_MASK 0xFF
249#define IWL_ADD_STA_BAID_VALID_MASK 0x8000
250#define IWL_ADD_STA_BAID_MASK 0x7F00
251#define IWL_ADD_STA_BAID_SHIFT 8
Sara Sharon837c4da2016-01-07 16:50:45 +0200252
Johannes Berg8ca151b2013-01-24 14:25:36 +0100253/**
Sara Sharon854c5702016-01-26 13:17:47 +0200254 * struct iwl_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100255 * ( REPLY_ADD_STA = 0x18 )
256 * @add_modify: 1: modify existing, 0: add new station
Emmanuel Grumbachf9dc0002014-03-30 09:53:27 +0300257 * @awake_acs:
258 * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
259 * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100260 * @mac_id_n_color: the Mac context this station belongs to
261 * @addr[ETH_ALEN]: station's MAC address
262 * @sta_id: index of station in uCode's station table
263 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
264 * alone. 1 - modify, 0 - don't change.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100265 * @station_flags: look at %iwl_sta_flags
266 * @station_flags_msk: what of %station_flags have changed
Johannes Berg8ca151b2013-01-24 14:25:36 +0100267 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
268 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
269 * add_immediate_ba_ssn.
270 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
271 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
272 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
273 * add_immediate_ba_tid.
274 * @sleep_tx_count: number of packets to transmit to station even though it is
275 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
276 * keeps track of STA sleep state.
277 * @sleep_state_flags: Look at %iwl_sta_sleep_flag.
278 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
279 * mac-addr.
280 * @beamform_flags: beam forming controls
281 * @tfd_queue_msk: tfd queues used by this station
282 *
283 * The device contains an internal table of per-station information, with info
284 * on security keys, aggregation parameters, and Tx rates for initial Tx
285 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
286 *
287 * ADD_STA sets up the table entry for one station, either creating a new
288 * entry, or modifying a pre-existing one.
289 */
Sara Sharon854c5702016-01-26 13:17:47 +0200290struct iwl_mvm_add_sta_cmd_v7 {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300291 u8 add_modify;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100292 u8 awake_acs;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300293 __le16 tid_disable_tx;
294 __le32 mac_id_n_color;
295 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
296 __le16 reserved2;
297 u8 sta_id;
298 u8 modify_mask;
299 __le16 reserved3;
300 __le32 station_flags;
301 __le32 station_flags_msk;
302 u8 add_immediate_ba_tid;
303 u8 remove_immediate_ba_tid;
304 __le16 add_immediate_ba_ssn;
305 __le16 sleep_tx_count;
306 __le16 sleep_state_flags;
307 __le16 assoc_id;
308 __le16 beamform_flags;
309 __le32 tfd_queue_msk;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100310} __packed; /* ADD_STA_CMD_API_S_VER_7 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300311
312/**
Sara Sharonced19f22017-02-06 19:09:32 +0200313 * enum iwl_sta_type - FW station types
314 * ( REPLY_ADD_STA = 0x18 )
315 * @IWL_STA_LINK: Link station - normal RX and TX traffic.
316 * @IWL_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons
317 * and probe responses.
318 * @IWL_STA_MULTICAST: multicast traffic,
319 * @IWL_STA_TDLS_LINK: TDLS link station
320 * @IWL_STA_AUX_ACTIVITY: auxilary station (scan, ROC and so on).
321 */
322enum iwl_sta_type {
323 IWL_STA_LINK,
324 IWL_STA_GENERAL_PURPOSE,
325 IWL_STA_MULTICAST,
326 IWL_STA_TDLS_LINK,
327 IWL_STA_AUX_ACTIVITY,
328};
329
330/**
Sara Sharon854c5702016-01-26 13:17:47 +0200331 * struct iwl_mvm_add_sta_cmd - Add/modify a station in the fw's sta table.
332 * ( REPLY_ADD_STA = 0x18 )
333 * @add_modify: 1: modify existing, 0: add new station
334 * @awake_acs:
335 * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
336 * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
337 * @mac_id_n_color: the Mac context this station belongs to
338 * @addr[ETH_ALEN]: station's MAC address
339 * @sta_id: index of station in uCode's station table
340 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
341 * alone. 1 - modify, 0 - don't change.
342 * @station_flags: look at %iwl_sta_flags
343 * @station_flags_msk: what of %station_flags have changed
344 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
345 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
346 * add_immediate_ba_ssn.
347 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
348 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
349 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
350 * add_immediate_ba_tid.
351 * @sleep_tx_count: number of packets to transmit to station even though it is
352 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
353 * keeps track of STA sleep state.
Sara Sharonced19f22017-02-06 19:09:32 +0200354 * @station_type: type of this station. See &enum iwl_sta_type.
Sara Sharon854c5702016-01-26 13:17:47 +0200355 * @sleep_state_flags: Look at %iwl_sta_sleep_flag.
356 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
357 * mac-addr.
358 * @beamform_flags: beam forming controls
Sara Sharonbb497012016-09-29 14:52:40 +0300359 * @tfd_queue_msk: tfd queues used by this station.
360 * Obselete for new TX API (9 and above).
Sara Sharon854c5702016-01-26 13:17:47 +0200361 * @rx_ba_window: aggregation window size
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200362 * @sp_length: the size of the SP as it appears in the WME IE
363 * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
364 * enabled ACs.
Sara Sharon854c5702016-01-26 13:17:47 +0200365 *
366 * The device contains an internal table of per-station information, with info
367 * on security keys, aggregation parameters, and Tx rates for initial Tx
368 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
369 *
370 * ADD_STA sets up the table entry for one station, either creating a new
371 * entry, or modifying a pre-existing one.
372 */
373struct iwl_mvm_add_sta_cmd {
374 u8 add_modify;
375 u8 awake_acs;
376 __le16 tid_disable_tx;
377 __le32 mac_id_n_color;
378 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
379 __le16 reserved2;
380 u8 sta_id;
381 u8 modify_mask;
382 __le16 reserved3;
383 __le32 station_flags;
384 __le32 station_flags_msk;
385 u8 add_immediate_ba_tid;
386 u8 remove_immediate_ba_tid;
387 __le16 add_immediate_ba_ssn;
388 __le16 sleep_tx_count;
Sara Sharonced19f22017-02-06 19:09:32 +0200389 u8 sleep_state_flags;
390 u8 station_type;
Sara Sharon854c5702016-01-26 13:17:47 +0200391 __le16 assoc_id;
392 __le16 beamform_flags;
393 __le32 tfd_queue_msk;
394 __le16 rx_ba_window;
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200395 u8 sp_length;
396 u8 uapsd_acs;
Sara Sharonced19f22017-02-06 19:09:32 +0200397} __packed; /* ADD_STA_CMD_API_S_VER_10 */
Sara Sharon854c5702016-01-26 13:17:47 +0200398
399/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200400 * struct iwl_mvm_add_sta_key_common - add/modify sta key common part
Max Stepanov5a258aa2013-04-07 09:11:21 +0300401 * ( REPLY_ADD_STA_KEY = 0x17 )
402 * @sta_id: index of station in uCode's station table
403 * @key_offset: key offset in key storage
404 * @key_flags: type %iwl_sta_key_flag
405 * @key: key material data
Max Stepanov5a258aa2013-04-07 09:11:21 +0300406 * @rx_secur_seq_cnt: RX security sequence counter for the key
Max Stepanov5a258aa2013-04-07 09:11:21 +0300407 */
Sara Sharon45c458b2016-11-09 15:43:26 +0200408struct iwl_mvm_add_sta_key_common {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300409 u8 sta_id;
410 u8 key_offset;
411 __le16 key_flags;
Ayala Beker2a53d162016-04-07 16:21:57 +0300412 u8 key[32];
Max Stepanov5a258aa2013-04-07 09:11:21 +0300413 u8 rx_secur_seq_cnt[16];
Sara Sharon45c458b2016-11-09 15:43:26 +0200414} __packed;
415
416/**
417 * struct iwl_mvm_add_sta_key_cmd_v1 - add/modify sta key
418 * @common: see &struct iwl_mvm_add_sta_key_common
419 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
420 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
421 */
422struct iwl_mvm_add_sta_key_cmd_v1 {
423 struct iwl_mvm_add_sta_key_common common;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300424 u8 tkip_rx_tsc_byte2;
425 u8 reserved;
426 __le16 tkip_rx_ttak[5];
427} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_1 */
428
429/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200430 * struct iwl_mvm_add_sta_key_cmd - add/modify sta key
431 * @common: see &struct iwl_mvm_add_sta_key_common
432 * @rx_mic_key: TKIP RX unicast or multicast key
433 * @tx_mic_key: TKIP TX key
434 * @transmit_seq_cnt: TSC, transmit packet number
435 */
436struct iwl_mvm_add_sta_key_cmd {
437 struct iwl_mvm_add_sta_key_common common;
438 __le64 rx_mic_key;
439 __le64 tx_mic_key;
440 __le64 transmit_seq_cnt;
441} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_2 */
442
443/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100444 * enum iwl_mvm_add_sta_rsp_status - status in the response to ADD_STA command
445 * @ADD_STA_SUCCESS: operation was executed successfully
446 * @ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
447 * @ADD_STA_IMMEDIATE_BA_FAILURE: can't add Rx block ack session
448 * @ADD_STA_MODIFY_NON_EXISTING_STA: driver requested to modify a station that
449 * doesn't exist.
450 */
451enum iwl_mvm_add_sta_rsp_status {
452 ADD_STA_SUCCESS = 0x1,
453 ADD_STA_STATIONS_OVERLOAD = 0x2,
454 ADD_STA_IMMEDIATE_BA_FAILURE = 0x4,
455 ADD_STA_MODIFY_NON_EXISTING_STA = 0x8,
456};
457
458/**
459 * struct iwl_mvm_rm_sta_cmd - Add / modify a station in the fw's station table
460 * ( REMOVE_STA = 0x19 )
461 * @sta_id: the station id of the station to be removed
462 */
463struct iwl_mvm_rm_sta_cmd {
464 u8 sta_id;
465 u8 reserved[3];
466} __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
467
468/**
Ayala Beker8e160ab2016-04-11 11:37:38 +0300469 * struct iwl_mvm_mgmt_mcast_key_cmd_v1
470 * ( MGMT_MCAST_KEY = 0x1f )
471 * @ctrl_flags: %iwl_sta_key_flag
472 * @igtk:
473 * @k1: unused
474 * @k2: unused
475 * @sta_id: station ID that support IGTK
476 * @key_id:
477 * @receive_seq_cnt: initial RSC/PN needed for replay check
478 */
479struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
480 __le32 ctrl_flags;
481 u8 igtk[16];
482 u8 k1[16];
483 u8 k2[16];
484 __le32 key_id;
485 __le32 sta_id;
486 __le64 receive_seq_cnt;
487} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
488
489/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100490 * struct iwl_mvm_mgmt_mcast_key_cmd
491 * ( MGMT_MCAST_KEY = 0x1f )
492 * @ctrl_flags: %iwl_sta_key_flag
Ayala Beker8e160ab2016-04-11 11:37:38 +0300493 * @igtk: IGTK master key
Johannes Berg8ca151b2013-01-24 14:25:36 +0100494 * @sta_id: station ID that support IGTK
495 * @key_id:
496 * @receive_seq_cnt: initial RSC/PN needed for replay check
497 */
498struct iwl_mvm_mgmt_mcast_key_cmd {
499 __le32 ctrl_flags;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300500 u8 igtk[32];
Johannes Berg8ca151b2013-01-24 14:25:36 +0100501 __le32 key_id;
502 __le32 sta_id;
503 __le64 receive_seq_cnt;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300504} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100505
506struct iwl_mvm_wep_key {
507 u8 key_index;
508 u8 key_offset;
509 __le16 reserved1;
510 u8 key_size;
511 u8 reserved2[3];
512 u8 key[16];
513} __packed;
514
515struct iwl_mvm_wep_key_cmd {
516 __le32 mac_id_n_color;
517 u8 num_keys;
518 u8 decryption_type;
519 u8 flags;
520 u8 reserved;
521 struct iwl_mvm_wep_key wep_key[0];
522} __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */
523
Johannes Berg3e56ead2013-02-15 22:23:18 +0100524/**
525 * struct iwl_mvm_eosp_notification - EOSP notification from firmware
526 * @remain_frame_count: # of frames remaining, non-zero if SP was cut
527 * short by GO absence
528 * @sta_id: station ID
529 */
530struct iwl_mvm_eosp_notification {
531 __le32 remain_frame_count;
532 __le32 sta_id;
533} __packed; /* UAPSD_EOSP_NTFY_API_S_VER_1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100534
535#endif /* __fw_api_sta_h__ */