hal_9224.h 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114
  1. /*
  2. * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #include "qdf_types.h"
  20. #include "qdf_util.h"
  21. #include "qdf_mem.h"
  22. #include "qdf_nbuf.h"
  23. #include "qdf_module.h"
  24. #include "target_type.h"
  25. #include "wcss_version.h"
  26. #include "hal_be_hw_headers.h"
  27. #include "hal_internal.h"
  28. #include "hal_api.h"
  29. #include "hal_flow.h"
  30. #include "rx_flow_search_entry.h"
  31. #include "hal_rx_flow_info.h"
  32. #include "hal_be_api.h"
  33. #include "tcl_entrance_from_ppe_ring.h"
  34. #include "sw_monitor_ring.h"
  35. #include "wcss_seq_hwioreg_umac.h"
  36. #include "wfss_ce_reg_seq_hwioreg.h"
  37. #include <uniform_reo_status_header.h>
  38. #include <wbm_release_ring_tx.h>
  39. #include <phyrx_location.h>
  40. #ifdef QCA_MONITOR_2_0_SUPPORT
  41. #include <mon_ingress_ring.h>
  42. #include <mon_destination_ring.h>
  43. #endif
  44. #include "rx_reo_queue_1k.h"
  45. #include <hal_be_rx.h>
  46. #define UNIFIED_RX_MPDU_START_0_RX_MPDU_INFO_RX_MPDU_INFO_DETAILS_OFFSET \
  47. RX_MPDU_START_RX_MPDU_INFO_DETAILS_RXPCU_MPDU_FILTER_IN_CATEGORY_OFFSET
  48. #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
  49. RX_MSDU_LINK_MSDU_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET
  50. #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
  51. RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET
  52. #define UNIFIED_RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
  53. RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
  54. #define UNIFIED_REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
  55. REO_DESTINATION_RING_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
  56. #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER \
  57. STATUS_HEADER_REO_STATUS_NUMBER
  58. #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC \
  59. STATUS_HEADER_TIMESTAMP
  60. #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
  61. RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET
  62. #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
  63. RX_MSDU_LINK_MSDU_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET
  64. #define UNIFIED_TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
  65. TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET
  66. #define UNIFIED_TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
  67. TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET
  68. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET \
  69. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_OFFSET
  70. #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB \
  71. BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB
  72. #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK \
  73. BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK
  74. #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB \
  75. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB
  76. #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK \
  77. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK
  78. #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB \
  79. BUFFER_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB
  80. #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK \
  81. BUFFER_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK
  82. #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB \
  83. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_LSB
  84. #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK \
  85. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_MASK
  86. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB \
  87. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_LSB
  88. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK \
  89. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MASK
  90. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK \
  91. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_MASK
  92. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET \
  93. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_OFFSET
  94. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB \
  95. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_LSB
  96. #include "hal_be_api_mon.h"
  97. #ifdef CONFIG_WIFI_EMULATION_WIFI_3_0
  98. #define CMEM_REG_BASE 0x0010e000
  99. #define CMEM_WINDOW_ADDRESS_9224 \
  100. ((CMEM_REG_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  101. #endif
  102. #define CE_WINDOW_ADDRESS_9224 \
  103. ((CE_WFSS_CE_REG_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  104. #define UMAC_WINDOW_ADDRESS_9224 \
  105. ((UMAC_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  106. #ifdef CONFIG_WIFI_EMULATION_WIFI_3_0
  107. #define WINDOW_CONFIGURATION_VALUE_9224 \
  108. ((CE_WINDOW_ADDRESS_9224 << 6) |\
  109. (UMAC_WINDOW_ADDRESS_9224 << 12) | \
  110. CMEM_WINDOW_ADDRESS_9224 | \
  111. WINDOW_ENABLE_BIT)
  112. #else
  113. #define WINDOW_CONFIGURATION_VALUE_9224 \
  114. ((CE_WINDOW_ADDRESS_9224 << 6) |\
  115. (UMAC_WINDOW_ADDRESS_9224 << 12) | \
  116. WINDOW_ENABLE_BIT)
  117. #endif
  118. /* For Berryllium sw2rxdma ring size increased to 20 bits */
  119. #define HAL_RXDMA_MAX_RING_SIZE_BE 0xFFFFF
  120. #ifdef CONFIG_WORD_BASED_TLV
  121. #ifndef BIG_ENDIAN_HOST
  122. struct rx_msdu_end_compact_qca9224 {
  123. uint32_t rxpcu_mpdu_filter_in_category : 2, // [1:0]
  124. sw_frame_group_id : 7, // [8:2]
  125. reserved_0 : 7, // [15:9]
  126. phy_ppdu_id : 16; // [31:16]
  127. uint32_t ip_hdr_chksum : 16, // [15:0]
  128. reported_mpdu_length : 14, // [29:16]
  129. reserved_1a : 2; // [31:30]
  130. uint32_t key_id_octet : 8, // [7:0]
  131. cce_super_rule : 6, // [13:8]
  132. cce_classify_not_done_truncate : 1, // [14:14]
  133. cce_classify_not_done_cce_dis : 1, // [15:15]
  134. cumulative_l3_checksum : 16; // [31:16]
  135. uint32_t rule_indication_31_0 : 32; // [31:0]
  136. uint32_t rule_indication_63_32 : 32; // [31:0]
  137. uint32_t da_offset : 6, // [5:0]
  138. sa_offset : 6, // [11:6]
  139. da_offset_valid : 1, // [12:12]
  140. sa_offset_valid : 1, // [13:13]
  141. reserved_5a : 2, // [15:14]
  142. l3_type : 16; // [31:16]
  143. uint32_t ipv6_options_crc : 32; // [31:0]
  144. uint32_t tcp_seq_number : 32; // [31:0]
  145. uint32_t tcp_ack_number : 32; // [31:0]
  146. uint32_t tcp_flag : 9, // [8:0]
  147. lro_eligible : 1, // [9:9]
  148. reserved_9a : 6, // [15:10]
  149. window_size : 16; // [31:16]
  150. uint32_t tcp_udp_chksum : 16, // [15:0]
  151. sa_idx_timeout : 1, // [16:16]
  152. da_idx_timeout : 1, // [17:17]
  153. msdu_limit_error : 1, // [18:18]
  154. flow_idx_timeout : 1, // [19:19]
  155. flow_idx_invalid : 1, // [20:20]
  156. wifi_parser_error : 1, // [21:21]
  157. amsdu_parser_error : 1, // [22:22]
  158. sa_is_valid : 1, // [23:23]
  159. da_is_valid : 1, // [24:24]
  160. da_is_mcbc : 1, // [25:25]
  161. l3_header_padding : 2, // [27:26]
  162. first_msdu : 1, // [28:28]
  163. last_msdu : 1, // [29:29]
  164. tcp_udp_chksum_fail_copy : 1, // [30:30]
  165. ip_chksum_fail_copy : 1; // [31:31]
  166. uint32_t sa_idx : 16, // [15:0]
  167. da_idx_or_sw_peer_id : 16; // [31:16]
  168. uint32_t msdu_drop : 1, // [0:0]
  169. reo_destination_indication : 5, // [5:1]
  170. flow_idx : 20, // [25:6]
  171. use_ppe : 1, // [26:26]
  172. reserved_12a : 5; // [31:27]
  173. uint32_t fse_metadata : 32; // [31:0]
  174. uint32_t cce_metadata : 16, // [15:0]
  175. sa_sw_peer_id : 16; // [31:16]
  176. uint32_t aggregation_count : 8, // [7:0]
  177. flow_aggregation_continuation : 1, // [8:8]
  178. fisa_timeout : 1, // [9:9]
  179. reserved_15a : 22; // [31:10]
  180. uint32_t cumulative_l4_checksum : 16, // [15:0]
  181. cumulative_ip_length : 16; // [31:16]
  182. uint32_t reserved_17a : 6, // [5:0]
  183. service_code : 9, // [14:6]
  184. priority_valid : 1, // [15:15]
  185. intra_bss : 1, // [16:16]
  186. dest_chip_id : 2, // [18:17]
  187. multicast_echo : 1, // [19:19]
  188. wds_learning_event : 1, // [20:20]
  189. wds_roaming_event : 1, // [21:21]
  190. wds_keep_alive_event : 1, // [22:22]
  191. reserved_17b : 9; // [31:23]
  192. uint32_t msdu_length : 14, // [13:0]
  193. stbc : 1, // [14:14]
  194. ipsec_esp : 1, // [15:15]
  195. l3_offset : 7, // [22:16]
  196. ipsec_ah : 1, // [23:23]
  197. l4_offset : 8; // [31:24]
  198. uint32_t msdu_number : 8, // [7:0]
  199. decap_format : 2, // [9:8]
  200. ipv4_proto : 1, // [10:10]
  201. ipv6_proto : 1, // [11:11]
  202. tcp_proto : 1, // [12:12]
  203. udp_proto : 1, // [13:13]
  204. ip_frag : 1, // [14:14]
  205. tcp_only_ack : 1, // [15:15]
  206. da_is_bcast_mcast : 1, // [16:16]
  207. toeplitz_hash_sel : 2, // [18:17]
  208. ip_fixed_header_valid : 1, // [19:19]
  209. ip_extn_header_valid : 1, // [20:20]
  210. tcp_udp_header_valid : 1, // [21:21]
  211. mesh_control_present : 1, // [22:22]
  212. ldpc : 1, // [23:23]
  213. ip4_protocol_ip6_next_header : 8; // [31:24]
  214. uint32_t toeplitz_hash_2_or_4 : 32; // [31:0]
  215. uint32_t flow_id_toeplitz : 32; // [31:0]
  216. uint32_t user_rssi : 8, // [7:0]
  217. pkt_type : 4, // [11:8]
  218. sgi : 2, // [13:12]
  219. rate_mcs : 4, // [17:14]
  220. receive_bandwidth : 3, // [20:18]
  221. reception_type : 3, // [23:21]
  222. mimo_ss_bitmap : 8; // [31:24]
  223. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  224. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  225. uint32_t sw_phy_meta_data : 32; // [31:0]
  226. uint32_t vlan_ctag_ci : 16, // [15:0]
  227. vlan_stag_ci : 16; // [31:16]
  228. uint32_t reserved_27a : 32; // [31:0]
  229. uint32_t reserved_28a : 32; // [31:0]
  230. uint32_t reserved_29a : 32; // [31:0]
  231. uint32_t first_mpdu : 1, // [0:0]
  232. reserved_30a : 1, // [1:1]
  233. mcast_bcast : 1, // [2:2]
  234. ast_index_not_found : 1, // [3:3]
  235. ast_index_timeout : 1, // [4:4]
  236. power_mgmt : 1, // [5:5]
  237. non_qos : 1, // [6:6]
  238. null_data : 1, // [7:7]
  239. mgmt_type : 1, // [8:8]
  240. ctrl_type : 1, // [9:9]
  241. more_data : 1, // [10:10]
  242. eosp : 1, // [11:11]
  243. a_msdu_error : 1, // [12:12]
  244. fragment_flag : 1, // [13:13]
  245. order : 1, // [14:14]
  246. cce_match : 1, // [15:15]
  247. overflow_err : 1, // [16:16]
  248. msdu_length_err : 1, // [17:17]
  249. tcp_udp_chksum_fail : 1, // [18:18]
  250. ip_chksum_fail : 1, // [19:19]
  251. sa_idx_invalid : 1, // [20:20]
  252. da_idx_invalid : 1, // [21:21]
  253. reserved_30b : 1, // [22:22]
  254. rx_in_tx_decrypt_byp : 1, // [23:23]
  255. encrypt_required : 1, // [24:24]
  256. directed : 1, // [25:25]
  257. buffer_fragment : 1, // [26:26]
  258. mpdu_length_err : 1, // [27:27]
  259. tkip_mic_err : 1, // [28:28]
  260. decrypt_err : 1, // [29:29]
  261. unencrypted_frame_err : 1, // [30:30]
  262. fcs_err : 1; // [31:31]
  263. uint32_t reserved_31a : 10, // [9:0]
  264. decrypt_status_code : 3, // [12:10]
  265. rx_bitmap_not_updated : 1, // [13:13]
  266. reserved_31b : 17, // [30:14]
  267. msdu_done : 1; // [31:31]
  268. };
  269. struct rx_mpdu_start_compact_qca9224 {
  270. struct rxpt_classify_info rxpt_classify_info_details;
  271. uint32_t rx_reo_queue_desc_addr_31_0 : 32; // [31:0]
  272. uint32_t rx_reo_queue_desc_addr_39_32 : 8, // [7:0]
  273. receive_queue_number : 16, // [23:8]
  274. pre_delim_err_warning : 1, // [24:24]
  275. first_delim_err : 1, // [25:25]
  276. reserved_2a : 6; // [31:26]
  277. uint32_t pn_31_0 : 32; // [31:0]
  278. uint32_t pn_63_32 : 32; // [31:0]
  279. uint32_t pn_95_64 : 32; // [31:0]
  280. uint32_t pn_127_96 : 32; // [31:0]
  281. uint32_t epd_en : 1, // [0:0]
  282. all_frames_shall_be_encrypted : 1, // [1:1]
  283. encrypt_type : 4, // [5:2]
  284. wep_key_width_for_variable_key : 2, // [7:6]
  285. mesh_sta : 2, // [9:8]
  286. bssid_hit : 1, // [10:10]
  287. bssid_number : 4, // [14:11]
  288. tid : 4, // [18:15]
  289. reserved_7a : 13; // [31:19]
  290. uint32_t peer_meta_data : 32; // [31:0]
  291. uint32_t rxpcu_mpdu_filter_in_category : 2, // [1:0]
  292. sw_frame_group_id : 7, // [8:2]
  293. ndp_frame : 1, // [9:9]
  294. phy_err : 1, // [10:10]
  295. phy_err_during_mpdu_header : 1, // [11:11]
  296. protocol_version_err : 1, // [12:12]
  297. ast_based_lookup_valid : 1, // [13:13]
  298. ranging : 1, // [14:14]
  299. reserved_9a : 1, // [15:15]
  300. phy_ppdu_id : 16; // [31:16]
  301. uint32_t ast_index : 16, // [15:0]
  302. sw_peer_id : 16; // [31:16]
  303. uint32_t mpdu_frame_control_valid : 1, // [0:0]
  304. mpdu_duration_valid : 1, // [1:1]
  305. mac_addr_ad1_valid : 1, // [2:2]
  306. mac_addr_ad2_valid : 1, // [3:3]
  307. mac_addr_ad3_valid : 1, // [4:4]
  308. mac_addr_ad4_valid : 1, // [5:5]
  309. mpdu_sequence_control_valid : 1, // [6:6]
  310. mpdu_qos_control_valid : 1, // [7:7]
  311. mpdu_ht_control_valid : 1, // [8:8]
  312. frame_encryption_info_valid : 1, // [9:9]
  313. mpdu_fragment_number : 4, // [13:10]
  314. more_fragment_flag : 1, // [14:14]
  315. reserved_11a : 1, // [15:15]
  316. fr_ds : 1, // [16:16]
  317. to_ds : 1, // [17:17]
  318. encrypted : 1, // [18:18]
  319. mpdu_retry : 1, // [19:19]
  320. mpdu_sequence_number : 12; // [31:20]
  321. uint32_t key_id_octet : 8, // [7:0]
  322. new_peer_entry : 1, // [8:8]
  323. decrypt_needed : 1, // [9:9]
  324. decap_type : 2, // [11:10]
  325. rx_insert_vlan_c_tag_padding : 1, // [12:12]
  326. rx_insert_vlan_s_tag_padding : 1, // [13:13]
  327. strip_vlan_c_tag_decap : 1, // [14:14]
  328. strip_vlan_s_tag_decap : 1, // [15:15]
  329. pre_delim_count : 12, // [27:16]
  330. ampdu_flag : 1, // [28:28]
  331. bar_frame : 1, // [29:29]
  332. raw_mpdu : 1, // [30:30]
  333. reserved_12 : 1; // [31:31]
  334. uint32_t mpdu_length : 14, // [13:0]
  335. first_mpdu : 1, // [14:14]
  336. mcast_bcast : 1, // [15:15]
  337. ast_index_not_found : 1, // [16:16]
  338. ast_index_timeout : 1, // [17:17]
  339. power_mgmt : 1, // [18:18]
  340. non_qos : 1, // [19:19]
  341. null_data : 1, // [20:20]
  342. mgmt_type : 1, // [21:21]
  343. ctrl_type : 1, // [22:22]
  344. more_data : 1, // [23:23]
  345. eosp : 1, // [24:24]
  346. fragment_flag : 1, // [25:25]
  347. order : 1, // [26:26]
  348. u_apsd_trigger : 1, // [27:27]
  349. encrypt_required : 1, // [28:28]
  350. directed : 1, // [29:29]
  351. amsdu_present : 1, // [30:30]
  352. reserved_13 : 1; // [31:31]
  353. uint32_t mpdu_frame_control_field : 16, // [15:0]
  354. mpdu_duration_field : 16; // [31:16]
  355. uint32_t mac_addr_ad1_31_0 : 32; // [31:0]
  356. uint32_t mac_addr_ad1_47_32 : 16, // [15:0]
  357. mac_addr_ad2_15_0 : 16; // [31:16]
  358. uint32_t mac_addr_ad2_47_16 : 32; // [31:0]
  359. uint32_t mac_addr_ad3_31_0 : 32; // [31:0]
  360. uint32_t mac_addr_ad3_47_32 : 16, // [15:0]
  361. mpdu_sequence_control_field : 16; // [31:16]
  362. uint32_t mac_addr_ad4_31_0 : 32; // [31:0]
  363. uint32_t mac_addr_ad4_47_32 : 16, // [15:0]
  364. mpdu_qos_control_field : 16; // [31:16]
  365. uint32_t mpdu_ht_control_field : 32; // [31:0]
  366. uint32_t vdev_id : 8, // [7:0]
  367. service_code : 9, // [16:8]
  368. priority_valid : 1, // [17:17]
  369. src_info : 12, // [29:18]
  370. reserved_23a : 1, // [30:30]
  371. multi_link_addr_ad1_ad2_valid : 1; // [31:31]
  372. uint32_t multi_link_addr_ad1_31_0 : 32; // [31:0]
  373. uint32_t multi_link_addr_ad1_47_32 : 16, // [15:0]
  374. multi_link_addr_ad2_15_0 : 16; // [31:16]
  375. uint32_t multi_link_addr_ad2_47_16 : 32; // [31:0]
  376. uint32_t reserved_27a : 32; // [31:0]
  377. uint32_t reserved_28a : 32; // [31:0]
  378. uint32_t reserved_29a : 32; // [31:0]
  379. };
  380. #else
  381. struct rx_msdu_end_compact_qca9224 {
  382. uint32_t phy_ppdu_id : 16, // [31:16]
  383. reserved_0 : 7, // [15:9]
  384. sw_frame_group_id : 7, // [8:2]
  385. rxpcu_mpdu_filter_in_category : 2; // [1:0]
  386. uint32_t reserved_1a : 2, // [31:30]
  387. reported_mpdu_length : 14, // [29:16]
  388. ip_hdr_chksum : 16; // [15:0]
  389. uint32_t cumulative_l3_checksum : 16, // [31:16]
  390. cce_classify_not_done_cce_dis : 1, // [15:15]
  391. cce_classify_not_done_truncate : 1, // [14:14]
  392. cce_super_rule : 6, // [13:8]
  393. key_id_octet : 8; // [7:0]
  394. uint32_t rule_indication_31_0 : 32; // [31:0]
  395. uint32_t rule_indication_63_32 : 32; // [31:0]
  396. uint32_t l3_type : 16, // [31:16]
  397. reserved_5a : 2, // [15:14]
  398. sa_offset_valid : 1, // [13:13]
  399. da_offset_valid : 1, // [12:12]
  400. sa_offset : 6, // [11:6]
  401. da_offset : 6; // [5:0]
  402. uint32_t ipv6_options_crc : 32; // [31:0]
  403. uint32_t tcp_seq_number : 32; // [31:0]
  404. uint32_t tcp_ack_number : 32; // [31:0]
  405. uint32_t window_size : 16, // [31:16]
  406. reserved_9a : 6, // [15:10]
  407. lro_eligible : 1, // [9:9]
  408. tcp_flag : 9; // [8:0]
  409. uint32_t ip_chksum_fail_copy : 1, // [31:31]
  410. tcp_udp_chksum_fail_copy : 1, // [30:30]
  411. last_msdu : 1, // [29:29]
  412. first_msdu : 1, // [28:28]
  413. l3_header_padding : 2, // [27:26]
  414. da_is_mcbc : 1, // [25:25]
  415. da_is_valid : 1, // [24:24]
  416. sa_is_valid : 1, // [23:23]
  417. amsdu_parser_error : 1, // [22:22]
  418. wifi_parser_error : 1, // [21:21]
  419. flow_idx_invalid : 1, // [20:20]
  420. flow_idx_timeout : 1, // [19:19]
  421. msdu_limit_error : 1, // [18:18]
  422. da_idx_timeout : 1, // [17:17]
  423. sa_idx_timeout : 1, // [16:16]
  424. tcp_udp_chksum : 16; // [15:0]
  425. uint32_t da_idx_or_sw_peer_id : 16, // [31:16]
  426. sa_idx : 16; // [15:0]
  427. uint32_t reserved_12a : 5, // [31:27]
  428. use_ppe : 1, // [26:26]
  429. flow_idx : 20, // [25:6]
  430. reo_destination_indication : 5, // [5:1]
  431. msdu_drop : 1; // [0:0]
  432. uint32_t fse_metadata : 32; // [31:0]
  433. uint32_t sa_sw_peer_id : 16, // [31:16]
  434. cce_metadata : 16; // [15:0]
  435. uint32_t reserved_15a : 22, // [31:10]
  436. fisa_timeout : 1, // [9:9]
  437. flow_aggregation_continuation : 1, // [8:8]
  438. aggregation_count : 8; // [7:0]
  439. uint32_t cumulative_ip_length : 16, // [31:16]
  440. cumulative_l4_checksum : 16; // [15:0]
  441. uint32_t reserved_17b : 9, // [31:23]
  442. wds_keep_alive_event : 1, // [22:22]
  443. wds_roaming_event : 1, // [21:21]
  444. wds_learning_event : 1, // [20:20]
  445. multicast_echo : 1, // [19:19]
  446. dest_chip_id : 2, // [18:17]
  447. intra_bss : 1, // [16:16]
  448. priority_valid : 1, // [15:15]
  449. service_code : 9, // [14:6]
  450. reserved_17a : 6; // [5:0]
  451. uint32_t l4_offset : 8, // [31:24]
  452. ipsec_ah : 1, // [23:23]
  453. l3_offset : 7, // [22:16]
  454. ipsec_esp : 1, // [15:15]
  455. stbc : 1, // [14:14]
  456. msdu_length : 14; // [13:0]
  457. uint32_t ip4_protocol_ip6_next_header : 8, // [31:24]
  458. ldpc : 1, // [23:23]
  459. mesh_control_present : 1, // [22:22]
  460. tcp_udp_header_valid : 1, // [21:21]
  461. ip_extn_header_valid : 1, // [20:20]
  462. ip_fixed_header_valid : 1, // [19:19]
  463. toeplitz_hash_sel : 2, // [18:17]
  464. da_is_bcast_mcast : 1, // [16:16]
  465. tcp_only_ack : 1, // [15:15]
  466. ip_frag : 1, // [14:14]
  467. udp_proto : 1, // [13:13]
  468. tcp_proto : 1, // [12:12]
  469. ipv6_proto : 1, // [11:11]
  470. ipv4_proto : 1, // [10:10]
  471. decap_format : 2, // [9:8]
  472. msdu_number : 8; // [7:0]
  473. uint32_t toeplitz_hash_2_or_4 : 32; // [31:0]
  474. uint32_t flow_id_toeplitz : 32; // [31:0]
  475. uint32_t mimo_ss_bitmap : 8, // [31:24]
  476. reception_type : 3, // [23:21]
  477. receive_bandwidth : 3, // [20:18]
  478. rate_mcs : 4, // [17:14]
  479. sgi : 2, // [13:12]
  480. pkt_type : 4, // [11:8]
  481. user_rssi : 8; // [7:0]
  482. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  483. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  484. uint32_t sw_phy_meta_data : 32; // [31:0]
  485. uint32_t vlan_stag_ci : 16, // [31:16]
  486. vlan_ctag_ci : 16; // [15:0]
  487. uint32_t reserved_27a : 32; // [31:0]
  488. uint32_t reserved_28a : 32; // [31:0]
  489. uint32_t reserved_29a : 32; // [31:0]
  490. uint32_t fcs_err : 1, // [31:31]
  491. unencrypted_frame_err : 1, // [30:30]
  492. decrypt_err : 1, // [29:29]
  493. tkip_mic_err : 1, // [28:28]
  494. mpdu_length_err : 1, // [27:27]
  495. buffer_fragment : 1, // [26:26]
  496. directed : 1, // [25:25]
  497. encrypt_required : 1, // [24:24]
  498. rx_in_tx_decrypt_byp : 1, // [23:23]
  499. reserved_30b : 1, // [22:22]
  500. da_idx_invalid : 1, // [21:21]
  501. sa_idx_invalid : 1, // [20:20]
  502. ip_chksum_fail : 1, // [19:19]
  503. tcp_udp_chksum_fail : 1, // [18:18]
  504. msdu_length_err : 1, // [17:17]
  505. overflow_err : 1, // [16:16]
  506. cce_match : 1, // [15:15]
  507. order : 1, // [14:14]
  508. fragment_flag : 1, // [13:13]
  509. a_msdu_error : 1, // [12:12]
  510. eosp : 1, // [11:11]
  511. more_data : 1, // [10:10]
  512. ctrl_type : 1, // [9:9]
  513. mgmt_type : 1, // [8:8]
  514. null_data : 1, // [7:7]
  515. non_qos : 1, // [6:6]
  516. power_mgmt : 1, // [5:5]
  517. ast_index_timeout : 1, // [4:4]
  518. ast_index_not_found : 1, // [3:3]
  519. mcast_bcast : 1, // [2:2]
  520. reserved_30a : 1, // [1:1]
  521. first_mpdu : 1; // [0:0]
  522. uint32_t msdu_done : 1, // [31:31]
  523. reserved_31b : 17, // [30:14]
  524. rx_bitmap_not_updated : 1, // [13:13]
  525. decrypt_status_code : 3, // [12:10]
  526. reserved_31a : 10; // [9:0]
  527. };
  528. struct rx_mpdu_start_compact_qca9224 {
  529. struct rxpt_classify_info rxpt_classify_info_details;
  530. uint32_t rx_reo_queue_desc_addr_31_0 : 32; // [31:0]
  531. uint32_t reserved_2a : 6, // [31:26]
  532. first_delim_err : 1, // [25:25]
  533. pre_delim_err_warning : 1, // [24:24]
  534. receive_queue_number : 16, // [23:8]
  535. rx_reo_queue_desc_addr_39_32 : 8; // [7:0]
  536. uint32_t pn_31_0 : 32; // [31:0]
  537. uint32_t pn_63_32 : 32; // [31:0]
  538. uint32_t pn_95_64 : 32; // [31:0]
  539. uint32_t pn_127_96 : 32; // [31:0]
  540. uint32_t reserved_7a : 13, // [31:19]
  541. tid : 4, // [18:15]
  542. bssid_number : 4, // [14:11]
  543. bssid_hit : 1, // [10:10]
  544. mesh_sta : 2, // [9:8]
  545. wep_key_width_for_variable_key : 2, // [7:6]
  546. encrypt_type : 4, // [5:2]
  547. all_frames_shall_be_encrypted : 1, // [1:1]
  548. epd_en : 1; // [0:0]
  549. uint32_t peer_meta_data : 32; // [31:0]
  550. uint32_t phy_ppdu_id : 16, // [31:16]
  551. reserved_9a : 1, // [15:15]
  552. ranging : 1, // [14:14]
  553. ast_based_lookup_valid : 1, // [13:13]
  554. protocol_version_err : 1, // [12:12]
  555. phy_err_during_mpdu_header : 1, // [11:11]
  556. phy_err : 1, // [10:10]
  557. ndp_frame : 1, // [9:9]
  558. sw_frame_group_id : 7, // [8:2]
  559. rxpcu_mpdu_filter_in_category : 2; // [1:0]
  560. uint32_t sw_peer_id : 16, // [31:16]
  561. ast_index : 16; // [15:0]
  562. uint32_t mpdu_sequence_number : 12, // [31:20]
  563. mpdu_retry : 1, // [19:19]
  564. encrypted : 1, // [18:18]
  565. to_ds : 1, // [17:17]
  566. fr_ds : 1, // [16:16]
  567. reserved_11a : 1, // [15:15]
  568. more_fragment_flag : 1, // [14:14]
  569. mpdu_fragment_number : 4, // [13:10]
  570. frame_encryption_info_valid : 1, // [9:9]
  571. mpdu_ht_control_valid : 1, // [8:8]
  572. mpdu_qos_control_valid : 1, // [7:7]
  573. mpdu_sequence_control_valid : 1, // [6:6]
  574. mac_addr_ad4_valid : 1, // [5:5]
  575. mac_addr_ad3_valid : 1, // [4:4]
  576. mac_addr_ad2_valid : 1, // [3:3]
  577. mac_addr_ad1_valid : 1, // [2:2]
  578. mpdu_duration_valid : 1, // [1:1]
  579. mpdu_frame_control_valid : 1; // [0:0]
  580. uint32_t reserved_12 : 1, // [31:31]
  581. raw_mpdu : 1, // [30:30]
  582. bar_frame : 1, // [29:29]
  583. ampdu_flag : 1, // [28:28]
  584. pre_delim_count : 12, // [27:16]
  585. strip_vlan_s_tag_decap : 1, // [15:15]
  586. strip_vlan_c_tag_decap : 1, // [14:14]
  587. rx_insert_vlan_s_tag_padding : 1, // [13:13]
  588. rx_insert_vlan_c_tag_padding : 1, // [12:12]
  589. decap_type : 2, // [11:10]
  590. decrypt_needed : 1, // [9:9]
  591. new_peer_entry : 1, // [8:8]
  592. key_id_octet : 8; // [7:0]
  593. uint32_t reserved_13 : 1, // [31:31]
  594. amsdu_present : 1, // [30:30]
  595. directed : 1, // [29:29]
  596. encrypt_required : 1, // [28:28]
  597. u_apsd_trigger : 1, // [27:27]
  598. order : 1, // [26:26]
  599. fragment_flag : 1, // [25:25]
  600. eosp : 1, // [24:24]
  601. more_data : 1, // [23:23]
  602. ctrl_type : 1, // [22:22]
  603. mgmt_type : 1, // [21:21]
  604. null_data : 1, // [20:20]
  605. non_qos : 1, // [19:19]
  606. power_mgmt : 1, // [18:18]
  607. ast_index_timeout : 1, // [17:17]
  608. ast_index_not_found : 1, // [16:16]
  609. mcast_bcast : 1, // [15:15]
  610. first_mpdu : 1, // [14:14]
  611. mpdu_length : 14; // [13:0]
  612. uint32_t mpdu_duration_field : 16, // [31:16]
  613. mpdu_frame_control_field : 16; // [15:0]
  614. uint32_t mac_addr_ad1_31_0 : 32; // [31:0]
  615. uint32_t mac_addr_ad2_15_0 : 16, // [31:16]
  616. mac_addr_ad1_47_32 : 16; // [15:0]
  617. uint32_t mac_addr_ad2_47_16 : 32; // [31:0]
  618. uint32_t mac_addr_ad3_31_0 : 32; // [31:0]
  619. uint32_t mpdu_sequence_control_field : 16, // [31:16]
  620. mac_addr_ad3_47_32 : 16; // [15:0]
  621. uint32_t mac_addr_ad4_31_0 : 32; // [31:0]
  622. uint32_t mpdu_qos_control_field : 16, // [31:16]
  623. mac_addr_ad4_47_32 : 16; // [15:0]
  624. uint32_t mpdu_ht_control_field : 32; // [31:0]
  625. uint32_t multi_link_addr_ad1_ad2_valid : 1, // [31:31]
  626. reserved_23a : 1, // [30:30]
  627. src_info : 12, // [29:18]
  628. priority_valid : 1, // [17:17]
  629. service_code : 9, // [16:8]
  630. vdev_id : 8; // [7:0]
  631. uint32_t multi_link_addr_ad1_31_0 : 32; // [31:0]
  632. uint32_t multi_link_addr_ad2_15_0 : 16, // [31:16]
  633. multi_link_addr_ad1_47_32 : 16; // [15:0]
  634. uint32_t multi_link_addr_ad2_47_16 : 32; // [31:0]
  635. uint32_t reserved_27a : 32; // [31:0]
  636. uint32_t reserved_28a : 32; // [31:0]
  637. uint32_t reserved_29a : 32; // [31:0]
  638. };
  639. #endif /* BIG_ENDIAN_HOST */
  640. /* TLV struct for word based Tlv */
  641. typedef struct rx_mpdu_start_compact_qca9224 hal_rx_mpdu_start_t;
  642. typedef struct rx_msdu_end_compact_qca9224 hal_rx_msdu_end_t;
  643. #endif /* CONFIG_WORD_BASED_TLV */
  644. #include "hal_9224_rx.h"
  645. #include "hal_9224_tx.h"
  646. #include "hal_be_rx_tlv.h"
  647. #include <hal_be_generic_api.h>
  648. #define LINK_DESC_SIZE (NUM_OF_DWORDS_RX_MSDU_LINK << 2)
  649. #define HAL_PPE_VP_ENTRIES_MAX 32
  650. /**
  651. * hal_get_link_desc_size_9224(): API to get the link desc size
  652. *
  653. * Return: uint32_t
  654. */
  655. static uint32_t hal_get_link_desc_size_9224(void)
  656. {
  657. return LINK_DESC_SIZE;
  658. }
  659. /**
  660. * hal_rx_get_tlv_9224(): API to get the tlv
  661. *
  662. * @rx_tlv: TLV data extracted from the rx packet
  663. * Return: uint8_t
  664. */
  665. static uint8_t hal_rx_get_tlv_9224(void *rx_tlv)
  666. {
  667. return HAL_RX_GET(rx_tlv, PHYRX_RSSI_LEGACY, RECEIVE_BANDWIDTH);
  668. }
  669. /**
  670. * hal_rx_wbm_err_msdu_continuation_get_9224 () - API to check if WBM
  671. * msdu continuation bit is set
  672. *
  673. *@wbm_desc: wbm release ring descriptor
  674. *
  675. * Return: true if msdu continuation bit is set.
  676. */
  677. static inline
  678. uint8_t hal_rx_wbm_err_msdu_continuation_get_9224(void *wbm_desc)
  679. {
  680. uint32_t comp_desc = *(uint32_t *)(((uint8_t *)wbm_desc) +
  681. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_OFFSET);
  682. return (comp_desc &
  683. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_MASK) >>
  684. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_LSB;
  685. }
  686. #if (defined(WLAN_SA_API_ENABLE)) && (defined(QCA_WIFI_QCA9574))
  687. #define HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, evm, pilot) \
  688. (ppdu_info)->evm_info.pilot_evm[pilot] = HAL_RX_GET(rx_tlv, \
  689. PHYRX_OTHER_RECEIVE_INFO, \
  690. SU_EVM_DETAILS_##evm##_PILOT_##pilot##_EVM)
  691. static inline void
  692. hal_rx_update_su_evm_info(void *rx_tlv,
  693. void *ppdu_info_hdl)
  694. {
  695. struct hal_rx_ppdu_info *ppdu_info =
  696. (struct hal_rx_ppdu_info *)ppdu_info_hdl;
  697. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 1, 0);
  698. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 2, 1);
  699. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 3, 2);
  700. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 4, 3);
  701. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 5, 4);
  702. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 6, 5);
  703. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 7, 6);
  704. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 8, 7);
  705. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 9, 8);
  706. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 10, 9);
  707. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 11, 10);
  708. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 12, 11);
  709. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 13, 12);
  710. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 14, 13);
  711. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 15, 14);
  712. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 16, 15);
  713. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 17, 16);
  714. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 18, 17);
  715. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 19, 18);
  716. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 20, 19);
  717. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 21, 20);
  718. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 22, 21);
  719. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 23, 22);
  720. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 24, 23);
  721. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 25, 24);
  722. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 26, 25);
  723. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 27, 26);
  724. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 28, 27);
  725. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 29, 28);
  726. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 30, 29);
  727. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 31, 30);
  728. HAL_RX_UPDATE_SU_EVM_INFO(rx_tlv, ppdu_info, 32, 31);
  729. }
  730. static void hal_rx_get_evm_info(void *rx_tlv_hdr, void *ppdu_info_hdl)
  731. {
  732. struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
  733. void *rx_tlv = (uint8_t *)rx_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
  734. uint32_t tlv_tag;
  735. tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(rx_tlv_hdr);
  736. switch (tlv_tag) {
  737. case WIFIPHYRX_OTHER_RECEIVE_INFO_EVM_DETAILS_E:
  738. /* Skip TLV length to get TLV content */
  739. rx_tlv = (uint8_t *)rx_tlv + HAL_RX_TLV32_HDR_SIZE;
  740. ppdu_info->evm_info.number_of_symbols = HAL_RX_GET(rx_tlv,
  741. PHYRX_OTHER_RECEIVE_INFO,
  742. SU_EVM_DETAILS_0_NUMBER_OF_SYMBOLS);
  743. ppdu_info->evm_info.pilot_count = HAL_RX_GET(rx_tlv,
  744. PHYRX_OTHER_RECEIVE_INFO,
  745. SU_EVM_DETAILS_0_PILOT_COUNT);
  746. ppdu_info->evm_info.nss_count = HAL_RX_GET(rx_tlv,
  747. PHYRX_OTHER_RECEIVE_INFO,
  748. SU_EVM_DETAILS_0_NSS_COUNT);
  749. hal_rx_update_su_evm_info(rx_tlv, ppdu_info_hdl);
  750. break;
  751. }
  752. }
  753. #else /* WLAN_SA_API_ENABLE && QCA_WIFI_QCA9574 */
  754. static void hal_rx_get_evm_info(void *tlv_tag, void *ppdu_info_hdl)
  755. {
  756. }
  757. #endif /* WLAN_SA_API_ENABLE && QCA_WIFI_QCA9574 */
  758. /**
  759. * hal_rx_proc_phyrx_other_receive_info_tlv_9224(): API to get tlv info
  760. *
  761. * Return: uint32_t
  762. */
  763. static inline
  764. void hal_rx_proc_phyrx_other_receive_info_tlv_9224(void *rx_tlv_hdr,
  765. void *ppdu_info_hdl)
  766. {
  767. uint32_t tlv_tag, tlv_len;
  768. uint32_t temp_len, other_tlv_len, other_tlv_tag;
  769. void *rx_tlv = (uint8_t *)rx_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
  770. void *other_tlv_hdr = NULL;
  771. void *other_tlv = NULL;
  772. /* Get evm info for Smart Antenna */
  773. hal_rx_get_evm_info(rx_tlv_hdr, ppdu_info_hdl);
  774. tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(rx_tlv_hdr);
  775. tlv_len = HAL_RX_GET_USER_TLV32_LEN(rx_tlv_hdr);
  776. temp_len = 0;
  777. other_tlv_hdr = rx_tlv + HAL_RX_TLV32_HDR_SIZE;
  778. other_tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(other_tlv_hdr);
  779. other_tlv_len = HAL_RX_GET_USER_TLV32_LEN(other_tlv_hdr);
  780. temp_len += other_tlv_len;
  781. other_tlv = other_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
  782. switch (other_tlv_tag) {
  783. default:
  784. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  785. "%s unhandled TLV type: %d, TLV len:%d",
  786. __func__, other_tlv_tag, other_tlv_len);
  787. break;
  788. }
  789. }
  790. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  791. static inline
  792. void hal_rx_get_bb_info_9224(void *rx_tlv, void *ppdu_info_hdl)
  793. {
  794. struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
  795. ppdu_info->cfr_info.bb_captured_channel =
  796. HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_CHANNEL);
  797. ppdu_info->cfr_info.bb_captured_timeout =
  798. HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_TIMEOUT);
  799. ppdu_info->cfr_info.bb_captured_reason =
  800. HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_REASON);
  801. }
  802. static inline
  803. void hal_rx_get_rtt_info_9224(void *rx_tlv, void *ppdu_info_hdl)
  804. {
  805. struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
  806. ppdu_info->cfr_info.rx_location_info_valid =
  807. HAL_RX_GET_64(rx_tlv, PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  808. RX_LOCATION_INFO_VALID);
  809. ppdu_info->cfr_info.rtt_che_buffer_pointer_low32 =
  810. HAL_RX_GET_64(rx_tlv,
  811. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  812. RTT_CHE_BUFFER_POINTER_LOW32);
  813. ppdu_info->cfr_info.rtt_che_buffer_pointer_high8 =
  814. HAL_RX_GET_64(rx_tlv,
  815. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  816. RTT_CHE_BUFFER_POINTER_HIGH8);
  817. ppdu_info->cfr_info.chan_capture_status =
  818. HAL_GET_RX_LOCATION_INFO_CHAN_CAPTURE_STATUS(rx_tlv);
  819. ppdu_info->cfr_info.rx_start_ts =
  820. HAL_RX_GET_64(rx_tlv,
  821. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  822. RX_START_TS);
  823. ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t)
  824. HAL_RX_GET_64(rx_tlv,
  825. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  826. RTT_CFO_MEASUREMENT);
  827. ppdu_info->cfr_info.agc_gain_info0 =
  828. HAL_RX_GET_64(rx_tlv,
  829. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  830. GAIN_CHAIN0);
  831. ppdu_info->cfr_info.agc_gain_info0 |=
  832. (((uint32_t)HAL_RX_GET_64(rx_tlv,
  833. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  834. GAIN_CHAIN1)) << 16);
  835. ppdu_info->cfr_info.agc_gain_info1 =
  836. HAL_RX_GET_64(rx_tlv,
  837. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  838. GAIN_CHAIN2);
  839. ppdu_info->cfr_info.agc_gain_info1 |=
  840. (((uint32_t)HAL_RX_GET_64(rx_tlv,
  841. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  842. GAIN_CHAIN3)) << 16);
  843. ppdu_info->cfr_info.agc_gain_info2 = 0;
  844. ppdu_info->cfr_info.agc_gain_info3 = 0;
  845. ppdu_info->cfr_info.mcs_rate =
  846. HAL_RX_GET_64(rx_tlv,
  847. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  848. RTT_MCS_RATE);
  849. ppdu_info->cfr_info.gi_type =
  850. HAL_RX_GET_64(rx_tlv,
  851. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  852. RTT_GI_TYPE);
  853. }
  854. #endif
  855. /**
  856. * hal_rx_dump_mpdu_start_tlv_9224: dump RX mpdu_start TLV in structured
  857. * human readable format.
  858. * @mpdu_start: pointer the rx_attention TLV in pkt.
  859. * @dbg_level: log level.
  860. *
  861. * Return: void
  862. */
  863. static inline void hal_rx_dump_mpdu_start_tlv_9224(void *mpdustart,
  864. uint8_t dbg_level)
  865. {
  866. #ifdef CONFIG_WORD_BASED_TLV
  867. struct rx_mpdu_start_compact_qca9224 *mpdu_info =
  868. (struct rx_mpdu_start_compact_qca9224 *)mpdustart;
  869. #else
  870. struct rx_mpdu_start *mpdu_start = (struct rx_mpdu_start *)mpdustart;
  871. struct rx_mpdu_info *mpdu_info =
  872. (struct rx_mpdu_info *)&mpdu_start->rx_mpdu_info_details;
  873. #endif
  874. QDF_TRACE(QDF_MODULE_ID_HAL, dbg_level,
  875. "rx_mpdu_start tlv (1/5) - "
  876. "rx_reo_queue_desc_addr_31_0 :%x"
  877. "rx_reo_queue_desc_addr_39_32 :%x"
  878. "receive_queue_number:%x "
  879. "pre_delim_err_warning:%x "
  880. "first_delim_err:%x "
  881. "reserved_2a:%x "
  882. "pn_31_0:%x "
  883. "pn_63_32:%x "
  884. "pn_95_64:%x "
  885. "pn_127_96:%x "
  886. "epd_en:%x "
  887. "all_frames_shall_be_encrypted :%x"
  888. "encrypt_type:%x "
  889. "wep_key_width_for_variable_key :%x"
  890. "mesh_sta:%x "
  891. "bssid_hit:%x "
  892. "bssid_number:%x "
  893. "tid:%x "
  894. "reserved_7a:%x ",
  895. mpdu_info->rx_reo_queue_desc_addr_31_0,
  896. mpdu_info->rx_reo_queue_desc_addr_39_32,
  897. mpdu_info->receive_queue_number,
  898. mpdu_info->pre_delim_err_warning,
  899. mpdu_info->first_delim_err,
  900. mpdu_info->reserved_2a,
  901. mpdu_info->pn_31_0,
  902. mpdu_info->pn_63_32,
  903. mpdu_info->pn_95_64,
  904. mpdu_info->pn_127_96,
  905. mpdu_info->epd_en,
  906. mpdu_info->all_frames_shall_be_encrypted,
  907. mpdu_info->encrypt_type,
  908. mpdu_info->wep_key_width_for_variable_key,
  909. mpdu_info->mesh_sta,
  910. mpdu_info->bssid_hit,
  911. mpdu_info->bssid_number,
  912. mpdu_info->tid,
  913. mpdu_info->reserved_7a);
  914. QDF_TRACE(QDF_MODULE_ID_HAL, dbg_level,
  915. "rx_mpdu_start tlv (2/5) - "
  916. "ast_index:%x "
  917. "sw_peer_id:%x "
  918. "mpdu_frame_control_valid:%x "
  919. "mpdu_duration_valid:%x "
  920. "mac_addr_ad1_valid:%x "
  921. "mac_addr_ad2_valid:%x "
  922. "mac_addr_ad3_valid:%x "
  923. "mac_addr_ad4_valid:%x "
  924. "mpdu_sequence_control_valid :%x"
  925. "mpdu_qos_control_valid:%x "
  926. "mpdu_ht_control_valid:%x "
  927. "frame_encryption_info_valid :%x",
  928. mpdu_info->ast_index,
  929. mpdu_info->sw_peer_id,
  930. mpdu_info->mpdu_frame_control_valid,
  931. mpdu_info->mpdu_duration_valid,
  932. mpdu_info->mac_addr_ad1_valid,
  933. mpdu_info->mac_addr_ad2_valid,
  934. mpdu_info->mac_addr_ad3_valid,
  935. mpdu_info->mac_addr_ad4_valid,
  936. mpdu_info->mpdu_sequence_control_valid,
  937. mpdu_info->mpdu_qos_control_valid,
  938. mpdu_info->mpdu_ht_control_valid,
  939. mpdu_info->frame_encryption_info_valid);
  940. QDF_TRACE(QDF_MODULE_ID_HAL, dbg_level,
  941. "rx_mpdu_start tlv (3/5) - "
  942. "mpdu_fragment_number:%x "
  943. "more_fragment_flag:%x "
  944. "reserved_11a:%x "
  945. "fr_ds:%x "
  946. "to_ds:%x "
  947. "encrypted:%x "
  948. "mpdu_retry:%x "
  949. "mpdu_sequence_number:%x ",
  950. mpdu_info->mpdu_fragment_number,
  951. mpdu_info->more_fragment_flag,
  952. mpdu_info->reserved_11a,
  953. mpdu_info->fr_ds,
  954. mpdu_info->to_ds,
  955. mpdu_info->encrypted,
  956. mpdu_info->mpdu_retry,
  957. mpdu_info->mpdu_sequence_number);
  958. QDF_TRACE(QDF_MODULE_ID_HAL, dbg_level,
  959. "rx_mpdu_start tlv (4/5) - "
  960. "mpdu_frame_control_field:%x "
  961. "mpdu_duration_field:%x ",
  962. mpdu_info->mpdu_frame_control_field,
  963. mpdu_info->mpdu_duration_field);
  964. QDF_TRACE(QDF_MODULE_ID_HAL, dbg_level,
  965. "rx_mpdu_start tlv (5/5) - "
  966. "mac_addr_ad1_31_0:%x "
  967. "mac_addr_ad1_47_32:%x "
  968. "mac_addr_ad2_15_0:%x "
  969. "mac_addr_ad2_47_16:%x "
  970. "mac_addr_ad3_31_0:%x "
  971. "mac_addr_ad3_47_32:%x "
  972. "mpdu_sequence_control_field :%x"
  973. "mac_addr_ad4_31_0:%x "
  974. "mac_addr_ad4_47_32:%x "
  975. "mpdu_qos_control_field:%x ",
  976. mpdu_info->mac_addr_ad1_31_0,
  977. mpdu_info->mac_addr_ad1_47_32,
  978. mpdu_info->mac_addr_ad2_15_0,
  979. mpdu_info->mac_addr_ad2_47_16,
  980. mpdu_info->mac_addr_ad3_31_0,
  981. mpdu_info->mac_addr_ad3_47_32,
  982. mpdu_info->mpdu_sequence_control_field,
  983. mpdu_info->mac_addr_ad4_31_0,
  984. mpdu_info->mac_addr_ad4_47_32,
  985. mpdu_info->mpdu_qos_control_field);
  986. }
  987. /**
  988. * hal_rx_dump_msdu_end_tlv_9224: dump RX msdu_end TLV in structured
  989. * human readable format.
  990. * @ msdu_end: pointer the msdu_end TLV in pkt.
  991. * @ dbg_level: log level.
  992. *
  993. * Return: void
  994. */
  995. static void hal_rx_dump_msdu_end_tlv_9224(void *msduend,
  996. uint8_t dbg_level)
  997. {
  998. #ifdef CONFIG_WORD_BASED_TLV
  999. struct rx_msdu_end_compact_qca9224 *msdu_end =
  1000. (struct rx_msdu_end_compact_qca9224 *)msduend;
  1001. #else
  1002. struct rx_msdu_end *msdu_end =
  1003. (struct rx_msdu_end *)msduend;
  1004. #endif
  1005. QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
  1006. "rx_msdu_end tlv - "
  1007. "key_id_octet: %d "
  1008. "cce_super_rule: %d "
  1009. "cce_classify_not_done_truncat: %d "
  1010. "cce_classify_not_done_cce_dis: %d "
  1011. "rule_indication_31_0: %d "
  1012. "tcp_udp_chksum: %d "
  1013. "sa_idx_timeout: %d "
  1014. "da_idx_timeout: %d "
  1015. "msdu_limit_error: %d "
  1016. "flow_idx_timeout: %d "
  1017. "flow_idx_invalid: %d "
  1018. "wifi_parser_error: %d "
  1019. "sa_is_valid: %d "
  1020. "da_is_valid: %d "
  1021. "da_is_mcbc: %d "
  1022. "tkip_mic_err: %d "
  1023. "l3_header_padding: %d "
  1024. "first_msdu: %d "
  1025. "last_msdu: %d "
  1026. "sa_idx: %d "
  1027. "msdu_drop: %d "
  1028. "reo_destination_indication: %d "
  1029. "flow_idx: %d "
  1030. "fse_metadata: %d "
  1031. "cce_metadata: %d "
  1032. "sa_sw_peer_id: %d ",
  1033. msdu_end->key_id_octet,
  1034. msdu_end->cce_super_rule,
  1035. msdu_end->cce_classify_not_done_truncate,
  1036. msdu_end->cce_classify_not_done_cce_dis,
  1037. msdu_end->rule_indication_31_0,
  1038. msdu_end->tcp_udp_chksum,
  1039. msdu_end->sa_idx_timeout,
  1040. msdu_end->da_idx_timeout,
  1041. msdu_end->msdu_limit_error,
  1042. msdu_end->flow_idx_timeout,
  1043. msdu_end->flow_idx_invalid,
  1044. msdu_end->wifi_parser_error,
  1045. msdu_end->sa_is_valid,
  1046. msdu_end->da_is_valid,
  1047. msdu_end->da_is_mcbc,
  1048. msdu_end->tkip_mic_err,
  1049. msdu_end->l3_header_padding,
  1050. msdu_end->first_msdu,
  1051. msdu_end->last_msdu,
  1052. msdu_end->sa_idx,
  1053. msdu_end->msdu_drop,
  1054. msdu_end->reo_destination_indication,
  1055. msdu_end->flow_idx,
  1056. msdu_end->fse_metadata,
  1057. msdu_end->cce_metadata,
  1058. msdu_end->sa_sw_peer_id);
  1059. }
  1060. /**
  1061. * hal_reo_status_get_header_9224 - Process reo desc info
  1062. * @d - Pointer to reo descriptior
  1063. * @b - tlv type info
  1064. * @h1 - Pointer to hal_reo_status_header where info to be stored
  1065. *
  1066. * Return - none.
  1067. *
  1068. */
  1069. static void hal_reo_status_get_header_9224(hal_ring_desc_t ring_desc,
  1070. int b, void *h1)
  1071. {
  1072. uint64_t *d = (uint64_t *)ring_desc;
  1073. uint64_t val1 = 0;
  1074. struct hal_reo_status_header *h =
  1075. (struct hal_reo_status_header *)h1;
  1076. /* Offsets of descriptor fields defined in HW headers start
  1077. * from the field after TLV header
  1078. */
  1079. d += HAL_GET_NUM_QWORDS(sizeof(struct tlv_32_hdr));
  1080. switch (b) {
  1081. case HAL_REO_QUEUE_STATS_STATUS_TLV:
  1082. val1 = d[HAL_OFFSET_QW(REO_GET_QUEUE_STATS_STATUS,
  1083. STATUS_HEADER_REO_STATUS_NUMBER)];
  1084. break;
  1085. case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
  1086. val1 = d[HAL_OFFSET_QW(REO_FLUSH_QUEUE_STATUS,
  1087. STATUS_HEADER_REO_STATUS_NUMBER)];
  1088. break;
  1089. case HAL_REO_FLUSH_CACHE_STATUS_TLV:
  1090. val1 = d[HAL_OFFSET_QW(REO_FLUSH_CACHE_STATUS,
  1091. STATUS_HEADER_REO_STATUS_NUMBER)];
  1092. break;
  1093. case HAL_REO_UNBLK_CACHE_STATUS_TLV:
  1094. val1 = d[HAL_OFFSET_QW(REO_UNBLOCK_CACHE_STATUS,
  1095. STATUS_HEADER_REO_STATUS_NUMBER)];
  1096. break;
  1097. case HAL_REO_TIMOUT_LIST_STATUS_TLV:
  1098. val1 = d[HAL_OFFSET_QW(REO_FLUSH_TIMEOUT_LIST_STATUS,
  1099. STATUS_HEADER_REO_STATUS_NUMBER)];
  1100. break;
  1101. case HAL_REO_DESC_THRES_STATUS_TLV:
  1102. val1 =
  1103. d[HAL_OFFSET_QW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS,
  1104. STATUS_HEADER_REO_STATUS_NUMBER)];
  1105. break;
  1106. case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
  1107. val1 = d[HAL_OFFSET_QW(REO_UPDATE_RX_REO_QUEUE_STATUS,
  1108. STATUS_HEADER_REO_STATUS_NUMBER)];
  1109. break;
  1110. default:
  1111. qdf_nofl_err("ERROR: Unknown tlv\n");
  1112. break;
  1113. }
  1114. h->cmd_num =
  1115. HAL_GET_FIELD(
  1116. UNIFORM_REO_STATUS_HEADER, REO_STATUS_NUMBER,
  1117. val1);
  1118. h->exec_time =
  1119. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER,
  1120. CMD_EXECUTION_TIME, val1);
  1121. h->status =
  1122. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER,
  1123. REO_CMD_EXECUTION_STATUS, val1);
  1124. switch (b) {
  1125. case HAL_REO_QUEUE_STATS_STATUS_TLV:
  1126. val1 = d[HAL_OFFSET_QW(REO_GET_QUEUE_STATS_STATUS,
  1127. STATUS_HEADER_TIMESTAMP)];
  1128. break;
  1129. case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
  1130. val1 = d[HAL_OFFSET_QW(REO_FLUSH_QUEUE_STATUS,
  1131. STATUS_HEADER_TIMESTAMP)];
  1132. break;
  1133. case HAL_REO_FLUSH_CACHE_STATUS_TLV:
  1134. val1 = d[HAL_OFFSET_QW(REO_FLUSH_CACHE_STATUS,
  1135. STATUS_HEADER_TIMESTAMP)];
  1136. break;
  1137. case HAL_REO_UNBLK_CACHE_STATUS_TLV:
  1138. val1 = d[HAL_OFFSET_QW(REO_UNBLOCK_CACHE_STATUS,
  1139. STATUS_HEADER_TIMESTAMP)];
  1140. break;
  1141. case HAL_REO_TIMOUT_LIST_STATUS_TLV:
  1142. val1 = d[HAL_OFFSET_QW(REO_FLUSH_TIMEOUT_LIST_STATUS,
  1143. STATUS_HEADER_TIMESTAMP)];
  1144. break;
  1145. case HAL_REO_DESC_THRES_STATUS_TLV:
  1146. val1 =
  1147. d[HAL_OFFSET_QW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS,
  1148. STATUS_HEADER_TIMESTAMP)];
  1149. break;
  1150. case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
  1151. val1 = d[HAL_OFFSET_QW(REO_UPDATE_RX_REO_QUEUE_STATUS,
  1152. STATUS_HEADER_TIMESTAMP)];
  1153. break;
  1154. default:
  1155. qdf_nofl_err("ERROR: Unknown tlv\n");
  1156. break;
  1157. }
  1158. h->tstamp =
  1159. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER, TIMESTAMP, val1);
  1160. }
  1161. static
  1162. void *hal_rx_msdu0_buffer_addr_lsb_9224(void *link_desc_va)
  1163. {
  1164. return (void *)HAL_RX_MSDU0_BUFFER_ADDR_LSB(link_desc_va);
  1165. }
  1166. static
  1167. void *hal_rx_msdu_desc_info_ptr_get_9224(void *msdu0)
  1168. {
  1169. return (void *)HAL_RX_MSDU_DESC_INFO_PTR_GET(msdu0);
  1170. }
  1171. static
  1172. void *hal_ent_mpdu_desc_info_9224(void *ent_ring_desc)
  1173. {
  1174. return (void *)HAL_ENT_MPDU_DESC_INFO(ent_ring_desc);
  1175. }
  1176. static
  1177. void *hal_dst_mpdu_desc_info_9224(void *dst_ring_desc)
  1178. {
  1179. return (void *)HAL_DST_MPDU_DESC_INFO(dst_ring_desc);
  1180. }
  1181. /**
  1182. * hal_reo_config_9224(): Set reo config parameters
  1183. * @soc: hal soc handle
  1184. * @reg_val: value to be set
  1185. * @reo_params: reo parameters
  1186. *
  1187. * Return: void
  1188. */
  1189. static void
  1190. hal_reo_config_9224(struct hal_soc *soc,
  1191. uint32_t reg_val,
  1192. struct hal_reo_params *reo_params)
  1193. {
  1194. HAL_REO_R0_CONFIG(soc, reg_val, reo_params);
  1195. }
  1196. /**
  1197. * hal_rx_msdu_desc_info_get_ptr_9224() - Get msdu desc info ptr
  1198. * @msdu_details_ptr - Pointer to msdu_details_ptr
  1199. *
  1200. * Return - Pointer to rx_msdu_desc_info structure.
  1201. *
  1202. */
  1203. static void *hal_rx_msdu_desc_info_get_ptr_9224(void *msdu_details_ptr)
  1204. {
  1205. return HAL_RX_MSDU_DESC_INFO_GET(msdu_details_ptr);
  1206. }
  1207. /**
  1208. * hal_rx_link_desc_msdu0_ptr_9224 - Get pointer to rx_msdu details
  1209. * @link_desc - Pointer to link desc
  1210. *
  1211. * Return - Pointer to rx_msdu_details structure
  1212. *
  1213. */
  1214. static void *hal_rx_link_desc_msdu0_ptr_9224(void *link_desc)
  1215. {
  1216. return HAL_RX_LINK_DESC_MSDU0_PTR(link_desc);
  1217. }
  1218. /**
  1219. * hal_get_window_address_9224(): Function to get hp/tp address
  1220. * @hal_soc: Pointer to hal_soc
  1221. * @addr: address offset of register
  1222. *
  1223. * Return: modified address offset of register
  1224. */
  1225. static inline qdf_iomem_t hal_get_window_address_9224(struct hal_soc *hal_soc,
  1226. qdf_iomem_t addr)
  1227. {
  1228. uint32_t offset = addr - hal_soc->dev_base_addr;
  1229. qdf_iomem_t new_offset;
  1230. /*
  1231. * If offset lies within DP register range, use 3rd window to write
  1232. * into DP region.
  1233. */
  1234. if ((offset ^ UMAC_BASE) < WINDOW_RANGE_MASK) {
  1235. new_offset = (hal_soc->dev_base_addr + (3 * WINDOW_START) +
  1236. (offset & WINDOW_RANGE_MASK));
  1237. /*
  1238. * If offset lies within CE register range, use 2nd window to write
  1239. * into CE region.
  1240. */
  1241. } else if ((offset ^ CE_WFSS_CE_REG_BASE) < WINDOW_RANGE_MASK) {
  1242. new_offset = (hal_soc->dev_base_addr + (2 * WINDOW_START) +
  1243. (offset & WINDOW_RANGE_MASK));
  1244. } else {
  1245. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1246. "%s: ERROR: Accessing Wrong register\n", __func__);
  1247. qdf_assert_always(0);
  1248. return 0;
  1249. }
  1250. return new_offset;
  1251. }
  1252. static inline void hal_write_window_register(struct hal_soc *hal_soc)
  1253. {
  1254. /* Write value into window configuration register */
  1255. qdf_iowrite32(hal_soc->dev_base_addr + WINDOW_REG_ADDRESS,
  1256. WINDOW_CONFIGURATION_VALUE_9224);
  1257. }
  1258. static
  1259. void hal_compute_reo_remap_ix2_ix3_9224(uint32_t *ring, uint32_t num_rings,
  1260. uint32_t *remap1, uint32_t *remap2)
  1261. {
  1262. switch (num_rings) {
  1263. case 1:
  1264. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1265. HAL_REO_REMAP_IX2(ring[0], 17) |
  1266. HAL_REO_REMAP_IX2(ring[0], 18) |
  1267. HAL_REO_REMAP_IX2(ring[0], 19) |
  1268. HAL_REO_REMAP_IX2(ring[0], 20) |
  1269. HAL_REO_REMAP_IX2(ring[0], 21) |
  1270. HAL_REO_REMAP_IX2(ring[0], 22) |
  1271. HAL_REO_REMAP_IX2(ring[0], 23);
  1272. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1273. HAL_REO_REMAP_IX3(ring[0], 25) |
  1274. HAL_REO_REMAP_IX3(ring[0], 26) |
  1275. HAL_REO_REMAP_IX3(ring[0], 27) |
  1276. HAL_REO_REMAP_IX3(ring[0], 28) |
  1277. HAL_REO_REMAP_IX3(ring[0], 29) |
  1278. HAL_REO_REMAP_IX3(ring[0], 30) |
  1279. HAL_REO_REMAP_IX3(ring[0], 31);
  1280. break;
  1281. case 2:
  1282. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1283. HAL_REO_REMAP_IX2(ring[0], 17) |
  1284. HAL_REO_REMAP_IX2(ring[1], 18) |
  1285. HAL_REO_REMAP_IX2(ring[1], 19) |
  1286. HAL_REO_REMAP_IX2(ring[0], 20) |
  1287. HAL_REO_REMAP_IX2(ring[0], 21) |
  1288. HAL_REO_REMAP_IX2(ring[1], 22) |
  1289. HAL_REO_REMAP_IX2(ring[1], 23);
  1290. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1291. HAL_REO_REMAP_IX3(ring[0], 25) |
  1292. HAL_REO_REMAP_IX3(ring[1], 26) |
  1293. HAL_REO_REMAP_IX3(ring[1], 27) |
  1294. HAL_REO_REMAP_IX3(ring[0], 28) |
  1295. HAL_REO_REMAP_IX3(ring[0], 29) |
  1296. HAL_REO_REMAP_IX3(ring[1], 30) |
  1297. HAL_REO_REMAP_IX3(ring[1], 31);
  1298. break;
  1299. case 3:
  1300. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1301. HAL_REO_REMAP_IX2(ring[1], 17) |
  1302. HAL_REO_REMAP_IX2(ring[2], 18) |
  1303. HAL_REO_REMAP_IX2(ring[0], 19) |
  1304. HAL_REO_REMAP_IX2(ring[1], 20) |
  1305. HAL_REO_REMAP_IX2(ring[2], 21) |
  1306. HAL_REO_REMAP_IX2(ring[0], 22) |
  1307. HAL_REO_REMAP_IX2(ring[1], 23);
  1308. *remap2 = HAL_REO_REMAP_IX3(ring[2], 24) |
  1309. HAL_REO_REMAP_IX3(ring[0], 25) |
  1310. HAL_REO_REMAP_IX3(ring[1], 26) |
  1311. HAL_REO_REMAP_IX3(ring[2], 27) |
  1312. HAL_REO_REMAP_IX3(ring[0], 28) |
  1313. HAL_REO_REMAP_IX3(ring[1], 29) |
  1314. HAL_REO_REMAP_IX3(ring[2], 30) |
  1315. HAL_REO_REMAP_IX3(ring[0], 31);
  1316. break;
  1317. case 4:
  1318. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1319. HAL_REO_REMAP_IX2(ring[1], 17) |
  1320. HAL_REO_REMAP_IX2(ring[2], 18) |
  1321. HAL_REO_REMAP_IX2(ring[3], 19) |
  1322. HAL_REO_REMAP_IX2(ring[0], 20) |
  1323. HAL_REO_REMAP_IX2(ring[1], 21) |
  1324. HAL_REO_REMAP_IX2(ring[2], 22) |
  1325. HAL_REO_REMAP_IX2(ring[3], 23);
  1326. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1327. HAL_REO_REMAP_IX3(ring[1], 25) |
  1328. HAL_REO_REMAP_IX3(ring[2], 26) |
  1329. HAL_REO_REMAP_IX3(ring[3], 27) |
  1330. HAL_REO_REMAP_IX3(ring[0], 28) |
  1331. HAL_REO_REMAP_IX3(ring[1], 29) |
  1332. HAL_REO_REMAP_IX3(ring[2], 30) |
  1333. HAL_REO_REMAP_IX3(ring[3], 31);
  1334. break;
  1335. }
  1336. }
  1337. static
  1338. void hal_compute_reo_remap_ix0_9224(struct hal_soc *soc)
  1339. {
  1340. uint32_t remap0;
  1341. remap0 = HAL_REG_READ(soc, HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR
  1342. (REO_REG_REG_BASE));
  1343. remap0 &= ~(HAL_REO_REMAP_IX0(0xF, 6));
  1344. remap0 |= HAL_REO_REMAP_IX0(REO2PPE_DST_IND, 6);
  1345. HAL_REG_WRITE(soc, HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR
  1346. (REO_REG_REG_BASE), remap0);
  1347. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR 0x%x",
  1348. HAL_REG_READ(soc, HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR
  1349. (REO_REG_REG_BASE)));
  1350. }
  1351. /**
  1352. * hal_rx_flow_setup_fse_9224() - Setup a flow search entry in HW FST
  1353. * @fst: Pointer to the Rx Flow Search Table
  1354. * @table_offset: offset into the table where the flow is to be setup
  1355. * @flow: Flow Parameters
  1356. *
  1357. * Return: Success/Failure
  1358. */
  1359. static void *
  1360. hal_rx_flow_setup_fse_9224(uint8_t *rx_fst, uint32_t table_offset,
  1361. uint8_t *rx_flow)
  1362. {
  1363. struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
  1364. struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
  1365. uint8_t *fse;
  1366. bool fse_valid;
  1367. if (table_offset >= fst->max_entries) {
  1368. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  1369. "HAL FSE table offset %u exceeds max entries %u",
  1370. table_offset, fst->max_entries);
  1371. return NULL;
  1372. }
  1373. fse = (uint8_t *)fst->base_vaddr +
  1374. (table_offset * HAL_RX_FST_ENTRY_SIZE);
  1375. fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID);
  1376. if (fse_valid) {
  1377. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
  1378. "HAL FSE %pK already valid", fse);
  1379. return NULL;
  1380. }
  1381. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96) =
  1382. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96,
  1383. qdf_htonl(flow->tuple_info.src_ip_127_96));
  1384. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_95_64) =
  1385. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_95_64,
  1386. qdf_htonl(flow->tuple_info.src_ip_95_64));
  1387. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_63_32) =
  1388. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_63_32,
  1389. qdf_htonl(flow->tuple_info.src_ip_63_32));
  1390. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_31_0) =
  1391. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_31_0,
  1392. qdf_htonl(flow->tuple_info.src_ip_31_0));
  1393. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_127_96) =
  1394. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_127_96,
  1395. qdf_htonl(flow->tuple_info.dest_ip_127_96));
  1396. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_95_64) =
  1397. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_95_64,
  1398. qdf_htonl(flow->tuple_info.dest_ip_95_64));
  1399. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_63_32) =
  1400. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_63_32,
  1401. qdf_htonl(flow->tuple_info.dest_ip_63_32));
  1402. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_31_0) =
  1403. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_31_0,
  1404. qdf_htonl(flow->tuple_info.dest_ip_31_0));
  1405. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_PORT);
  1406. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_PORT) |=
  1407. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_PORT,
  1408. (flow->tuple_info.dest_port));
  1409. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_PORT);
  1410. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_PORT) |=
  1411. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_PORT,
  1412. (flow->tuple_info.src_port));
  1413. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL);
  1414. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL) |=
  1415. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL,
  1416. flow->tuple_info.l4_protocol);
  1417. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER);
  1418. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER) |=
  1419. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER,
  1420. flow->reo_destination_handler);
  1421. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID);
  1422. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID) |=
  1423. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, VALID, 1);
  1424. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, METADATA);
  1425. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, METADATA) =
  1426. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, METADATA,
  1427. flow->fse_metadata);
  1428. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_INDICATION);
  1429. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_INDICATION) |=
  1430. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY,
  1431. REO_DESTINATION_INDICATION,
  1432. flow->reo_destination_indication);
  1433. /* Reset all the other fields in FSE */
  1434. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, RESERVED_9);
  1435. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_DROP);
  1436. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_COUNT);
  1437. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_BYTE_COUNT);
  1438. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, TIMESTAMP);
  1439. return fse;
  1440. }
  1441. #ifndef NO_RX_PKT_HDR_TLV
  1442. /**
  1443. * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format
  1444. * @ pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt.
  1445. * @ dbg_level: log level.
  1446. *
  1447. * Return: void
  1448. */
  1449. static inline void hal_rx_dump_pkt_hdr_tlv_9224(struct rx_pkt_tlvs *pkt_tlvs,
  1450. uint8_t dbg_level)
  1451. {
  1452. struct rx_pkt_hdr_tlv *pkt_hdr_tlv = &pkt_tlvs->pkt_hdr_tlv;
  1453. hal_verbose_debug("\n---------------\n"
  1454. "rx_pkt_hdr_tlv\n"
  1455. "---------------\n"
  1456. "phy_ppdu_id %llu ",
  1457. pkt_hdr_tlv->phy_ppdu_id);
  1458. hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,
  1459. sizeof(pkt_hdr_tlv->rx_pkt_hdr));
  1460. }
  1461. #else
  1462. /**
  1463. * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format
  1464. * @ pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt.
  1465. * @ dbg_level: log level.
  1466. *
  1467. * Return: void
  1468. */
  1469. static inline void hal_rx_dump_pkt_hdr_tlv_9224(struct rx_pkt_tlvs *pkt_tlvs,
  1470. uint8_t dbg_level)
  1471. {
  1472. }
  1473. #endif
  1474. /*
  1475. * hal_tx_dump_ppe_vp_entry_9224()
  1476. * @hal_soc_hdl: HAL SoC handle
  1477. *
  1478. * Return: void
  1479. */
  1480. static inline
  1481. void hal_tx_dump_ppe_vp_entry_9224(hal_soc_handle_t hal_soc_hdl)
  1482. {
  1483. struct hal_soc *soc = (struct hal_soc *)hal_soc_hdl;
  1484. uint32_t reg_addr, reg_val = 0, i;
  1485. for (i = 0; i < HAL_PPE_VP_ENTRIES_MAX; i++) {
  1486. reg_addr =
  1487. HWIO_TCL_R0_PPE_VP_CONFIG_TABLE_n_ADDR(
  1488. MAC_TCL_REG_REG_BASE,
  1489. i);
  1490. reg_val = HAL_REG_READ(soc, reg_addr);
  1491. hal_verbose_debug("%d: 0x%x\n", i, reg_val);
  1492. }
  1493. }
  1494. /**
  1495. * hal_rx_dump_pkt_tlvs_9224(): API to print RX Pkt TLVS QCN9224
  1496. * @hal_soc_hdl: hal_soc handle
  1497. * @buf: pointer the pkt buffer
  1498. * @dbg_level: log level
  1499. *
  1500. * Return: void
  1501. */
  1502. #ifdef CONFIG_WORD_BASED_TLV
  1503. static void hal_rx_dump_pkt_tlvs_9224(hal_soc_handle_t hal_soc_hdl,
  1504. uint8_t *buf, uint8_t dbg_level)
  1505. {
  1506. struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
  1507. struct rx_msdu_end_compact_qca9224 *msdu_end =
  1508. &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
  1509. struct rx_mpdu_start_compact_qca9224 *mpdu_start =
  1510. &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
  1511. hal_rx_dump_msdu_end_tlv_9224(msdu_end, dbg_level);
  1512. hal_rx_dump_mpdu_start_tlv_9224(mpdu_start, dbg_level);
  1513. hal_rx_dump_pkt_hdr_tlv_9224(pkt_tlvs, dbg_level);
  1514. }
  1515. #else
  1516. static void hal_rx_dump_pkt_tlvs_9224(hal_soc_handle_t hal_soc_hdl,
  1517. uint8_t *buf, uint8_t dbg_level)
  1518. {
  1519. struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
  1520. struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
  1521. struct rx_mpdu_start *mpdu_start =
  1522. &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
  1523. hal_rx_dump_msdu_end_tlv_9224(msdu_end, dbg_level);
  1524. hal_rx_dump_mpdu_start_tlv_9224(mpdu_start, dbg_level);
  1525. hal_rx_dump_pkt_hdr_tlv_9224(pkt_tlvs, dbg_level);
  1526. }
  1527. #endif
  1528. #define HAL_NUM_TCL_BANKS_9224 48
  1529. /**
  1530. * hal_cmem_write_9224() - function for CMEM buffer writing
  1531. * @hal_soc_hdl: HAL SOC handle
  1532. * @offset: CMEM address
  1533. * @value: value to write
  1534. *
  1535. * Return: None.
  1536. */
  1537. static void hal_cmem_write_9224(hal_soc_handle_t hal_soc_hdl,
  1538. uint32_t offset,
  1539. uint32_t value)
  1540. {
  1541. struct hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
  1542. pld_reg_write(hal->qdf_dev->dev, offset, value, NULL);
  1543. }
  1544. /**
  1545. * hal_tx_get_num_tcl_banks_9224() - Get number of banks in target
  1546. *
  1547. * Returns: number of bank
  1548. */
  1549. static uint8_t hal_tx_get_num_tcl_banks_9224(void)
  1550. {
  1551. return HAL_NUM_TCL_BANKS_9224;
  1552. }
  1553. static void hal_reo_setup_9224(struct hal_soc *soc, void *reoparams,
  1554. int qref_reset)
  1555. {
  1556. uint32_t reg_val;
  1557. struct hal_reo_params *reo_params = (struct hal_reo_params *)reoparams;
  1558. reg_val = HAL_REG_READ(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR(
  1559. REO_REG_REG_BASE));
  1560. hal_reo_config_9224(soc, reg_val, reo_params);
  1561. /* Other ring enable bits and REO_ENABLE will be set by FW */
  1562. /* TODO: Setup destination ring mapping if enabled */
  1563. /* TODO: Error destination ring setting is left to default.
  1564. * Default setting is to send all errors to release ring.
  1565. */
  1566. /* Set the reo descriptor swap bits in case of BIG endian platform */
  1567. hal_setup_reo_swap(soc);
  1568. HAL_REG_WRITE(soc,
  1569. HWIO_REO_R0_AGING_THRESHOLD_IX_0_ADDR(REO_REG_REG_BASE),
  1570. HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000);
  1571. HAL_REG_WRITE(soc,
  1572. HWIO_REO_R0_AGING_THRESHOLD_IX_1_ADDR(REO_REG_REG_BASE),
  1573. (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000));
  1574. HAL_REG_WRITE(soc,
  1575. HWIO_REO_R0_AGING_THRESHOLD_IX_2_ADDR(REO_REG_REG_BASE),
  1576. (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000));
  1577. HAL_REG_WRITE(soc,
  1578. HWIO_REO_R0_AGING_THRESHOLD_IX_3_ADDR(REO_REG_REG_BASE),
  1579. (HAL_DEFAULT_VO_REO_TIMEOUT_MS * 1000));
  1580. /*
  1581. * When hash based routing is enabled, routing of the rx packet
  1582. * is done based on the following value: 1 _ _ _ _ The last 4
  1583. * bits are based on hash[3:0]. This means the possible values
  1584. * are 0x10 to 0x1f. This value is used to look-up the
  1585. * ring ID configured in Destination_Ring_Ctrl_IX_* register.
  1586. * The Destination_Ring_Ctrl_IX_2 and Destination_Ring_Ctrl_IX_3
  1587. * registers need to be configured to set-up the 16 entries to
  1588. * map the hash values to a ring number. There are 3 bits per
  1589. * hash entry – which are mapped as follows:
  1590. * 0: TCL, 1:SW1, 2:SW2, * 3:SW3, 4:SW4, 5:Release, 6:FW(WIFI),
  1591. * 7: NOT_USED.
  1592. */
  1593. if (reo_params->rx_hash_enabled) {
  1594. hal_compute_reo_remap_ix0_9224(soc);
  1595. HAL_REG_WRITE(soc,
  1596. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR
  1597. (REO_REG_REG_BASE), reo_params->remap0);
  1598. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x",
  1599. HAL_REG_READ(soc,
  1600. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR(
  1601. REO_REG_REG_BASE)));
  1602. HAL_REG_WRITE(soc,
  1603. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR
  1604. (REO_REG_REG_BASE), reo_params->remap1);
  1605. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x",
  1606. HAL_REG_READ(soc,
  1607. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR(
  1608. REO_REG_REG_BASE)));
  1609. HAL_REG_WRITE(soc,
  1610. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR
  1611. (REO_REG_REG_BASE), reo_params->remap2);
  1612. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR 0x%x",
  1613. HAL_REG_READ(soc,
  1614. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR(
  1615. REO_REG_REG_BASE)));
  1616. }
  1617. /* TODO: Check if the following registers shoould be setup by host:
  1618. * AGING_CONTROL
  1619. * HIGH_MEMORY_THRESHOLD
  1620. * GLOBAL_LINK_DESC_COUNT_THRESH_IX_0[1,2]
  1621. * GLOBAL_LINK_DESC_COUNT_CTRL
  1622. */
  1623. hal_reo_shared_qaddr_init((hal_soc_handle_t)soc, qref_reset);
  1624. }
  1625. static uint16_t hal_get_rx_max_ba_window_qcn9224(int tid)
  1626. {
  1627. return HAL_RX_BA_WINDOW_1024;
  1628. }
  1629. /**
  1630. * hal_qcn9224_get_reo_qdesc_size()- Get the reo queue descriptor size
  1631. * from the give Block-Ack window size
  1632. * Return: reo queue descriptor size
  1633. */
  1634. static uint32_t hal_qcn9224_get_reo_qdesc_size(uint32_t ba_window_size, int tid)
  1635. {
  1636. /* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for
  1637. * NON_QOS_TID until HW issues are resolved.
  1638. */
  1639. if (tid != HAL_NON_QOS_TID)
  1640. ba_window_size = hal_get_rx_max_ba_window_qcn9224(tid);
  1641. /* Return descriptor size corresponding to window size of 2 since
  1642. * we set ba_window_size to 2 while setting up REO descriptors as
  1643. * a WAR to get 2k jump exception aggregates are received without
  1644. * a BA session.
  1645. */
  1646. if (ba_window_size <= 1) {
  1647. if (tid != HAL_NON_QOS_TID)
  1648. return sizeof(struct rx_reo_queue) +
  1649. sizeof(struct rx_reo_queue_ext);
  1650. else
  1651. return sizeof(struct rx_reo_queue);
  1652. }
  1653. if (ba_window_size <= 105)
  1654. return sizeof(struct rx_reo_queue) +
  1655. sizeof(struct rx_reo_queue_ext);
  1656. if (ba_window_size <= 210)
  1657. return sizeof(struct rx_reo_queue) +
  1658. (2 * sizeof(struct rx_reo_queue_ext));
  1659. if (ba_window_size <= 256)
  1660. return sizeof(struct rx_reo_queue) +
  1661. (3 * sizeof(struct rx_reo_queue_ext));
  1662. return sizeof(struct rx_reo_queue) +
  1663. (10 * sizeof(struct rx_reo_queue_ext)) +
  1664. sizeof(struct rx_reo_queue_1k);
  1665. }
  1666. /*
  1667. * hal_tx_dump_ppe_vp_entry_9224()
  1668. * @hal_soc_hdl: HAL SoC handle
  1669. *
  1670. * Return: Number of PPE VP entries
  1671. */
  1672. static
  1673. uint32_t hal_tx_get_num_ppe_vp_tbl_entries_9224(hal_soc_handle_t hal_soc_hdl)
  1674. {
  1675. return HAL_PPE_VP_ENTRIES_MAX;
  1676. }
  1677. /**
  1678. * hal_rx_tlv_msdu_done_copy_get_9224() - Get msdu done copy bit from rx_tlv
  1679. *
  1680. * Returns: msdu done copy bit
  1681. */
  1682. static inline uint32_t hal_rx_tlv_msdu_done_copy_get_9224(uint8_t *buf)
  1683. {
  1684. return HAL_RX_TLV_MSDU_DONE_COPY_GET(buf);
  1685. }
  1686. static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
  1687. {
  1688. /* init and setup */
  1689. hal_soc->ops->hal_srng_dst_hw_init = hal_srng_dst_hw_init_generic;
  1690. hal_soc->ops->hal_srng_src_hw_init = hal_srng_src_hw_init_generic;
  1691. hal_soc->ops->hal_srng_hw_disable = hal_srng_hw_disable_generic;
  1692. hal_soc->ops->hal_get_hw_hptp = hal_get_hw_hptp_generic;
  1693. hal_soc->ops->hal_get_window_address = hal_get_window_address_9224;
  1694. hal_soc->ops->hal_cmem_write = hal_cmem_write_9224;
  1695. /* tx */
  1696. hal_soc->ops->hal_tx_set_dscp_tid_map = hal_tx_set_dscp_tid_map_9224;
  1697. hal_soc->ops->hal_tx_update_dscp_tid = hal_tx_update_dscp_tid_9224;
  1698. hal_soc->ops->hal_tx_comp_get_status =
  1699. hal_tx_comp_get_status_generic_be;
  1700. hal_soc->ops->hal_tx_init_cmd_credit_ring =
  1701. hal_tx_init_cmd_credit_ring_9224;
  1702. hal_soc->ops->hal_tx_set_ppe_cmn_cfg =
  1703. hal_tx_set_ppe_cmn_config_9224;
  1704. hal_soc->ops->hal_tx_set_ppe_vp_entry =
  1705. hal_tx_set_ppe_vp_entry_9224;
  1706. hal_soc->ops->hal_tx_set_ppe_pri2tid =
  1707. hal_tx_set_ppe_pri2tid_map_9224;
  1708. hal_soc->ops->hal_tx_update_ppe_pri2tid =
  1709. hal_tx_update_ppe_pri2tid_9224;
  1710. hal_soc->ops->hal_tx_dump_ppe_vp_entry =
  1711. hal_tx_dump_ppe_vp_entry_9224;
  1712. hal_soc->ops->hal_tx_get_num_ppe_vp_tbl_entries =
  1713. hal_tx_get_num_ppe_vp_tbl_entries_9224;
  1714. hal_soc->ops->hal_tx_enable_pri2tid_map =
  1715. hal_tx_enable_pri2tid_map_9224;
  1716. hal_soc->ops->hal_tx_config_rbm_mapping_be =
  1717. hal_tx_config_rbm_mapping_be_9224;
  1718. /* rx */
  1719. hal_soc->ops->hal_rx_msdu_start_nss_get = hal_rx_tlv_nss_get_be;
  1720. hal_soc->ops->hal_rx_mon_hw_desc_get_mpdu_status =
  1721. hal_rx_mon_hw_desc_get_mpdu_status_be;
  1722. hal_soc->ops->hal_rx_get_tlv = hal_rx_get_tlv_9224;
  1723. hal_soc->ops->hal_rx_proc_phyrx_other_receive_info_tlv =
  1724. hal_rx_proc_phyrx_other_receive_info_tlv_9224;
  1725. hal_soc->ops->hal_rx_dump_msdu_end_tlv = hal_rx_dump_msdu_end_tlv_9224;
  1726. hal_soc->ops->hal_rx_dump_mpdu_start_tlv =
  1727. hal_rx_dump_mpdu_start_tlv_9224;
  1728. hal_soc->ops->hal_rx_dump_pkt_tlvs = hal_rx_dump_pkt_tlvs_9224;
  1729. hal_soc->ops->hal_get_link_desc_size = hal_get_link_desc_size_9224;
  1730. hal_soc->ops->hal_rx_mpdu_start_tid_get = hal_rx_tlv_tid_get_be;
  1731. hal_soc->ops->hal_rx_msdu_start_reception_type_get =
  1732. hal_rx_tlv_reception_type_get_be;
  1733. hal_soc->ops->hal_rx_msdu_end_da_idx_get =
  1734. hal_rx_msdu_end_da_idx_get_be;
  1735. hal_soc->ops->hal_rx_msdu_desc_info_get_ptr =
  1736. hal_rx_msdu_desc_info_get_ptr_9224;
  1737. hal_soc->ops->hal_rx_link_desc_msdu0_ptr =
  1738. hal_rx_link_desc_msdu0_ptr_9224;
  1739. hal_soc->ops->hal_reo_status_get_header =
  1740. hal_reo_status_get_header_9224;
  1741. hal_soc->ops->hal_rx_status_get_tlv_info =
  1742. hal_rx_status_get_tlv_info_wrapper_be;
  1743. hal_soc->ops->hal_rx_wbm_err_info_get =
  1744. hal_rx_wbm_err_info_get_generic_be;
  1745. hal_soc->ops->hal_tx_set_pcp_tid_map =
  1746. hal_tx_set_pcp_tid_map_generic_be;
  1747. hal_soc->ops->hal_tx_update_pcp_tid_map =
  1748. hal_tx_update_pcp_tid_generic_be;
  1749. hal_soc->ops->hal_tx_set_tidmap_prty =
  1750. hal_tx_update_tidmap_prty_generic_be;
  1751. hal_soc->ops->hal_rx_get_rx_fragment_number =
  1752. hal_rx_get_rx_fragment_number_be,
  1753. hal_soc->ops->hal_rx_msdu_end_da_is_mcbc_get =
  1754. hal_rx_tlv_da_is_mcbc_get_be;
  1755. hal_soc->ops->hal_rx_msdu_end_is_tkip_mic_err =
  1756. hal_rx_tlv_is_tkip_mic_err_get_be;
  1757. hal_soc->ops->hal_rx_msdu_end_sa_is_valid_get =
  1758. hal_rx_tlv_sa_is_valid_get_be;
  1759. hal_soc->ops->hal_rx_msdu_end_sa_idx_get = hal_rx_tlv_sa_idx_get_be;
  1760. hal_soc->ops->hal_rx_desc_is_first_msdu = hal_rx_desc_is_first_msdu_be;
  1761. hal_soc->ops->hal_rx_msdu_end_l3_hdr_padding_get =
  1762. hal_rx_tlv_l3_hdr_padding_get_be;
  1763. hal_soc->ops->hal_rx_encryption_info_valid =
  1764. hal_rx_encryption_info_valid_be;
  1765. hal_soc->ops->hal_rx_print_pn = hal_rx_print_pn_be;
  1766. hal_soc->ops->hal_rx_msdu_end_first_msdu_get =
  1767. hal_rx_tlv_first_msdu_get_be;
  1768. hal_soc->ops->hal_rx_msdu_end_da_is_valid_get =
  1769. hal_rx_tlv_da_is_valid_get_be;
  1770. hal_soc->ops->hal_rx_msdu_end_last_msdu_get =
  1771. hal_rx_tlv_last_msdu_get_be;
  1772. hal_soc->ops->hal_rx_get_mpdu_mac_ad4_valid =
  1773. hal_rx_get_mpdu_mac_ad4_valid_be;
  1774. hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get =
  1775. hal_rx_mpdu_start_sw_peer_id_get_be;
  1776. hal_soc->ops->hal_rx_tlv_peer_meta_data_get =
  1777. hal_rx_msdu_peer_meta_data_get_be;
  1778. hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be;
  1779. hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be;
  1780. hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =
  1781. hal_rx_get_mpdu_frame_control_valid_be;
  1782. hal_soc->ops->hal_rx_mpdu_get_addr1 = hal_rx_mpdu_get_addr1_be;
  1783. hal_soc->ops->hal_rx_mpdu_get_addr2 = hal_rx_mpdu_get_addr2_be;
  1784. hal_soc->ops->hal_rx_mpdu_get_addr3 = hal_rx_mpdu_get_addr3_be;
  1785. hal_soc->ops->hal_rx_mpdu_get_addr4 = hal_rx_mpdu_get_addr4_be;
  1786. hal_soc->ops->hal_rx_get_mpdu_sequence_control_valid =
  1787. hal_rx_get_mpdu_sequence_control_valid_be;
  1788. hal_soc->ops->hal_rx_is_unicast = hal_rx_is_unicast_be;
  1789. hal_soc->ops->hal_rx_tid_get = hal_rx_tid_get_be;
  1790. hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
  1791. hal_rx_hw_desc_get_ppduid_get_be;
  1792. hal_soc->ops->hal_rx_mpdu_start_mpdu_qos_control_valid_get =
  1793. hal_rx_mpdu_start_mpdu_qos_control_valid_get_be;
  1794. hal_soc->ops->hal_rx_msdu_end_sa_sw_peer_id_get =
  1795. hal_rx_msdu_end_sa_sw_peer_id_get_be;
  1796. hal_soc->ops->hal_rx_msdu0_buffer_addr_lsb =
  1797. hal_rx_msdu0_buffer_addr_lsb_9224;
  1798. hal_soc->ops->hal_rx_msdu_desc_info_ptr_get =
  1799. hal_rx_msdu_desc_info_ptr_get_9224;
  1800. hal_soc->ops->hal_ent_mpdu_desc_info = hal_ent_mpdu_desc_info_9224;
  1801. hal_soc->ops->hal_dst_mpdu_desc_info = hal_dst_mpdu_desc_info_9224;
  1802. hal_soc->ops->hal_rx_get_fc_valid = hal_rx_get_fc_valid_be;
  1803. hal_soc->ops->hal_rx_get_to_ds_flag = hal_rx_get_to_ds_flag_be;
  1804. hal_soc->ops->hal_rx_get_mac_addr2_valid =
  1805. hal_rx_get_mac_addr2_valid_be;
  1806. hal_soc->ops->hal_rx_get_filter_category =
  1807. hal_rx_get_filter_category_be;
  1808. hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
  1809. hal_soc->ops->hal_reo_config = hal_reo_config_9224;
  1810. hal_soc->ops->hal_rx_msdu_flow_idx_get = hal_rx_msdu_flow_idx_get_be;
  1811. hal_soc->ops->hal_rx_msdu_flow_idx_invalid =
  1812. hal_rx_msdu_flow_idx_invalid_be;
  1813. hal_soc->ops->hal_rx_msdu_flow_idx_timeout =
  1814. hal_rx_msdu_flow_idx_timeout_be;
  1815. hal_soc->ops->hal_rx_msdu_fse_metadata_get =
  1816. hal_rx_msdu_fse_metadata_get_be;
  1817. hal_soc->ops->hal_rx_msdu_cce_match_get =
  1818. hal_rx_msdu_cce_match_get_be;
  1819. hal_soc->ops->hal_rx_msdu_cce_metadata_get =
  1820. hal_rx_msdu_cce_metadata_get_be;
  1821. hal_soc->ops->hal_rx_msdu_get_flow_params =
  1822. hal_rx_msdu_get_flow_params_be;
  1823. hal_soc->ops->hal_rx_tlv_get_tcp_chksum = hal_rx_tlv_get_tcp_chksum_be;
  1824. hal_soc->ops->hal_rx_get_rx_sequence = hal_rx_get_rx_sequence_be;
  1825. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  1826. hal_soc->ops->hal_rx_get_bb_info = hal_rx_get_bb_info_9224;
  1827. hal_soc->ops->hal_rx_get_rtt_info = hal_rx_get_rtt_info_9224;
  1828. #else
  1829. hal_soc->ops->hal_rx_get_bb_info = NULL;
  1830. hal_soc->ops->hal_rx_get_rtt_info = NULL;
  1831. #endif
  1832. /* rx - msdu fast path info fields */
  1833. hal_soc->ops->hal_rx_msdu_packet_metadata_get =
  1834. hal_rx_msdu_packet_metadata_get_generic_be;
  1835. hal_soc->ops->hal_rx_mpdu_start_tlv_tag_valid =
  1836. hal_rx_mpdu_start_tlv_tag_valid_be;
  1837. hal_soc->ops->hal_rx_wbm_err_msdu_continuation_get =
  1838. hal_rx_wbm_err_msdu_continuation_get_9224;
  1839. /* rx - TLV struct offsets */
  1840. hal_soc->ops->hal_rx_msdu_end_offset_get =
  1841. hal_rx_msdu_end_offset_get_generic;
  1842. hal_soc->ops->hal_rx_mpdu_start_offset_get =
  1843. hal_rx_mpdu_start_offset_get_generic;
  1844. #ifndef NO_RX_PKT_HDR_TLV
  1845. hal_soc->ops->hal_rx_pkt_tlv_offset_get =
  1846. hal_rx_pkt_tlv_offset_get_generic;
  1847. #endif
  1848. hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_9224;
  1849. hal_soc->ops->hal_rx_flow_get_tuple_info =
  1850. hal_rx_flow_get_tuple_info_be;
  1851. hal_soc->ops->hal_rx_flow_delete_entry =
  1852. hal_rx_flow_delete_entry_be;
  1853. hal_soc->ops->hal_rx_fst_get_fse_size = hal_rx_fst_get_fse_size_be;
  1854. hal_soc->ops->hal_compute_reo_remap_ix2_ix3 =
  1855. hal_compute_reo_remap_ix2_ix3_9224;
  1856. hal_soc->ops->hal_rx_msdu_get_reo_destination_indication =
  1857. hal_rx_msdu_get_reo_destination_indication_be;
  1858. hal_soc->ops->hal_rx_get_tlv_size = hal_rx_get_tlv_size_generic_be;
  1859. hal_soc->ops->hal_rx_msdu_is_wlan_mcast =
  1860. hal_rx_msdu_is_wlan_mcast_generic_be;
  1861. hal_soc->ops->hal_tx_get_num_tcl_banks = hal_tx_get_num_tcl_banks_9224;
  1862. hal_soc->ops->hal_rx_tlv_decap_format_get =
  1863. hal_rx_tlv_decap_format_get_be;
  1864. #ifdef RECEIVE_OFFLOAD
  1865. hal_soc->ops->hal_rx_tlv_get_offload_info =
  1866. hal_rx_tlv_get_offload_info_be;
  1867. hal_soc->ops->hal_rx_get_proto_params = hal_rx_get_proto_params_be;
  1868. hal_soc->ops->hal_rx_get_l3_l4_offsets = hal_rx_get_l3_l4_offsets_be;
  1869. #endif
  1870. hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get =
  1871. hal_rx_attn_phy_ppdu_id_get_be;
  1872. hal_soc->ops->hal_rx_tlv_msdu_done_get =
  1873. hal_rx_tlv_msdu_done_copy_get_9224;
  1874. hal_soc->ops->hal_rx_tlv_msdu_len_get =
  1875. hal_rx_msdu_start_msdu_len_get_be;
  1876. hal_soc->ops->hal_rx_get_frame_ctrl_field =
  1877. hal_rx_get_frame_ctrl_field_be;
  1878. hal_soc->ops->hal_rx_tlv_csum_err_get = hal_rx_tlv_csum_err_get_be;
  1879. hal_soc->ops->hal_rx_mpdu_info_ampdu_flag_get =
  1880. hal_rx_mpdu_info_ampdu_flag_get_be;
  1881. hal_soc->ops->hal_rx_tlv_msdu_len_set =
  1882. hal_rx_msdu_start_msdu_len_set_be;
  1883. hal_soc->ops->hal_rx_tlv_sgi_get = hal_rx_tlv_sgi_get_be;
  1884. hal_soc->ops->hal_rx_tlv_rate_mcs_get = hal_rx_tlv_rate_mcs_get_be;
  1885. hal_soc->ops->hal_rx_tlv_bw_get = hal_rx_tlv_bw_get_be;
  1886. hal_soc->ops->hal_rx_tlv_get_pkt_type = hal_rx_tlv_get_pkt_type_be;
  1887. hal_soc->ops->hal_rx_tlv_mic_err_get = hal_rx_tlv_mic_err_get_be;
  1888. hal_soc->ops->hal_rx_tlv_decrypt_err_get =
  1889. hal_rx_tlv_decrypt_err_get_be;
  1890. hal_soc->ops->hal_rx_tlv_first_mpdu_get = hal_rx_tlv_first_mpdu_get_be;
  1891. hal_soc->ops->hal_rx_tlv_get_is_decrypted =
  1892. hal_rx_tlv_get_is_decrypted_be;
  1893. hal_soc->ops->hal_rx_msdu_get_keyid = hal_rx_msdu_get_keyid_be;
  1894. hal_soc->ops->hal_rx_tlv_get_freq = hal_rx_tlv_get_freq_be;
  1895. hal_soc->ops->hal_rx_priv_info_set_in_tlv =
  1896. hal_rx_priv_info_set_in_tlv_be;
  1897. hal_soc->ops->hal_rx_priv_info_get_from_tlv =
  1898. hal_rx_priv_info_get_from_tlv_be;
  1899. hal_soc->ops->hal_rx_pkt_hdr_get = hal_rx_pkt_hdr_get_be;
  1900. hal_soc->ops->hal_reo_setup = hal_reo_setup_9224;
  1901. hal_soc->ops->hal_reo_config_reo2ppe_dest_info = NULL;
  1902. #ifdef REO_SHARED_QREF_TABLE_EN
  1903. hal_soc->ops->hal_reo_shared_qaddr_setup = hal_reo_shared_qaddr_setup_be;
  1904. hal_soc->ops->hal_reo_shared_qaddr_init = hal_reo_shared_qaddr_init_be;
  1905. hal_soc->ops->hal_reo_shared_qaddr_detach = hal_reo_shared_qaddr_detach_be;
  1906. hal_soc->ops->hal_reo_shared_qaddr_write = hal_reo_shared_qaddr_write_be;
  1907. hal_soc->ops->hal_reo_shared_qaddr_cache_clear = hal_reo_shared_qaddr_cache_clear_be;
  1908. #endif
  1909. /* Overwrite the default BE ops */
  1910. hal_soc->ops->hal_get_rx_max_ba_window =
  1911. hal_get_rx_max_ba_window_qcn9224;
  1912. hal_soc->ops->hal_get_reo_qdesc_size = hal_qcn9224_get_reo_qdesc_size;
  1913. /* TX MONITOR */
  1914. #ifdef QCA_MONITOR_2_0_SUPPORT
  1915. hal_soc->ops->hal_txmon_is_mon_buf_addr_tlv =
  1916. hal_txmon_is_mon_buf_addr_tlv_generic_be;
  1917. hal_soc->ops->hal_txmon_populate_packet_info =
  1918. hal_txmon_populate_packet_info_generic_be;
  1919. hal_soc->ops->hal_txmon_status_parse_tlv =
  1920. hal_txmon_status_parse_tlv_generic_be;
  1921. hal_soc->ops->hal_txmon_status_get_num_users =
  1922. hal_txmon_status_get_num_users_generic_be;
  1923. #endif /* QCA_MONITOR_2_0_SUPPORT */
  1924. hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
  1925. hal_soc->ops->hal_tx_vdev_mismatch_routing_set =
  1926. hal_tx_vdev_mismatch_routing_set_generic_be;
  1927. hal_soc->ops->hal_tx_mcast_mlo_reinject_routing_set =
  1928. hal_tx_mcast_mlo_reinject_routing_set_generic_be;
  1929. hal_soc->ops->hal_get_ba_aging_timeout =
  1930. hal_get_ba_aging_timeout_be_generic;
  1931. hal_soc->ops->hal_setup_link_idle_list =
  1932. hal_setup_link_idle_list_generic_be;
  1933. hal_soc->ops->hal_cookie_conversion_reg_cfg_be =
  1934. hal_cookie_conversion_reg_cfg_generic_be;
  1935. hal_soc->ops->hal_set_ba_aging_timeout =
  1936. hal_set_ba_aging_timeout_be_generic;
  1937. hal_soc->ops->hal_tx_populate_bank_register =
  1938. hal_tx_populate_bank_register_be;
  1939. hal_soc->ops->hal_tx_vdev_mcast_ctrl_set =
  1940. hal_tx_vdev_mcast_ctrl_set_be;
  1941. };
  1942. /**
  1943. * hal_srng_hw_reg_offset_init_qcn9224() - Initialize the HW srng reg offset
  1944. * applicable only for QCN9224
  1945. * @hal_soc: HAL Soc handle
  1946. *
  1947. * Return: None
  1948. */
  1949. static inline void hal_srng_hw_reg_offset_init_qcn9224(struct hal_soc *hal_soc)
  1950. {
  1951. int32_t *hw_reg_offset = hal_soc->hal_hw_reg_offset;
  1952. hw_reg_offset[DST_MSI2_BASE_LSB] = REG_OFFSET(DST, MSI2_BASE_LSB),
  1953. hw_reg_offset[DST_MSI2_BASE_MSB] = REG_OFFSET(DST, MSI2_BASE_MSB),
  1954. hw_reg_offset[DST_MSI2_DATA] = REG_OFFSET(DST, MSI2_DATA),
  1955. hw_reg_offset[DST_PRODUCER_INT2_SETUP] =
  1956. REG_OFFSET(DST, PRODUCER_INT2_SETUP);
  1957. }