blob: 0f6264fdfed1e64533cfc588130c29bb4f330018 [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
Johannes Berg31a658b2017-03-09 15:56:57 +0100226 * @key_flags: type &enum iwl_sta_key_flag
Johannes Berg8ca151b2013-01-24 14:25:36 +0100227 * @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 )
Johannes Berg67625862017-03-14 11:01:27 +0100256 * @add_modify: see &enum iwl_sta_mode
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 Berg67625862017-03-14 11:01:27 +0100260 * @mac_id_n_color: the Mac context this station belongs to,
261 * see &enum iwl_mvm_id_and_color
Johannes Berg31a658b2017-03-09 15:56:57 +0100262 * @addr: station's MAC address
Johannes Berg8ca151b2013-01-24 14:25:36 +0100263 * @sta_id: index of station in uCode's station table
264 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
265 * alone. 1 - modify, 0 - don't change.
Johannes Berg31a658b2017-03-09 15:56:57 +0100266 * @station_flags: look at &enum iwl_sta_flags
267 * @station_flags_msk: what of %station_flags have changed,
268 * also &enum iwl_sta_flags
Johannes Berg8ca151b2013-01-24 14:25:36 +0100269 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
270 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
271 * add_immediate_ba_ssn.
272 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
273 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
274 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
275 * add_immediate_ba_tid.
276 * @sleep_tx_count: number of packets to transmit to station even though it is
277 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
278 * keeps track of STA sleep state.
Johannes Berg31a658b2017-03-09 15:56:57 +0100279 * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100280 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
281 * mac-addr.
282 * @beamform_flags: beam forming controls
283 * @tfd_queue_msk: tfd queues used by this station
284 *
285 * The device contains an internal table of per-station information, with info
286 * on security keys, aggregation parameters, and Tx rates for initial Tx
287 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
288 *
289 * ADD_STA sets up the table entry for one station, either creating a new
290 * entry, or modifying a pre-existing one.
291 */
Sara Sharon854c5702016-01-26 13:17:47 +0200292struct iwl_mvm_add_sta_cmd_v7 {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300293 u8 add_modify;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100294 u8 awake_acs;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300295 __le16 tid_disable_tx;
296 __le32 mac_id_n_color;
297 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
298 __le16 reserved2;
299 u8 sta_id;
300 u8 modify_mask;
301 __le16 reserved3;
302 __le32 station_flags;
303 __le32 station_flags_msk;
304 u8 add_immediate_ba_tid;
305 u8 remove_immediate_ba_tid;
306 __le16 add_immediate_ba_ssn;
307 __le16 sleep_tx_count;
308 __le16 sleep_state_flags;
309 __le16 assoc_id;
310 __le16 beamform_flags;
311 __le32 tfd_queue_msk;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100312} __packed; /* ADD_STA_CMD_API_S_VER_7 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300313
314/**
Sara Sharonced19f22017-02-06 19:09:32 +0200315 * enum iwl_sta_type - FW station types
316 * ( REPLY_ADD_STA = 0x18 )
317 * @IWL_STA_LINK: Link station - normal RX and TX traffic.
318 * @IWL_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons
319 * and probe responses.
320 * @IWL_STA_MULTICAST: multicast traffic,
321 * @IWL_STA_TDLS_LINK: TDLS link station
322 * @IWL_STA_AUX_ACTIVITY: auxilary station (scan, ROC and so on).
323 */
324enum iwl_sta_type {
325 IWL_STA_LINK,
326 IWL_STA_GENERAL_PURPOSE,
327 IWL_STA_MULTICAST,
328 IWL_STA_TDLS_LINK,
329 IWL_STA_AUX_ACTIVITY,
330};
331
332/**
Sara Sharon854c5702016-01-26 13:17:47 +0200333 * struct iwl_mvm_add_sta_cmd - Add/modify a station in the fw's sta table.
334 * ( REPLY_ADD_STA = 0x18 )
Johannes Berg67625862017-03-14 11:01:27 +0100335 * @add_modify: see &enum iwl_sta_mode
Sara Sharon854c5702016-01-26 13:17:47 +0200336 * @awake_acs:
337 * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
338 * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
Johannes Berg67625862017-03-14 11:01:27 +0100339 * @mac_id_n_color: the Mac context this station belongs to,
340 * see &enum iwl_mvm_id_and_color
Johannes Berg31a658b2017-03-09 15:56:57 +0100341 * @addr: station's MAC address
Sara Sharon854c5702016-01-26 13:17:47 +0200342 * @sta_id: index of station in uCode's station table
343 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
344 * alone. 1 - modify, 0 - don't change.
Johannes Berg31a658b2017-03-09 15:56:57 +0100345 * @station_flags: look at &enum iwl_sta_flags
346 * @station_flags_msk: what of %station_flags have changed,
347 * also &enum iwl_sta_flags
Sara Sharon854c5702016-01-26 13:17:47 +0200348 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
349 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
350 * add_immediate_ba_ssn.
351 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
352 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
353 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
354 * add_immediate_ba_tid.
355 * @sleep_tx_count: number of packets to transmit to station even though it is
356 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
357 * keeps track of STA sleep state.
Sara Sharonced19f22017-02-06 19:09:32 +0200358 * @station_type: type of this station. See &enum iwl_sta_type.
Johannes Berg31a658b2017-03-09 15:56:57 +0100359 * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
Sara Sharon854c5702016-01-26 13:17:47 +0200360 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
361 * mac-addr.
362 * @beamform_flags: beam forming controls
Sara Sharonbb497012016-09-29 14:52:40 +0300363 * @tfd_queue_msk: tfd queues used by this station.
364 * Obselete for new TX API (9 and above).
Sara Sharon854c5702016-01-26 13:17:47 +0200365 * @rx_ba_window: aggregation window size
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200366 * @sp_length: the size of the SP as it appears in the WME IE
367 * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
368 * enabled ACs.
Sara Sharon854c5702016-01-26 13:17:47 +0200369 *
370 * The device contains an internal table of per-station information, with info
371 * on security keys, aggregation parameters, and Tx rates for initial Tx
372 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
373 *
374 * ADD_STA sets up the table entry for one station, either creating a new
375 * entry, or modifying a pre-existing one.
376 */
377struct iwl_mvm_add_sta_cmd {
378 u8 add_modify;
379 u8 awake_acs;
380 __le16 tid_disable_tx;
381 __le32 mac_id_n_color;
382 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
383 __le16 reserved2;
384 u8 sta_id;
385 u8 modify_mask;
386 __le16 reserved3;
387 __le32 station_flags;
388 __le32 station_flags_msk;
389 u8 add_immediate_ba_tid;
390 u8 remove_immediate_ba_tid;
391 __le16 add_immediate_ba_ssn;
392 __le16 sleep_tx_count;
Sara Sharonced19f22017-02-06 19:09:32 +0200393 u8 sleep_state_flags;
394 u8 station_type;
Sara Sharon854c5702016-01-26 13:17:47 +0200395 __le16 assoc_id;
396 __le16 beamform_flags;
397 __le32 tfd_queue_msk;
398 __le16 rx_ba_window;
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200399 u8 sp_length;
400 u8 uapsd_acs;
Sara Sharonced19f22017-02-06 19:09:32 +0200401} __packed; /* ADD_STA_CMD_API_S_VER_10 */
Sara Sharon854c5702016-01-26 13:17:47 +0200402
403/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200404 * struct iwl_mvm_add_sta_key_common - add/modify sta key common part
Max Stepanov5a258aa2013-04-07 09:11:21 +0300405 * ( REPLY_ADD_STA_KEY = 0x17 )
406 * @sta_id: index of station in uCode's station table
407 * @key_offset: key offset in key storage
Johannes Berg31a658b2017-03-09 15:56:57 +0100408 * @key_flags: type &enum iwl_sta_key_flag
Max Stepanov5a258aa2013-04-07 09:11:21 +0300409 * @key: key material data
Max Stepanov5a258aa2013-04-07 09:11:21 +0300410 * @rx_secur_seq_cnt: RX security sequence counter for the key
Max Stepanov5a258aa2013-04-07 09:11:21 +0300411 */
Sara Sharon45c458b2016-11-09 15:43:26 +0200412struct iwl_mvm_add_sta_key_common {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300413 u8 sta_id;
414 u8 key_offset;
415 __le16 key_flags;
Ayala Beker2a53d162016-04-07 16:21:57 +0300416 u8 key[32];
Max Stepanov5a258aa2013-04-07 09:11:21 +0300417 u8 rx_secur_seq_cnt[16];
Sara Sharon45c458b2016-11-09 15:43:26 +0200418} __packed;
419
420/**
421 * struct iwl_mvm_add_sta_key_cmd_v1 - add/modify sta key
422 * @common: see &struct iwl_mvm_add_sta_key_common
423 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
424 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
425 */
426struct iwl_mvm_add_sta_key_cmd_v1 {
427 struct iwl_mvm_add_sta_key_common common;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300428 u8 tkip_rx_tsc_byte2;
429 u8 reserved;
430 __le16 tkip_rx_ttak[5];
431} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_1 */
432
433/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200434 * struct iwl_mvm_add_sta_key_cmd - add/modify sta key
435 * @common: see &struct iwl_mvm_add_sta_key_common
436 * @rx_mic_key: TKIP RX unicast or multicast key
437 * @tx_mic_key: TKIP TX key
438 * @transmit_seq_cnt: TSC, transmit packet number
439 */
440struct iwl_mvm_add_sta_key_cmd {
441 struct iwl_mvm_add_sta_key_common common;
442 __le64 rx_mic_key;
443 __le64 tx_mic_key;
444 __le64 transmit_seq_cnt;
445} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_2 */
446
447/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100448 * enum iwl_mvm_add_sta_rsp_status - status in the response to ADD_STA command
449 * @ADD_STA_SUCCESS: operation was executed successfully
450 * @ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
451 * @ADD_STA_IMMEDIATE_BA_FAILURE: can't add Rx block ack session
452 * @ADD_STA_MODIFY_NON_EXISTING_STA: driver requested to modify a station that
453 * doesn't exist.
454 */
455enum iwl_mvm_add_sta_rsp_status {
456 ADD_STA_SUCCESS = 0x1,
457 ADD_STA_STATIONS_OVERLOAD = 0x2,
458 ADD_STA_IMMEDIATE_BA_FAILURE = 0x4,
459 ADD_STA_MODIFY_NON_EXISTING_STA = 0x8,
460};
461
462/**
463 * struct iwl_mvm_rm_sta_cmd - Add / modify a station in the fw's station table
464 * ( REMOVE_STA = 0x19 )
465 * @sta_id: the station id of the station to be removed
466 */
467struct iwl_mvm_rm_sta_cmd {
468 u8 sta_id;
469 u8 reserved[3];
470} __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
471
472/**
Ayala Beker8e160ab2016-04-11 11:37:38 +0300473 * struct iwl_mvm_mgmt_mcast_key_cmd_v1
474 * ( MGMT_MCAST_KEY = 0x1f )
Johannes Berg67625862017-03-14 11:01:27 +0100475 * @ctrl_flags: &enum iwl_sta_key_flag
Ayala Beker8e160ab2016-04-11 11:37:38 +0300476 * @igtk:
477 * @k1: unused
478 * @k2: unused
479 * @sta_id: station ID that support IGTK
480 * @key_id:
481 * @receive_seq_cnt: initial RSC/PN needed for replay check
482 */
483struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
484 __le32 ctrl_flags;
485 u8 igtk[16];
486 u8 k1[16];
487 u8 k2[16];
488 __le32 key_id;
489 __le32 sta_id;
490 __le64 receive_seq_cnt;
491} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
492
493/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100494 * struct iwl_mvm_mgmt_mcast_key_cmd
495 * ( MGMT_MCAST_KEY = 0x1f )
Johannes Berg67625862017-03-14 11:01:27 +0100496 * @ctrl_flags: &enum iwl_sta_key_flag
Ayala Beker8e160ab2016-04-11 11:37:38 +0300497 * @igtk: IGTK master key
Johannes Berg8ca151b2013-01-24 14:25:36 +0100498 * @sta_id: station ID that support IGTK
499 * @key_id:
500 * @receive_seq_cnt: initial RSC/PN needed for replay check
501 */
502struct iwl_mvm_mgmt_mcast_key_cmd {
503 __le32 ctrl_flags;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300504 u8 igtk[32];
Johannes Berg8ca151b2013-01-24 14:25:36 +0100505 __le32 key_id;
506 __le32 sta_id;
507 __le64 receive_seq_cnt;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300508} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100509
510struct iwl_mvm_wep_key {
511 u8 key_index;
512 u8 key_offset;
513 __le16 reserved1;
514 u8 key_size;
515 u8 reserved2[3];
516 u8 key[16];
517} __packed;
518
519struct iwl_mvm_wep_key_cmd {
520 __le32 mac_id_n_color;
521 u8 num_keys;
522 u8 decryption_type;
523 u8 flags;
524 u8 reserved;
525 struct iwl_mvm_wep_key wep_key[0];
526} __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */
527
Johannes Berg3e56ead2013-02-15 22:23:18 +0100528/**
529 * struct iwl_mvm_eosp_notification - EOSP notification from firmware
530 * @remain_frame_count: # of frames remaining, non-zero if SP was cut
531 * short by GO absence
532 * @sta_id: station ID
533 */
534struct iwl_mvm_eosp_notification {
535 __le32 remain_frame_count;
536 __le32 sta_id;
537} __packed; /* UAPSD_EOSP_NTFY_API_S_VER_1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100538
539#endif /* __fw_api_sta_h__ */