fw-api-sta.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /******************************************************************************
  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. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 Intel Deutschland GmbH
  11. *
  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
  27. * in the file called COPYING.
  28. *
  29. * Contact Information:
  30. * Intel Linux Wireless <linuxwifi@intel.com>
  31. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  32. *
  33. * BSD LICENSE
  34. *
  35. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  36. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  37. * Copyright(c) 2016 Intel Deutschland GmbH
  38. * 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. #ifndef __fw_api_sta_h__
  67. #define __fw_api_sta_h__
  68. /**
  69. * enum iwl_sta_flags - flags for the ADD_STA host command
  70. * @STA_FLG_REDUCED_TX_PWR_CTRL:
  71. * @STA_FLG_REDUCED_TX_PWR_DATA:
  72. * @STA_FLG_DISABLE_TX: set if TX should be disabled
  73. * @STA_FLG_PS: set if STA is in Power Save
  74. * @STA_FLG_INVALID: set if STA is invalid
  75. * @STA_FLG_DLP_EN: Direct Link Protocol is enabled
  76. * @STA_FLG_SET_ALL_KEYS: the current key applies to all key IDs
  77. * @STA_FLG_DRAIN_FLOW: drain flow
  78. * @STA_FLG_PAN: STA is for PAN interface
  79. * @STA_FLG_CLASS_AUTH:
  80. * @STA_FLG_CLASS_ASSOC:
  81. * @STA_FLG_CLASS_MIMO_PROT:
  82. * @STA_FLG_MAX_AGG_SIZE_MSK: maximal size for A-MPDU
  83. * @STA_FLG_AGG_MPDU_DENS_MSK: maximal MPDU density for Tx aggregation
  84. * @STA_FLG_FAT_EN_MSK: support for channel width (for Tx). This flag is
  85. * initialised by driver and can be updated by fw upon reception of
  86. * action frames that can change the channel width. When cleared the fw
  87. * will send all the frames in 20MHz even when FAT channel is requested.
  88. * @STA_FLG_MIMO_EN_MSK: support for MIMO. This flag is initialised by the
  89. * driver and can be updated by fw upon reception of action frames.
  90. * @STA_FLG_MFP_EN: Management Frame Protection
  91. */
  92. enum iwl_sta_flags {
  93. STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3),
  94. STA_FLG_REDUCED_TX_PWR_DATA = BIT(6),
  95. STA_FLG_DISABLE_TX = BIT(4),
  96. STA_FLG_PS = BIT(8),
  97. STA_FLG_DRAIN_FLOW = BIT(12),
  98. STA_FLG_PAN = BIT(13),
  99. STA_FLG_CLASS_AUTH = BIT(14),
  100. STA_FLG_CLASS_ASSOC = BIT(15),
  101. STA_FLG_RTS_MIMO_PROT = BIT(17),
  102. STA_FLG_MAX_AGG_SIZE_SHIFT = 19,
  103. STA_FLG_MAX_AGG_SIZE_8K = (0 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  104. STA_FLG_MAX_AGG_SIZE_16K = (1 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  105. STA_FLG_MAX_AGG_SIZE_32K = (2 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  106. STA_FLG_MAX_AGG_SIZE_64K = (3 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  107. STA_FLG_MAX_AGG_SIZE_128K = (4 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  108. STA_FLG_MAX_AGG_SIZE_256K = (5 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  109. STA_FLG_MAX_AGG_SIZE_512K = (6 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  110. STA_FLG_MAX_AGG_SIZE_1024K = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  111. STA_FLG_MAX_AGG_SIZE_MSK = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  112. STA_FLG_AGG_MPDU_DENS_SHIFT = 23,
  113. STA_FLG_AGG_MPDU_DENS_2US = (4 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  114. STA_FLG_AGG_MPDU_DENS_4US = (5 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  115. STA_FLG_AGG_MPDU_DENS_8US = (6 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  116. STA_FLG_AGG_MPDU_DENS_16US = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  117. STA_FLG_AGG_MPDU_DENS_MSK = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  118. STA_FLG_FAT_EN_20MHZ = (0 << 26),
  119. STA_FLG_FAT_EN_40MHZ = (1 << 26),
  120. STA_FLG_FAT_EN_80MHZ = (2 << 26),
  121. STA_FLG_FAT_EN_160MHZ = (3 << 26),
  122. STA_FLG_FAT_EN_MSK = (3 << 26),
  123. STA_FLG_MIMO_EN_SISO = (0 << 28),
  124. STA_FLG_MIMO_EN_MIMO2 = (1 << 28),
  125. STA_FLG_MIMO_EN_MIMO3 = (2 << 28),
  126. STA_FLG_MIMO_EN_MSK = (3 << 28),
  127. };
  128. /**
  129. * enum iwl_sta_key_flag - key flags for the ADD_STA host command
  130. * @STA_KEY_FLG_NO_ENC: no encryption
  131. * @STA_KEY_FLG_WEP: WEP encryption algorithm
  132. * @STA_KEY_FLG_CCM: CCMP encryption algorithm
  133. * @STA_KEY_FLG_TKIP: TKIP encryption algorithm
  134. * @STA_KEY_FLG_EXT: extended cipher algorithm (depends on the FW support)
  135. * @STA_KEY_FLG_GCMP: GCMP encryption algorithm
  136. * @STA_KEY_FLG_CMAC: CMAC encryption algorithm
  137. * @STA_KEY_FLG_ENC_UNKNOWN: unknown encryption algorithm
  138. * @STA_KEY_FLG_EN_MSK: mask for encryption algorithmi value
  139. * @STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
  140. * station info array (1 - n 1X mode)
  141. * @STA_KEY_FLG_KEYID_MSK: the index of the key
  142. * @STA_KEY_NOT_VALID: key is invalid
  143. * @STA_KEY_FLG_WEP_13BYTES: set for 13 bytes WEP key
  144. * @STA_KEY_FLG_KEY_32BYTES for non-wep key set for 32 bytes key
  145. * @STA_KEY_MULTICAST: set for multical key
  146. * @STA_KEY_MFP: key is used for Management Frame Protection
  147. */
  148. enum iwl_sta_key_flag {
  149. STA_KEY_FLG_NO_ENC = (0 << 0),
  150. STA_KEY_FLG_WEP = (1 << 0),
  151. STA_KEY_FLG_CCM = (2 << 0),
  152. STA_KEY_FLG_TKIP = (3 << 0),
  153. STA_KEY_FLG_EXT = (4 << 0),
  154. STA_KEY_FLG_GCMP = (5 << 0),
  155. STA_KEY_FLG_CMAC = (6 << 0),
  156. STA_KEY_FLG_ENC_UNKNOWN = (7 << 0),
  157. STA_KEY_FLG_EN_MSK = (7 << 0),
  158. STA_KEY_FLG_WEP_KEY_MAP = BIT(3),
  159. STA_KEY_FLG_KEYID_POS = 8,
  160. STA_KEY_FLG_KEYID_MSK = (3 << STA_KEY_FLG_KEYID_POS),
  161. STA_KEY_NOT_VALID = BIT(11),
  162. STA_KEY_FLG_WEP_13BYTES = BIT(12),
  163. STA_KEY_FLG_KEY_32BYTES = BIT(12),
  164. STA_KEY_MULTICAST = BIT(14),
  165. STA_KEY_MFP = BIT(15),
  166. };
  167. /**
  168. * enum iwl_sta_modify_flag - indicate to the fw what flag are being changed
  169. * @STA_MODIFY_QUEUE_REMOVAL: this command removes a queue
  170. * @STA_MODIFY_TID_DISABLE_TX: this command modifies %tid_disable_tx
  171. * @STA_MODIFY_UAPSD_ACS: this command modifies %uapsd_trigger_acs
  172. * @STA_MODIFY_ADD_BA_TID: this command modifies %add_immediate_ba_tid
  173. * @STA_MODIFY_REMOVE_BA_TID: this command modifies %remove_immediate_ba_tid
  174. * @STA_MODIFY_SLEEPING_STA_TX_COUNT: this command modifies %sleep_tx_count
  175. * @STA_MODIFY_PROT_TH:
  176. * @STA_MODIFY_QUEUES: modify the queues used by this station
  177. */
  178. enum iwl_sta_modify_flag {
  179. STA_MODIFY_QUEUE_REMOVAL = BIT(0),
  180. STA_MODIFY_TID_DISABLE_TX = BIT(1),
  181. STA_MODIFY_UAPSD_ACS = BIT(2),
  182. STA_MODIFY_ADD_BA_TID = BIT(3),
  183. STA_MODIFY_REMOVE_BA_TID = BIT(4),
  184. STA_MODIFY_SLEEPING_STA_TX_COUNT = BIT(5),
  185. STA_MODIFY_PROT_TH = BIT(6),
  186. STA_MODIFY_QUEUES = BIT(7),
  187. };
  188. #define STA_MODE_MODIFY 1
  189. /**
  190. * enum iwl_sta_sleep_flag - type of sleep of the station
  191. * @STA_SLEEP_STATE_AWAKE:
  192. * @STA_SLEEP_STATE_PS_POLL:
  193. * @STA_SLEEP_STATE_UAPSD:
  194. * @STA_SLEEP_STATE_MOREDATA: set more-data bit on
  195. * (last) released frame
  196. */
  197. enum iwl_sta_sleep_flag {
  198. STA_SLEEP_STATE_AWAKE = 0,
  199. STA_SLEEP_STATE_PS_POLL = BIT(0),
  200. STA_SLEEP_STATE_UAPSD = BIT(1),
  201. STA_SLEEP_STATE_MOREDATA = BIT(2),
  202. };
  203. /* STA ID and color bits definitions */
  204. #define STA_ID_SEED (0x0f)
  205. #define STA_ID_POS (0)
  206. #define STA_ID_MSK (STA_ID_SEED << STA_ID_POS)
  207. #define STA_COLOR_SEED (0x7)
  208. #define STA_COLOR_POS (4)
  209. #define STA_COLOR_MSK (STA_COLOR_SEED << STA_COLOR_POS)
  210. #define STA_ID_N_COLOR_GET_COLOR(id_n_color) \
  211. (((id_n_color) & STA_COLOR_MSK) >> STA_COLOR_POS)
  212. #define STA_ID_N_COLOR_GET_ID(id_n_color) \
  213. (((id_n_color) & STA_ID_MSK) >> STA_ID_POS)
  214. #define STA_KEY_MAX_NUM (16)
  215. #define STA_KEY_IDX_INVALID (0xff)
  216. #define STA_KEY_MAX_DATA_KEY_NUM (4)
  217. #define IWL_MAX_GLOBAL_KEYS (4)
  218. #define STA_KEY_LEN_WEP40 (5)
  219. #define STA_KEY_LEN_WEP104 (13)
  220. /**
  221. * struct iwl_mvm_keyinfo - key information
  222. * @key_flags: type %iwl_sta_key_flag
  223. * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
  224. * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
  225. * @key_offset: key offset in the fw's key table
  226. * @key: 16-byte unicast decryption key
  227. * @tx_secur_seq_cnt: initial RSC / PN needed for replay check
  228. * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
  229. * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
  230. */
  231. struct iwl_mvm_keyinfo {
  232. __le16 key_flags;
  233. u8 tkip_rx_tsc_byte2;
  234. u8 reserved1;
  235. __le16 tkip_rx_ttak[5];
  236. u8 key_offset;
  237. u8 reserved2;
  238. u8 key[16];
  239. __le64 tx_secur_seq_cnt;
  240. __le64 hw_tkip_mic_rx_key;
  241. __le64 hw_tkip_mic_tx_key;
  242. } __packed;
  243. #define IWL_ADD_STA_STATUS_MASK 0xFF
  244. #define IWL_ADD_STA_BAID_VALID_MASK 0x8000
  245. #define IWL_ADD_STA_BAID_MASK 0x7F00
  246. #define IWL_ADD_STA_BAID_SHIFT 8
  247. /**
  248. * struct iwl_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table.
  249. * ( REPLY_ADD_STA = 0x18 )
  250. * @add_modify: 1: modify existing, 0: add new station
  251. * @awake_acs:
  252. * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
  253. * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
  254. * @mac_id_n_color: the Mac context this station belongs to
  255. * @addr[ETH_ALEN]: station's MAC address
  256. * @sta_id: index of station in uCode's station table
  257. * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
  258. * alone. 1 - modify, 0 - don't change.
  259. * @station_flags: look at %iwl_sta_flags
  260. * @station_flags_msk: what of %station_flags have changed
  261. * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
  262. * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
  263. * add_immediate_ba_ssn.
  264. * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
  265. * Set %STA_MODIFY_REMOVE_BA_TID to use this field
  266. * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
  267. * add_immediate_ba_tid.
  268. * @sleep_tx_count: number of packets to transmit to station even though it is
  269. * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
  270. * keeps track of STA sleep state.
  271. * @sleep_state_flags: Look at %iwl_sta_sleep_flag.
  272. * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
  273. * mac-addr.
  274. * @beamform_flags: beam forming controls
  275. * @tfd_queue_msk: tfd queues used by this station
  276. *
  277. * The device contains an internal table of per-station information, with info
  278. * on security keys, aggregation parameters, and Tx rates for initial Tx
  279. * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
  280. *
  281. * ADD_STA sets up the table entry for one station, either creating a new
  282. * entry, or modifying a pre-existing one.
  283. */
  284. struct iwl_mvm_add_sta_cmd_v7 {
  285. u8 add_modify;
  286. u8 awake_acs;
  287. __le16 tid_disable_tx;
  288. __le32 mac_id_n_color;
  289. u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
  290. __le16 reserved2;
  291. u8 sta_id;
  292. u8 modify_mask;
  293. __le16 reserved3;
  294. __le32 station_flags;
  295. __le32 station_flags_msk;
  296. u8 add_immediate_ba_tid;
  297. u8 remove_immediate_ba_tid;
  298. __le16 add_immediate_ba_ssn;
  299. __le16 sleep_tx_count;
  300. __le16 sleep_state_flags;
  301. __le16 assoc_id;
  302. __le16 beamform_flags;
  303. __le32 tfd_queue_msk;
  304. } __packed; /* ADD_STA_CMD_API_S_VER_7 */
  305. /**
  306. * struct iwl_mvm_add_sta_cmd - Add/modify a station in the fw's sta table.
  307. * ( REPLY_ADD_STA = 0x18 )
  308. * @add_modify: 1: modify existing, 0: add new station
  309. * @awake_acs:
  310. * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
  311. * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
  312. * @mac_id_n_color: the Mac context this station belongs to
  313. * @addr[ETH_ALEN]: station's MAC address
  314. * @sta_id: index of station in uCode's station table
  315. * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
  316. * alone. 1 - modify, 0 - don't change.
  317. * @station_flags: look at %iwl_sta_flags
  318. * @station_flags_msk: what of %station_flags have changed
  319. * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
  320. * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
  321. * add_immediate_ba_ssn.
  322. * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
  323. * Set %STA_MODIFY_REMOVE_BA_TID to use this field
  324. * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
  325. * add_immediate_ba_tid.
  326. * @sleep_tx_count: number of packets to transmit to station even though it is
  327. * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
  328. * keeps track of STA sleep state.
  329. * @sleep_state_flags: Look at %iwl_sta_sleep_flag.
  330. * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
  331. * mac-addr.
  332. * @beamform_flags: beam forming controls
  333. * @tfd_queue_msk: tfd queues used by this station
  334. * @rx_ba_window: aggregation window size
  335. * @scd_queue_bank: queue bank in used. Each bank contains 32 queues. 0 means
  336. * that the queues used by this station are in the first 32.
  337. *
  338. * The device contains an internal table of per-station information, with info
  339. * on security keys, aggregation parameters, and Tx rates for initial Tx
  340. * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
  341. *
  342. * ADD_STA sets up the table entry for one station, either creating a new
  343. * entry, or modifying a pre-existing one.
  344. */
  345. struct iwl_mvm_add_sta_cmd {
  346. u8 add_modify;
  347. u8 awake_acs;
  348. __le16 tid_disable_tx;
  349. __le32 mac_id_n_color;
  350. u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
  351. __le16 reserved2;
  352. u8 sta_id;
  353. u8 modify_mask;
  354. __le16 reserved3;
  355. __le32 station_flags;
  356. __le32 station_flags_msk;
  357. u8 add_immediate_ba_tid;
  358. u8 remove_immediate_ba_tid;
  359. __le16 add_immediate_ba_ssn;
  360. __le16 sleep_tx_count;
  361. __le16 sleep_state_flags;
  362. __le16 assoc_id;
  363. __le16 beamform_flags;
  364. __le32 tfd_queue_msk;
  365. __le16 rx_ba_window;
  366. u8 scd_queue_bank;
  367. u8 uapsd_trigger_acs;
  368. } __packed; /* ADD_STA_CMD_API_S_VER_8 */
  369. /**
  370. * struct iwl_mvm_add_sta_key_cmd - add/modify sta key
  371. * ( REPLY_ADD_STA_KEY = 0x17 )
  372. * @sta_id: index of station in uCode's station table
  373. * @key_offset: key offset in key storage
  374. * @key_flags: type %iwl_sta_key_flag
  375. * @key: key material data
  376. * @rx_secur_seq_cnt: RX security sequence counter for the key
  377. * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
  378. * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
  379. */
  380. struct iwl_mvm_add_sta_key_cmd {
  381. u8 sta_id;
  382. u8 key_offset;
  383. __le16 key_flags;
  384. u8 key[32];
  385. u8 rx_secur_seq_cnt[16];
  386. u8 tkip_rx_tsc_byte2;
  387. u8 reserved;
  388. __le16 tkip_rx_ttak[5];
  389. } __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_1 */
  390. /**
  391. * enum iwl_mvm_add_sta_rsp_status - status in the response to ADD_STA command
  392. * @ADD_STA_SUCCESS: operation was executed successfully
  393. * @ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
  394. * @ADD_STA_IMMEDIATE_BA_FAILURE: can't add Rx block ack session
  395. * @ADD_STA_MODIFY_NON_EXISTING_STA: driver requested to modify a station that
  396. * doesn't exist.
  397. */
  398. enum iwl_mvm_add_sta_rsp_status {
  399. ADD_STA_SUCCESS = 0x1,
  400. ADD_STA_STATIONS_OVERLOAD = 0x2,
  401. ADD_STA_IMMEDIATE_BA_FAILURE = 0x4,
  402. ADD_STA_MODIFY_NON_EXISTING_STA = 0x8,
  403. };
  404. /**
  405. * struct iwl_mvm_rm_sta_cmd - Add / modify a station in the fw's station table
  406. * ( REMOVE_STA = 0x19 )
  407. * @sta_id: the station id of the station to be removed
  408. */
  409. struct iwl_mvm_rm_sta_cmd {
  410. u8 sta_id;
  411. u8 reserved[3];
  412. } __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
  413. /**
  414. * struct iwl_mvm_mgmt_mcast_key_cmd_v1
  415. * ( MGMT_MCAST_KEY = 0x1f )
  416. * @ctrl_flags: %iwl_sta_key_flag
  417. * @igtk:
  418. * @k1: unused
  419. * @k2: unused
  420. * @sta_id: station ID that support IGTK
  421. * @key_id:
  422. * @receive_seq_cnt: initial RSC/PN needed for replay check
  423. */
  424. struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
  425. __le32 ctrl_flags;
  426. u8 igtk[16];
  427. u8 k1[16];
  428. u8 k2[16];
  429. __le32 key_id;
  430. __le32 sta_id;
  431. __le64 receive_seq_cnt;
  432. } __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
  433. /**
  434. * struct iwl_mvm_mgmt_mcast_key_cmd
  435. * ( MGMT_MCAST_KEY = 0x1f )
  436. * @ctrl_flags: %iwl_sta_key_flag
  437. * @igtk: IGTK master key
  438. * @sta_id: station ID that support IGTK
  439. * @key_id:
  440. * @receive_seq_cnt: initial RSC/PN needed for replay check
  441. */
  442. struct iwl_mvm_mgmt_mcast_key_cmd {
  443. __le32 ctrl_flags;
  444. u8 igtk[32];
  445. __le32 key_id;
  446. __le32 sta_id;
  447. __le64 receive_seq_cnt;
  448. } __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
  449. struct iwl_mvm_wep_key {
  450. u8 key_index;
  451. u8 key_offset;
  452. __le16 reserved1;
  453. u8 key_size;
  454. u8 reserved2[3];
  455. u8 key[16];
  456. } __packed;
  457. struct iwl_mvm_wep_key_cmd {
  458. __le32 mac_id_n_color;
  459. u8 num_keys;
  460. u8 decryption_type;
  461. u8 flags;
  462. u8 reserved;
  463. struct iwl_mvm_wep_key wep_key[0];
  464. } __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */
  465. /**
  466. * struct iwl_mvm_eosp_notification - EOSP notification from firmware
  467. * @remain_frame_count: # of frames remaining, non-zero if SP was cut
  468. * short by GO absence
  469. * @sta_id: station ID
  470. */
  471. struct iwl_mvm_eosp_notification {
  472. __le32 remain_frame_count;
  473. __le32 sta_id;
  474. } __packed; /* UAPSD_EOSP_NTFY_API_S_VER_1 */
  475. #endif /* __fw_api_sta_h__ */