fw-api-rx.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2015 - 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 - 2015 Intel Mobile Communications GmbH
  37. * Copyright(c) 2015 - 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. *****************************************************************************/
  67. #ifndef __fw_api_rx_h__
  68. #define __fw_api_rx_h__
  69. /* API for pre-9000 hardware */
  70. #define IWL_RX_INFO_PHY_CNT 8
  71. #define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
  72. #define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
  73. #define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00
  74. #define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000
  75. #define IWL_RX_INFO_ENERGY_ANT_A_POS 0
  76. #define IWL_RX_INFO_ENERGY_ANT_B_POS 8
  77. #define IWL_RX_INFO_ENERGY_ANT_C_POS 16
  78. enum iwl_mac_context_info {
  79. MAC_CONTEXT_INFO_NONE,
  80. MAC_CONTEXT_INFO_GSCAN,
  81. };
  82. /**
  83. * struct iwl_rx_phy_info - phy info
  84. * (REPLY_RX_PHY_CMD = 0xc0)
  85. * @non_cfg_phy_cnt: non configurable DSP phy data byte count
  86. * @cfg_phy_cnt: configurable DSP phy data byte count
  87. * @stat_id: configurable DSP phy data set ID
  88. * @reserved1:
  89. * @system_timestamp: GP2 at on air rise
  90. * @timestamp: TSF at on air rise
  91. * @beacon_time_stamp: beacon at on-air rise
  92. * @phy_flags: general phy flags: band, modulation, ...
  93. * @channel: channel number
  94. * @non_cfg_phy_buf: for various implementations of non_cfg_phy
  95. * @rate_n_flags: RATE_MCS_*
  96. * @byte_count: frame's byte-count
  97. * @frame_time: frame's time on the air, based on byte count and frame rate
  98. * calculation
  99. * @mac_active_msk: what MACs were active when the frame was received
  100. * @mac_context_info: additional info on the context in which the frame was
  101. * received as defined in &enum iwl_mac_context_info
  102. *
  103. * Before each Rx, the device sends this data. It contains PHY information
  104. * about the reception of the packet.
  105. */
  106. struct iwl_rx_phy_info {
  107. u8 non_cfg_phy_cnt;
  108. u8 cfg_phy_cnt;
  109. u8 stat_id;
  110. u8 reserved1;
  111. __le32 system_timestamp;
  112. __le64 timestamp;
  113. __le32 beacon_time_stamp;
  114. __le16 phy_flags;
  115. __le16 channel;
  116. __le32 non_cfg_phy[IWL_RX_INFO_PHY_CNT];
  117. __le32 rate_n_flags;
  118. __le32 byte_count;
  119. u8 mac_active_msk;
  120. u8 mac_context_info;
  121. __le16 frame_time;
  122. } __packed;
  123. /*
  124. * TCP offload Rx assist info
  125. *
  126. * bits 0:3 - reserved
  127. * bits 4:7 - MIC CRC length
  128. * bits 8:12 - MAC header length
  129. * bit 13 - Padding indication
  130. * bit 14 - A-AMSDU indication
  131. * bit 15 - Offload enabled
  132. */
  133. enum iwl_csum_rx_assist_info {
  134. CSUM_RXA_RESERVED_MASK = 0x000f,
  135. CSUM_RXA_MICSIZE_MASK = 0x00f0,
  136. CSUM_RXA_HEADERLEN_MASK = 0x1f00,
  137. CSUM_RXA_PADD = BIT(13),
  138. CSUM_RXA_AMSDU = BIT(14),
  139. CSUM_RXA_ENA = BIT(15)
  140. };
  141. /**
  142. * struct iwl_rx_mpdu_res_start - phy info
  143. * @assist: see CSUM_RX_ASSIST_ above
  144. */
  145. struct iwl_rx_mpdu_res_start {
  146. __le16 byte_count;
  147. __le16 assist;
  148. } __packed; /* _RX_MPDU_RES_START_API_S_VER_2 */
  149. /**
  150. * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags
  151. * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band
  152. * @RX_RES_PHY_FLAGS_MOD_CCK:
  153. * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short
  154. * @RX_RES_PHY_FLAGS_NARROW_BAND:
  155. * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received
  156. * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
  157. * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame
  158. * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble
  159. * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame
  160. */
  161. enum iwl_rx_phy_flags {
  162. RX_RES_PHY_FLAGS_BAND_24 = BIT(0),
  163. RX_RES_PHY_FLAGS_MOD_CCK = BIT(1),
  164. RX_RES_PHY_FLAGS_SHORT_PREAMBLE = BIT(2),
  165. RX_RES_PHY_FLAGS_NARROW_BAND = BIT(3),
  166. RX_RES_PHY_FLAGS_ANTENNA = (0x7 << 4),
  167. RX_RES_PHY_FLAGS_ANTENNA_POS = 4,
  168. RX_RES_PHY_FLAGS_AGG = BIT(7),
  169. RX_RES_PHY_FLAGS_OFDM_HT = BIT(8),
  170. RX_RES_PHY_FLAGS_OFDM_GF = BIT(9),
  171. RX_RES_PHY_FLAGS_OFDM_VHT = BIT(10),
  172. };
  173. /**
  174. * enum iwl_mvm_rx_status - written by fw for each Rx packet
  175. * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine
  176. * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow
  177. * @RX_MPDU_RES_STATUS_SRC_STA_FOUND:
  178. * @RX_MPDU_RES_STATUS_KEY_VALID:
  179. * @RX_MPDU_RES_STATUS_KEY_PARAM_OK:
  180. * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed
  181. * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked
  182. * in the driver.
  183. * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine
  184. * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or
  185. * alg = CCM only. Checks replay attack for 11w frames. Relevant only if
  186. * %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set.
  187. * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted
  188. * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP
  189. * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM
  190. * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP
  191. * @RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC: this frame is encrypted using CCM_CMAC
  192. * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted
  193. * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm
  194. * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted
  195. * @RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP:
  196. * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP:
  197. * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT:
  198. * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame
  199. * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw
  200. * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors
  201. * @RX_MPDU_RES_STATUS_HASH_INDEX_MSK:
  202. * @RX_MPDU_RES_STATUS_STA_ID_MSK:
  203. * @RX_MPDU_RES_STATUS_RRF_KILL:
  204. * @RX_MPDU_RES_STATUS_FILTERING_MSK:
  205. * @RX_MPDU_RES_STATUS2_FILTERING_MSK:
  206. */
  207. enum iwl_mvm_rx_status {
  208. RX_MPDU_RES_STATUS_CRC_OK = BIT(0),
  209. RX_MPDU_RES_STATUS_OVERRUN_OK = BIT(1),
  210. RX_MPDU_RES_STATUS_SRC_STA_FOUND = BIT(2),
  211. RX_MPDU_RES_STATUS_KEY_VALID = BIT(3),
  212. RX_MPDU_RES_STATUS_KEY_PARAM_OK = BIT(4),
  213. RX_MPDU_RES_STATUS_ICV_OK = BIT(5),
  214. RX_MPDU_RES_STATUS_MIC_OK = BIT(6),
  215. RX_MPDU_RES_STATUS_TTAK_OK = BIT(7),
  216. RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR = BIT(7),
  217. RX_MPDU_RES_STATUS_SEC_NO_ENC = (0 << 8),
  218. RX_MPDU_RES_STATUS_SEC_WEP_ENC = (1 << 8),
  219. RX_MPDU_RES_STATUS_SEC_CCM_ENC = (2 << 8),
  220. RX_MPDU_RES_STATUS_SEC_TKIP_ENC = (3 << 8),
  221. RX_MPDU_RES_STATUS_SEC_EXT_ENC = (4 << 8),
  222. RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC = (6 << 8),
  223. RX_MPDU_RES_STATUS_SEC_ENC_ERR = (7 << 8),
  224. RX_MPDU_RES_STATUS_SEC_ENC_MSK = (7 << 8),
  225. RX_MPDU_RES_STATUS_DEC_DONE = BIT(11),
  226. RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP = BIT(12),
  227. RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP = BIT(13),
  228. RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT = BIT(14),
  229. RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME = BIT(15),
  230. RX_MPDU_RES_STATUS_CSUM_DONE = BIT(16),
  231. RX_MPDU_RES_STATUS_CSUM_OK = BIT(17),
  232. RX_MPDU_RES_STATUS_HASH_INDEX_MSK = (0x3F0000),
  233. RX_MDPU_RES_STATUS_STA_ID_SHIFT = 24,
  234. RX_MPDU_RES_STATUS_STA_ID_MSK = 0x1f << RX_MDPU_RES_STATUS_STA_ID_SHIFT,
  235. RX_MPDU_RES_STATUS_RRF_KILL = BIT(29),
  236. RX_MPDU_RES_STATUS_FILTERING_MSK = (0xc00000),
  237. RX_MPDU_RES_STATUS2_FILTERING_MSK = (0xc0000000),
  238. };
  239. /* 9000 series API */
  240. enum iwl_rx_mpdu_mac_flags1 {
  241. IWL_RX_MDPU_MFLG1_ADDRTYPE_MASK = 0x03,
  242. IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK = 0xf0,
  243. /* shift should be 4, but the length is measured in 2-byte
  244. * words, so shifting only by 3 gives a byte result
  245. */
  246. IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT = 3,
  247. };
  248. enum iwl_rx_mpdu_mac_flags2 {
  249. /* in 2-byte words */
  250. IWL_RX_MPDU_MFLG2_HDR_LEN_MASK = 0x1f,
  251. IWL_RX_MPDU_MFLG2_PAD = 0x20,
  252. IWL_RX_MPDU_MFLG2_AMSDU = 0x40,
  253. };
  254. enum iwl_rx_mpdu_amsdu_info {
  255. IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK = 0x7f,
  256. IWL_RX_MPDU_AMSDU_LAST_SUBFRAME = 0x80,
  257. };
  258. enum iwl_rx_l3_proto_values {
  259. IWL_RX_L3_TYPE_NONE,
  260. IWL_RX_L3_TYPE_IPV4,
  261. IWL_RX_L3_TYPE_IPV4_FRAG,
  262. IWL_RX_L3_TYPE_IPV6_FRAG,
  263. IWL_RX_L3_TYPE_IPV6,
  264. IWL_RX_L3_TYPE_IPV6_IN_IPV4,
  265. IWL_RX_L3_TYPE_ARP,
  266. IWL_RX_L3_TYPE_EAPOL,
  267. };
  268. #define IWL_RX_L3_PROTO_POS 4
  269. enum iwl_rx_l3l4_flags {
  270. IWL_RX_L3L4_IP_HDR_CSUM_OK = BIT(0),
  271. IWL_RX_L3L4_TCP_UDP_CSUM_OK = BIT(1),
  272. IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH = BIT(2),
  273. IWL_RX_L3L4_TCP_ACK = BIT(3),
  274. IWL_RX_L3L4_L3_PROTO_MASK = 0xf << IWL_RX_L3_PROTO_POS,
  275. IWL_RX_L3L4_L4_PROTO_MASK = 0xf << 8,
  276. IWL_RX_L3L4_RSS_HASH_MASK = 0xf << 12,
  277. };
  278. enum iwl_rx_mpdu_status {
  279. IWL_RX_MPDU_STATUS_CRC_OK = BIT(0),
  280. IWL_RX_MPDU_STATUS_OVERRUN_OK = BIT(1),
  281. IWL_RX_MPDU_STATUS_SRC_STA_FOUND = BIT(2),
  282. IWL_RX_MPDU_STATUS_KEY_VALID = BIT(3),
  283. IWL_RX_MPDU_STATUS_KEY_PARAM_OK = BIT(4),
  284. IWL_RX_MPDU_STATUS_ICV_OK = BIT(5),
  285. IWL_RX_MPDU_STATUS_MIC_OK = BIT(6),
  286. IWL_RX_MPDU_RES_STATUS_TTAK_OK = BIT(7),
  287. IWL_RX_MPDU_STATUS_SEC_MASK = 0x7 << 8,
  288. IWL_RX_MPDU_STATUS_SEC_NONE = 0x0 << 8,
  289. IWL_RX_MPDU_STATUS_SEC_WEP = 0x1 << 8,
  290. IWL_RX_MPDU_STATUS_SEC_CCM = 0x2 << 8,
  291. IWL_RX_MPDU_STATUS_SEC_TKIP = 0x3 << 8,
  292. IWL_RX_MPDU_STATUS_SEC_EXT_ENC = 0x4 << 8,
  293. IWL_RX_MPDU_STATUS_SEC_GCM = 0x5 << 8,
  294. IWL_RX_MPDU_STATUS_DECRYPTED = BIT(11),
  295. IWL_RX_MPDU_STATUS_WEP_MATCH = BIT(12),
  296. IWL_RX_MPDU_STATUS_EXT_IV_MATCH = BIT(13),
  297. IWL_RX_MPDU_STATUS_KEY_ID_MATCH = BIT(14),
  298. IWL_RX_MPDU_STATUS_ROBUST_MNG_FRAME = BIT(15),
  299. };
  300. enum iwl_rx_mpdu_hash_filter {
  301. IWL_RX_MPDU_HF_A1_HASH_MASK = 0x3f,
  302. IWL_RX_MPDU_HF_FILTER_STATUS_MASK = 0xc0,
  303. };
  304. enum iwl_rx_mpdu_sta_id_flags {
  305. IWL_RX_MPDU_SIF_STA_ID_MASK = 0x1f,
  306. IWL_RX_MPDU_SIF_RRF_ABORT = 0x20,
  307. IWL_RX_MPDU_SIF_FILTER_STATUS_MASK = 0xc0,
  308. };
  309. #define IWL_RX_REORDER_DATA_INVALID_BAID 0x7f
  310. enum iwl_rx_mpdu_reorder_data {
  311. IWL_RX_MPDU_REORDER_NSSN_MASK = 0x00000fff,
  312. IWL_RX_MPDU_REORDER_SN_MASK = 0x00fff000,
  313. IWL_RX_MPDU_REORDER_SN_SHIFT = 12,
  314. IWL_RX_MPDU_REORDER_BAID_MASK = 0x7f000000,
  315. IWL_RX_MPDU_REORDER_BAID_SHIFT = 24,
  316. IWL_RX_MPDU_REORDER_BA_OLD_SN = 0x80000000,
  317. };
  318. enum iwl_rx_mpdu_phy_info {
  319. IWL_RX_MPDU_PHY_AMPDU = BIT(5),
  320. IWL_RX_MPDU_PHY_AMPDU_TOGGLE = BIT(6),
  321. IWL_RX_MPDU_PHY_SHORT_PREAMBLE = BIT(7),
  322. IWL_RX_MPDU_PHY_TSF_OVERLOAD = BIT(8),
  323. };
  324. enum iwl_rx_mpdu_mac_info {
  325. IWL_RX_MPDU_PHY_MAC_INDEX_MASK = 0x0f,
  326. IWL_RX_MPDU_PHY_PHY_INDEX_MASK = 0xf0,
  327. };
  328. struct iwl_rx_mpdu_desc {
  329. /* DW2 */
  330. __le16 mpdu_len;
  331. u8 mac_flags1;
  332. u8 mac_flags2;
  333. /* DW3 */
  334. u8 amsdu_info;
  335. __le16 phy_info;
  336. u8 mac_phy_idx;
  337. /* DW4 - carries csum data only when rpa_en == 1 */
  338. __le16 raw_csum; /* alledgedly unreliable */
  339. __le16 l3l4_flags;
  340. /* DW5 */
  341. __le16 status;
  342. u8 hash_filter;
  343. u8 sta_id_flags;
  344. /* DW6 */
  345. __le32 reorder_data;
  346. /* DW7 - carries rss_hash only when rpa_en == 1 */
  347. __le32 rss_hash;
  348. /* DW8 - carries filter_match only when rpa_en == 1 */
  349. __le32 filter_match;
  350. /* DW9 */
  351. __le32 rate_n_flags;
  352. /* DW10 */
  353. u8 energy_a, energy_b, channel, mac_context;
  354. /* DW11 */
  355. __le32 gp2_on_air_rise;
  356. /* DW12 & DW13 - carries TSF only TSF_OVERLOAD bit == 0 */
  357. __le64 tsf_on_air_rise;
  358. } __packed;
  359. struct iwl_frame_release {
  360. u8 baid;
  361. u8 reserved;
  362. __le16 nssn;
  363. };
  364. enum iwl_rss_hash_func_en {
  365. IWL_RSS_HASH_TYPE_IPV4_TCP,
  366. IWL_RSS_HASH_TYPE_IPV4_UDP,
  367. IWL_RSS_HASH_TYPE_IPV4_PAYLOAD,
  368. IWL_RSS_HASH_TYPE_IPV6_TCP,
  369. IWL_RSS_HASH_TYPE_IPV6_UDP,
  370. IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
  371. };
  372. #define IWL_RSS_HASH_KEY_CNT 10
  373. #define IWL_RSS_INDIRECTION_TABLE_SIZE 128
  374. #define IWL_RSS_ENABLE 1
  375. /**
  376. * struct iwl_rss_config_cmd - RSS (Receive Side Scaling) configuration
  377. *
  378. * @flags: 1 - enable, 0 - disable
  379. * @hash_mask: Type of RSS to use. Values are from %iwl_rss_hash_func_en
  380. * @secret_key: 320 bit input of random key configuration from driver
  381. * @indirection_table: indirection table
  382. */
  383. struct iwl_rss_config_cmd {
  384. __le32 flags;
  385. u8 hash_mask;
  386. u8 reserved[3];
  387. __le32 secret_key[IWL_RSS_HASH_KEY_CNT];
  388. u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];
  389. } __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */
  390. #define IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE 128
  391. #define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
  392. #define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
  393. /**
  394. * struct iwl_rxq_sync_cmd - RXQ notification trigger
  395. *
  396. * @flags: flags of the notification. bit 0:3 are the sender queue
  397. * @rxq_mask: rx queues to send the notification on
  398. * @count: number of bytes in payload, should be DWORD aligned
  399. * @payload: data to send to rx queues
  400. */
  401. struct iwl_rxq_sync_cmd {
  402. __le32 flags;
  403. __le32 rxq_mask;
  404. __le32 count;
  405. u8 payload[];
  406. } __packed; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
  407. /**
  408. * struct iwl_rxq_sync_notification - Notification triggered by RXQ
  409. * sync command
  410. *
  411. * @count: number of bytes in payload
  412. * @payload: data to send to rx queues
  413. */
  414. struct iwl_rxq_sync_notification {
  415. __le32 count;
  416. u8 payload[];
  417. } __packed; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
  418. /**
  419. * Internal message identifier
  420. *
  421. * @IWL_MVM_RXQ_EMPTY: empty sync notification
  422. * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
  423. */
  424. enum iwl_mvm_rxq_notif_type {
  425. IWL_MVM_RXQ_EMPTY,
  426. IWL_MVM_RXQ_NOTIF_DEL_BA,
  427. };
  428. /**
  429. * struct iwl_mvm_internal_rxq_notif - Internal representation of the data sent
  430. * in &iwl_rxq_sync_cmd. Should be DWORD aligned.
  431. * FW is agnostic to the payload, so there are no endianity requirements.
  432. *
  433. * @type: value from &iwl_mvm_rxq_notif_type
  434. * @sync: ctrl path is waiting for all notifications to be received
  435. * @cookie: internal cookie to identify old notifications
  436. * @data: payload
  437. */
  438. struct iwl_mvm_internal_rxq_notif {
  439. u16 type;
  440. u16 sync;
  441. u32 cookie;
  442. u8 data[];
  443. } __packed;
  444. /**
  445. * enum iwl_mvm_pm_event - type of station PM event
  446. * @IWL_MVM_PM_EVENT_AWAKE: station woke up
  447. * @IWL_MVM_PM_EVENT_ASLEEP: station went to sleep
  448. * @IWL_MVM_PM_EVENT_UAPSD: station sent uAPSD trigger
  449. * @IWL_MVM_PM_EVENT_PS_POLL: station sent PS-Poll
  450. */
  451. enum iwl_mvm_pm_event {
  452. IWL_MVM_PM_EVENT_AWAKE,
  453. IWL_MVM_PM_EVENT_ASLEEP,
  454. IWL_MVM_PM_EVENT_UAPSD,
  455. IWL_MVM_PM_EVENT_PS_POLL,
  456. }; /* PEER_PM_NTFY_API_E_VER_1 */
  457. /**
  458. * struct iwl_mvm_pm_state_notification - station PM state notification
  459. * @sta_id: station ID of the station changing state
  460. * @type: the new powersave state, see IWL_MVM_PM_EVENT_ above
  461. */
  462. struct iwl_mvm_pm_state_notification {
  463. u8 sta_id;
  464. u8 type;
  465. /* private: */
  466. u16 reserved;
  467. } __packed; /* PEER_PM_NTFY_API_S_VER_1 */
  468. #endif /* __fw_api_rx_h__ */