sta.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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 - 2017 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. * The full GNU General Public License is included in this distribution
  22. * in the file called COPYING.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <linuxwifi@intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *
  28. * BSD LICENSE
  29. *
  30. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  31. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  32. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  33. * All rights reserved.
  34. *
  35. * Redistribution and use in source and binary forms, with or without
  36. * modification, are permitted provided that the following conditions
  37. * are met:
  38. *
  39. * * Redistributions of source code must retain the above copyright
  40. * notice, this list of conditions and the following disclaimer.
  41. * * Redistributions in binary form must reproduce the above copyright
  42. * notice, this list of conditions and the following disclaimer in
  43. * the documentation and/or other materials provided with the
  44. * distribution.
  45. * * Neither the name Intel Corporation nor the names of its
  46. * contributors may be used to endorse or promote products derived
  47. * from this software without specific prior written permission.
  48. *
  49. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  50. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  51. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  52. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  53. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  54. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  55. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  56. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  57. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  58. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  59. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60. *****************************************************************************/
  61. #ifndef __iwl_fw_api_sta_h__
  62. #define __iwl_fw_api_sta_h__
  63. /**
  64. * enum iwl_sta_flags - flags for the ADD_STA host command
  65. * @STA_FLG_REDUCED_TX_PWR_CTRL: reduced TX power (control frames)
  66. * @STA_FLG_REDUCED_TX_PWR_DATA: reduced TX power (data frames)
  67. * @STA_FLG_DISABLE_TX: set if TX should be disabled
  68. * @STA_FLG_PS: set if STA is in Power Save
  69. * @STA_FLG_INVALID: set if STA is invalid
  70. * @STA_FLG_DLP_EN: Direct Link Protocol is enabled
  71. * @STA_FLG_SET_ALL_KEYS: the current key applies to all key IDs
  72. * @STA_FLG_DRAIN_FLOW: drain flow
  73. * @STA_FLG_PAN: STA is for PAN interface
  74. * @STA_FLG_CLASS_AUTH: station is authenticated
  75. * @STA_FLG_CLASS_ASSOC: station is associated
  76. * @STA_FLG_RTS_MIMO_PROT: station requires RTS MIMO protection (dynamic SMPS)
  77. * @STA_FLG_MAX_AGG_SIZE_MSK: maximal size for A-MPDU (mask)
  78. * @STA_FLG_MAX_AGG_SIZE_SHIFT: maximal size for A-MPDU (bit shift)
  79. * @STA_FLG_MAX_AGG_SIZE_8K: maximal size for A-MPDU (8k supported)
  80. * @STA_FLG_MAX_AGG_SIZE_16K: maximal size for A-MPDU (16k supported)
  81. * @STA_FLG_MAX_AGG_SIZE_32K: maximal size for A-MPDU (32k supported)
  82. * @STA_FLG_MAX_AGG_SIZE_64K: maximal size for A-MPDU (64k supported)
  83. * @STA_FLG_MAX_AGG_SIZE_128K: maximal size for A-MPDU (128k supported)
  84. * @STA_FLG_MAX_AGG_SIZE_256K: maximal size for A-MPDU (256k supported)
  85. * @STA_FLG_MAX_AGG_SIZE_512K: maximal size for A-MPDU (512k supported)
  86. * @STA_FLG_MAX_AGG_SIZE_1024K: maximal size for A-MPDU (1024k supported)
  87. * @STA_FLG_AGG_MPDU_DENS_MSK: maximal MPDU density for Tx aggregation
  88. * @STA_FLG_FAT_EN_MSK: support for channel width (for Tx). This flag is
  89. * initialised by driver and can be updated by fw upon reception of
  90. * action frames that can change the channel width. When cleared the fw
  91. * will send all the frames in 20MHz even when FAT channel is requested.
  92. * @STA_FLG_FAT_EN_20MHZ: no wide channels are supported, only 20 MHz
  93. * @STA_FLG_FAT_EN_40MHZ: wide channels up to 40 MHz supported
  94. * @STA_FLG_FAT_EN_80MHZ: wide channels up to 80 MHz supported
  95. * @STA_FLG_FAT_EN_160MHZ: wide channels up to 160 MHz supported
  96. * @STA_FLG_MIMO_EN_MSK: support for MIMO. This flag is initialised by the
  97. * driver and can be updated by fw upon reception of action frames.
  98. * @STA_FLG_MIMO_EN_SISO: no support for MIMO
  99. * @STA_FLG_MIMO_EN_MIMO2: 2 streams supported
  100. * @STA_FLG_MIMO_EN_MIMO3: 3 streams supported
  101. * @STA_FLG_MFP_EN: Management Frame Protection
  102. * @STA_FLG_AGG_MPDU_DENS_MSK: A-MPDU density (mask)
  103. * @STA_FLG_AGG_MPDU_DENS_SHIFT: A-MPDU density (bit shift)
  104. * @STA_FLG_AGG_MPDU_DENS_2US: A-MPDU density (2 usec gap)
  105. * @STA_FLG_AGG_MPDU_DENS_4US: A-MPDU density (4 usec gap)
  106. * @STA_FLG_AGG_MPDU_DENS_8US: A-MPDU density (8 usec gap)
  107. * @STA_FLG_AGG_MPDU_DENS_16US: A-MPDU density (16 usec gap)
  108. */
  109. enum iwl_sta_flags {
  110. STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3),
  111. STA_FLG_REDUCED_TX_PWR_DATA = BIT(6),
  112. STA_FLG_DISABLE_TX = BIT(4),
  113. STA_FLG_PS = BIT(8),
  114. STA_FLG_DRAIN_FLOW = BIT(12),
  115. STA_FLG_PAN = BIT(13),
  116. STA_FLG_CLASS_AUTH = BIT(14),
  117. STA_FLG_CLASS_ASSOC = BIT(15),
  118. STA_FLG_RTS_MIMO_PROT = BIT(17),
  119. STA_FLG_MAX_AGG_SIZE_SHIFT = 19,
  120. STA_FLG_MAX_AGG_SIZE_8K = (0 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  121. STA_FLG_MAX_AGG_SIZE_16K = (1 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  122. STA_FLG_MAX_AGG_SIZE_32K = (2 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  123. STA_FLG_MAX_AGG_SIZE_64K = (3 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  124. STA_FLG_MAX_AGG_SIZE_128K = (4 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  125. STA_FLG_MAX_AGG_SIZE_256K = (5 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  126. STA_FLG_MAX_AGG_SIZE_512K = (6 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  127. STA_FLG_MAX_AGG_SIZE_1024K = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  128. STA_FLG_MAX_AGG_SIZE_MSK = (7 << STA_FLG_MAX_AGG_SIZE_SHIFT),
  129. STA_FLG_AGG_MPDU_DENS_SHIFT = 23,
  130. STA_FLG_AGG_MPDU_DENS_2US = (4 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  131. STA_FLG_AGG_MPDU_DENS_4US = (5 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  132. STA_FLG_AGG_MPDU_DENS_8US = (6 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  133. STA_FLG_AGG_MPDU_DENS_16US = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  134. STA_FLG_AGG_MPDU_DENS_MSK = (7 << STA_FLG_AGG_MPDU_DENS_SHIFT),
  135. STA_FLG_FAT_EN_20MHZ = (0 << 26),
  136. STA_FLG_FAT_EN_40MHZ = (1 << 26),
  137. STA_FLG_FAT_EN_80MHZ = (2 << 26),
  138. STA_FLG_FAT_EN_160MHZ = (3 << 26),
  139. STA_FLG_FAT_EN_MSK = (3 << 26),
  140. STA_FLG_MIMO_EN_SISO = (0 << 28),
  141. STA_FLG_MIMO_EN_MIMO2 = (1 << 28),
  142. STA_FLG_MIMO_EN_MIMO3 = (2 << 28),
  143. STA_FLG_MIMO_EN_MSK = (3 << 28),
  144. };
  145. /**
  146. * enum iwl_sta_key_flag - key flags for the ADD_STA host command
  147. * @STA_KEY_FLG_NO_ENC: no encryption
  148. * @STA_KEY_FLG_WEP: WEP encryption algorithm
  149. * @STA_KEY_FLG_CCM: CCMP encryption algorithm
  150. * @STA_KEY_FLG_TKIP: TKIP encryption algorithm
  151. * @STA_KEY_FLG_EXT: extended cipher algorithm (depends on the FW support)
  152. * @STA_KEY_FLG_GCMP: GCMP encryption algorithm
  153. * @STA_KEY_FLG_CMAC: CMAC encryption algorithm
  154. * @STA_KEY_FLG_ENC_UNKNOWN: unknown encryption algorithm
  155. * @STA_KEY_FLG_EN_MSK: mask for encryption algorithmi value
  156. * @STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
  157. * station info array (1 - n 1X mode)
  158. * @STA_KEY_FLG_KEYID_MSK: the index of the key
  159. * @STA_KEY_FLG_KEYID_POS: key index bit position
  160. * @STA_KEY_NOT_VALID: key is invalid
  161. * @STA_KEY_FLG_WEP_13BYTES: set for 13 bytes WEP key
  162. * @STA_KEY_FLG_KEY_32BYTES: for non-wep key set for 32 bytes key
  163. * @STA_KEY_MULTICAST: set for multical key
  164. * @STA_KEY_MFP: key is used for Management Frame Protection
  165. */
  166. enum iwl_sta_key_flag {
  167. STA_KEY_FLG_NO_ENC = (0 << 0),
  168. STA_KEY_FLG_WEP = (1 << 0),
  169. STA_KEY_FLG_CCM = (2 << 0),
  170. STA_KEY_FLG_TKIP = (3 << 0),
  171. STA_KEY_FLG_EXT = (4 << 0),
  172. STA_KEY_FLG_GCMP = (5 << 0),
  173. STA_KEY_FLG_CMAC = (6 << 0),
  174. STA_KEY_FLG_ENC_UNKNOWN = (7 << 0),
  175. STA_KEY_FLG_EN_MSK = (7 << 0),
  176. STA_KEY_FLG_WEP_KEY_MAP = BIT(3),
  177. STA_KEY_FLG_KEYID_POS = 8,
  178. STA_KEY_FLG_KEYID_MSK = (3 << STA_KEY_FLG_KEYID_POS),
  179. STA_KEY_NOT_VALID = BIT(11),
  180. STA_KEY_FLG_WEP_13BYTES = BIT(12),
  181. STA_KEY_FLG_KEY_32BYTES = BIT(12),
  182. STA_KEY_MULTICAST = BIT(14),
  183. STA_KEY_MFP = BIT(15),
  184. };
  185. /**
  186. * enum iwl_sta_modify_flag - indicate to the fw what flag are being changed
  187. * @STA_MODIFY_QUEUE_REMOVAL: this command removes a queue
  188. * @STA_MODIFY_TID_DISABLE_TX: this command modifies %tid_disable_tx
  189. * @STA_MODIFY_UAPSD_ACS: this command modifies %uapsd_acs
  190. * @STA_MODIFY_ADD_BA_TID: this command modifies %add_immediate_ba_tid
  191. * @STA_MODIFY_REMOVE_BA_TID: this command modifies %remove_immediate_ba_tid
  192. * @STA_MODIFY_SLEEPING_STA_TX_COUNT: this command modifies %sleep_tx_count
  193. * @STA_MODIFY_PROT_TH: modify RTS threshold
  194. * @STA_MODIFY_QUEUES: modify the queues used by this station
  195. */
  196. enum iwl_sta_modify_flag {
  197. STA_MODIFY_QUEUE_REMOVAL = BIT(0),
  198. STA_MODIFY_TID_DISABLE_TX = BIT(1),
  199. STA_MODIFY_UAPSD_ACS = BIT(2),
  200. STA_MODIFY_ADD_BA_TID = BIT(3),
  201. STA_MODIFY_REMOVE_BA_TID = BIT(4),
  202. STA_MODIFY_SLEEPING_STA_TX_COUNT = BIT(5),
  203. STA_MODIFY_PROT_TH = BIT(6),
  204. STA_MODIFY_QUEUES = BIT(7),
  205. };
  206. /**
  207. * enum iwl_sta_mode - station command mode
  208. * @STA_MODE_ADD: add new station
  209. * @STA_MODE_MODIFY: modify the station
  210. */
  211. enum iwl_sta_mode {
  212. STA_MODE_ADD = 0,
  213. STA_MODE_MODIFY = 1,
  214. };
  215. /**
  216. * enum iwl_sta_sleep_flag - type of sleep of the station
  217. * @STA_SLEEP_STATE_AWAKE: station is awake
  218. * @STA_SLEEP_STATE_PS_POLL: station is PS-polling
  219. * @STA_SLEEP_STATE_UAPSD: station uses U-APSD
  220. * @STA_SLEEP_STATE_MOREDATA: set more-data bit on
  221. * (last) released frame
  222. */
  223. enum iwl_sta_sleep_flag {
  224. STA_SLEEP_STATE_AWAKE = 0,
  225. STA_SLEEP_STATE_PS_POLL = BIT(0),
  226. STA_SLEEP_STATE_UAPSD = BIT(1),
  227. STA_SLEEP_STATE_MOREDATA = BIT(2),
  228. };
  229. #define STA_KEY_MAX_NUM (16)
  230. #define STA_KEY_IDX_INVALID (0xff)
  231. #define STA_KEY_MAX_DATA_KEY_NUM (4)
  232. #define IWL_MAX_GLOBAL_KEYS (4)
  233. #define STA_KEY_LEN_WEP40 (5)
  234. #define STA_KEY_LEN_WEP104 (13)
  235. /**
  236. * struct iwl_mvm_keyinfo - key information
  237. * @key_flags: type &enum iwl_sta_key_flag
  238. * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
  239. * @reserved1: reserved
  240. * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
  241. * @key_offset: key offset in the fw's key table
  242. * @reserved2: reserved
  243. * @key: 16-byte unicast decryption key
  244. * @tx_secur_seq_cnt: initial RSC / PN needed for replay check
  245. * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
  246. * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
  247. */
  248. struct iwl_mvm_keyinfo {
  249. __le16 key_flags;
  250. u8 tkip_rx_tsc_byte2;
  251. u8 reserved1;
  252. __le16 tkip_rx_ttak[5];
  253. u8 key_offset;
  254. u8 reserved2;
  255. u8 key[16];
  256. __le64 tx_secur_seq_cnt;
  257. __le64 hw_tkip_mic_rx_key;
  258. __le64 hw_tkip_mic_tx_key;
  259. } __packed;
  260. #define IWL_ADD_STA_STATUS_MASK 0xFF
  261. #define IWL_ADD_STA_BAID_VALID_MASK 0x8000
  262. #define IWL_ADD_STA_BAID_MASK 0x7F00
  263. #define IWL_ADD_STA_BAID_SHIFT 8
  264. /**
  265. * struct iwl_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table.
  266. * ( REPLY_ADD_STA = 0x18 )
  267. * @add_modify: see &enum iwl_sta_mode
  268. * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD)
  269. * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
  270. * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
  271. * @mac_id_n_color: the Mac context this station belongs to,
  272. * see &enum iwl_ctxt_id_and_color
  273. * @addr: station's MAC address
  274. * @reserved2: reserved
  275. * @sta_id: index of station in uCode's station table
  276. * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
  277. * alone. 1 - modify, 0 - don't change.
  278. * @reserved3: reserved
  279. * @station_flags: look at &enum iwl_sta_flags
  280. * @station_flags_msk: what of %station_flags have changed,
  281. * also &enum iwl_sta_flags
  282. * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
  283. * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
  284. * add_immediate_ba_ssn.
  285. * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
  286. * Set %STA_MODIFY_REMOVE_BA_TID to use this field
  287. * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
  288. * add_immediate_ba_tid.
  289. * @sleep_tx_count: number of packets to transmit to station even though it is
  290. * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
  291. * keeps track of STA sleep state.
  292. * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
  293. * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
  294. * mac-addr.
  295. * @beamform_flags: beam forming controls
  296. * @tfd_queue_msk: tfd queues used by this station
  297. *
  298. * The device contains an internal table of per-station information, with info
  299. * on security keys, aggregation parameters, and Tx rates for initial Tx
  300. * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
  301. *
  302. * ADD_STA sets up the table entry for one station, either creating a new
  303. * entry, or modifying a pre-existing one.
  304. */
  305. struct iwl_mvm_add_sta_cmd_v7 {
  306. u8 add_modify;
  307. u8 awake_acs;
  308. __le16 tid_disable_tx;
  309. __le32 mac_id_n_color;
  310. u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
  311. __le16 reserved2;
  312. u8 sta_id;
  313. u8 modify_mask;
  314. __le16 reserved3;
  315. __le32 station_flags;
  316. __le32 station_flags_msk;
  317. u8 add_immediate_ba_tid;
  318. u8 remove_immediate_ba_tid;
  319. __le16 add_immediate_ba_ssn;
  320. __le16 sleep_tx_count;
  321. __le16 sleep_state_flags;
  322. __le16 assoc_id;
  323. __le16 beamform_flags;
  324. __le32 tfd_queue_msk;
  325. } __packed; /* ADD_STA_CMD_API_S_VER_7 */
  326. /**
  327. * enum iwl_sta_type - FW station types
  328. * ( REPLY_ADD_STA = 0x18 )
  329. * @IWL_STA_LINK: Link station - normal RX and TX traffic.
  330. * @IWL_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons
  331. * and probe responses.
  332. * @IWL_STA_MULTICAST: multicast traffic,
  333. * @IWL_STA_TDLS_LINK: TDLS link station
  334. * @IWL_STA_AUX_ACTIVITY: auxilary station (scan, ROC and so on).
  335. */
  336. enum iwl_sta_type {
  337. IWL_STA_LINK,
  338. IWL_STA_GENERAL_PURPOSE,
  339. IWL_STA_MULTICAST,
  340. IWL_STA_TDLS_LINK,
  341. IWL_STA_AUX_ACTIVITY,
  342. };
  343. /**
  344. * struct iwl_mvm_add_sta_cmd - Add/modify a station in the fw's sta table.
  345. * ( REPLY_ADD_STA = 0x18 )
  346. * @add_modify: see &enum iwl_sta_mode
  347. * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD)
  348. * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable
  349. * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field.
  350. * @mac_id_n_color: the Mac context this station belongs to,
  351. * see &enum iwl_ctxt_id_and_color
  352. * @addr: station's MAC address
  353. * @reserved2: reserved
  354. * @sta_id: index of station in uCode's station table
  355. * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave
  356. * alone. 1 - modify, 0 - don't change.
  357. * @reserved3: reserved
  358. * @station_flags: look at &enum iwl_sta_flags
  359. * @station_flags_msk: what of %station_flags have changed,
  360. * also &enum iwl_sta_flags
  361. * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
  362. * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set
  363. * add_immediate_ba_ssn.
  364. * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
  365. * Set %STA_MODIFY_REMOVE_BA_TID to use this field
  366. * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
  367. * add_immediate_ba_tid.
  368. * @sleep_tx_count: number of packets to transmit to station even though it is
  369. * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
  370. * keeps track of STA sleep state.
  371. * @station_type: type of this station. See &enum iwl_sta_type.
  372. * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag.
  373. * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
  374. * mac-addr.
  375. * @beamform_flags: beam forming controls
  376. * @tfd_queue_msk: tfd queues used by this station.
  377. * Obselete for new TX API (9 and above).
  378. * @rx_ba_window: aggregation window size
  379. * @sp_length: the size of the SP as it appears in the WME IE
  380. * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
  381. * enabled ACs.
  382. *
  383. * The device contains an internal table of per-station information, with info
  384. * on security keys, aggregation parameters, and Tx rates for initial Tx
  385. * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD).
  386. *
  387. * ADD_STA sets up the table entry for one station, either creating a new
  388. * entry, or modifying a pre-existing one.
  389. */
  390. struct iwl_mvm_add_sta_cmd {
  391. u8 add_modify;
  392. u8 awake_acs;
  393. __le16 tid_disable_tx;
  394. __le32 mac_id_n_color;
  395. u8 addr[ETH_ALEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */
  396. __le16 reserved2;
  397. u8 sta_id;
  398. u8 modify_mask;
  399. __le16 reserved3;
  400. __le32 station_flags;
  401. __le32 station_flags_msk;
  402. u8 add_immediate_ba_tid;
  403. u8 remove_immediate_ba_tid;
  404. __le16 add_immediate_ba_ssn;
  405. __le16 sleep_tx_count;
  406. u8 sleep_state_flags;
  407. u8 station_type;
  408. __le16 assoc_id;
  409. __le16 beamform_flags;
  410. __le32 tfd_queue_msk;
  411. __le16 rx_ba_window;
  412. u8 sp_length;
  413. u8 uapsd_acs;
  414. } __packed; /* ADD_STA_CMD_API_S_VER_10 */
  415. /**
  416. * struct iwl_mvm_add_sta_key_common - add/modify sta key common part
  417. * ( REPLY_ADD_STA_KEY = 0x17 )
  418. * @sta_id: index of station in uCode's station table
  419. * @key_offset: key offset in key storage
  420. * @key_flags: type &enum iwl_sta_key_flag
  421. * @key: key material data
  422. * @rx_secur_seq_cnt: RX security sequence counter for the key
  423. */
  424. struct iwl_mvm_add_sta_key_common {
  425. u8 sta_id;
  426. u8 key_offset;
  427. __le16 key_flags;
  428. u8 key[32];
  429. u8 rx_secur_seq_cnt[16];
  430. } __packed;
  431. /**
  432. * struct iwl_mvm_add_sta_key_cmd_v1 - add/modify sta key
  433. * @common: see &struct iwl_mvm_add_sta_key_common
  434. * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
  435. * @reserved: reserved
  436. * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
  437. */
  438. struct iwl_mvm_add_sta_key_cmd_v1 {
  439. struct iwl_mvm_add_sta_key_common common;
  440. u8 tkip_rx_tsc_byte2;
  441. u8 reserved;
  442. __le16 tkip_rx_ttak[5];
  443. } __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_1 */
  444. /**
  445. * struct iwl_mvm_add_sta_key_cmd - add/modify sta key
  446. * @common: see &struct iwl_mvm_add_sta_key_common
  447. * @rx_mic_key: TKIP RX unicast or multicast key
  448. * @tx_mic_key: TKIP TX key
  449. * @transmit_seq_cnt: TSC, transmit packet number
  450. */
  451. struct iwl_mvm_add_sta_key_cmd {
  452. struct iwl_mvm_add_sta_key_common common;
  453. __le64 rx_mic_key;
  454. __le64 tx_mic_key;
  455. __le64 transmit_seq_cnt;
  456. } __packed; /* ADD_MODIFY_STA_KEY_API_S_VER_2 */
  457. /**
  458. * enum iwl_mvm_add_sta_rsp_status - status in the response to ADD_STA command
  459. * @ADD_STA_SUCCESS: operation was executed successfully
  460. * @ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
  461. * @ADD_STA_IMMEDIATE_BA_FAILURE: can't add Rx block ack session
  462. * @ADD_STA_MODIFY_NON_EXISTING_STA: driver requested to modify a station that
  463. * doesn't exist.
  464. */
  465. enum iwl_mvm_add_sta_rsp_status {
  466. ADD_STA_SUCCESS = 0x1,
  467. ADD_STA_STATIONS_OVERLOAD = 0x2,
  468. ADD_STA_IMMEDIATE_BA_FAILURE = 0x4,
  469. ADD_STA_MODIFY_NON_EXISTING_STA = 0x8,
  470. };
  471. /**
  472. * struct iwl_mvm_rm_sta_cmd - Add / modify a station in the fw's station table
  473. * ( REMOVE_STA = 0x19 )
  474. * @sta_id: the station id of the station to be removed
  475. * @reserved: reserved
  476. */
  477. struct iwl_mvm_rm_sta_cmd {
  478. u8 sta_id;
  479. u8 reserved[3];
  480. } __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
  481. /**
  482. * struct iwl_mvm_mgmt_mcast_key_cmd_v1
  483. * ( MGMT_MCAST_KEY = 0x1f )
  484. * @ctrl_flags: &enum iwl_sta_key_flag
  485. * @igtk: IGTK key material
  486. * @k1: unused
  487. * @k2: unused
  488. * @sta_id: station ID that support IGTK
  489. * @key_id: key ID
  490. * @receive_seq_cnt: initial RSC/PN needed for replay check
  491. */
  492. struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
  493. __le32 ctrl_flags;
  494. u8 igtk[16];
  495. u8 k1[16];
  496. u8 k2[16];
  497. __le32 key_id;
  498. __le32 sta_id;
  499. __le64 receive_seq_cnt;
  500. } __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
  501. /**
  502. * struct iwl_mvm_mgmt_mcast_key_cmd
  503. * ( MGMT_MCAST_KEY = 0x1f )
  504. * @ctrl_flags: &enum iwl_sta_key_flag
  505. * @igtk: IGTK master key
  506. * @sta_id: station ID that support IGTK
  507. * @key_id: key ID
  508. * @receive_seq_cnt: initial RSC/PN needed for replay check
  509. */
  510. struct iwl_mvm_mgmt_mcast_key_cmd {
  511. __le32 ctrl_flags;
  512. u8 igtk[32];
  513. __le32 key_id;
  514. __le32 sta_id;
  515. __le64 receive_seq_cnt;
  516. } __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
  517. struct iwl_mvm_wep_key {
  518. u8 key_index;
  519. u8 key_offset;
  520. __le16 reserved1;
  521. u8 key_size;
  522. u8 reserved2[3];
  523. u8 key[16];
  524. } __packed;
  525. struct iwl_mvm_wep_key_cmd {
  526. __le32 mac_id_n_color;
  527. u8 num_keys;
  528. u8 decryption_type;
  529. u8 flags;
  530. u8 reserved;
  531. struct iwl_mvm_wep_key wep_key[0];
  532. } __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */
  533. /**
  534. * struct iwl_mvm_eosp_notification - EOSP notification from firmware
  535. * @remain_frame_count: # of frames remaining, non-zero if SP was cut
  536. * short by GO absence
  537. * @sta_id: station ID
  538. */
  539. struct iwl_mvm_eosp_notification {
  540. __le32 remain_frame_count;
  541. __le32 sta_id;
  542. } __packed; /* UAPSD_EOSP_NTFY_API_S_VER_1 */
  543. #endif /* __iwl_fw_api_sta_h__ */