mac.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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) 2017 Intel Deutschland GmbH
  10. * Copyright(c) 2018 Intel Corporation
  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) 2017 Intel Deutschland GmbH
  32. * Copyright(c) 2018 Intel Corporation
  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_mac_h__
  62. #define __iwl_fw_api_mac_h__
  63. /*
  64. * The first MAC indices (starting from 0) are available to the driver,
  65. * AUX indices follows - 1 for non-CDB, 2 for CDB.
  66. */
  67. #define MAC_INDEX_AUX 4
  68. #define MAC_INDEX_MIN_DRIVER 0
  69. #define NUM_MAC_INDEX_DRIVER MAC_INDEX_AUX
  70. #define NUM_MAC_INDEX (NUM_MAC_INDEX_DRIVER + 1)
  71. #define NUM_MAC_INDEX_CDB (NUM_MAC_INDEX_DRIVER + 2)
  72. #define IWL_MVM_STATION_COUNT 16
  73. #define IWL_MVM_INVALID_STA 0xFF
  74. enum iwl_ac {
  75. AC_BK,
  76. AC_BE,
  77. AC_VI,
  78. AC_VO,
  79. AC_NUM,
  80. };
  81. /**
  82. * enum iwl_mac_protection_flags - MAC context flags
  83. * @MAC_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
  84. * this will require CCK RTS/CTS2self.
  85. * RTS/CTS will protect full burst time.
  86. * @MAC_PROT_FLG_HT_PROT: enable HT protection
  87. * @MAC_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
  88. * @MAC_PROT_FLG_SELF_CTS_EN: allow CTS2self
  89. */
  90. enum iwl_mac_protection_flags {
  91. MAC_PROT_FLG_TGG_PROTECT = BIT(3),
  92. MAC_PROT_FLG_HT_PROT = BIT(23),
  93. MAC_PROT_FLG_FAT_PROT = BIT(24),
  94. MAC_PROT_FLG_SELF_CTS_EN = BIT(30),
  95. };
  96. #define MAC_FLG_SHORT_SLOT BIT(4)
  97. #define MAC_FLG_SHORT_PREAMBLE BIT(5)
  98. /**
  99. * enum iwl_mac_types - Supported MAC types
  100. * @FW_MAC_TYPE_FIRST: lowest supported MAC type
  101. * @FW_MAC_TYPE_AUX: Auxiliary MAC (internal)
  102. * @FW_MAC_TYPE_LISTENER: monitor MAC type (?)
  103. * @FW_MAC_TYPE_PIBSS: Pseudo-IBSS
  104. * @FW_MAC_TYPE_IBSS: IBSS
  105. * @FW_MAC_TYPE_BSS_STA: BSS (managed) station
  106. * @FW_MAC_TYPE_P2P_DEVICE: P2P Device
  107. * @FW_MAC_TYPE_P2P_STA: P2P client
  108. * @FW_MAC_TYPE_GO: P2P GO
  109. * @FW_MAC_TYPE_TEST: ?
  110. * @FW_MAC_TYPE_MAX: highest support MAC type
  111. */
  112. enum iwl_mac_types {
  113. FW_MAC_TYPE_FIRST = 1,
  114. FW_MAC_TYPE_AUX = FW_MAC_TYPE_FIRST,
  115. FW_MAC_TYPE_LISTENER,
  116. FW_MAC_TYPE_PIBSS,
  117. FW_MAC_TYPE_IBSS,
  118. FW_MAC_TYPE_BSS_STA,
  119. FW_MAC_TYPE_P2P_DEVICE,
  120. FW_MAC_TYPE_P2P_STA,
  121. FW_MAC_TYPE_GO,
  122. FW_MAC_TYPE_TEST,
  123. FW_MAC_TYPE_MAX = FW_MAC_TYPE_TEST
  124. }; /* MAC_CONTEXT_TYPE_API_E_VER_1 */
  125. /**
  126. * enum iwl_tsf_id - TSF hw timer ID
  127. * @TSF_ID_A: use TSF A
  128. * @TSF_ID_B: use TSF B
  129. * @TSF_ID_C: use TSF C
  130. * @TSF_ID_D: use TSF D
  131. * @NUM_TSF_IDS: number of TSF timers available
  132. */
  133. enum iwl_tsf_id {
  134. TSF_ID_A = 0,
  135. TSF_ID_B = 1,
  136. TSF_ID_C = 2,
  137. TSF_ID_D = 3,
  138. NUM_TSF_IDS = 4,
  139. }; /* TSF_ID_API_E_VER_1 */
  140. /**
  141. * struct iwl_mac_data_ap - configuration data for AP MAC context
  142. * @beacon_time: beacon transmit time in system time
  143. * @beacon_tsf: beacon transmit time in TSF
  144. * @bi: beacon interval in TU
  145. * @bi_reciprocal: 2^32 / bi
  146. * @dtim_interval: dtim transmit time in TU
  147. * @dtim_reciprocal: 2^32 / dtim_interval
  148. * @mcast_qid: queue ID for multicast traffic.
  149. * NOTE: obsolete from VER2 and on
  150. * @beacon_template: beacon template ID
  151. */
  152. struct iwl_mac_data_ap {
  153. __le32 beacon_time;
  154. __le64 beacon_tsf;
  155. __le32 bi;
  156. __le32 bi_reciprocal;
  157. __le32 dtim_interval;
  158. __le32 dtim_reciprocal;
  159. __le32 mcast_qid;
  160. __le32 beacon_template;
  161. } __packed; /* AP_MAC_DATA_API_S_VER_2 */
  162. /**
  163. * struct iwl_mac_data_ibss - configuration data for IBSS MAC context
  164. * @beacon_time: beacon transmit time in system time
  165. * @beacon_tsf: beacon transmit time in TSF
  166. * @bi: beacon interval in TU
  167. * @bi_reciprocal: 2^32 / bi
  168. * @beacon_template: beacon template ID
  169. */
  170. struct iwl_mac_data_ibss {
  171. __le32 beacon_time;
  172. __le64 beacon_tsf;
  173. __le32 bi;
  174. __le32 bi_reciprocal;
  175. __le32 beacon_template;
  176. } __packed; /* IBSS_MAC_DATA_API_S_VER_1 */
  177. /**
  178. * struct iwl_mac_data_sta - configuration data for station MAC context
  179. * @is_assoc: 1 for associated state, 0 otherwise
  180. * @dtim_time: DTIM arrival time in system time
  181. * @dtim_tsf: DTIM arrival time in TSF
  182. * @bi: beacon interval in TU, applicable only when associated
  183. * @bi_reciprocal: 2^32 / bi , applicable only when associated
  184. * @dtim_interval: DTIM interval in TU, applicable only when associated
  185. * @dtim_reciprocal: 2^32 / dtim_interval , applicable only when associated
  186. * @listen_interval: in beacon intervals, applicable only when associated
  187. * @assoc_id: unique ID assigned by the AP during association
  188. * @assoc_beacon_arrive_time: TSF of first beacon after association
  189. */
  190. struct iwl_mac_data_sta {
  191. __le32 is_assoc;
  192. __le32 dtim_time;
  193. __le64 dtim_tsf;
  194. __le32 bi;
  195. __le32 bi_reciprocal;
  196. __le32 dtim_interval;
  197. __le32 dtim_reciprocal;
  198. __le32 listen_interval;
  199. __le32 assoc_id;
  200. __le32 assoc_beacon_arrive_time;
  201. } __packed; /* STA_MAC_DATA_API_S_VER_1 */
  202. /**
  203. * struct iwl_mac_data_go - configuration data for P2P GO MAC context
  204. * @ap: iwl_mac_data_ap struct with most config data
  205. * @ctwin: client traffic window in TU (period after TBTT when GO is present).
  206. * 0 indicates that there is no CT window.
  207. * @opp_ps_enabled: indicate that opportunistic PS allowed
  208. */
  209. struct iwl_mac_data_go {
  210. struct iwl_mac_data_ap ap;
  211. __le32 ctwin;
  212. __le32 opp_ps_enabled;
  213. } __packed; /* GO_MAC_DATA_API_S_VER_1 */
  214. /**
  215. * struct iwl_mac_data_p2p_sta - configuration data for P2P client MAC context
  216. * @sta: iwl_mac_data_sta struct with most config data
  217. * @ctwin: client traffic window in TU (period after TBTT when GO is present).
  218. * 0 indicates that there is no CT window.
  219. */
  220. struct iwl_mac_data_p2p_sta {
  221. struct iwl_mac_data_sta sta;
  222. __le32 ctwin;
  223. } __packed; /* P2P_STA_MAC_DATA_API_S_VER_1 */
  224. /**
  225. * struct iwl_mac_data_pibss - Pseudo IBSS config data
  226. * @stats_interval: interval in TU between statistics notifications to host.
  227. */
  228. struct iwl_mac_data_pibss {
  229. __le32 stats_interval;
  230. } __packed; /* PIBSS_MAC_DATA_API_S_VER_1 */
  231. /*
  232. * struct iwl_mac_data_p2p_dev - configuration data for the P2P Device MAC
  233. * context.
  234. * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
  235. * other channels as well. This should be to true only in case that the
  236. * device is discoverable and there is an active GO. Note that setting this
  237. * field when not needed, will increase the number of interrupts and have
  238. * effect on the platform power, as this setting opens the Rx filters on
  239. * all macs.
  240. */
  241. struct iwl_mac_data_p2p_dev {
  242. __le32 is_disc_extended;
  243. } __packed; /* _P2P_DEV_MAC_DATA_API_S_VER_1 */
  244. /**
  245. * enum iwl_mac_filter_flags - MAC context filter flags
  246. * @MAC_FILTER_IN_PROMISC: accept all data frames
  247. * @MAC_FILTER_IN_CONTROL_AND_MGMT: pass all management and
  248. * control frames to the host
  249. * @MAC_FILTER_ACCEPT_GRP: accept multicast frames
  250. * @MAC_FILTER_DIS_DECRYPT: don't decrypt unicast frames
  251. * @MAC_FILTER_DIS_GRP_DECRYPT: don't decrypt multicast frames
  252. * @MAC_FILTER_IN_BEACON: transfer foreign BSS's beacons to host
  253. * (in station mode when associated)
  254. * @MAC_FILTER_OUT_BCAST: filter out all broadcast frames
  255. * @MAC_FILTER_IN_CRC32: extract FCS and append it to frames
  256. * @MAC_FILTER_IN_PROBE_REQUEST: pass probe requests to host
  257. */
  258. enum iwl_mac_filter_flags {
  259. MAC_FILTER_IN_PROMISC = BIT(0),
  260. MAC_FILTER_IN_CONTROL_AND_MGMT = BIT(1),
  261. MAC_FILTER_ACCEPT_GRP = BIT(2),
  262. MAC_FILTER_DIS_DECRYPT = BIT(3),
  263. MAC_FILTER_DIS_GRP_DECRYPT = BIT(4),
  264. MAC_FILTER_IN_BEACON = BIT(6),
  265. MAC_FILTER_OUT_BCAST = BIT(8),
  266. MAC_FILTER_IN_CRC32 = BIT(11),
  267. MAC_FILTER_IN_PROBE_REQUEST = BIT(12),
  268. /**
  269. * @MAC_FILTER_IN_11AX: mark BSS as supporting 802.11ax
  270. */
  271. MAC_FILTER_IN_11AX = BIT(14),
  272. };
  273. /**
  274. * enum iwl_mac_qos_flags - QoS flags
  275. * @MAC_QOS_FLG_UPDATE_EDCA: ?
  276. * @MAC_QOS_FLG_TGN: HT is enabled
  277. * @MAC_QOS_FLG_TXOP_TYPE: ?
  278. *
  279. */
  280. enum iwl_mac_qos_flags {
  281. MAC_QOS_FLG_UPDATE_EDCA = BIT(0),
  282. MAC_QOS_FLG_TGN = BIT(1),
  283. MAC_QOS_FLG_TXOP_TYPE = BIT(4),
  284. };
  285. /**
  286. * struct iwl_ac_qos - QOS timing params for MAC_CONTEXT_CMD
  287. * @cw_min: Contention window, start value in numbers of slots.
  288. * Should be a power-of-2, minus 1. Device's default is 0x0f.
  289. * @cw_max: Contention window, max value in numbers of slots.
  290. * Should be a power-of-2, minus 1. Device's default is 0x3f.
  291. * @aifsn: Number of slots in Arbitration Interframe Space (before
  292. * performing random backoff timing prior to Tx). Device default 1.
  293. * @fifos_mask: FIFOs used by this MAC for this AC
  294. * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
  295. *
  296. * One instance of this config struct for each of 4 EDCA access categories
  297. * in struct iwl_qosparam_cmd.
  298. *
  299. * Device will automatically increase contention window by (2*CW) + 1 for each
  300. * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
  301. * value, to cap the CW value.
  302. */
  303. struct iwl_ac_qos {
  304. __le16 cw_min;
  305. __le16 cw_max;
  306. u8 aifsn;
  307. u8 fifos_mask;
  308. __le16 edca_txop;
  309. } __packed; /* AC_QOS_API_S_VER_2 */
  310. /**
  311. * struct iwl_mac_ctx_cmd - command structure to configure MAC contexts
  312. * ( MAC_CONTEXT_CMD = 0x28 )
  313. * @id_and_color: ID and color of the MAC
  314. * @action: action to perform, one of FW_CTXT_ACTION_*
  315. * @mac_type: one of &enum iwl_mac_types
  316. * @tsf_id: TSF HW timer, one of &enum iwl_tsf_id
  317. * @node_addr: MAC address
  318. * @reserved_for_node_addr: reserved
  319. * @bssid_addr: BSSID
  320. * @reserved_for_bssid_addr: reserved
  321. * @cck_rates: basic rates available for CCK
  322. * @ofdm_rates: basic rates available for OFDM
  323. * @protection_flags: combination of &enum iwl_mac_protection_flags
  324. * @cck_short_preamble: 0x20 for enabling short preamble, 0 otherwise
  325. * @short_slot: 0x10 for enabling short slots, 0 otherwise
  326. * @filter_flags: combination of &enum iwl_mac_filter_flags
  327. * @qos_flags: from &enum iwl_mac_qos_flags
  328. * @ac: one iwl_mac_qos configuration for each AC
  329. */
  330. struct iwl_mac_ctx_cmd {
  331. /* COMMON_INDEX_HDR_API_S_VER_1 */
  332. __le32 id_and_color;
  333. __le32 action;
  334. /* MAC_CONTEXT_COMMON_DATA_API_S_VER_1 */
  335. __le32 mac_type;
  336. __le32 tsf_id;
  337. u8 node_addr[6];
  338. __le16 reserved_for_node_addr;
  339. u8 bssid_addr[6];
  340. __le16 reserved_for_bssid_addr;
  341. __le32 cck_rates;
  342. __le32 ofdm_rates;
  343. __le32 protection_flags;
  344. __le32 cck_short_preamble;
  345. __le32 short_slot;
  346. __le32 filter_flags;
  347. /* MAC_QOS_PARAM_API_S_VER_1 */
  348. __le32 qos_flags;
  349. struct iwl_ac_qos ac[AC_NUM+1];
  350. /* MAC_CONTEXT_COMMON_DATA_API_S */
  351. union {
  352. struct iwl_mac_data_ap ap;
  353. struct iwl_mac_data_go go;
  354. struct iwl_mac_data_sta sta;
  355. struct iwl_mac_data_p2p_sta p2p_sta;
  356. struct iwl_mac_data_p2p_dev p2p_dev;
  357. struct iwl_mac_data_pibss pibss;
  358. struct iwl_mac_data_ibss ibss;
  359. };
  360. } __packed; /* MAC_CONTEXT_CMD_API_S_VER_1 */
  361. static inline u32 iwl_mvm_reciprocal(u32 v)
  362. {
  363. if (!v)
  364. return 0;
  365. return 0xFFFFFFFF / v;
  366. }
  367. #define IWL_NONQOS_SEQ_GET 0x1
  368. #define IWL_NONQOS_SEQ_SET 0x2
  369. struct iwl_nonqos_seq_query_cmd {
  370. __le32 get_set_flag;
  371. __le32 mac_id_n_color;
  372. __le16 value;
  373. __le16 reserved;
  374. } __packed; /* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */
  375. /**
  376. * struct iwl_missed_beacons_notif - information on missed beacons
  377. * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
  378. * @mac_id: interface ID
  379. * @consec_missed_beacons_since_last_rx: number of consecutive missed
  380. * beacons since last RX.
  381. * @consec_missed_beacons: number of consecutive missed beacons
  382. * @num_expected_beacons: number of expected beacons
  383. * @num_recvd_beacons: number of received beacons
  384. */
  385. struct iwl_missed_beacons_notif {
  386. __le32 mac_id;
  387. __le32 consec_missed_beacons_since_last_rx;
  388. __le32 consec_missed_beacons;
  389. __le32 num_expected_beacons;
  390. __le32 num_recvd_beacons;
  391. } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
  392. /**
  393. * struct iwl_he_backoff_conf - used for backoff configuration
  394. * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)
  395. * used for backoff configuration of TXF5..TXF8 trigger based.
  396. * The MU-TIMER is reloaded w/ MU_TIME each time a frame from the AC is sent via
  397. * trigger-based TX.
  398. * @cwmin: CW min
  399. * @cwmax: CW max
  400. * @aifsn: AIFSN
  401. * AIFSN=0, means that no backoff from the specified TRIG-BASED AC is
  402. * allowed till the MU-TIMER is 0
  403. * @mu_time: MU time in 8TU units
  404. */
  405. struct iwl_he_backoff_conf {
  406. __le16 cwmin;
  407. __le16 cwmax;
  408. __le16 aifsn;
  409. __le16 mu_time;
  410. } __packed; /* AC_QOS_DOT11AX_API_S */
  411. #define MAX_HE_SUPP_NSS 2
  412. #define MAX_HE_CHANNEL_BW_INDX 4
  413. /**
  414. * struct iwl_he_pkt_ext - QAM thresholds
  415. * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS
  416. * The IE is organized in the following way:
  417. * Support for Nss x BW (or RU) matrix:
  418. * (0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)
  419. * Each entry contains 2 QAM thresholds for 8us and 16us:
  420. * 0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6/7=RES
  421. * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:
  422. * QAM_tx < QAM_th1 --> PPE=0us
  423. * QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us
  424. * QAM_th2 <= QAM_tx --> PPE=16us
  425. * @pkt_ext_qam_th: QAM thresholds
  426. * For each Nss/Bw define 2 QAM thrsholds (0..5)
  427. * For rates below the low_th, no need for PPE
  428. * For rates between low_th and high_th, need 8us PPE
  429. * For rates equal or higher then the high_th, need 16us PPE
  430. * Nss (0-siso, 1-mimo2) x BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz) x
  431. * (0-low_th, 1-high_th)
  432. */
  433. struct iwl_he_pkt_ext {
  434. u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_HE_CHANNEL_BW_INDX][2];
  435. } __packed; /* PKT_EXT_DOT11AX_API_S */
  436. /**
  437. * enum iwl_he_sta_ctxt_flags - HE STA context flags
  438. * @STA_CTXT_HE_REF_BSSID_VALID: ref bssid addr valid (for receiving specific
  439. * control frames such as TRIG, NDPA, BACK)
  440. * @STA_CTXT_HE_BSS_COLOR_DIS: BSS color disable, don't use the BSS
  441. * color for RX filter but use MAC header
  442. * @STA_CTXT_HE_PARTIAL_BSS_COLOR: partial BSS color allocation
  443. * @STA_CTXT_HE_32BIT_BA_BITMAP: indicates the receiver supports BA bitmap
  444. * of 32-bits
  445. * @STA_CTXT_HE_PACKET_EXT: indicates that the packet-extension info is valid
  446. * and should be used
  447. * @STA_CTXT_HE_TRIG_RND_ALLOC: indicates that trigger based random allocation
  448. * is enabled according to UORA element existence
  449. * @STA_CTXT_HE_CONST_TRIG_RND_ALLOC: used for AV testing
  450. * @STA_CTXT_HE_ACK_ENABLED: indicates that the AP supports receiving ACK-
  451. * enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
  452. * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA
  453. * parameter set, i.e. the backoff counters for trig-based ACs
  454. */
  455. enum iwl_he_sta_ctxt_flags {
  456. STA_CTXT_HE_REF_BSSID_VALID = BIT(4),
  457. STA_CTXT_HE_BSS_COLOR_DIS = BIT(5),
  458. STA_CTXT_HE_PARTIAL_BSS_COLOR = BIT(6),
  459. STA_CTXT_HE_32BIT_BA_BITMAP = BIT(7),
  460. STA_CTXT_HE_PACKET_EXT = BIT(8),
  461. STA_CTXT_HE_TRIG_RND_ALLOC = BIT(9),
  462. STA_CTXT_HE_CONST_TRIG_RND_ALLOC = BIT(10),
  463. STA_CTXT_HE_ACK_ENABLED = BIT(11),
  464. STA_CTXT_HE_MU_EDCA_CW = BIT(12),
  465. };
  466. /**
  467. * enum iwl_he_htc_flags - HE HTC support flags
  468. * @IWL_HE_HTC_SUPPORT: HE-HTC support
  469. * @IWL_HE_HTC_UL_MU_RESP_SCHED: HE UL MU response schedule
  470. * support via A-control field
  471. * @IWL_HE_HTC_BSR_SUPP: BSR support in A-control field
  472. * @IWL_HE_HTC_OMI_SUPP: A-OMI support in A-control field
  473. * @IWL_HE_HTC_BQR_SUPP: A-BQR support in A-control field
  474. */
  475. enum iwl_he_htc_flags {
  476. IWL_HE_HTC_SUPPORT = BIT(0),
  477. IWL_HE_HTC_UL_MU_RESP_SCHED = BIT(3),
  478. IWL_HE_HTC_BSR_SUPP = BIT(4),
  479. IWL_HE_HTC_OMI_SUPP = BIT(5),
  480. IWL_HE_HTC_BQR_SUPP = BIT(6),
  481. };
  482. /*
  483. * @IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK: the STA does not provide HE MFB
  484. * @IWL_HE_HTC_LINK_ADAP_UNSOLICITED: the STA provides only unsolicited HE MFB
  485. * @IWL_HE_HTC_LINK_ADAP_BOTH: the STA is capable of providing HE MFB in
  486. * response to HE MRQ and if the STA provides unsolicited HE MFB
  487. */
  488. #define IWL_HE_HTC_LINK_ADAP_POS (1)
  489. #define IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK (0)
  490. #define IWL_HE_HTC_LINK_ADAP_UNSOLICITED (2 << IWL_HE_HTC_LINK_ADAP_POS)
  491. #define IWL_HE_HTC_LINK_ADAP_BOTH (3 << IWL_HE_HTC_LINK_ADAP_POS)
  492. /**
  493. * struct iwl_he_sta_context_cmd - configure FW to work with HE AP
  494. * @sta_id: STA id
  495. * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
  496. * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
  497. * @reserved1: reserved byte for future use
  498. * @reserved2: reserved byte for future use
  499. * @flags: see %iwl_11ax_sta_ctxt_flags
  500. * @ref_bssid_addr: reference BSSID used by the AP
  501. * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
  502. * @htc_flags: which features are supported in HTC
  503. * @frag_flags: frag support in A-MSDU
  504. * @frag_level: frag support level
  505. * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
  506. * @frag_min_size: min frag size (except last frag)
  507. * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
  508. * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
  509. * @htc_trig_based_pkt_ext: default PE in 4us units
  510. * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
  511. * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
  512. * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
  513. * @reserved3: reserved byte for future use
  514. * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
  515. */
  516. struct iwl_he_sta_context_cmd {
  517. u8 sta_id;
  518. u8 tid_limit;
  519. u8 reserved1;
  520. u8 reserved2;
  521. __le32 flags;
  522. /* The below fields are set via Multiple BSSID IE */
  523. u8 ref_bssid_addr[6];
  524. __le16 reserved0;
  525. /* The below fields are set via HE-capabilities IE */
  526. __le32 htc_flags;
  527. u8 frag_flags;
  528. u8 frag_level;
  529. u8 frag_max_num;
  530. u8 frag_min_size;
  531. /* The below fields are set via PPE thresholds element */
  532. struct iwl_he_pkt_ext pkt_ext;
  533. /* The below fields are set via HE-Operation IE */
  534. u8 bss_color;
  535. u8 htc_trig_based_pkt_ext;
  536. __le16 frame_time_rts_th;
  537. /* Random access parameter set (i.e. RAPS) */
  538. u8 rand_alloc_ecwmin;
  539. u8 rand_alloc_ecwmax;
  540. __le16 reserved3;
  541. /* The below fields are set via MU EDCA parameter set element */
  542. struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
  543. } __packed; /* STA_CONTEXT_DOT11AX_API_S */
  544. #endif /* __iwl_fw_api_mac_h__ */