blob: 81f0a3463baccec93f75aceaca1ca0ea04b8424c [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
Johannes Bergacf91dd2017-05-16 16:15:42 +020072 * @STA_FLG_REDUCED_TX_PWR_CTRL: reduced TX power (control frames)
73 * @STA_FLG_REDUCED_TX_PWR_DATA: reduced TX power (data frames)
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
Johannes Bergacf91dd2017-05-16 16:15:42 +020081 * @STA_FLG_CLASS_AUTH: station is authenticated
82 * @STA_FLG_CLASS_ASSOC: station is associated
83 * @STA_FLG_RTS_MIMO_PROT: station requires RTS MIMO protection (dynamic SMPS)
84 * @STA_FLG_MAX_AGG_SIZE_MSK: maximal size for A-MPDU (mask)
85 * @STA_FLG_MAX_AGG_SIZE_SHIFT: maximal size for A-MPDU (bit shift)
86 * @STA_FLG_MAX_AGG_SIZE_8K: maximal size for A-MPDU (8k supported)
87 * @STA_FLG_MAX_AGG_SIZE_16K: maximal size for A-MPDU (16k supported)
88 * @STA_FLG_MAX_AGG_SIZE_32K: maximal size for A-MPDU (32k supported)
89 * @STA_FLG_MAX_AGG_SIZE_64K: maximal size for A-MPDU (64k supported)
90 * @STA_FLG_MAX_AGG_SIZE_128K: maximal size for A-MPDU (128k supported)
91 * @STA_FLG_MAX_AGG_SIZE_256K: maximal size for A-MPDU (256k supported)
92 * @STA_FLG_MAX_AGG_SIZE_512K: maximal size for A-MPDU (512k supported)
93 * @STA_FLG_MAX_AGG_SIZE_1024K: maximal size for A-MPDU (1024k supported)
Johannes Berg8ca151b2013-01-24 14:25:36 +010094 * @STA_FLG_AGG_MPDU_DENS_MSK: maximal MPDU density for Tx aggregation
95 * @STA_FLG_FAT_EN_MSK: support for channel width (for Tx). This flag is
96 * initialised by driver and can be updated by fw upon reception of
97 * action frames that can change the channel width. When cleared the fw
98 * will send all the frames in 20MHz even when FAT channel is requested.
Johannes Bergacf91dd2017-05-16 16:15:42 +020099 * @STA_FLG_FAT_EN_20MHZ: no wide channels are supported, only 20 MHz
100 * @STA_FLG_FAT_EN_40MHZ: wide channels up to 40 MHz supported
101 * @STA_FLG_FAT_EN_80MHZ: wide channels up to 80 MHz supported
102 * @STA_FLG_FAT_EN_160MHZ: wide channels up to 160 MHz supported
Johannes Berg8ca151b2013-01-24 14:25:36 +0100103 * @STA_FLG_MIMO_EN_MSK: support for MIMO. This flag is initialised by the
104 * driver and can be updated by fw upon reception of action frames.
Johannes Bergacf91dd2017-05-16 16:15:42 +0200105 * @STA_FLG_MIMO_EN_SISO: no support for MIMO
106 * @STA_FLG_MIMO_EN_MIMO2: 2 streams supported
107 * @STA_FLG_MIMO_EN_MIMO3: 3 streams supported
Johannes Berg8ca151b2013-01-24 14:25:36 +0100108 * @STA_FLG_MFP_EN: Management Frame Protection
Johannes Bergacf91dd2017-05-16 16:15:42 +0200109 * @STA_FLG_AGG_MPDU_DENS_MSK: A-MPDU density (mask)
110 * @STA_FLG_AGG_MPDU_DENS_SHIFT: A-MPDU density (bit shift)
111 * @STA_FLG_AGG_MPDU_DENS_2US: A-MPDU density (2 usec gap)
112 * @STA_FLG_AGG_MPDU_DENS_4US: A-MPDU density (4 usec gap)
113 * @STA_FLG_AGG_MPDU_DENS_8US: A-MPDU density (8 usec gap)
114 * @STA_FLG_AGG_MPDU_DENS_16US: A-MPDU density (16 usec gap)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100115 */
116enum iwl_sta_flags {
117 STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3),
118 STA_FLG_REDUCED_TX_PWR_DATA = BIT(6),
119
Andrei Otcheretianski09b0ce12014-05-25 17:07:38 +0300120 STA_FLG_DISABLE_TX = BIT(4),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100121
122 STA_FLG_PS = BIT(8),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100123 STA_FLG_DRAIN_FLOW = BIT(12),
124 STA_FLG_PAN = BIT(13),
125 STA_FLG_CLASS_AUTH = BIT(14),
126 STA_FLG_CLASS_ASSOC = BIT(15),
127 STA_FLG_RTS_MIMO_PROT = BIT(17),
128
129 STA_FLG_MAX_AGG_SIZE_SHIFT = 19,
130 STA_FLG_MAX_AGG_SIZE_8K = (0 << STA_FLG_MAX_AGG_SIZE_SHIFT),
131 STA_FLG_MAX_AGG_SIZE_16K = (1 << STA_FLG_MAX_AGG_SIZE_SHIFT),
132 STA_FLG_MAX_AGG_SIZE_32K = (2 << STA_FLG_MAX_AGG_SIZE_SHIFT),
133 STA_FLG_MAX_AGG_SIZE_64K = (3 << STA_FLG_MAX_AGG_SIZE_SHIFT),
134 STA_FLG_MAX_AGG_SIZE_128K = (4 << STA_FLG_MAX_AGG_SIZE_SHIFT),
135 STA_FLG_MAX_AGG_SIZE_256K = (5 << STA_FLG_MAX_AGG_SIZE_SHIFT),
136 STA_FLG_MAX_AGG_SIZE_512K = (6 << STA_FLG_MAX_AGG_SIZE_SHIFT),
137 STA_FLG_MAX_AGG_SIZE_1024K = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
138 STA_FLG_MAX_AGG_SIZE_MSK = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
139
140 STA_FLG_AGG_MPDU_DENS_SHIFT = 23,
141 STA_FLG_AGG_MPDU_DENS_2US = (4 << STA_FLG_AGG_MPDU_DENS_SHIFT),
142 STA_FLG_AGG_MPDU_DENS_4US = (5 << STA_FLG_AGG_MPDU_DENS_SHIFT),
143 STA_FLG_AGG_MPDU_DENS_8US = (6 << STA_FLG_AGG_MPDU_DENS_SHIFT),
144 STA_FLG_AGG_MPDU_DENS_16US = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
145 STA_FLG_AGG_MPDU_DENS_MSK = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
146
147 STA_FLG_FAT_EN_20MHZ = (0 << 26),
148 STA_FLG_FAT_EN_40MHZ = (1 << 26),
149 STA_FLG_FAT_EN_80MHZ = (2 << 26),
150 STA_FLG_FAT_EN_160MHZ = (3 << 26),
151 STA_FLG_FAT_EN_MSK = (3 << 26),
152
153 STA_FLG_MIMO_EN_SISO = (0 << 28),
154 STA_FLG_MIMO_EN_MIMO2 = (1 << 28),
155 STA_FLG_MIMO_EN_MIMO3 = (2 << 28),
156 STA_FLG_MIMO_EN_MSK = (3 << 28),
157};
158
159/**
160 * enum iwl_sta_key_flag - key flags for the ADD_STA host command
Max Stepanove36e5432013-08-27 19:56:13 +0300161 * @STA_KEY_FLG_NO_ENC: no encryption
162 * @STA_KEY_FLG_WEP: WEP encryption algorithm
163 * @STA_KEY_FLG_CCM: CCMP encryption algorithm
164 * @STA_KEY_FLG_TKIP: TKIP encryption algorithm
165 * @STA_KEY_FLG_EXT: extended cipher algorithm (depends on the FW support)
Ayala Beker2a53d162016-04-07 16:21:57 +0300166 * @STA_KEY_FLG_GCMP: GCMP encryption algorithm
Max Stepanove36e5432013-08-27 19:56:13 +0300167 * @STA_KEY_FLG_CMAC: CMAC encryption algorithm
168 * @STA_KEY_FLG_ENC_UNKNOWN: unknown encryption algorithm
169 * @STA_KEY_FLG_EN_MSK: mask for encryption algorithmi value
Johannes Berg8ca151b2013-01-24 14:25:36 +0100170 * @STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
171 * station info array (1 - n 1X mode)
172 * @STA_KEY_FLG_KEYID_MSK: the index of the key
Johannes Bergacf91dd2017-05-16 16:15:42 +0200173 * @STA_KEY_FLG_KEYID_POS: key index bit position
Johannes Berg8ca151b2013-01-24 14:25:36 +0100174 * @STA_KEY_NOT_VALID: key is invalid
175 * @STA_KEY_FLG_WEP_13BYTES: set for 13 bytes WEP key
Johannes Bergacf91dd2017-05-16 16:15:42 +0200176 * @STA_KEY_FLG_KEY_32BYTES: for non-wep key set for 32 bytes key
Johannes Berg8ca151b2013-01-24 14:25:36 +0100177 * @STA_KEY_MULTICAST: set for multical key
178 * @STA_KEY_MFP: key is used for Management Frame Protection
179 */
180enum iwl_sta_key_flag {
181 STA_KEY_FLG_NO_ENC = (0 << 0),
182 STA_KEY_FLG_WEP = (1 << 0),
183 STA_KEY_FLG_CCM = (2 << 0),
184 STA_KEY_FLG_TKIP = (3 << 0),
Max Stepanove36e5432013-08-27 19:56:13 +0300185 STA_KEY_FLG_EXT = (4 << 0),
Ayala Beker2a53d162016-04-07 16:21:57 +0300186 STA_KEY_FLG_GCMP = (5 << 0),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100187 STA_KEY_FLG_CMAC = (6 << 0),
188 STA_KEY_FLG_ENC_UNKNOWN = (7 << 0),
189 STA_KEY_FLG_EN_MSK = (7 << 0),
190
191 STA_KEY_FLG_WEP_KEY_MAP = BIT(3),
192 STA_KEY_FLG_KEYID_POS = 8,
193 STA_KEY_FLG_KEYID_MSK = (3 << STA_KEY_FLG_KEYID_POS),
194 STA_KEY_NOT_VALID = BIT(11),
195 STA_KEY_FLG_WEP_13BYTES = BIT(12),
Ayala Beker2a53d162016-04-07 16:21:57 +0300196 STA_KEY_FLG_KEY_32BYTES = BIT(12),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100197 STA_KEY_MULTICAST = BIT(14),
198 STA_KEY_MFP = BIT(15),
199};
200
201/**
202 * enum iwl_sta_modify_flag - indicate to the fw what flag are being changed
Liad Kaufman2b1ba3e2015-09-21 14:14:23 +0200203 * @STA_MODIFY_QUEUE_REMOVAL: this command removes a queue
Johannes Berg8ca151b2013-01-24 14:25:36 +0100204 * @STA_MODIFY_TID_DISABLE_TX: this command modifies %tid_disable_tx
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200205 * @STA_MODIFY_UAPSD_ACS: this command modifies %uapsd_acs
Johannes Berg8ca151b2013-01-24 14:25:36 +0100206 * @STA_MODIFY_ADD_BA_TID: this command modifies %add_immediate_ba_tid
207 * @STA_MODIFY_REMOVE_BA_TID: this command modifies %remove_immediate_ba_tid
208 * @STA_MODIFY_SLEEPING_STA_TX_COUNT: this command modifies %sleep_tx_count
Johannes Bergacf91dd2017-05-16 16:15:42 +0200209 * @STA_MODIFY_PROT_TH: modify RTS threshold
Johannes Berg8ca151b2013-01-24 14:25:36 +0100210 * @STA_MODIFY_QUEUES: modify the queues used by this station
211 */
212enum iwl_sta_modify_flag {
Liad Kaufman2b1ba3e2015-09-21 14:14:23 +0200213 STA_MODIFY_QUEUE_REMOVAL = BIT(0),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100214 STA_MODIFY_TID_DISABLE_TX = BIT(1),
Johannes Berg65e25482016-04-13 14:24:22 +0200215 STA_MODIFY_UAPSD_ACS = BIT(2),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100216 STA_MODIFY_ADD_BA_TID = BIT(3),
217 STA_MODIFY_REMOVE_BA_TID = BIT(4),
218 STA_MODIFY_SLEEPING_STA_TX_COUNT = BIT(5),
219 STA_MODIFY_PROT_TH = BIT(6),
220 STA_MODIFY_QUEUES = BIT(7),
221};
222
Johannes Bergd69f0a22017-03-14 10:58:16 +0100223/**
224 * enum iwl_sta_mode - station command mode
225 * @STA_MODE_ADD: add new station
226 * @STA_MODE_MODIFY: modify the station
227 */
228enum iwl_sta_mode {
229 STA_MODE_ADD = 0,
230 STA_MODE_MODIFY = 1,
231};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100232
233/**
234 * enum iwl_sta_sleep_flag - type of sleep of the station
Johannes Bergacf91dd2017-05-16 16:15:42 +0200235 * @STA_SLEEP_STATE_AWAKE: station is awake
236 * @STA_SLEEP_STATE_PS_POLL: station is PS-polling
237 * @STA_SLEEP_STATE_UAPSD: station uses U-APSD
Johannes Berg3e56ead2013-02-15 22:23:18 +0100238 * @STA_SLEEP_STATE_MOREDATA: set more-data bit on
239 * (last) released frame
Johannes Berg8ca151b2013-01-24 14:25:36 +0100240 */
241enum iwl_sta_sleep_flag {
Johannes Berg3e56ead2013-02-15 22:23:18 +0100242 STA_SLEEP_STATE_AWAKE = 0,
243 STA_SLEEP_STATE_PS_POLL = BIT(0),
244 STA_SLEEP_STATE_UAPSD = BIT(1),
245 STA_SLEEP_STATE_MOREDATA = BIT(2),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100246};
247
Johannes Berg8ca151b2013-01-24 14:25:36 +0100248#define STA_KEY_MAX_NUM (16)
249#define STA_KEY_IDX_INVALID (0xff)
250#define STA_KEY_MAX_DATA_KEY_NUM (4)
251#define IWL_MAX_GLOBAL_KEYS (4)
252#define STA_KEY_LEN_WEP40 (5)
253#define STA_KEY_LEN_WEP104 (13)
254
255/**
256 * struct iwl_mvm_keyinfo - key information
Johannes Berg31a658b2017-03-09 15:56:57 +0100257 * @key_flags: type &enum iwl_sta_key_flag
Johannes Berg8ca151b2013-01-24 14:25:36 +0100258 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
Johannes Bergacf91dd2017-05-16 16:15:42 +0200259 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100260 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
261 * @key_offset: key offset in the fw's key table
Johannes Bergacf91dd2017-05-16 16:15:42 +0200262 * @reserved2: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100263 * @key: 16-byte unicast decryption key
264 * @tx_secur_seq_cnt: initial RSC / PN needed for replay check
265 * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
266 * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
267 */
268struct iwl_mvm_keyinfo {
269 __le16 key_flags;
270 u8 tkip_rx_tsc_byte2;
271 u8 reserved1;
272 __le16 tkip_rx_ttak[5];
273 u8 key_offset;
274 u8 reserved2;
275 u8 key[16];
276 __le64 tx_secur_seq_cnt;
277 __le64 hw_tkip_mic_rx_key;
278 __le64 hw_tkip_mic_tx_key;
279} __packed;
280
Sara Sharon10b2b202016-03-20 16:23:41 +0200281#define IWL_ADD_STA_STATUS_MASK 0xFF
282#define IWL_ADD_STA_BAID_VALID_MASK 0x8000
283#define IWL_ADD_STA_BAID_MASK 0x7F00
284#define IWL_ADD_STA_BAID_SHIFT 8
Sara Sharon837c4da2016-01-07 16:50:45 +0200285
Johannes Berg8ca151b2013-01-24 14:25:36 +0100286/**
Sara Sharon854c5702016-01-26 13:17:47 +0200287 * struct iwl_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100288 * ( REPLY_ADD_STA = 0x18 )
Johannes Berg67625862017-03-14 11:01:27 +0100289 * @add_modify: see &enum iwl_sta_mode
Johannes Bergacf91dd2017-05-16 16:15:42 +0200290 * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD)
Emmanuel Grumbachf9dc0002014-03-30 09:53:27 +0300291 * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
292 * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
Johannes Berg67625862017-03-14 11:01:27 +0100293 * @mac_id_n_color: the Mac context this station belongs to,
294 * see &enum iwl_mvm_id_and_color
Johannes Berg31a658b2017-03-09 15:56:57 +0100295 * @addr: station's MAC address
Johannes Bergacf91dd2017-05-16 16:15:42 +0200296 * @reserved2: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100297 * @sta_id: index of station in uCode's station table
298 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
299 * alone. 1 - modify, 0 - don't change.
Johannes Bergacf91dd2017-05-16 16:15:42 +0200300 * @reserved3: reserved
Johannes Berg31a658b2017-03-09 15:56:57 +0100301 * @station_flags: look at &enum iwl_sta_flags
302 * @station_flags_msk: what of %station_flags have changed,
303 * also &enum iwl_sta_flags
Johannes Berg8ca151b2013-01-24 14:25:36 +0100304 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
305 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
306 * add_immediate_ba_ssn.
307 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
308 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
309 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
310 * add_immediate_ba_tid.
311 * @sleep_tx_count: number of packets to transmit to station even though it is
312 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
313 * keeps track of STA sleep state.
Johannes Berg31a658b2017-03-09 15:56:57 +0100314 * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100315 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
316 * mac-addr.
317 * @beamform_flags: beam forming controls
318 * @tfd_queue_msk: tfd queues used by this station
319 *
320 * The device contains an internal table of per-station information, with info
321 * on security keys, aggregation parameters, and Tx rates for initial Tx
322 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
323 *
324 * ADD_STA sets up the table entry for one station, either creating a new
325 * entry, or modifying a pre-existing one.
326 */
Sara Sharon854c5702016-01-26 13:17:47 +0200327struct iwl_mvm_add_sta_cmd_v7 {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300328 u8 add_modify;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100329 u8 awake_acs;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300330 __le16 tid_disable_tx;
331 __le32 mac_id_n_color;
332 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
333 __le16 reserved2;
334 u8 sta_id;
335 u8 modify_mask;
336 __le16 reserved3;
337 __le32 station_flags;
338 __le32 station_flags_msk;
339 u8 add_immediate_ba_tid;
340 u8 remove_immediate_ba_tid;
341 __le16 add_immediate_ba_ssn;
342 __le16 sleep_tx_count;
343 __le16 sleep_state_flags;
344 __le16 assoc_id;
345 __le16 beamform_flags;
346 __le32 tfd_queue_msk;
Johannes Berg3e56ead2013-02-15 22:23:18 +0100347} __packed; /* ADD_STA_CMD_API_S_VER_7 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300348
349/**
Sara Sharonced19f22017-02-06 19:09:32 +0200350 * enum iwl_sta_type - FW station types
351 * ( REPLY_ADD_STA = 0x18 )
352 * @IWL_STA_LINK: Link station - normal RX and TX traffic.
353 * @IWL_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons
354 * and probe responses.
355 * @IWL_STA_MULTICAST: multicast traffic,
356 * @IWL_STA_TDLS_LINK: TDLS link station
357 * @IWL_STA_AUX_ACTIVITY: auxilary station (scan, ROC and so on).
358 */
359enum iwl_sta_type {
360 IWL_STA_LINK,
361 IWL_STA_GENERAL_PURPOSE,
362 IWL_STA_MULTICAST,
363 IWL_STA_TDLS_LINK,
364 IWL_STA_AUX_ACTIVITY,
365};
366
367/**
Sara Sharon854c5702016-01-26 13:17:47 +0200368 * struct iwl_mvm_add_sta_cmd - Add/modify a station in the fw's sta table.
369 * ( REPLY_ADD_STA = 0x18 )
Johannes Berg67625862017-03-14 11:01:27 +0100370 * @add_modify: see &enum iwl_sta_mode
Johannes Bergacf91dd2017-05-16 16:15:42 +0200371 * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD)
Sara Sharon854c5702016-01-26 13:17:47 +0200372 * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
373 * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
Johannes Berg67625862017-03-14 11:01:27 +0100374 * @mac_id_n_color: the Mac context this station belongs to,
375 * see &enum iwl_mvm_id_and_color
Johannes Berg31a658b2017-03-09 15:56:57 +0100376 * @addr: station's MAC address
Johannes Bergacf91dd2017-05-16 16:15:42 +0200377 * @reserved2: reserved
Sara Sharon854c5702016-01-26 13:17:47 +0200378 * @sta_id: index of station in uCode's station table
379 * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
380 * alone. 1 - modify, 0 - don't change.
Johannes Bergacf91dd2017-05-16 16:15:42 +0200381 * @reserved3: reserved
Johannes Berg31a658b2017-03-09 15:56:57 +0100382 * @station_flags: look at &enum iwl_sta_flags
383 * @station_flags_msk: what of %station_flags have changed,
384 * also &enum iwl_sta_flags
Sara Sharon854c5702016-01-26 13:17:47 +0200385 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
386 * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
387 * add_immediate_ba_ssn.
388 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
389 * Set %STA_MODIFY_REMOVE_BA_TID to use this field
390 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
391 * add_immediate_ba_tid.
392 * @sleep_tx_count: number of packets to transmit to station even though it is
393 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
394 * keeps track of STA sleep state.
Sara Sharonced19f22017-02-06 19:09:32 +0200395 * @station_type: type of this station. See &enum iwl_sta_type.
Johannes Berg31a658b2017-03-09 15:56:57 +0100396 * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
Sara Sharon854c5702016-01-26 13:17:47 +0200397 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
398 * mac-addr.
399 * @beamform_flags: beam forming controls
Sara Sharonbb497012016-09-29 14:52:40 +0300400 * @tfd_queue_msk: tfd queues used by this station.
401 * Obselete for new TX API (9 and above).
Sara Sharon854c5702016-01-26 13:17:47 +0200402 * @rx_ba_window: aggregation window size
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200403 * @sp_length: the size of the SP as it appears in the WME IE
404 * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
405 * enabled ACs.
Sara Sharon854c5702016-01-26 13:17:47 +0200406 *
407 * The device contains an internal table of per-station information, with info
408 * on security keys, aggregation parameters, and Tx rates for initial Tx
409 * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
410 *
411 * ADD_STA sets up the table entry for one station, either creating a new
412 * entry, or modifying a pre-existing one.
413 */
414struct iwl_mvm_add_sta_cmd {
415 u8 add_modify;
416 u8 awake_acs;
417 __le16 tid_disable_tx;
418 __le32 mac_id_n_color;
419 u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
420 __le16 reserved2;
421 u8 sta_id;
422 u8 modify_mask;
423 __le16 reserved3;
424 __le32 station_flags;
425 __le32 station_flags_msk;
426 u8 add_immediate_ba_tid;
427 u8 remove_immediate_ba_tid;
428 __le16 add_immediate_ba_ssn;
429 __le16 sleep_tx_count;
Sara Sharonced19f22017-02-06 19:09:32 +0200430 u8 sleep_state_flags;
431 u8 station_type;
Sara Sharon854c5702016-01-26 13:17:47 +0200432 __le16 assoc_id;
433 __le16 beamform_flags;
434 __le32 tfd_queue_msk;
435 __le16 rx_ba_window;
Emmanuel Grumbachc80eb572017-01-12 15:43:57 +0200436 u8 sp_length;
437 u8 uapsd_acs;
Sara Sharonced19f22017-02-06 19:09:32 +0200438} __packed; /* ADD_STA_CMD_API_S_VER_10 */
Sara Sharon854c5702016-01-26 13:17:47 +0200439
440/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200441 * struct iwl_mvm_add_sta_key_common - add/modify sta key common part
Max Stepanov5a258aa2013-04-07 09:11:21 +0300442 * ( REPLY_ADD_STA_KEY = 0x17 )
443 * @sta_id: index of station in uCode's station table
444 * @key_offset: key offset in key storage
Johannes Berg31a658b2017-03-09 15:56:57 +0100445 * @key_flags: type &enum iwl_sta_key_flag
Max Stepanov5a258aa2013-04-07 09:11:21 +0300446 * @key: key material data
Max Stepanov5a258aa2013-04-07 09:11:21 +0300447 * @rx_secur_seq_cnt: RX security sequence counter for the key
Max Stepanov5a258aa2013-04-07 09:11:21 +0300448 */
Sara Sharon45c458b2016-11-09 15:43:26 +0200449struct iwl_mvm_add_sta_key_common {
Max Stepanov5a258aa2013-04-07 09:11:21 +0300450 u8 sta_id;
451 u8 key_offset;
452 __le16 key_flags;
Ayala Beker2a53d162016-04-07 16:21:57 +0300453 u8 key[32];
Max Stepanov5a258aa2013-04-07 09:11:21 +0300454 u8 rx_secur_seq_cnt[16];
Sara Sharon45c458b2016-11-09 15:43:26 +0200455} __packed;
456
457/**
458 * struct iwl_mvm_add_sta_key_cmd_v1 - add/modify sta key
459 * @common: see &struct iwl_mvm_add_sta_key_common
460 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
Johannes Bergacf91dd2017-05-16 16:15:42 +0200461 * @reserved: reserved
Sara Sharon45c458b2016-11-09 15:43:26 +0200462 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
463 */
464struct iwl_mvm_add_sta_key_cmd_v1 {
465 struct iwl_mvm_add_sta_key_common common;
Max Stepanov5a258aa2013-04-07 09:11:21 +0300466 u8 tkip_rx_tsc_byte2;
467 u8 reserved;
468 __le16 tkip_rx_ttak[5];
469} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_1 */
470
471/**
Sara Sharon45c458b2016-11-09 15:43:26 +0200472 * struct iwl_mvm_add_sta_key_cmd - add/modify sta key
473 * @common: see &struct iwl_mvm_add_sta_key_common
474 * @rx_mic_key: TKIP RX unicast or multicast key
475 * @tx_mic_key: TKIP TX key
476 * @transmit_seq_cnt: TSC, transmit packet number
477 */
478struct iwl_mvm_add_sta_key_cmd {
479 struct iwl_mvm_add_sta_key_common common;
480 __le64 rx_mic_key;
481 __le64 tx_mic_key;
482 __le64 transmit_seq_cnt;
483} __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_2 */
484
485/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100486 * enum iwl_mvm_add_sta_rsp_status - status in the response to ADD_STA command
487 * @ADD_STA_SUCCESS: operation was executed successfully
488 * @ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
489 * @ADD_STA_IMMEDIATE_BA_FAILURE: can't add Rx block ack session
490 * @ADD_STA_MODIFY_NON_EXISTING_STA: driver requested to modify a station that
491 * doesn't exist.
492 */
493enum iwl_mvm_add_sta_rsp_status {
494 ADD_STA_SUCCESS = 0x1,
495 ADD_STA_STATIONS_OVERLOAD = 0x2,
496 ADD_STA_IMMEDIATE_BA_FAILURE = 0x4,
497 ADD_STA_MODIFY_NON_EXISTING_STA = 0x8,
498};
499
500/**
501 * struct iwl_mvm_rm_sta_cmd - Add / modify a station in the fw's station table
502 * ( REMOVE_STA = 0x19 )
503 * @sta_id: the station id of the station to be removed
Johannes Bergacf91dd2017-05-16 16:15:42 +0200504 * @reserved: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100505 */
506struct iwl_mvm_rm_sta_cmd {
507 u8 sta_id;
508 u8 reserved[3];
509} __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
510
511/**
Ayala Beker8e160ab2016-04-11 11:37:38 +0300512 * struct iwl_mvm_mgmt_mcast_key_cmd_v1
513 * ( MGMT_MCAST_KEY = 0x1f )
Johannes Berg67625862017-03-14 11:01:27 +0100514 * @ctrl_flags: &enum iwl_sta_key_flag
Johannes Bergacf91dd2017-05-16 16:15:42 +0200515 * @igtk: IGTK key material
Ayala Beker8e160ab2016-04-11 11:37:38 +0300516 * @k1: unused
517 * @k2: unused
518 * @sta_id: station ID that support IGTK
Johannes Bergacf91dd2017-05-16 16:15:42 +0200519 * @key_id: key ID
Ayala Beker8e160ab2016-04-11 11:37:38 +0300520 * @receive_seq_cnt: initial RSC/PN needed for replay check
521 */
522struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
523 __le32 ctrl_flags;
524 u8 igtk[16];
525 u8 k1[16];
526 u8 k2[16];
527 __le32 key_id;
528 __le32 sta_id;
529 __le64 receive_seq_cnt;
530} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
531
532/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100533 * struct iwl_mvm_mgmt_mcast_key_cmd
534 * ( MGMT_MCAST_KEY = 0x1f )
Johannes Berg67625862017-03-14 11:01:27 +0100535 * @ctrl_flags: &enum iwl_sta_key_flag
Ayala Beker8e160ab2016-04-11 11:37:38 +0300536 * @igtk: IGTK master key
Johannes Berg8ca151b2013-01-24 14:25:36 +0100537 * @sta_id: station ID that support IGTK
Johannes Bergacf91dd2017-05-16 16:15:42 +0200538 * @key_id: key ID
Johannes Berg8ca151b2013-01-24 14:25:36 +0100539 * @receive_seq_cnt: initial RSC/PN needed for replay check
540 */
541struct iwl_mvm_mgmt_mcast_key_cmd {
542 __le32 ctrl_flags;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300543 u8 igtk[32];
Johannes Berg8ca151b2013-01-24 14:25:36 +0100544 __le32 key_id;
545 __le32 sta_id;
546 __le64 receive_seq_cnt;
Ayala Beker8e160ab2016-04-11 11:37:38 +0300547} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100548
549struct iwl_mvm_wep_key {
550 u8 key_index;
551 u8 key_offset;
552 __le16 reserved1;
553 u8 key_size;
554 u8 reserved2[3];
555 u8 key[16];
556} __packed;
557
558struct iwl_mvm_wep_key_cmd {
559 __le32 mac_id_n_color;
560 u8 num_keys;
561 u8 decryption_type;
562 u8 flags;
563 u8 reserved;
564 struct iwl_mvm_wep_key wep_key[0];
565} __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */
566
Johannes Berg3e56ead2013-02-15 22:23:18 +0100567/**
568 * struct iwl_mvm_eosp_notification - EOSP notification from firmware
569 * @remain_frame_count: # of frames remaining, non-zero if SP was cut
570 * short by GO absence
571 * @sta_id: station ID
572 */
573struct iwl_mvm_eosp_notification {
574 __le32 remain_frame_count;
575 __le32 sta_id;
576} __packed; /* UAPSD_EOSP_NTFY_API_S_VER_1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100577
578#endif /* __fw_api_sta_h__ */