rxpt_classify_info.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _RXPT_CLASSIFY_INFO_H_
  16. #define _RXPT_CLASSIFY_INFO_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_RXPT_CLASSIFY_INFO 1
  20. struct rxpt_classify_info {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t reo_destination_indication : 5, // [4:0]
  23. lmac_peer_id_msb : 2, // [6:5]
  24. use_flow_id_toeplitz_clfy : 1, // [7:7]
  25. pkt_selection_fp_ucast_data : 1, // [8:8]
  26. pkt_selection_fp_mcast_data : 1, // [9:9]
  27. pkt_selection_fp_1000 : 1, // [10:10]
  28. rxdma0_source_ring_selection : 3, // [13:11]
  29. rxdma0_destination_ring_selection : 3, // [16:14]
  30. mcast_echo_drop_enable : 1, // [17:17]
  31. wds_learning_detect_en : 1, // [18:18]
  32. intrabss_check_en : 1, // [19:19]
  33. use_ppe : 1, // [20:20]
  34. ppe_routing_enable : 1, // [21:21]
  35. reserved_0b : 10; // [31:22]
  36. #else
  37. uint32_t reserved_0b : 10, // [31:22]
  38. ppe_routing_enable : 1, // [21:21]
  39. use_ppe : 1, // [20:20]
  40. intrabss_check_en : 1, // [19:19]
  41. wds_learning_detect_en : 1, // [18:18]
  42. mcast_echo_drop_enable : 1, // [17:17]
  43. rxdma0_destination_ring_selection : 3, // [16:14]
  44. rxdma0_source_ring_selection : 3, // [13:11]
  45. pkt_selection_fp_1000 : 1, // [10:10]
  46. pkt_selection_fp_mcast_data : 1, // [9:9]
  47. pkt_selection_fp_ucast_data : 1, // [8:8]
  48. use_flow_id_toeplitz_clfy : 1, // [7:7]
  49. lmac_peer_id_msb : 2, // [6:5]
  50. reo_destination_indication : 5; // [4:0]
  51. #endif
  52. };
  53. /* Description REO_DESTINATION_INDICATION
  54. The ID of the REO exit ring where the MSDU frame shall push
  55. after (MPDU level) reordering has finished.
  56. <enum 0 reo_destination_sw0> Reo will push the frame into
  57. the REO2SW0 ring
  58. <enum 1 reo_destination_sw1> Reo will push the frame into
  59. the REO2SW1 ring
  60. <enum 2 reo_destination_sw2> Reo will push the frame into
  61. the REO2SW2 ring
  62. <enum 3 reo_destination_sw3> Reo will push the frame into
  63. the REO2SW3 ring
  64. <enum 4 reo_destination_sw4> Reo will push the frame into
  65. the REO2SW4 ring
  66. <enum 5 reo_destination_release> Reo will push the frame
  67. into the REO_release ring
  68. <enum 6 reo_destination_fw> Reo will push the frame into
  69. the REO2FW ring
  70. <enum 7 reo_destination_sw5> Reo will push the frame into
  71. the REO2SW5 ring (REO remaps this in chips without REO2SW5
  72. ring, e.g. Pine)
  73. <enum 8 reo_destination_sw6> Reo will push the frame into
  74. the REO2SW6 ring (REO remaps this in chips without REO2SW6
  75. ring, e.g. Pine)
  76. <enum 9 reo_destination_sw7> Reo will push the frame into
  77. the REO2SW7 ring (REO remaps this in chips without REO2SW7
  78. ring)
  79. <enum 10 reo_destination_sw8> Reo will push the frame into
  80. the REO2SW8 ring (REO remaps this in chips without REO2SW8
  81. ring)
  82. <enum 11 reo_destination_11> REO remaps this
  83. <enum 12 reo_destination_12> REO remaps this <enum 13 reo_destination_13>
  84. REO remaps this
  85. <enum 14 reo_destination_14> REO remaps this
  86. <enum 15 reo_destination_15> REO remaps this
  87. <enum 16 reo_destination_16> REO remaps this
  88. <enum 17 reo_destination_17> REO remaps this
  89. <enum 18 reo_destination_18> REO remaps this
  90. <enum 19 reo_destination_19> REO remaps this
  91. <enum 20 reo_destination_20> REO remaps this
  92. <enum 21 reo_destination_21> REO remaps this
  93. <enum 22 reo_destination_22> REO remaps this
  94. <enum 23 reo_destination_23> REO remaps this
  95. <enum 24 reo_destination_24> REO remaps this
  96. <enum 25 reo_destination_25> REO remaps this
  97. <enum 26 reo_destination_26> REO remaps this
  98. <enum 27 reo_destination_27> REO remaps this
  99. <enum 28 reo_destination_28> REO remaps this
  100. <enum 29 reo_destination_29> REO remaps this
  101. <enum 30 reo_destination_30> REO remaps this
  102. <enum 31 reo_destination_31> REO remaps this
  103. <legal all>
  104. */
  105. #define RXPT_CLASSIFY_INFO_REO_DESTINATION_INDICATION_OFFSET 0x00000000
  106. #define RXPT_CLASSIFY_INFO_REO_DESTINATION_INDICATION_LSB 0
  107. #define RXPT_CLASSIFY_INFO_REO_DESTINATION_INDICATION_MSB 4
  108. #define RXPT_CLASSIFY_INFO_REO_DESTINATION_INDICATION_MASK 0x0000001f
  109. /* Description LMAC_PEER_ID_MSB
  110. If use_flow_id_toeplitz_clfy is set and lmac_peer_id_'sb
  111. is 2'b00, Rx OLE uses a REO desination indicati'n of {1'b1,
  112. hash[3:0]} using the chosen Toeplitz hash from Common Parser
  113. if flow search fails.
  114. If use_flow_id_toeplitz_clfy is set and lmac_peer_id_msb
  115. 's not 2'b00, Rx OLE uses a REO desination indication of
  116. {lmac_peer_id_msb, hash[2:0]} using the chosen Toeplitz
  117. hash from Common Parser if flow search fails.
  118. This LMAC/peer-based routing is not supported in Hastings80
  119. and HastingsPrime.
  120. <legal all>
  121. */
  122. #define RXPT_CLASSIFY_INFO_LMAC_PEER_ID_MSB_OFFSET 0x00000000
  123. #define RXPT_CLASSIFY_INFO_LMAC_PEER_ID_MSB_LSB 5
  124. #define RXPT_CLASSIFY_INFO_LMAC_PEER_ID_MSB_MSB 6
  125. #define RXPT_CLASSIFY_INFO_LMAC_PEER_ID_MSB_MASK 0x00000060
  126. /* Description USE_FLOW_ID_TOEPLITZ_CLFY
  127. Indication to Rx OLE to enable REO destination routing based
  128. on the chosen Toeplitz hash from Common Parser, in case
  129. flow search fails
  130. <legal all>
  131. */
  132. #define RXPT_CLASSIFY_INFO_USE_FLOW_ID_TOEPLITZ_CLFY_OFFSET 0x00000000
  133. #define RXPT_CLASSIFY_INFO_USE_FLOW_ID_TOEPLITZ_CLFY_LSB 7
  134. #define RXPT_CLASSIFY_INFO_USE_FLOW_ID_TOEPLITZ_CLFY_MSB 7
  135. #define RXPT_CLASSIFY_INFO_USE_FLOW_ID_TOEPLITZ_CLFY_MASK 0x00000080
  136. /* Description PKT_SELECTION_FP_UCAST_DATA
  137. Filter pass Unicast data frame (matching rxpcu_filter_pass
  138. and sw_frame_group_Unicast_data) routing selection
  139. TODO: What about 'rxpcu_filter_pass_monior_ovrd'?
  140. 1'b0: source and destination rings are selected from the
  141. RxOLE register settings for the packet type
  142. 1'b1: source ring and destination ring is selected from
  143. the rxdma0_source_ring_selection and rxdma0_destination_ring_selection
  144. fields in this STRUCT
  145. <legal all>
  146. */
  147. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_UCAST_DATA_OFFSET 0x00000000
  148. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_UCAST_DATA_LSB 8
  149. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_UCAST_DATA_MSB 8
  150. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_UCAST_DATA_MASK 0x00000100
  151. /* Description PKT_SELECTION_FP_MCAST_DATA
  152. Filter pass Multicast data frame (matching rxpcu_filter_pass
  153. and sw_frame_group_Multicast_data) routing selection
  154. TODO: What about 'rxpcu_filter_pass_monior_ovrd'?
  155. 1'b0: source and destination rings are selected from the
  156. RxOLE register settings for the packet type
  157. 1'b1: source ring and destination ring is selected from
  158. the rxdma0_source_ring_selection and rxdma0_destination_ring_selection
  159. fields in this STRUCT
  160. <legal all>
  161. */
  162. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_MCAST_DATA_OFFSET 0x00000000
  163. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_MCAST_DATA_LSB 9
  164. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_MCAST_DATA_MSB 9
  165. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_MCAST_DATA_MASK 0x00000200
  166. /* Description PKT_SELECTION_FP_1000
  167. Filter pass BAR frame (matching rxpcu_filter_pass and sw_frame_group_ctrl_1000)
  168. routing selection
  169. TODO: What about 'rxpcu_filter_pass_monior_ovrd'?
  170. 1'b0: source and destination rings are selected from the
  171. RxOLE register settings for the packet type
  172. 1'b1: source ring and destination ring is selected from
  173. the rxdma0_source_ring_selection and rxdma0_destination_ring_selection
  174. fields in this STRUCT
  175. <legal all>
  176. */
  177. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_1000_OFFSET 0x00000000
  178. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_1000_LSB 10
  179. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_1000_MSB 10
  180. #define RXPT_CLASSIFY_INFO_PKT_SELECTION_FP_1000_MASK 0x00000400
  181. /* Description RXDMA0_SOURCE_RING_SELECTION
  182. Field only valid when for the received frame type the corresponding
  183. pkt_selection_fp_... bit is set
  184. <enum 0 sw2rxdma0_0_buf_source_ring> The data buffer for
  185. this frame shall be sourced by sw2rxdma0 buffer source
  186. ring.
  187. <enum 1 fw2rxdma0_pmac0_buf_source_ring> The data buffer
  188. for this frame shall be sourced by fw2rxdma buffer source
  189. ring for PMAC0.
  190. <enum 2 sw2rxdma0_1_buf_source_ring> The data buffer for
  191. this frame shall be sourced by sw2rxdma1 buffer source
  192. ring.
  193. <enum 3 no_buffer_rxdma0_ring> The frame shall not be written
  194. to any data buffer.
  195. <enum 4 sw2rxdma0_exception_buf_source_ring> The data buffer
  196. for this frame shall be sourced by sw2rxdma_exception buffer
  197. source ring.
  198. <enum 5 fw2rxdma0_pmac1_buf_source_ring> The data buffer
  199. for this frame shall be sourced by fw2rxdma buffer source
  200. ring for PMAC1.
  201. <legal 0-5>
  202. */
  203. #define RXPT_CLASSIFY_INFO_RXDMA0_SOURCE_RING_SELECTION_OFFSET 0x00000000
  204. #define RXPT_CLASSIFY_INFO_RXDMA0_SOURCE_RING_SELECTION_LSB 11
  205. #define RXPT_CLASSIFY_INFO_RXDMA0_SOURCE_RING_SELECTION_MSB 13
  206. #define RXPT_CLASSIFY_INFO_RXDMA0_SOURCE_RING_SELECTION_MASK 0x00003800
  207. /* Description RXDMA0_DESTINATION_RING_SELECTION
  208. Field only valid when for the received frame type the corresponding
  209. pkt_selection_fp_... bit is set
  210. <enum 0 rxdma_release_ring> RXDMA0 shall push the frame
  211. to the Release ring. Effectively this means the frame needs
  212. to be dropped.
  213. <enum 1 rxdma2fw_pmac0_ring> RXDMA0 shall push the frame
  214. to the FW ring for PMAC0.
  215. <enum 2 rxdma2sw_ring> RXDMA0 shall push the frame to the
  216. SW ring.
  217. <enum 3 rxdma2reo_ring> RXDMA0 shall push the frame to
  218. the REO entrance ring.
  219. <enum 4 rxdma2fw_pmac1_ring> RXDMA0 shall push the frame
  220. to the FW ring for PMAC1.
  221. <enum 5 rxdma2reo_remote0_ring> RXDMA0 shall push the frame
  222. to the first MLO REO entrance ring.
  223. <enum 6 rxdma2reo_remote1_ring> RXDMA0 shall push the frame
  224. to the second MLO REO entrance ring.
  225. <legal 0-6>
  226. */
  227. #define RXPT_CLASSIFY_INFO_RXDMA0_DESTINATION_RING_SELECTION_OFFSET 0x00000000
  228. #define RXPT_CLASSIFY_INFO_RXDMA0_DESTINATION_RING_SELECTION_LSB 14
  229. #define RXPT_CLASSIFY_INFO_RXDMA0_DESTINATION_RING_SELECTION_MSB 16
  230. #define RXPT_CLASSIFY_INFO_RXDMA0_DESTINATION_RING_SELECTION_MASK 0x0001c000
  231. /* Description MCAST_ECHO_DROP_ENABLE
  232. If set, for multicast packets, multicast echo check (i.e.
  233. SA search with mcast_echo_check = 1) shall be performed
  234. by RXOLE, and any multicast echo packets should be indicated
  235. to RXDMA for release to WBM
  236. <legal all>
  237. */
  238. #define RXPT_CLASSIFY_INFO_MCAST_ECHO_DROP_ENABLE_OFFSET 0x00000000
  239. #define RXPT_CLASSIFY_INFO_MCAST_ECHO_DROP_ENABLE_LSB 17
  240. #define RXPT_CLASSIFY_INFO_MCAST_ECHO_DROP_ENABLE_MSB 17
  241. #define RXPT_CLASSIFY_INFO_MCAST_ECHO_DROP_ENABLE_MASK 0x00020000
  242. /* Description WDS_LEARNING_DETECT_EN
  243. If set, WDS learning detection based on SA search and notification
  244. to FW (using RXDMA0 status ring) is enabled and the "timestamp"
  245. field in address search failure cache-only entry should
  246. be used to avoid multiple WDS learning notifications.
  247. <legal all>
  248. */
  249. #define RXPT_CLASSIFY_INFO_WDS_LEARNING_DETECT_EN_OFFSET 0x00000000
  250. #define RXPT_CLASSIFY_INFO_WDS_LEARNING_DETECT_EN_LSB 18
  251. #define RXPT_CLASSIFY_INFO_WDS_LEARNING_DETECT_EN_MSB 18
  252. #define RXPT_CLASSIFY_INFO_WDS_LEARNING_DETECT_EN_MASK 0x00040000
  253. /* Description INTRABSS_CHECK_EN
  254. If set, intra-BSS routing detection is enabled
  255. <legal all>
  256. */
  257. #define RXPT_CLASSIFY_INFO_INTRABSS_CHECK_EN_OFFSET 0x00000000
  258. #define RXPT_CLASSIFY_INFO_INTRABSS_CHECK_EN_LSB 19
  259. #define RXPT_CLASSIFY_INFO_INTRABSS_CHECK_EN_MSB 19
  260. #define RXPT_CLASSIFY_INFO_INTRABSS_CHECK_EN_MASK 0x00080000
  261. /* Description USE_PPE
  262. Indicates to RXDMA to ignore the REO_destination_indication
  263. and use a programmed value corresponding to the REO2PPE
  264. ring
  265. This override to REO2PPE for packets requiring multiple
  266. buffers shall be disabled based on an RXDMA configuration,
  267. as PPE may not support such packets.
  268. Supported only in full AP chips like Waikiki, not in client/soft
  269. AP chips like Hamilton
  270. <legal all>
  271. */
  272. #define RXPT_CLASSIFY_INFO_USE_PPE_OFFSET 0x00000000
  273. #define RXPT_CLASSIFY_INFO_USE_PPE_LSB 20
  274. #define RXPT_CLASSIFY_INFO_USE_PPE_MSB 20
  275. #define RXPT_CLASSIFY_INFO_USE_PPE_MASK 0x00100000
  276. /* Description PPE_ROUTING_ENABLE
  277. Global enable/disable bit for routing to PPE, used to disable
  278. PPE routing even if RXOLE CCE or flow search indicate 'Use_PPE'
  279. This is set by SW for peers which are being handled by a
  280. host SW/accelerator subsystem that also handles packet
  281. buffer management for WiFi-to-PPE routing.
  282. This is cleared by SW for peers which are being handled
  283. by a different subsystem, completely disabling WiFi-to-PPE
  284. routing for such peers.
  285. <legal all>
  286. */
  287. #define RXPT_CLASSIFY_INFO_PPE_ROUTING_ENABLE_OFFSET 0x00000000
  288. #define RXPT_CLASSIFY_INFO_PPE_ROUTING_ENABLE_LSB 21
  289. #define RXPT_CLASSIFY_INFO_PPE_ROUTING_ENABLE_MSB 21
  290. #define RXPT_CLASSIFY_INFO_PPE_ROUTING_ENABLE_MASK 0x00200000
  291. /* Description RESERVED_0B
  292. <legal 0>
  293. */
  294. #define RXPT_CLASSIFY_INFO_RESERVED_0B_OFFSET 0x00000000
  295. #define RXPT_CLASSIFY_INFO_RESERVED_0B_LSB 22
  296. #define RXPT_CLASSIFY_INFO_RESERVED_0B_MSB 31
  297. #define RXPT_CLASSIFY_INFO_RESERVED_0B_MASK 0xffc00000
  298. #endif // RXPT_CLASSIFY_INFO