hal_9224.h 67 KB

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