hal_9224.c 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515
  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 <wbm_release_ring_rx.h>
  40. #include <phyrx_location.h>
  41. #ifdef QCA_MONITOR_2_0_SUPPORT
  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_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_OFFSET \
  48. RXPCU_PPDU_END_INFO_RX_PPDU_DURATION_OFFSET
  49. #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_MASK \
  50. RXPCU_PPDU_END_INFO_RX_PPDU_DURATION_MASK
  51. #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_LSB \
  52. RXPCU_PPDU_END_INFO_RX_PPDU_DURATION_LSB
  53. #define UNIFIED_PHYRX_HT_SIG_0_HT_SIG_INFO_PHYRX_HT_SIG_INFO_DETAILS_OFFSET \
  54. PHYRX_HT_SIG_PHYRX_HT_SIG_INFO_DETAILS_MCS_OFFSET
  55. #define UNIFIED_PHYRX_L_SIG_B_0_L_SIG_B_INFO_PHYRX_L_SIG_B_INFO_DETAILS_OFFSET \
  56. PHYRX_L_SIG_B_PHYRX_L_SIG_B_INFO_DETAILS_RATE_OFFSET
  57. #define UNIFIED_PHYRX_L_SIG_A_0_L_SIG_A_INFO_PHYRX_L_SIG_A_INFO_DETAILS_OFFSET \
  58. PHYRX_L_SIG_A_PHYRX_L_SIG_A_INFO_DETAILS_RATE_OFFSET
  59. #define UNIFIED_PHYRX_VHT_SIG_A_0_VHT_SIG_A_INFO_PHYRX_VHT_SIG_A_INFO_DETAILS_OFFSET \
  60. PHYRX_VHT_SIG_A_PHYRX_VHT_SIG_A_INFO_DETAILS_BANDWIDTH_OFFSET
  61. #define UNIFIED_PHYRX_HE_SIG_A_SU_0_HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS_OFFSET \
  62. PHYRX_HE_SIG_A_SU_PHYRX_HE_SIG_A_SU_INFO_DETAILS_FORMAT_INDICATION_OFFSET
  63. #define UNIFIED_PHYRX_HE_SIG_A_MU_DL_0_HE_SIG_A_MU_DL_INFO_PHYRX_HE_SIG_A_MU_DL_INFO_DETAILS_OFFSET \
  64. PHYRX_HE_SIG_A_MU_DL_PHYRX_HE_SIG_A_MU_DL_INFO_DETAILS_DL_UL_FLAG_OFFSET
  65. #define UNIFIED_PHYRX_HE_SIG_B1_MU_0_HE_SIG_B1_MU_INFO_PHYRX_HE_SIG_B1_MU_INFO_DETAILS_OFFSET \
  66. PHYRX_HE_SIG_B1_MU_PHYRX_HE_SIG_B1_MU_INFO_DETAILS_RU_ALLOCATION_OFFSET
  67. #define UNIFIED_PHYRX_HE_SIG_B2_MU_0_HE_SIG_B2_MU_INFO_PHYRX_HE_SIG_B2_MU_INFO_DETAILS_OFFSET \
  68. PHYRX_HE_SIG_B2_MU_PHYRX_HE_SIG_B2_MU_INFO_DETAILS_STA_ID_OFFSET
  69. #define UNIFIED_PHYRX_HE_SIG_B2_OFDMA_0_HE_SIG_B2_OFDMA_INFO_PHYRX_HE_SIG_B2_OFDMA_INFO_DETAILS_OFFSET \
  70. PHYRX_HE_SIG_B2_OFDMA_PHYRX_HE_SIG_B2_OFDMA_INFO_DETAILS_STA_ID_OFFSET
  71. #define UNIFIED_PHYRX_RSSI_LEGACY_3_RECEIVE_RSSI_INFO_PRE_RSSI_INFO_DETAILS_OFFSET \
  72. PHYRX_RSSI_LEGACY_PRE_RSSI_INFO_DETAILS_RSSI_PRI20_CHAIN0_OFFSET
  73. #define UNIFIED_PHYRX_RSSI_LEGACY_19_RECEIVE_RSSI_INFO_PREAMBLE_RSSI_INFO_DETAILS_OFFSET \
  74. PHYRX_RSSI_LEGACY_PREAMBLE_RSSI_INFO_DETAILS_RSSI_PRI20_CHAIN0_OFFSET
  75. #define UNIFIED_RX_MPDU_START_0_RX_MPDU_INFO_RX_MPDU_INFO_DETAILS_OFFSET \
  76. RX_MPDU_START_RX_MPDU_INFO_DETAILS_RXPCU_MPDU_FILTER_IN_CATEGORY_OFFSET
  77. #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
  78. RX_MSDU_LINK_MSDU_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET
  79. #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
  80. RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET
  81. #define UNIFIED_RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
  82. RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
  83. #define UNIFIED_REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
  84. REO_DESTINATION_RING_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
  85. #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER \
  86. STATUS_HEADER_REO_STATUS_NUMBER
  87. #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC \
  88. STATUS_HEADER_TIMESTAMP
  89. #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
  90. RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET
  91. #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
  92. RX_MSDU_LINK_MSDU_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET
  93. #define UNIFIED_TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
  94. TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET
  95. #define UNIFIED_TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
  96. TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET
  97. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET \
  98. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_OFFSET
  99. #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB \
  100. BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB
  101. #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK \
  102. BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK
  103. #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB \
  104. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB
  105. #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK \
  106. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK
  107. #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB \
  108. BUFFER_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB
  109. #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK \
  110. BUFFER_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK
  111. #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB \
  112. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_LSB
  113. #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK \
  114. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_MASK
  115. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB \
  116. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_LSB
  117. #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK \
  118. TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MASK
  119. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK \
  120. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_MASK
  121. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET \
  122. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_OFFSET
  123. #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB \
  124. WBM_RELEASE_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_LSB
  125. #ifdef CONFIG_WIFI_EMULATION_WIFI_3_0
  126. #define CMEM_REG_BASE 0x0010e000
  127. #define CMEM_WINDOW_ADDRESS_9224 \
  128. ((CMEM_REG_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  129. #endif
  130. #define CE_WINDOW_ADDRESS_9224 \
  131. ((CE_WFSS_CE_REG_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  132. #define UMAC_WINDOW_ADDRESS_9224 \
  133. ((UMAC_BASE >> WINDOW_SHIFT) & WINDOW_VALUE_MASK)
  134. #ifdef CONFIG_WIFI_EMULATION_WIFI_3_0
  135. #define WINDOW_CONFIGURATION_VALUE_9224 \
  136. ((CE_WINDOW_ADDRESS_9224 << 6) |\
  137. (UMAC_WINDOW_ADDRESS_9224 << 12) | \
  138. CMEM_WINDOW_ADDRESS_9224 | \
  139. WINDOW_ENABLE_BIT)
  140. #else
  141. #define WINDOW_CONFIGURATION_VALUE_9224 \
  142. ((CE_WINDOW_ADDRESS_9224 << 6) |\
  143. (UMAC_WINDOW_ADDRESS_9224 << 12) | \
  144. WINDOW_ENABLE_BIT)
  145. #endif
  146. /* For Berryllium sw2rxdma ring size increased to 20 bits */
  147. #define HAL_RXDMA_MAX_RING_SIZE_BE 0xFFFFF
  148. #ifdef CONFIG_WORD_BASED_TLV
  149. #ifndef BIG_ENDIAN_HOST
  150. struct rx_msdu_end_compact_qca9224 {
  151. uint32_t rxpcu_mpdu_filter_in_category : 2, // [1:0]
  152. sw_frame_group_id : 7, // [8:2]
  153. reserved_0 : 7, // [15:9]
  154. phy_ppdu_id : 16; // [31:16]
  155. uint32_t ip_hdr_chksum : 16, // [15:0]
  156. reported_mpdu_length : 14, // [29:16]
  157. reserved_1a : 2; // [31:30]
  158. uint32_t key_id_octet : 8, // [7:0]
  159. cce_super_rule : 6, // [13:8]
  160. cce_classify_not_done_truncate : 1, // [14:14]
  161. cce_classify_not_done_cce_dis : 1, // [15:15]
  162. cumulative_l3_checksum : 16; // [31:16]
  163. uint32_t rule_indication_31_0 : 32; // [31:0]
  164. uint32_t rule_indication_63_32 : 32; // [31:0]
  165. uint32_t da_offset : 6, // [5:0]
  166. sa_offset : 6, // [11:6]
  167. da_offset_valid : 1, // [12:12]
  168. sa_offset_valid : 1, // [13:13]
  169. reserved_5a : 2, // [15:14]
  170. l3_type : 16; // [31:16]
  171. uint32_t ipv6_options_crc : 32; // [31:0]
  172. uint32_t tcp_seq_number : 32; // [31:0]
  173. uint32_t tcp_ack_number : 32; // [31:0]
  174. uint32_t tcp_flag : 9, // [8:0]
  175. lro_eligible : 1, // [9:9]
  176. reserved_9a : 6, // [15:10]
  177. window_size : 16; // [31:16]
  178. uint32_t tcp_udp_chksum : 16, // [15:0]
  179. sa_idx_timeout : 1, // [16:16]
  180. da_idx_timeout : 1, // [17:17]
  181. msdu_limit_error : 1, // [18:18]
  182. flow_idx_timeout : 1, // [19:19]
  183. flow_idx_invalid : 1, // [20:20]
  184. wifi_parser_error : 1, // [21:21]
  185. amsdu_parser_error : 1, // [22:22]
  186. sa_is_valid : 1, // [23:23]
  187. da_is_valid : 1, // [24:24]
  188. da_is_mcbc : 1, // [25:25]
  189. l3_header_padding : 2, // [27:26]
  190. first_msdu : 1, // [28:28]
  191. last_msdu : 1, // [29:29]
  192. tcp_udp_chksum_fail_copy : 1, // [30:30]
  193. ip_chksum_fail_copy : 1; // [31:31]
  194. uint32_t sa_idx : 16, // [15:0]
  195. da_idx_or_sw_peer_id : 16; // [31:16]
  196. uint32_t msdu_drop : 1, // [0:0]
  197. reo_destination_indication : 5, // [5:1]
  198. flow_idx : 20, // [25:6]
  199. use_ppe : 1, // [26:26]
  200. reserved_12a : 5; // [31:27]
  201. uint32_t fse_metadata : 32; // [31:0]
  202. uint32_t cce_metadata : 16, // [15:0]
  203. sa_sw_peer_id : 16; // [31:16]
  204. uint32_t aggregation_count : 8, // [7:0]
  205. flow_aggregation_continuation : 1, // [8:8]
  206. fisa_timeout : 1, // [9:9]
  207. reserved_15a : 22; // [31:10]
  208. uint32_t cumulative_l4_checksum : 16, // [15:0]
  209. cumulative_ip_length : 16; // [31:16]
  210. uint32_t reserved_17a : 6, // [5:0]
  211. service_code : 9, // [14:6]
  212. priority_valid : 1, // [15:15]
  213. intra_bss : 1, // [16:16]
  214. dest_chip_id : 2, // [18:17]
  215. multicast_echo : 1, // [19:19]
  216. wds_learning_event : 1, // [20:20]
  217. wds_roaming_event : 1, // [21:21]
  218. wds_keep_alive_event : 1, // [22:22]
  219. reserved_17b : 9; // [31:23]
  220. uint32_t msdu_length : 14, // [13:0]
  221. stbc : 1, // [14:14]
  222. ipsec_esp : 1, // [15:15]
  223. l3_offset : 7, // [22:16]
  224. ipsec_ah : 1, // [23:23]
  225. l4_offset : 8; // [31:24]
  226. uint32_t msdu_number : 8, // [7:0]
  227. decap_format : 2, // [9:8]
  228. ipv4_proto : 1, // [10:10]
  229. ipv6_proto : 1, // [11:11]
  230. tcp_proto : 1, // [12:12]
  231. udp_proto : 1, // [13:13]
  232. ip_frag : 1, // [14:14]
  233. tcp_only_ack : 1, // [15:15]
  234. da_is_bcast_mcast : 1, // [16:16]
  235. toeplitz_hash_sel : 2, // [18:17]
  236. ip_fixed_header_valid : 1, // [19:19]
  237. ip_extn_header_valid : 1, // [20:20]
  238. tcp_udp_header_valid : 1, // [21:21]
  239. mesh_control_present : 1, // [22:22]
  240. ldpc : 1, // [23:23]
  241. ip4_protocol_ip6_next_header : 8; // [31:24]
  242. uint32_t toeplitz_hash_2_or_4 : 32; // [31:0]
  243. uint32_t flow_id_toeplitz : 32; // [31:0]
  244. uint32_t user_rssi : 8, // [7:0]
  245. pkt_type : 4, // [11:8]
  246. sgi : 2, // [13:12]
  247. rate_mcs : 4, // [17:14]
  248. receive_bandwidth : 3, // [20:18]
  249. reception_type : 3, // [23:21]
  250. mimo_ss_bitmap : 8; // [31:24]
  251. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  252. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  253. uint32_t sw_phy_meta_data : 32; // [31:0]
  254. uint32_t vlan_ctag_ci : 16, // [15:0]
  255. vlan_stag_ci : 16; // [31:16]
  256. uint32_t reserved_27a : 32; // [31:0]
  257. uint32_t reserved_28a : 32; // [31:0]
  258. uint32_t reserved_29a : 32; // [31:0]
  259. uint32_t first_mpdu : 1, // [0:0]
  260. reserved_30a : 1, // [1:1]
  261. mcast_bcast : 1, // [2:2]
  262. ast_index_not_found : 1, // [3:3]
  263. ast_index_timeout : 1, // [4:4]
  264. power_mgmt : 1, // [5:5]
  265. non_qos : 1, // [6:6]
  266. null_data : 1, // [7:7]
  267. mgmt_type : 1, // [8:8]
  268. ctrl_type : 1, // [9:9]
  269. more_data : 1, // [10:10]
  270. eosp : 1, // [11:11]
  271. a_msdu_error : 1, // [12:12]
  272. fragment_flag : 1, // [13:13]
  273. order : 1, // [14:14]
  274. cce_match : 1, // [15:15]
  275. overflow_err : 1, // [16:16]
  276. msdu_length_err : 1, // [17:17]
  277. tcp_udp_chksum_fail : 1, // [18:18]
  278. ip_chksum_fail : 1, // [19:19]
  279. sa_idx_invalid : 1, // [20:20]
  280. da_idx_invalid : 1, // [21:21]
  281. reserved_30b : 1, // [22:22]
  282. rx_in_tx_decrypt_byp : 1, // [23:23]
  283. encrypt_required : 1, // [24:24]
  284. directed : 1, // [25:25]
  285. buffer_fragment : 1, // [26:26]
  286. mpdu_length_err : 1, // [27:27]
  287. tkip_mic_err : 1, // [28:28]
  288. decrypt_err : 1, // [29:29]
  289. unencrypted_frame_err : 1, // [30:30]
  290. fcs_err : 1; // [31:31]
  291. uint32_t reserved_31a : 10, // [9:0]
  292. decrypt_status_code : 3, // [12:10]
  293. rx_bitmap_not_updated : 1, // [13:13]
  294. reserved_31b : 17, // [30:14]
  295. msdu_done : 1; // [31:31]
  296. };
  297. struct rx_mpdu_start_compact_qca9224 {
  298. struct rxpt_classify_info rxpt_classify_info_details;
  299. uint32_t rx_reo_queue_desc_addr_31_0 : 32; // [31:0]
  300. uint32_t rx_reo_queue_desc_addr_39_32 : 8, // [7:0]
  301. receive_queue_number : 16, // [23:8]
  302. pre_delim_err_warning : 1, // [24:24]
  303. first_delim_err : 1, // [25:25]
  304. reserved_2a : 6; // [31:26]
  305. uint32_t pn_31_0 : 32; // [31:0]
  306. uint32_t pn_63_32 : 32; // [31:0]
  307. uint32_t pn_95_64 : 32; // [31:0]
  308. uint32_t pn_127_96 : 32; // [31:0]
  309. uint32_t epd_en : 1, // [0:0]
  310. all_frames_shall_be_encrypted : 1, // [1:1]
  311. encrypt_type : 4, // [5:2]
  312. wep_key_width_for_variable_key : 2, // [7:6]
  313. mesh_sta : 2, // [9:8]
  314. bssid_hit : 1, // [10:10]
  315. bssid_number : 4, // [14:11]
  316. tid : 4, // [18:15]
  317. reserved_7a : 13; // [31:19]
  318. uint32_t peer_meta_data : 32; // [31:0]
  319. uint32_t rxpcu_mpdu_filter_in_category : 2, // [1:0]
  320. sw_frame_group_id : 7, // [8:2]
  321. ndp_frame : 1, // [9:9]
  322. phy_err : 1, // [10:10]
  323. phy_err_during_mpdu_header : 1, // [11:11]
  324. protocol_version_err : 1, // [12:12]
  325. ast_based_lookup_valid : 1, // [13:13]
  326. ranging : 1, // [14:14]
  327. reserved_9a : 1, // [15:15]
  328. phy_ppdu_id : 16; // [31:16]
  329. uint32_t ast_index : 16, // [15:0]
  330. sw_peer_id : 16; // [31:16]
  331. uint32_t mpdu_frame_control_valid : 1, // [0:0]
  332. mpdu_duration_valid : 1, // [1:1]
  333. mac_addr_ad1_valid : 1, // [2:2]
  334. mac_addr_ad2_valid : 1, // [3:3]
  335. mac_addr_ad3_valid : 1, // [4:4]
  336. mac_addr_ad4_valid : 1, // [5:5]
  337. mpdu_sequence_control_valid : 1, // [6:6]
  338. mpdu_qos_control_valid : 1, // [7:7]
  339. mpdu_ht_control_valid : 1, // [8:8]
  340. frame_encryption_info_valid : 1, // [9:9]
  341. mpdu_fragment_number : 4, // [13:10]
  342. more_fragment_flag : 1, // [14:14]
  343. reserved_11a : 1, // [15:15]
  344. fr_ds : 1, // [16:16]
  345. to_ds : 1, // [17:17]
  346. encrypted : 1, // [18:18]
  347. mpdu_retry : 1, // [19:19]
  348. mpdu_sequence_number : 12; // [31:20]
  349. uint32_t key_id_octet : 8, // [7:0]
  350. new_peer_entry : 1, // [8:8]
  351. decrypt_needed : 1, // [9:9]
  352. decap_type : 2, // [11:10]
  353. rx_insert_vlan_c_tag_padding : 1, // [12:12]
  354. rx_insert_vlan_s_tag_padding : 1, // [13:13]
  355. strip_vlan_c_tag_decap : 1, // [14:14]
  356. strip_vlan_s_tag_decap : 1, // [15:15]
  357. pre_delim_count : 12, // [27:16]
  358. ampdu_flag : 1, // [28:28]
  359. bar_frame : 1, // [29:29]
  360. raw_mpdu : 1, // [30:30]
  361. reserved_12 : 1; // [31:31]
  362. uint32_t mpdu_length : 14, // [13:0]
  363. first_mpdu : 1, // [14:14]
  364. mcast_bcast : 1, // [15:15]
  365. ast_index_not_found : 1, // [16:16]
  366. ast_index_timeout : 1, // [17:17]
  367. power_mgmt : 1, // [18:18]
  368. non_qos : 1, // [19:19]
  369. null_data : 1, // [20:20]
  370. mgmt_type : 1, // [21:21]
  371. ctrl_type : 1, // [22:22]
  372. more_data : 1, // [23:23]
  373. eosp : 1, // [24:24]
  374. fragment_flag : 1, // [25:25]
  375. order : 1, // [26:26]
  376. u_apsd_trigger : 1, // [27:27]
  377. encrypt_required : 1, // [28:28]
  378. directed : 1, // [29:29]
  379. amsdu_present : 1, // [30:30]
  380. reserved_13 : 1; // [31:31]
  381. uint32_t mpdu_frame_control_field : 16, // [15:0]
  382. mpdu_duration_field : 16; // [31:16]
  383. uint32_t mac_addr_ad1_31_0 : 32; // [31:0]
  384. uint32_t mac_addr_ad1_47_32 : 16, // [15:0]
  385. mac_addr_ad2_15_0 : 16; // [31:16]
  386. uint32_t mac_addr_ad2_47_16 : 32; // [31:0]
  387. uint32_t mac_addr_ad3_31_0 : 32; // [31:0]
  388. uint32_t mac_addr_ad3_47_32 : 16, // [15:0]
  389. mpdu_sequence_control_field : 16; // [31:16]
  390. uint32_t mac_addr_ad4_31_0 : 32; // [31:0]
  391. uint32_t mac_addr_ad4_47_32 : 16, // [15:0]
  392. mpdu_qos_control_field : 16; // [31:16]
  393. uint32_t mpdu_ht_control_field : 32; // [31:0]
  394. uint32_t vdev_id : 8, // [7:0]
  395. service_code : 9, // [16:8]
  396. priority_valid : 1, // [17:17]
  397. src_info : 12, // [29:18]
  398. reserved_23a : 1, // [30:30]
  399. multi_link_addr_ad1_ad2_valid : 1; // [31:31]
  400. uint32_t multi_link_addr_ad1_31_0 : 32; // [31:0]
  401. uint32_t multi_link_addr_ad1_47_32 : 16, // [15:0]
  402. multi_link_addr_ad2_15_0 : 16; // [31:16]
  403. uint32_t multi_link_addr_ad2_47_16 : 32; // [31:0]
  404. uint32_t reserved_27a : 32; // [31:0]
  405. uint32_t reserved_28a : 32; // [31:0]
  406. uint32_t reserved_29a : 32; // [31:0]
  407. };
  408. #else
  409. struct rx_msdu_end_compact_qca9224 {
  410. uint32_t phy_ppdu_id : 16, // [31:16]
  411. reserved_0 : 7, // [15:9]
  412. sw_frame_group_id : 7, // [8:2]
  413. rxpcu_mpdu_filter_in_category : 2; // [1:0]
  414. uint32_t reserved_1a : 2, // [31:30]
  415. reported_mpdu_length : 14, // [29:16]
  416. ip_hdr_chksum : 16; // [15:0]
  417. uint32_t cumulative_l3_checksum : 16, // [31:16]
  418. cce_classify_not_done_cce_dis : 1, // [15:15]
  419. cce_classify_not_done_truncate : 1, // [14:14]
  420. cce_super_rule : 6, // [13:8]
  421. key_id_octet : 8; // [7:0]
  422. uint32_t rule_indication_31_0 : 32; // [31:0]
  423. uint32_t rule_indication_63_32 : 32; // [31:0]
  424. uint32_t l3_type : 16, // [31:16]
  425. reserved_5a : 2, // [15:14]
  426. sa_offset_valid : 1, // [13:13]
  427. da_offset_valid : 1, // [12:12]
  428. sa_offset : 6, // [11:6]
  429. da_offset : 6; // [5:0]
  430. uint32_t ipv6_options_crc : 32; // [31:0]
  431. uint32_t tcp_seq_number : 32; // [31:0]
  432. uint32_t tcp_ack_number : 32; // [31:0]
  433. uint32_t window_size : 16, // [31:16]
  434. reserved_9a : 6, // [15:10]
  435. lro_eligible : 1, // [9:9]
  436. tcp_flag : 9; // [8:0]
  437. uint32_t ip_chksum_fail_copy : 1, // [31:31]
  438. tcp_udp_chksum_fail_copy : 1, // [30:30]
  439. last_msdu : 1, // [29:29]
  440. first_msdu : 1, // [28:28]
  441. l3_header_padding : 2, // [27:26]
  442. da_is_mcbc : 1, // [25:25]
  443. da_is_valid : 1, // [24:24]
  444. sa_is_valid : 1, // [23:23]
  445. amsdu_parser_error : 1, // [22:22]
  446. wifi_parser_error : 1, // [21:21]
  447. flow_idx_invalid : 1, // [20:20]
  448. flow_idx_timeout : 1, // [19:19]
  449. msdu_limit_error : 1, // [18:18]
  450. da_idx_timeout : 1, // [17:17]
  451. sa_idx_timeout : 1, // [16:16]
  452. tcp_udp_chksum : 16; // [15:0]
  453. uint32_t da_idx_or_sw_peer_id : 16, // [31:16]
  454. sa_idx : 16; // [15:0]
  455. uint32_t reserved_12a : 5, // [31:27]
  456. use_ppe : 1, // [26:26]
  457. flow_idx : 20, // [25:6]
  458. reo_destination_indication : 5, // [5:1]
  459. msdu_drop : 1; // [0:0]
  460. uint32_t fse_metadata : 32; // [31:0]
  461. uint32_t sa_sw_peer_id : 16, // [31:16]
  462. cce_metadata : 16; // [15:0]
  463. uint32_t reserved_15a : 22, // [31:10]
  464. fisa_timeout : 1, // [9:9]
  465. flow_aggregation_continuation : 1, // [8:8]
  466. aggregation_count : 8; // [7:0]
  467. uint32_t cumulative_ip_length : 16, // [31:16]
  468. cumulative_l4_checksum : 16; // [15:0]
  469. uint32_t reserved_17b : 9, // [31:23]
  470. wds_keep_alive_event : 1, // [22:22]
  471. wds_roaming_event : 1, // [21:21]
  472. wds_learning_event : 1, // [20:20]
  473. multicast_echo : 1, // [19:19]
  474. dest_chip_id : 2, // [18:17]
  475. intra_bss : 1, // [16:16]
  476. priority_valid : 1, // [15:15]
  477. service_code : 9, // [14:6]
  478. reserved_17a : 6; // [5:0]
  479. uint32_t l4_offset : 8, // [31:24]
  480. ipsec_ah : 1, // [23:23]
  481. l3_offset : 7, // [22:16]
  482. ipsec_esp : 1, // [15:15]
  483. stbc : 1, // [14:14]
  484. msdu_length : 14; // [13:0]
  485. uint32_t ip4_protocol_ip6_next_header : 8, // [31:24]
  486. ldpc : 1, // [23:23]
  487. mesh_control_present : 1, // [22:22]
  488. tcp_udp_header_valid : 1, // [21:21]
  489. ip_extn_header_valid : 1, // [20:20]
  490. ip_fixed_header_valid : 1, // [19:19]
  491. toeplitz_hash_sel : 2, // [18:17]
  492. da_is_bcast_mcast : 1, // [16:16]
  493. tcp_only_ack : 1, // [15:15]
  494. ip_frag : 1, // [14:14]
  495. udp_proto : 1, // [13:13]
  496. tcp_proto : 1, // [12:12]
  497. ipv6_proto : 1, // [11:11]
  498. ipv4_proto : 1, // [10:10]
  499. decap_format : 2, // [9:8]
  500. msdu_number : 8; // [7:0]
  501. uint32_t toeplitz_hash_2_or_4 : 32; // [31:0]
  502. uint32_t flow_id_toeplitz : 32; // [31:0]
  503. uint32_t mimo_ss_bitmap : 8, // [31:24]
  504. reception_type : 3, // [23:21]
  505. receive_bandwidth : 3, // [20:18]
  506. rate_mcs : 4, // [17:14]
  507. sgi : 2, // [13:12]
  508. pkt_type : 4, // [11:8]
  509. user_rssi : 8; // [7:0]
  510. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  511. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  512. uint32_t sw_phy_meta_data : 32; // [31:0]
  513. uint32_t vlan_stag_ci : 16, // [31:16]
  514. vlan_ctag_ci : 16; // [15:0]
  515. uint32_t reserved_27a : 32; // [31:0]
  516. uint32_t reserved_28a : 32; // [31:0]
  517. uint32_t reserved_29a : 32; // [31:0]
  518. uint32_t fcs_err : 1, // [31:31]
  519. unencrypted_frame_err : 1, // [30:30]
  520. decrypt_err : 1, // [29:29]
  521. tkip_mic_err : 1, // [28:28]
  522. mpdu_length_err : 1, // [27:27]
  523. buffer_fragment : 1, // [26:26]
  524. directed : 1, // [25:25]
  525. encrypt_required : 1, // [24:24]
  526. rx_in_tx_decrypt_byp : 1, // [23:23]
  527. reserved_30b : 1, // [22:22]
  528. da_idx_invalid : 1, // [21:21]
  529. sa_idx_invalid : 1, // [20:20]
  530. ip_chksum_fail : 1, // [19:19]
  531. tcp_udp_chksum_fail : 1, // [18:18]
  532. msdu_length_err : 1, // [17:17]
  533. overflow_err : 1, // [16:16]
  534. cce_match : 1, // [15:15]
  535. order : 1, // [14:14]
  536. fragment_flag : 1, // [13:13]
  537. a_msdu_error : 1, // [12:12]
  538. eosp : 1, // [11:11]
  539. more_data : 1, // [10:10]
  540. ctrl_type : 1, // [9:9]
  541. mgmt_type : 1, // [8:8]
  542. null_data : 1, // [7:7]
  543. non_qos : 1, // [6:6]
  544. power_mgmt : 1, // [5:5]
  545. ast_index_timeout : 1, // [4:4]
  546. ast_index_not_found : 1, // [3:3]
  547. mcast_bcast : 1, // [2:2]
  548. reserved_30a : 1, // [1:1]
  549. first_mpdu : 1; // [0:0]
  550. uint32_t msdu_done : 1, // [31:31]
  551. reserved_31b : 17, // [30:14]
  552. rx_bitmap_not_updated : 1, // [13:13]
  553. decrypt_status_code : 3, // [12:10]
  554. reserved_31a : 10; // [9:0]
  555. };
  556. struct rx_mpdu_start_compact_qca9224 {
  557. struct rxpt_classify_info rxpt_classify_info_details;
  558. uint32_t rx_reo_queue_desc_addr_31_0 : 32; // [31:0]
  559. uint32_t reserved_2a : 6, // [31:26]
  560. first_delim_err : 1, // [25:25]
  561. pre_delim_err_warning : 1, // [24:24]
  562. receive_queue_number : 16, // [23:8]
  563. rx_reo_queue_desc_addr_39_32 : 8; // [7:0]
  564. uint32_t pn_31_0 : 32; // [31:0]
  565. uint32_t pn_63_32 : 32; // [31:0]
  566. uint32_t pn_95_64 : 32; // [31:0]
  567. uint32_t pn_127_96 : 32; // [31:0]
  568. uint32_t reserved_7a : 13, // [31:19]
  569. tid : 4, // [18:15]
  570. bssid_number : 4, // [14:11]
  571. bssid_hit : 1, // [10:10]
  572. mesh_sta : 2, // [9:8]
  573. wep_key_width_for_variable_key : 2, // [7:6]
  574. encrypt_type : 4, // [5:2]
  575. all_frames_shall_be_encrypted : 1, // [1:1]
  576. epd_en : 1; // [0:0]
  577. uint32_t peer_meta_data : 32; // [31:0]
  578. uint32_t phy_ppdu_id : 16, // [31:16]
  579. reserved_9a : 1, // [15:15]
  580. ranging : 1, // [14:14]
  581. ast_based_lookup_valid : 1, // [13:13]
  582. protocol_version_err : 1, // [12:12]
  583. phy_err_during_mpdu_header : 1, // [11:11]
  584. phy_err : 1, // [10:10]
  585. ndp_frame : 1, // [9:9]
  586. sw_frame_group_id : 7, // [8:2]
  587. rxpcu_mpdu_filter_in_category : 2; // [1:0]
  588. uint32_t sw_peer_id : 16, // [31:16]
  589. ast_index : 16; // [15:0]
  590. uint32_t mpdu_sequence_number : 12, // [31:20]
  591. mpdu_retry : 1, // [19:19]
  592. encrypted : 1, // [18:18]
  593. to_ds : 1, // [17:17]
  594. fr_ds : 1, // [16:16]
  595. reserved_11a : 1, // [15:15]
  596. more_fragment_flag : 1, // [14:14]
  597. mpdu_fragment_number : 4, // [13:10]
  598. frame_encryption_info_valid : 1, // [9:9]
  599. mpdu_ht_control_valid : 1, // [8:8]
  600. mpdu_qos_control_valid : 1, // [7:7]
  601. mpdu_sequence_control_valid : 1, // [6:6]
  602. mac_addr_ad4_valid : 1, // [5:5]
  603. mac_addr_ad3_valid : 1, // [4:4]
  604. mac_addr_ad2_valid : 1, // [3:3]
  605. mac_addr_ad1_valid : 1, // [2:2]
  606. mpdu_duration_valid : 1, // [1:1]
  607. mpdu_frame_control_valid : 1; // [0:0]
  608. uint32_t reserved_12 : 1, // [31:31]
  609. raw_mpdu : 1, // [30:30]
  610. bar_frame : 1, // [29:29]
  611. ampdu_flag : 1, // [28:28]
  612. pre_delim_count : 12, // [27:16]
  613. strip_vlan_s_tag_decap : 1, // [15:15]
  614. strip_vlan_c_tag_decap : 1, // [14:14]
  615. rx_insert_vlan_s_tag_padding : 1, // [13:13]
  616. rx_insert_vlan_c_tag_padding : 1, // [12:12]
  617. decap_type : 2, // [11:10]
  618. decrypt_needed : 1, // [9:9]
  619. new_peer_entry : 1, // [8:8]
  620. key_id_octet : 8; // [7:0]
  621. uint32_t reserved_13 : 1, // [31:31]
  622. amsdu_present : 1, // [30:30]
  623. directed : 1, // [29:29]
  624. encrypt_required : 1, // [28:28]
  625. u_apsd_trigger : 1, // [27:27]
  626. order : 1, // [26:26]
  627. fragment_flag : 1, // [25:25]
  628. eosp : 1, // [24:24]
  629. more_data : 1, // [23:23]
  630. ctrl_type : 1, // [22:22]
  631. mgmt_type : 1, // [21:21]
  632. null_data : 1, // [20:20]
  633. non_qos : 1, // [19:19]
  634. power_mgmt : 1, // [18:18]
  635. ast_index_timeout : 1, // [17:17]
  636. ast_index_not_found : 1, // [16:16]
  637. mcast_bcast : 1, // [15:15]
  638. first_mpdu : 1, // [14:14]
  639. mpdu_length : 14; // [13:0]
  640. uint32_t mpdu_duration_field : 16, // [31:16]
  641. mpdu_frame_control_field : 16; // [15:0]
  642. uint32_t mac_addr_ad1_31_0 : 32; // [31:0]
  643. uint32_t mac_addr_ad2_15_0 : 16, // [31:16]
  644. mac_addr_ad1_47_32 : 16; // [15:0]
  645. uint32_t mac_addr_ad2_47_16 : 32; // [31:0]
  646. uint32_t mac_addr_ad3_31_0 : 32; // [31:0]
  647. uint32_t mpdu_sequence_control_field : 16, // [31:16]
  648. mac_addr_ad3_47_32 : 16; // [15:0]
  649. uint32_t mac_addr_ad4_31_0 : 32; // [31:0]
  650. uint32_t mpdu_qos_control_field : 16, // [31:16]
  651. mac_addr_ad4_47_32 : 16; // [15:0]
  652. uint32_t mpdu_ht_control_field : 32; // [31:0]
  653. uint32_t multi_link_addr_ad1_ad2_valid : 1, // [31:31]
  654. reserved_23a : 1, // [30:30]
  655. src_info : 12, // [29:18]
  656. priority_valid : 1, // [17:17]
  657. service_code : 9, // [16:8]
  658. vdev_id : 8; // [7:0]
  659. uint32_t multi_link_addr_ad1_31_0 : 32; // [31:0]
  660. uint32_t multi_link_addr_ad2_15_0 : 16, // [31:16]
  661. multi_link_addr_ad1_47_32 : 16; // [15:0]
  662. uint32_t multi_link_addr_ad2_47_16 : 32; // [31:0]
  663. uint32_t reserved_27a : 32; // [31:0]
  664. uint32_t reserved_28a : 32; // [31:0]
  665. uint32_t reserved_29a : 32; // [31:0]
  666. };
  667. #endif /* BIG_ENDIAN_HOST */
  668. /* TLV struct for word based Tlv */
  669. typedef struct rx_mpdu_start_compact_qca9224 hal_rx_mpdu_start_t;
  670. typedef struct rx_msdu_end_compact_qca9224 hal_rx_msdu_end_t;
  671. #endif /* CONFIG_WORD_BASED_TLV */
  672. #include "hal_9224_rx.h"
  673. #include "hal_9224_tx.h"
  674. #include "hal_be_rx_tlv.h"
  675. #include <hal_be_generic_api.h>
  676. #define LINK_DESC_SIZE (NUM_OF_DWORDS_RX_MSDU_LINK << 2)
  677. #define HAL_PPE_VP_ENTRIES_MAX 32
  678. /**
  679. * hal_get_link_desc_size_9224(): API to get the link desc size
  680. *
  681. * Return: uint32_t
  682. */
  683. static uint32_t hal_get_link_desc_size_9224(void)
  684. {
  685. return LINK_DESC_SIZE;
  686. }
  687. /**
  688. * hal_rx_get_tlv_9224(): API to get the tlv
  689. *
  690. * @rx_tlv: TLV data extracted from the rx packet
  691. * Return: uint8_t
  692. */
  693. static uint8_t hal_rx_get_tlv_9224(void *rx_tlv)
  694. {
  695. return HAL_RX_GET(rx_tlv, PHYRX_RSSI_LEGACY, RECEIVE_BANDWIDTH);
  696. }
  697. /**
  698. * hal_rx_wbm_err_msdu_continuation_get_9224 () - API to check if WBM
  699. * msdu continuation bit is set
  700. *
  701. *@wbm_desc: wbm release ring descriptor
  702. *
  703. * Return: true if msdu continuation bit is set.
  704. */
  705. uint8_t hal_rx_wbm_err_msdu_continuation_get_9224(void *wbm_desc)
  706. {
  707. uint32_t comp_desc = *(uint32_t *)(((uint8_t *)wbm_desc) +
  708. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_OFFSET);
  709. return (comp_desc &
  710. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_MASK) >>
  711. WBM_RELEASE_RING_RX_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_LSB;
  712. }
  713. /**
  714. * hal_rx_proc_phyrx_other_receive_info_tlv_9224(): API to get tlv info
  715. *
  716. * Return: uint32_t
  717. */
  718. static inline
  719. void hal_rx_proc_phyrx_other_receive_info_tlv_9224(void *rx_tlv_hdr,
  720. void *ppdu_info_hdl)
  721. {
  722. uint32_t tlv_tag, tlv_len;
  723. uint32_t temp_len, other_tlv_len, other_tlv_tag;
  724. void *rx_tlv = (uint8_t *)rx_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
  725. void *other_tlv_hdr = NULL;
  726. void *other_tlv = NULL;
  727. tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(rx_tlv_hdr);
  728. tlv_len = HAL_RX_GET_USER_TLV32_LEN(rx_tlv_hdr);
  729. temp_len = 0;
  730. other_tlv_hdr = rx_tlv + HAL_RX_TLV32_HDR_SIZE;
  731. other_tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(other_tlv_hdr);
  732. other_tlv_len = HAL_RX_GET_USER_TLV32_LEN(other_tlv_hdr);
  733. temp_len += other_tlv_len;
  734. other_tlv = other_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
  735. switch (other_tlv_tag) {
  736. default:
  737. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  738. "%s unhandled TLV type: %d, TLV len:%d",
  739. __func__, other_tlv_tag, other_tlv_len);
  740. break;
  741. }
  742. }
  743. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  744. static inline
  745. void hal_rx_get_bb_info_9224(void *rx_tlv, void *ppdu_info_hdl)
  746. {
  747. struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
  748. ppdu_info->cfr_info.bb_captured_channel =
  749. HAL_RX_GET(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_CHANNEL);
  750. ppdu_info->cfr_info.bb_captured_timeout =
  751. HAL_RX_GET(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_TIMEOUT);
  752. ppdu_info->cfr_info.bb_captured_reason =
  753. HAL_RX_GET(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_REASON);
  754. }
  755. static inline
  756. void hal_rx_get_rtt_info_9224(void *rx_tlv, void *ppdu_info_hdl)
  757. {
  758. struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
  759. ppdu_info->cfr_info.rx_location_info_valid =
  760. HAL_RX_GET(rx_tlv, PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  761. RX_LOCATION_INFO_VALID);
  762. ppdu_info->cfr_info.rtt_che_buffer_pointer_low32 =
  763. HAL_RX_GET(rx_tlv,
  764. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  765. RTT_CHE_BUFFER_POINTER_LOW32);
  766. ppdu_info->cfr_info.rtt_che_buffer_pointer_high8 =
  767. HAL_RX_GET(rx_tlv,
  768. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  769. RTT_CHE_BUFFER_POINTER_HIGH8);
  770. ppdu_info->cfr_info.chan_capture_status =
  771. HAL_GET_RX_LOCATION_INFO_CHAN_CAPTURE_STATUS(rx_tlv);
  772. ppdu_info->cfr_info.rx_start_ts =
  773. HAL_RX_GET(rx_tlv,
  774. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  775. RX_START_TS);
  776. ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t)
  777. HAL_RX_GET(rx_tlv,
  778. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  779. RTT_CFO_MEASUREMENT);
  780. ppdu_info->cfr_info.agc_gain_info0 =
  781. HAL_RX_GET(rx_tlv,
  782. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  783. GAIN_CHAIN0);
  784. ppdu_info->cfr_info.agc_gain_info0 |=
  785. (((uint32_t)HAL_RX_GET(rx_tlv,
  786. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  787. GAIN_CHAIN1)) << 16);
  788. ppdu_info->cfr_info.agc_gain_info1 =
  789. HAL_RX_GET(rx_tlv,
  790. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  791. GAIN_CHAIN2);
  792. ppdu_info->cfr_info.agc_gain_info1 |=
  793. (((uint32_t)HAL_RX_GET(rx_tlv,
  794. PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
  795. GAIN_CHAIN3)) << 16);
  796. ppdu_info->cfr_info.agc_gain_info2 = 0;
  797. ppdu_info->cfr_info.agc_gain_info3 = 0;
  798. }
  799. #endif
  800. /**
  801. * hal_rx_dump_mpdu_start_tlv_9224: dump RX mpdu_start TLV in structured
  802. * human readable format.
  803. * @mpdu_start: pointer the rx_attention TLV in pkt.
  804. * @dbg_level: log level.
  805. *
  806. * Return: void
  807. */
  808. static inline void hal_rx_dump_mpdu_start_tlv_9224(void *mpdustart,
  809. uint8_t dbg_level)
  810. {
  811. #ifdef CONFIG_WORD_BASED_TLV
  812. struct rx_mpdu_start_compact_qca9224 *mpdu_info =
  813. (struct rx_mpdu_start_compact_qca9224 *)mpdustart;
  814. #else
  815. struct rx_mpdu_start *mpdu_start = (struct rx_mpdu_start *)mpdustart;
  816. struct rx_mpdu_info *mpdu_info =
  817. (struct rx_mpdu_info *)&mpdu_start->rx_mpdu_info_details;
  818. #endif
  819. QDF_TRACE(dbg_level, QDF_MODULE_ID_HAL,
  820. "rx_mpdu_start tlv (1/5) - "
  821. "rx_reo_queue_desc_addr_31_0 :%x"
  822. "rx_reo_queue_desc_addr_39_32 :%x"
  823. "receive_queue_number:%x "
  824. "pre_delim_err_warning:%x "
  825. "first_delim_err:%x "
  826. "reserved_2a:%x "
  827. "pn_31_0:%x "
  828. "pn_63_32:%x "
  829. "pn_95_64:%x "
  830. "pn_127_96:%x "
  831. "epd_en:%x "
  832. "all_frames_shall_be_encrypted :%x"
  833. "encrypt_type:%x "
  834. "wep_key_width_for_variable_key :%x"
  835. "mesh_sta:%x "
  836. "bssid_hit:%x "
  837. "bssid_number:%x "
  838. "tid:%x "
  839. "reserved_7a:%x ",
  840. mpdu_info->rx_reo_queue_desc_addr_31_0,
  841. mpdu_info->rx_reo_queue_desc_addr_39_32,
  842. mpdu_info->receive_queue_number,
  843. mpdu_info->pre_delim_err_warning,
  844. mpdu_info->first_delim_err,
  845. mpdu_info->reserved_2a,
  846. mpdu_info->pn_31_0,
  847. mpdu_info->pn_63_32,
  848. mpdu_info->pn_95_64,
  849. mpdu_info->pn_127_96,
  850. mpdu_info->epd_en,
  851. mpdu_info->all_frames_shall_be_encrypted,
  852. mpdu_info->encrypt_type,
  853. mpdu_info->wep_key_width_for_variable_key,
  854. mpdu_info->mesh_sta,
  855. mpdu_info->bssid_hit,
  856. mpdu_info->bssid_number,
  857. mpdu_info->tid,
  858. mpdu_info->reserved_7a);
  859. QDF_TRACE(dbg_level, QDF_MODULE_ID_HAL,
  860. "rx_mpdu_start tlv (2/5) - "
  861. "ast_index:%x "
  862. "sw_peer_id:%x "
  863. "mpdu_frame_control_valid:%x "
  864. "mpdu_duration_valid:%x "
  865. "mac_addr_ad1_valid:%x "
  866. "mac_addr_ad2_valid:%x "
  867. "mac_addr_ad3_valid:%x "
  868. "mac_addr_ad4_valid:%x "
  869. "mpdu_sequence_control_valid :%x"
  870. "mpdu_qos_control_valid:%x "
  871. "mpdu_ht_control_valid:%x "
  872. "frame_encryption_info_valid :%x",
  873. mpdu_info->ast_index,
  874. mpdu_info->sw_peer_id,
  875. mpdu_info->mpdu_frame_control_valid,
  876. mpdu_info->mpdu_duration_valid,
  877. mpdu_info->mac_addr_ad1_valid,
  878. mpdu_info->mac_addr_ad2_valid,
  879. mpdu_info->mac_addr_ad3_valid,
  880. mpdu_info->mac_addr_ad4_valid,
  881. mpdu_info->mpdu_sequence_control_valid,
  882. mpdu_info->mpdu_qos_control_valid,
  883. mpdu_info->mpdu_ht_control_valid,
  884. mpdu_info->frame_encryption_info_valid);
  885. QDF_TRACE(dbg_level, QDF_MODULE_ID_HAL,
  886. "rx_mpdu_start tlv (3/5) - "
  887. "mpdu_fragment_number:%x "
  888. "more_fragment_flag:%x "
  889. "reserved_11a:%x "
  890. "fr_ds:%x "
  891. "to_ds:%x "
  892. "encrypted:%x "
  893. "mpdu_retry:%x "
  894. "mpdu_sequence_number:%x ",
  895. mpdu_info->mpdu_fragment_number,
  896. mpdu_info->more_fragment_flag,
  897. mpdu_info->reserved_11a,
  898. mpdu_info->fr_ds,
  899. mpdu_info->to_ds,
  900. mpdu_info->encrypted,
  901. mpdu_info->mpdu_retry,
  902. mpdu_info->mpdu_sequence_number);
  903. QDF_TRACE(dbg_level, QDF_MODULE_ID_HAL,
  904. "rx_mpdu_start tlv (4/5) - "
  905. "mpdu_frame_control_field:%x "
  906. "mpdu_duration_field:%x ",
  907. mpdu_info->mpdu_frame_control_field,
  908. mpdu_info->mpdu_duration_field);
  909. QDF_TRACE(dbg_level, QDF_MODULE_ID_HAL,
  910. "rx_mpdu_start tlv (5/5) - "
  911. "mac_addr_ad1_31_0:%x "
  912. "mac_addr_ad1_47_32:%x "
  913. "mac_addr_ad2_15_0:%x "
  914. "mac_addr_ad2_47_16:%x "
  915. "mac_addr_ad3_31_0:%x "
  916. "mac_addr_ad3_47_32:%x "
  917. "mpdu_sequence_control_field :%x"
  918. "mac_addr_ad4_31_0:%x "
  919. "mac_addr_ad4_47_32:%x "
  920. "mpdu_qos_control_field:%x ",
  921. mpdu_info->mac_addr_ad1_31_0,
  922. mpdu_info->mac_addr_ad1_47_32,
  923. mpdu_info->mac_addr_ad2_15_0,
  924. mpdu_info->mac_addr_ad2_47_16,
  925. mpdu_info->mac_addr_ad3_31_0,
  926. mpdu_info->mac_addr_ad3_47_32,
  927. mpdu_info->mpdu_sequence_control_field,
  928. mpdu_info->mac_addr_ad4_31_0,
  929. mpdu_info->mac_addr_ad4_47_32,
  930. mpdu_info->mpdu_qos_control_field);
  931. }
  932. /**
  933. * hal_rx_dump_msdu_end_tlv_9224: dump RX msdu_end TLV in structured
  934. * human readable format.
  935. * @ msdu_end: pointer the msdu_end TLV in pkt.
  936. * @ dbg_level: log level.
  937. *
  938. * Return: void
  939. */
  940. static void hal_rx_dump_msdu_end_tlv_9224(void *msduend,
  941. uint8_t dbg_level)
  942. {
  943. #ifdef CONFIG_WORD_BASED_TLV
  944. struct rx_msdu_end_compact_qca9224 *msdu_end =
  945. (struct rx_msdu_end_compact_qca9224 *)msduend;
  946. #else
  947. struct rx_msdu_end *msdu_end =
  948. (struct rx_msdu_end *)msduend;
  949. #endif
  950. QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
  951. "rx_msdu_end tlv - "
  952. "key_id_octet: %d "
  953. "cce_super_rule: %d "
  954. "cce_classify_not_done_truncat: %d "
  955. "cce_classify_not_done_cce_dis: %d "
  956. "rule_indication_31_0: %d "
  957. "tcp_udp_chksum: %d "
  958. "sa_idx_timeout: %d "
  959. "da_idx_timeout: %d "
  960. "msdu_limit_error: %d "
  961. "flow_idx_timeout: %d "
  962. "flow_idx_invalid: %d "
  963. "wifi_parser_error: %d "
  964. "sa_is_valid: %d "
  965. "da_is_valid: %d "
  966. "da_is_mcbc: %d "
  967. "l3_header_padding: %d "
  968. "first_msdu: %d "
  969. "last_msdu: %d "
  970. "sa_idx: %d "
  971. "msdu_drop: %d "
  972. "reo_destination_indication: %d "
  973. "flow_idx: %d "
  974. "fse_metadata: %d "
  975. "cce_metadata: %d "
  976. "sa_sw_peer_id: %d ",
  977. msdu_end->key_id_octet,
  978. msdu_end->cce_super_rule,
  979. msdu_end->cce_classify_not_done_truncate,
  980. msdu_end->cce_classify_not_done_cce_dis,
  981. msdu_end->rule_indication_31_0,
  982. msdu_end->tcp_udp_chksum,
  983. msdu_end->sa_idx_timeout,
  984. msdu_end->da_idx_timeout,
  985. msdu_end->msdu_limit_error,
  986. msdu_end->flow_idx_timeout,
  987. msdu_end->flow_idx_invalid,
  988. msdu_end->wifi_parser_error,
  989. msdu_end->sa_is_valid,
  990. msdu_end->da_is_valid,
  991. msdu_end->da_is_mcbc,
  992. msdu_end->l3_header_padding,
  993. msdu_end->first_msdu,
  994. msdu_end->last_msdu,
  995. msdu_end->sa_idx,
  996. msdu_end->msdu_drop,
  997. msdu_end->reo_destination_indication,
  998. msdu_end->flow_idx,
  999. msdu_end->fse_metadata,
  1000. msdu_end->cce_metadata,
  1001. msdu_end->sa_sw_peer_id);
  1002. }
  1003. /**
  1004. * hal_reo_status_get_header_9224 - Process reo desc info
  1005. * @d - Pointer to reo descriptior
  1006. * @b - tlv type info
  1007. * @h1 - Pointer to hal_reo_status_header where info to be stored
  1008. *
  1009. * Return - none.
  1010. *
  1011. */
  1012. static void hal_reo_status_get_header_9224(hal_ring_desc_t ring_desc,
  1013. int b, void *h1)
  1014. {
  1015. uint64_t *d = (uint64_t *)ring_desc;
  1016. uint64_t val1 = 0;
  1017. struct hal_reo_status_header *h =
  1018. (struct hal_reo_status_header *)h1;
  1019. /* Offsets of descriptor fields defined in HW headers start
  1020. * from the field after TLV header
  1021. */
  1022. d += HAL_GET_NUM_QWORDS(sizeof(struct tlv_32_hdr));
  1023. switch (b) {
  1024. case HAL_REO_QUEUE_STATS_STATUS_TLV:
  1025. val1 = d[HAL_OFFSET_QW(REO_GET_QUEUE_STATS_STATUS,
  1026. STATUS_HEADER_REO_STATUS_NUMBER)];
  1027. break;
  1028. case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
  1029. val1 = d[HAL_OFFSET_QW(REO_FLUSH_QUEUE_STATUS,
  1030. STATUS_HEADER_REO_STATUS_NUMBER)];
  1031. break;
  1032. case HAL_REO_FLUSH_CACHE_STATUS_TLV:
  1033. val1 = d[HAL_OFFSET_QW(REO_FLUSH_CACHE_STATUS,
  1034. STATUS_HEADER_REO_STATUS_NUMBER)];
  1035. break;
  1036. case HAL_REO_UNBLK_CACHE_STATUS_TLV:
  1037. val1 = d[HAL_OFFSET_QW(REO_UNBLOCK_CACHE_STATUS,
  1038. STATUS_HEADER_REO_STATUS_NUMBER)];
  1039. break;
  1040. case HAL_REO_TIMOUT_LIST_STATUS_TLV:
  1041. val1 = d[HAL_OFFSET_QW(REO_FLUSH_TIMEOUT_LIST_STATUS,
  1042. STATUS_HEADER_REO_STATUS_NUMBER)];
  1043. break;
  1044. case HAL_REO_DESC_THRES_STATUS_TLV:
  1045. val1 =
  1046. d[HAL_OFFSET_QW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS,
  1047. STATUS_HEADER_REO_STATUS_NUMBER)];
  1048. break;
  1049. case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
  1050. val1 = d[HAL_OFFSET_QW(REO_UPDATE_RX_REO_QUEUE_STATUS,
  1051. STATUS_HEADER_REO_STATUS_NUMBER)];
  1052. break;
  1053. default:
  1054. qdf_nofl_err("ERROR: Unknown tlv\n");
  1055. break;
  1056. }
  1057. h->cmd_num =
  1058. HAL_GET_FIELD(
  1059. UNIFORM_REO_STATUS_HEADER, REO_STATUS_NUMBER,
  1060. val1);
  1061. h->exec_time =
  1062. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER,
  1063. CMD_EXECUTION_TIME, val1);
  1064. h->status =
  1065. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER,
  1066. REO_CMD_EXECUTION_STATUS, val1);
  1067. switch (b) {
  1068. case HAL_REO_QUEUE_STATS_STATUS_TLV:
  1069. val1 = d[HAL_OFFSET_QW(REO_GET_QUEUE_STATS_STATUS,
  1070. STATUS_HEADER_TIMESTAMP)];
  1071. break;
  1072. case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
  1073. val1 = d[HAL_OFFSET_QW(REO_FLUSH_QUEUE_STATUS,
  1074. STATUS_HEADER_TIMESTAMP)];
  1075. break;
  1076. case HAL_REO_FLUSH_CACHE_STATUS_TLV:
  1077. val1 = d[HAL_OFFSET_QW(REO_FLUSH_CACHE_STATUS,
  1078. STATUS_HEADER_TIMESTAMP)];
  1079. break;
  1080. case HAL_REO_UNBLK_CACHE_STATUS_TLV:
  1081. val1 = d[HAL_OFFSET_QW(REO_UNBLOCK_CACHE_STATUS,
  1082. STATUS_HEADER_TIMESTAMP)];
  1083. break;
  1084. case HAL_REO_TIMOUT_LIST_STATUS_TLV:
  1085. val1 = d[HAL_OFFSET_QW(REO_FLUSH_TIMEOUT_LIST_STATUS,
  1086. STATUS_HEADER_TIMESTAMP)];
  1087. break;
  1088. case HAL_REO_DESC_THRES_STATUS_TLV:
  1089. val1 =
  1090. d[HAL_OFFSET_QW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS,
  1091. STATUS_HEADER_TIMESTAMP)];
  1092. break;
  1093. case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
  1094. val1 = d[HAL_OFFSET_QW(REO_UPDATE_RX_REO_QUEUE_STATUS,
  1095. STATUS_HEADER_TIMESTAMP)];
  1096. break;
  1097. default:
  1098. qdf_nofl_err("ERROR: Unknown tlv\n");
  1099. break;
  1100. }
  1101. h->tstamp =
  1102. HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER, TIMESTAMP, val1);
  1103. }
  1104. static
  1105. void *hal_rx_msdu0_buffer_addr_lsb_9224(void *link_desc_va)
  1106. {
  1107. return (void *)HAL_RX_MSDU0_BUFFER_ADDR_LSB(link_desc_va);
  1108. }
  1109. static
  1110. void *hal_rx_msdu_desc_info_ptr_get_9224(void *msdu0)
  1111. {
  1112. return (void *)HAL_RX_MSDU_DESC_INFO_PTR_GET(msdu0);
  1113. }
  1114. static
  1115. void *hal_ent_mpdu_desc_info_9224(void *ent_ring_desc)
  1116. {
  1117. return (void *)HAL_ENT_MPDU_DESC_INFO(ent_ring_desc);
  1118. }
  1119. static
  1120. void *hal_dst_mpdu_desc_info_9224(void *dst_ring_desc)
  1121. {
  1122. return (void *)HAL_DST_MPDU_DESC_INFO(dst_ring_desc);
  1123. }
  1124. /**
  1125. * hal_reo_config_9224(): Set reo config parameters
  1126. * @soc: hal soc handle
  1127. * @reg_val: value to be set
  1128. * @reo_params: reo parameters
  1129. *
  1130. * Return: void
  1131. */
  1132. static void
  1133. hal_reo_config_9224(struct hal_soc *soc,
  1134. uint32_t reg_val,
  1135. struct hal_reo_params *reo_params)
  1136. {
  1137. HAL_REO_R0_CONFIG(soc, reg_val, reo_params);
  1138. }
  1139. /**
  1140. * hal_rx_msdu_desc_info_get_ptr_9224() - Get msdu desc info ptr
  1141. * @msdu_details_ptr - Pointer to msdu_details_ptr
  1142. *
  1143. * Return - Pointer to rx_msdu_desc_info structure.
  1144. *
  1145. */
  1146. static void *hal_rx_msdu_desc_info_get_ptr_9224(void *msdu_details_ptr)
  1147. {
  1148. return HAL_RX_MSDU_DESC_INFO_GET(msdu_details_ptr);
  1149. }
  1150. /**
  1151. * hal_rx_link_desc_msdu0_ptr_9224 - Get pointer to rx_msdu details
  1152. * @link_desc - Pointer to link desc
  1153. *
  1154. * Return - Pointer to rx_msdu_details structure
  1155. *
  1156. */
  1157. static void *hal_rx_link_desc_msdu0_ptr_9224(void *link_desc)
  1158. {
  1159. return HAL_RX_LINK_DESC_MSDU0_PTR(link_desc);
  1160. }
  1161. /**
  1162. * hal_get_window_address_9224(): Function to get hp/tp address
  1163. * @hal_soc: Pointer to hal_soc
  1164. * @addr: address offset of register
  1165. *
  1166. * Return: modified address offset of register
  1167. */
  1168. static inline qdf_iomem_t hal_get_window_address_9224(struct hal_soc *hal_soc,
  1169. qdf_iomem_t addr)
  1170. {
  1171. uint32_t offset = addr - hal_soc->dev_base_addr;
  1172. qdf_iomem_t new_offset;
  1173. /*
  1174. * If offset lies within DP register range, use 3rd window to write
  1175. * into DP region.
  1176. */
  1177. if ((offset ^ UMAC_BASE) < WINDOW_RANGE_MASK) {
  1178. new_offset = (hal_soc->dev_base_addr + (3 * WINDOW_START) +
  1179. (offset & WINDOW_RANGE_MASK));
  1180. /*
  1181. * If offset lies within CE register range, use 2nd window to write
  1182. * into CE region.
  1183. */
  1184. } else if ((offset ^ CE_WFSS_CE_REG_BASE) < WINDOW_RANGE_MASK) {
  1185. new_offset = (hal_soc->dev_base_addr + (2 * WINDOW_START) +
  1186. (offset & WINDOW_RANGE_MASK));
  1187. } else {
  1188. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1189. "%s: ERROR: Accessing Wrong register\n", __func__);
  1190. qdf_assert_always(0);
  1191. return 0;
  1192. }
  1193. return new_offset;
  1194. }
  1195. static inline void hal_write_window_register(struct hal_soc *hal_soc)
  1196. {
  1197. /* Write value into window configuration register */
  1198. qdf_iowrite32(hal_soc->dev_base_addr + WINDOW_REG_ADDRESS,
  1199. WINDOW_CONFIGURATION_VALUE_9224);
  1200. }
  1201. static
  1202. void hal_compute_reo_remap_ix2_ix3_9224(uint32_t *ring, uint32_t num_rings,
  1203. uint32_t *remap1, uint32_t *remap2)
  1204. {
  1205. switch (num_rings) {
  1206. case 1:
  1207. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1208. HAL_REO_REMAP_IX2(ring[0], 17) |
  1209. HAL_REO_REMAP_IX2(ring[0], 18) |
  1210. HAL_REO_REMAP_IX2(ring[0], 19) |
  1211. HAL_REO_REMAP_IX2(ring[0], 20) |
  1212. HAL_REO_REMAP_IX2(ring[0], 21) |
  1213. HAL_REO_REMAP_IX2(ring[0], 22) |
  1214. HAL_REO_REMAP_IX2(ring[0], 23);
  1215. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1216. HAL_REO_REMAP_IX3(ring[0], 25) |
  1217. HAL_REO_REMAP_IX3(ring[0], 26) |
  1218. HAL_REO_REMAP_IX3(ring[0], 27) |
  1219. HAL_REO_REMAP_IX3(ring[0], 28) |
  1220. HAL_REO_REMAP_IX3(ring[0], 29) |
  1221. HAL_REO_REMAP_IX3(ring[0], 30) |
  1222. HAL_REO_REMAP_IX3(ring[0], 31);
  1223. break;
  1224. case 2:
  1225. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1226. HAL_REO_REMAP_IX2(ring[0], 17) |
  1227. HAL_REO_REMAP_IX2(ring[1], 18) |
  1228. HAL_REO_REMAP_IX2(ring[1], 19) |
  1229. HAL_REO_REMAP_IX2(ring[0], 20) |
  1230. HAL_REO_REMAP_IX2(ring[0], 21) |
  1231. HAL_REO_REMAP_IX2(ring[1], 22) |
  1232. HAL_REO_REMAP_IX2(ring[1], 23);
  1233. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1234. HAL_REO_REMAP_IX3(ring[0], 25) |
  1235. HAL_REO_REMAP_IX3(ring[1], 26) |
  1236. HAL_REO_REMAP_IX3(ring[1], 27) |
  1237. HAL_REO_REMAP_IX3(ring[0], 28) |
  1238. HAL_REO_REMAP_IX3(ring[0], 29) |
  1239. HAL_REO_REMAP_IX3(ring[1], 30) |
  1240. HAL_REO_REMAP_IX3(ring[1], 31);
  1241. break;
  1242. case 3:
  1243. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1244. HAL_REO_REMAP_IX2(ring[1], 17) |
  1245. HAL_REO_REMAP_IX2(ring[2], 18) |
  1246. HAL_REO_REMAP_IX2(ring[0], 19) |
  1247. HAL_REO_REMAP_IX2(ring[1], 20) |
  1248. HAL_REO_REMAP_IX2(ring[2], 21) |
  1249. HAL_REO_REMAP_IX2(ring[0], 22) |
  1250. HAL_REO_REMAP_IX2(ring[1], 23);
  1251. *remap2 = HAL_REO_REMAP_IX3(ring[2], 24) |
  1252. HAL_REO_REMAP_IX3(ring[0], 25) |
  1253. HAL_REO_REMAP_IX3(ring[1], 26) |
  1254. HAL_REO_REMAP_IX3(ring[2], 27) |
  1255. HAL_REO_REMAP_IX3(ring[0], 28) |
  1256. HAL_REO_REMAP_IX3(ring[1], 29) |
  1257. HAL_REO_REMAP_IX3(ring[2], 30) |
  1258. HAL_REO_REMAP_IX3(ring[0], 31);
  1259. break;
  1260. case 4:
  1261. *remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
  1262. HAL_REO_REMAP_IX2(ring[1], 17) |
  1263. HAL_REO_REMAP_IX2(ring[2], 18) |
  1264. HAL_REO_REMAP_IX2(ring[3], 19) |
  1265. HAL_REO_REMAP_IX2(ring[0], 20) |
  1266. HAL_REO_REMAP_IX2(ring[1], 21) |
  1267. HAL_REO_REMAP_IX2(ring[2], 22) |
  1268. HAL_REO_REMAP_IX2(ring[3], 23);
  1269. *remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
  1270. HAL_REO_REMAP_IX3(ring[1], 25) |
  1271. HAL_REO_REMAP_IX3(ring[2], 26) |
  1272. HAL_REO_REMAP_IX3(ring[3], 27) |
  1273. HAL_REO_REMAP_IX3(ring[0], 28) |
  1274. HAL_REO_REMAP_IX3(ring[1], 29) |
  1275. HAL_REO_REMAP_IX3(ring[2], 30) |
  1276. HAL_REO_REMAP_IX3(ring[3], 31);
  1277. break;
  1278. }
  1279. }
  1280. /**
  1281. * hal_rx_flow_setup_fse_9224() - Setup a flow search entry in HW FST
  1282. * @fst: Pointer to the Rx Flow Search Table
  1283. * @table_offset: offset into the table where the flow is to be setup
  1284. * @flow: Flow Parameters
  1285. *
  1286. * Return: Success/Failure
  1287. */
  1288. static void *
  1289. hal_rx_flow_setup_fse_9224(uint8_t *rx_fst, uint32_t table_offset,
  1290. uint8_t *rx_flow)
  1291. {
  1292. struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
  1293. struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
  1294. uint8_t *fse;
  1295. bool fse_valid;
  1296. if (table_offset >= fst->max_entries) {
  1297. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  1298. "HAL FSE table offset %u exceeds max entries %u",
  1299. table_offset, fst->max_entries);
  1300. return NULL;
  1301. }
  1302. fse = (uint8_t *)fst->base_vaddr +
  1303. (table_offset * HAL_RX_FST_ENTRY_SIZE);
  1304. fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID);
  1305. if (fse_valid) {
  1306. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
  1307. "HAL FSE %pK already valid", fse);
  1308. return NULL;
  1309. }
  1310. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96) =
  1311. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96,
  1312. qdf_htonl(flow->tuple_info.src_ip_127_96));
  1313. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_95_64) =
  1314. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_95_64,
  1315. qdf_htonl(flow->tuple_info.src_ip_95_64));
  1316. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_63_32) =
  1317. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_63_32,
  1318. qdf_htonl(flow->tuple_info.src_ip_63_32));
  1319. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_31_0) =
  1320. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_31_0,
  1321. qdf_htonl(flow->tuple_info.src_ip_31_0));
  1322. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_127_96) =
  1323. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_127_96,
  1324. qdf_htonl(flow->tuple_info.dest_ip_127_96));
  1325. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_95_64) =
  1326. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_95_64,
  1327. qdf_htonl(flow->tuple_info.dest_ip_95_64));
  1328. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_63_32) =
  1329. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_63_32,
  1330. qdf_htonl(flow->tuple_info.dest_ip_63_32));
  1331. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_IP_31_0) =
  1332. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_IP_31_0,
  1333. qdf_htonl(flow->tuple_info.dest_ip_31_0));
  1334. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_PORT);
  1335. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, DEST_PORT) |=
  1336. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, DEST_PORT,
  1337. (flow->tuple_info.dest_port));
  1338. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_PORT);
  1339. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_PORT) |=
  1340. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_PORT,
  1341. (flow->tuple_info.src_port));
  1342. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL);
  1343. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL) |=
  1344. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, L4_PROTOCOL,
  1345. flow->tuple_info.l4_protocol);
  1346. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER);
  1347. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER) |=
  1348. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_HANDLER,
  1349. flow->reo_destination_handler);
  1350. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID);
  1351. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID) |=
  1352. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, VALID, 1);
  1353. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, METADATA);
  1354. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, METADATA) =
  1355. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, METADATA,
  1356. flow->fse_metadata);
  1357. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_INDICATION);
  1358. HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, REO_DESTINATION_INDICATION) |=
  1359. HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY,
  1360. REO_DESTINATION_INDICATION,
  1361. flow->reo_destination_indication);
  1362. /* Reset all the other fields in FSE */
  1363. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, RESERVED_9);
  1364. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_DROP);
  1365. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_COUNT);
  1366. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, MSDU_BYTE_COUNT);
  1367. HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY, TIMESTAMP);
  1368. return fse;
  1369. }
  1370. /**
  1371. * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format
  1372. * @ pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt.
  1373. * @ dbg_level: log level.
  1374. *
  1375. * Return: void
  1376. */
  1377. static inline void hal_rx_dump_pkt_hdr_tlv_9224(struct rx_pkt_tlvs *pkt_tlvs,
  1378. uint8_t dbg_level)
  1379. {
  1380. struct rx_pkt_hdr_tlv *pkt_hdr_tlv = &pkt_tlvs->pkt_hdr_tlv;
  1381. hal_verbose_debug("\n---------------\n"
  1382. "rx_pkt_hdr_tlv\n"
  1383. "---------------\n"
  1384. "phy_ppdu_id %llu ",
  1385. pkt_hdr_tlv->phy_ppdu_id);
  1386. hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,
  1387. sizeof(pkt_hdr_tlv->rx_pkt_hdr));
  1388. }
  1389. /*
  1390. * hal_tx_dump_ppe_vp_entry_9224()
  1391. * @hal_soc_hdl: HAL SoC handle
  1392. *
  1393. * Return: void
  1394. */
  1395. static inline
  1396. void hal_tx_dump_ppe_vp_entry_9224(hal_soc_handle_t hal_soc_hdl)
  1397. {
  1398. struct hal_soc *soc = (struct hal_soc *)hal_soc_hdl;
  1399. uint32_t reg_addr, reg_val = 0, i;
  1400. for (i = 0; i < HAL_PPE_VP_ENTRIES_MAX; i++) {
  1401. reg_addr =
  1402. HWIO_TCL_R0_PPE_VP_CONFIG_TABLE_n_ADDR(
  1403. MAC_TCL_REG_REG_BASE,
  1404. i);
  1405. reg_val = HAL_REG_READ(soc, reg_addr);
  1406. hal_verbose_debug("%d: 0x%x\n", i, reg_val);
  1407. }
  1408. }
  1409. /**
  1410. * hal_rx_dump_pkt_tlvs_9224(): API to print RX Pkt TLVS QCN9224
  1411. * @hal_soc_hdl: hal_soc handle
  1412. * @buf: pointer the pkt buffer
  1413. * @dbg_level: log level
  1414. *
  1415. * Return: void
  1416. */
  1417. #ifdef CONFIG_WORD_BASED_TLV
  1418. static void hal_rx_dump_pkt_tlvs_9224(hal_soc_handle_t hal_soc_hdl,
  1419. uint8_t *buf, uint8_t dbg_level)
  1420. {
  1421. struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
  1422. struct rx_msdu_end_compact_qca9224 *msdu_end =
  1423. &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
  1424. struct rx_mpdu_start_compact_qca9224 *mpdu_start =
  1425. &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
  1426. hal_rx_dump_msdu_end_tlv_9224(msdu_end, dbg_level);
  1427. hal_rx_dump_mpdu_start_tlv_9224(mpdu_start, dbg_level);
  1428. hal_rx_dump_pkt_hdr_tlv_9224(pkt_tlvs, dbg_level);
  1429. }
  1430. #else
  1431. static void hal_rx_dump_pkt_tlvs_9224(hal_soc_handle_t hal_soc_hdl,
  1432. uint8_t *buf, uint8_t dbg_level)
  1433. {
  1434. struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
  1435. struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
  1436. struct rx_mpdu_start *mpdu_start =
  1437. &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
  1438. hal_rx_dump_msdu_end_tlv_9224(msdu_end, dbg_level);
  1439. hal_rx_dump_mpdu_start_tlv_9224(mpdu_start, dbg_level);
  1440. hal_rx_dump_pkt_hdr_tlv_9224(pkt_tlvs, dbg_level);
  1441. }
  1442. #endif
  1443. #define HAL_NUM_TCL_BANKS_9224 48
  1444. /**
  1445. * hal_cmem_write_9224() - function for CMEM buffer writing
  1446. * @hal_soc_hdl: HAL SOC handle
  1447. * @offset: CMEM address
  1448. * @value: value to write
  1449. *
  1450. * Return: None.
  1451. */
  1452. static void hal_cmem_write_9224(hal_soc_handle_t hal_soc_hdl,
  1453. uint32_t offset,
  1454. uint32_t value)
  1455. {
  1456. struct hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
  1457. pld_reg_write(hal->qdf_dev->dev, offset, value);
  1458. }
  1459. /**
  1460. * hal_tx_get_num_tcl_banks_9224() - Get number of banks in target
  1461. *
  1462. * Returns: number of bank
  1463. */
  1464. static uint8_t hal_tx_get_num_tcl_banks_9224(void)
  1465. {
  1466. return HAL_NUM_TCL_BANKS_9224;
  1467. }
  1468. static void hal_reo_setup_9224(struct hal_soc *soc, void *reoparams)
  1469. {
  1470. uint32_t reg_val;
  1471. struct hal_reo_params *reo_params = (struct hal_reo_params *)reoparams;
  1472. reg_val = HAL_REG_READ(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR(
  1473. REO_REG_REG_BASE));
  1474. hal_reo_config_9224(soc, reg_val, reo_params);
  1475. /* Other ring enable bits and REO_ENABLE will be set by FW */
  1476. /* TODO: Setup destination ring mapping if enabled */
  1477. /* TODO: Error destination ring setting is left to default.
  1478. * Default setting is to send all errors to release ring.
  1479. */
  1480. /* Set the reo descriptor swap bits in case of BIG endian platform */
  1481. hal_setup_reo_swap(soc);
  1482. HAL_REG_WRITE(soc,
  1483. HWIO_REO_R0_AGING_THRESHOLD_IX_0_ADDR(REO_REG_REG_BASE),
  1484. HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000);
  1485. HAL_REG_WRITE(soc,
  1486. HWIO_REO_R0_AGING_THRESHOLD_IX_1_ADDR(REO_REG_REG_BASE),
  1487. (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000));
  1488. HAL_REG_WRITE(soc,
  1489. HWIO_REO_R0_AGING_THRESHOLD_IX_2_ADDR(REO_REG_REG_BASE),
  1490. (HAL_DEFAULT_BE_BK_VI_REO_TIMEOUT_MS * 1000));
  1491. HAL_REG_WRITE(soc,
  1492. HWIO_REO_R0_AGING_THRESHOLD_IX_3_ADDR(REO_REG_REG_BASE),
  1493. (HAL_DEFAULT_VO_REO_TIMEOUT_MS * 1000));
  1494. /*
  1495. * When hash based routing is enabled, routing of the rx packet
  1496. * is done based on the following value: 1 _ _ _ _ The last 4
  1497. * bits are based on hash[3:0]. This means the possible values
  1498. * are 0x10 to 0x1f. This value is used to look-up the
  1499. * ring ID configured in Destination_Ring_Ctrl_IX_* register.
  1500. * The Destination_Ring_Ctrl_IX_2 and Destination_Ring_Ctrl_IX_3
  1501. * registers need to be configured to set-up the 16 entries to
  1502. * map the hash values to a ring number. There are 3 bits per
  1503. * hash entry – which are mapped as follows:
  1504. * 0: TCL, 1:SW1, 2:SW2, * 3:SW3, 4:SW4, 5:Release, 6:FW(WIFI),
  1505. * 7: NOT_USED.
  1506. */
  1507. if (reo_params->rx_hash_enabled) {
  1508. HAL_REG_WRITE(soc,
  1509. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR
  1510. (REO_REG_REG_BASE), reo_params->remap0);
  1511. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x",
  1512. HAL_REG_READ(soc,
  1513. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_1_ADDR(
  1514. REO_REG_REG_BASE)));
  1515. HAL_REG_WRITE(soc,
  1516. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR
  1517. (REO_REG_REG_BASE), reo_params->remap1);
  1518. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR 0x%x",
  1519. HAL_REG_READ(soc,
  1520. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR(
  1521. REO_REG_REG_BASE)));
  1522. HAL_REG_WRITE(soc,
  1523. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR
  1524. (REO_REG_REG_BASE), reo_params->remap2);
  1525. hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR 0x%x",
  1526. HAL_REG_READ(soc,
  1527. HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR(
  1528. REO_REG_REG_BASE)));
  1529. }
  1530. /* TODO: Check if the following registers shoould be setup by host:
  1531. * AGING_CONTROL
  1532. * HIGH_MEMORY_THRESHOLD
  1533. * GLOBAL_LINK_DESC_COUNT_THRESH_IX_0[1,2]
  1534. * GLOBAL_LINK_DESC_COUNT_CTRL
  1535. */
  1536. hal_reo_shared_qaddr_init((hal_soc_handle_t)soc);
  1537. }
  1538. /**
  1539. * hal_qcn9224_get_reo_qdesc_size()- Get the reo queue descriptor size
  1540. * from the give Block-Ack window size
  1541. * Return: reo queue descriptor size
  1542. */
  1543. static uint32_t hal_qcn9224_get_reo_qdesc_size(uint32_t ba_window_size, int tid)
  1544. {
  1545. /* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for
  1546. * NON_QOS_TID until HW issues are resolved.
  1547. */
  1548. #define HAL_RX_MAX_BA_WINDOW_BE 1024
  1549. if (tid != HAL_NON_QOS_TID)
  1550. ba_window_size = HAL_RX_MAX_BA_WINDOW_BE;
  1551. /* Return descriptor size corresponding to window size of 2 since
  1552. * we set ba_window_size to 2 while setting up REO descriptors as
  1553. * a WAR to get 2k jump exception aggregates are received without
  1554. * a BA session.
  1555. */
  1556. if (ba_window_size <= 1) {
  1557. if (tid != HAL_NON_QOS_TID)
  1558. return sizeof(struct rx_reo_queue) +
  1559. sizeof(struct rx_reo_queue_ext);
  1560. else
  1561. return sizeof(struct rx_reo_queue);
  1562. }
  1563. if (ba_window_size <= 105)
  1564. return sizeof(struct rx_reo_queue) +
  1565. sizeof(struct rx_reo_queue_ext);
  1566. if (ba_window_size <= 210)
  1567. return sizeof(struct rx_reo_queue) +
  1568. (2 * sizeof(struct rx_reo_queue_ext));
  1569. if (ba_window_size <= 256)
  1570. return sizeof(struct rx_reo_queue) +
  1571. (3 * sizeof(struct rx_reo_queue_ext));
  1572. return sizeof(struct rx_reo_queue) +
  1573. (10 * sizeof(struct rx_reo_queue_ext)) +
  1574. sizeof(struct rx_reo_queue_1k);
  1575. }
  1576. /*
  1577. * hal_tx_dump_ppe_vp_entry_9224()
  1578. * @hal_soc_hdl: HAL SoC handle
  1579. *
  1580. * Return: Number of PPE VP entries
  1581. */
  1582. static
  1583. uint32_t hal_tx_get_num_ppe_vp_tbl_entries_9224(hal_soc_handle_t hal_soc_hdl)
  1584. {
  1585. return HAL_PPE_VP_ENTRIES_MAX;
  1586. }
  1587. static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
  1588. {
  1589. /* init and setup */
  1590. hal_soc->ops->hal_srng_dst_hw_init = hal_srng_dst_hw_init_generic;
  1591. hal_soc->ops->hal_srng_src_hw_init = hal_srng_src_hw_init_generic;
  1592. hal_soc->ops->hal_get_hw_hptp = hal_get_hw_hptp_generic;
  1593. hal_soc->ops->hal_get_window_address = hal_get_window_address_9224;
  1594. hal_soc->ops->hal_cmem_write = hal_cmem_write_9224;
  1595. /* tx */
  1596. hal_soc->ops->hal_tx_set_dscp_tid_map = hal_tx_set_dscp_tid_map_9224;
  1597. hal_soc->ops->hal_tx_update_dscp_tid = hal_tx_update_dscp_tid_9224;
  1598. hal_soc->ops->hal_tx_comp_get_status =
  1599. hal_tx_comp_get_status_generic_be;
  1600. hal_soc->ops->hal_tx_init_cmd_credit_ring =
  1601. hal_tx_init_cmd_credit_ring_9224;
  1602. hal_soc->ops->hal_tx_set_ppe_cmn_cfg =
  1603. hal_tx_set_ppe_cmn_config_9224;
  1604. hal_soc->ops->hal_tx_set_ppe_vp_entry =
  1605. hal_tx_set_ppe_vp_entry_9224;
  1606. hal_soc->ops->hal_tx_set_ppe_pri2tid =
  1607. hal_tx_set_ppe_pri2tid_map_9224;
  1608. hal_soc->ops->hal_tx_update_ppe_pri2tid =
  1609. hal_tx_update_ppe_pri2tid_9224;
  1610. hal_soc->ops->hal_tx_dump_ppe_vp_entry =
  1611. hal_tx_dump_ppe_vp_entry_9224;
  1612. hal_soc->ops->hal_tx_get_num_ppe_vp_tbl_entries =
  1613. hal_tx_get_num_ppe_vp_tbl_entries_9224;
  1614. hal_soc->ops->hal_tx_enable_pri2tid_map =
  1615. hal_tx_enable_pri2tid_map_9224;
  1616. /* rx */
  1617. hal_soc->ops->hal_rx_msdu_start_nss_get = hal_rx_tlv_nss_get_be;
  1618. hal_soc->ops->hal_rx_mon_hw_desc_get_mpdu_status =
  1619. hal_rx_mon_hw_desc_get_mpdu_status_be;
  1620. hal_soc->ops->hal_rx_get_tlv = hal_rx_get_tlv_9224;
  1621. hal_soc->ops->hal_rx_proc_phyrx_other_receive_info_tlv =
  1622. hal_rx_proc_phyrx_other_receive_info_tlv_9224;
  1623. hal_soc->ops->hal_rx_dump_msdu_end_tlv = hal_rx_dump_msdu_end_tlv_9224;
  1624. hal_soc->ops->hal_rx_dump_mpdu_start_tlv =
  1625. hal_rx_dump_mpdu_start_tlv_9224;
  1626. hal_soc->ops->hal_rx_dump_pkt_tlvs = hal_rx_dump_pkt_tlvs_9224;
  1627. hal_soc->ops->hal_get_link_desc_size = hal_get_link_desc_size_9224;
  1628. hal_soc->ops->hal_rx_mpdu_start_tid_get = hal_rx_tlv_tid_get_be;
  1629. hal_soc->ops->hal_rx_msdu_start_reception_type_get =
  1630. hal_rx_tlv_reception_type_get_be;
  1631. hal_soc->ops->hal_rx_msdu_end_da_idx_get =
  1632. hal_rx_msdu_end_da_idx_get_be;
  1633. hal_soc->ops->hal_rx_msdu_desc_info_get_ptr =
  1634. hal_rx_msdu_desc_info_get_ptr_9224;
  1635. hal_soc->ops->hal_rx_link_desc_msdu0_ptr =
  1636. hal_rx_link_desc_msdu0_ptr_9224;
  1637. hal_soc->ops->hal_reo_status_get_header =
  1638. hal_reo_status_get_header_9224;
  1639. hal_soc->ops->hal_rx_status_get_tlv_info =
  1640. hal_rx_status_get_tlv_info_generic_be;
  1641. hal_soc->ops->hal_rx_wbm_err_info_get =
  1642. hal_rx_wbm_err_info_get_generic_be;
  1643. hal_soc->ops->hal_tx_set_pcp_tid_map =
  1644. hal_tx_set_pcp_tid_map_generic_be;
  1645. hal_soc->ops->hal_tx_update_pcp_tid_map =
  1646. hal_tx_update_pcp_tid_generic_be;
  1647. hal_soc->ops->hal_tx_set_tidmap_prty =
  1648. hal_tx_update_tidmap_prty_generic_be;
  1649. hal_soc->ops->hal_rx_get_rx_fragment_number =
  1650. hal_rx_get_rx_fragment_number_be,
  1651. hal_soc->ops->hal_rx_msdu_end_da_is_mcbc_get =
  1652. hal_rx_tlv_da_is_mcbc_get_be;
  1653. hal_soc->ops->hal_rx_msdu_end_sa_is_valid_get =
  1654. hal_rx_tlv_sa_is_valid_get_be;
  1655. hal_soc->ops->hal_rx_msdu_end_sa_idx_get = hal_rx_tlv_sa_idx_get_be;
  1656. hal_soc->ops->hal_rx_desc_is_first_msdu = hal_rx_desc_is_first_msdu_be;
  1657. hal_soc->ops->hal_rx_msdu_end_l3_hdr_padding_get =
  1658. hal_rx_tlv_l3_hdr_padding_get_be;
  1659. hal_soc->ops->hal_rx_encryption_info_valid =
  1660. hal_rx_encryption_info_valid_be;
  1661. hal_soc->ops->hal_rx_print_pn = hal_rx_print_pn_be;
  1662. hal_soc->ops->hal_rx_msdu_end_first_msdu_get =
  1663. hal_rx_tlv_first_msdu_get_be;
  1664. hal_soc->ops->hal_rx_msdu_end_da_is_valid_get =
  1665. hal_rx_tlv_da_is_valid_get_be;
  1666. hal_soc->ops->hal_rx_msdu_end_last_msdu_get =
  1667. hal_rx_tlv_last_msdu_get_be;
  1668. hal_soc->ops->hal_rx_get_mpdu_mac_ad4_valid =
  1669. hal_rx_get_mpdu_mac_ad4_valid_be;
  1670. hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get =
  1671. hal_rx_mpdu_start_sw_peer_id_get_be;
  1672. hal_soc->ops->hal_rx_mpdu_peer_meta_data_get =
  1673. hal_rx_mpdu_peer_meta_data_get_be;
  1674. hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be;
  1675. hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be;
  1676. hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =
  1677. hal_rx_get_mpdu_frame_control_valid_be;
  1678. hal_soc->ops->hal_rx_mpdu_get_addr1 = hal_rx_mpdu_get_addr1_be;
  1679. hal_soc->ops->hal_rx_mpdu_get_addr2 = hal_rx_mpdu_get_addr2_be;
  1680. hal_soc->ops->hal_rx_mpdu_get_addr3 = hal_rx_mpdu_get_addr3_be;
  1681. hal_soc->ops->hal_rx_mpdu_get_addr4 = hal_rx_mpdu_get_addr4_be;
  1682. hal_soc->ops->hal_rx_get_mpdu_sequence_control_valid =
  1683. hal_rx_get_mpdu_sequence_control_valid_be;
  1684. hal_soc->ops->hal_rx_is_unicast = hal_rx_is_unicast_be;
  1685. hal_soc->ops->hal_rx_tid_get = hal_rx_tid_get_be;
  1686. hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
  1687. hal_rx_hw_desc_get_ppduid_get_be;
  1688. hal_soc->ops->hal_rx_mpdu_start_mpdu_qos_control_valid_get =
  1689. hal_rx_mpdu_start_mpdu_qos_control_valid_get_be;
  1690. hal_soc->ops->hal_rx_msdu_end_sa_sw_peer_id_get =
  1691. hal_rx_msdu_end_sa_sw_peer_id_get_be;
  1692. hal_soc->ops->hal_rx_msdu0_buffer_addr_lsb =
  1693. hal_rx_msdu0_buffer_addr_lsb_9224;
  1694. hal_soc->ops->hal_rx_msdu_desc_info_ptr_get =
  1695. hal_rx_msdu_desc_info_ptr_get_9224;
  1696. hal_soc->ops->hal_ent_mpdu_desc_info = hal_ent_mpdu_desc_info_9224;
  1697. hal_soc->ops->hal_dst_mpdu_desc_info = hal_dst_mpdu_desc_info_9224;
  1698. hal_soc->ops->hal_rx_get_fc_valid = hal_rx_get_fc_valid_be;
  1699. hal_soc->ops->hal_rx_get_to_ds_flag = hal_rx_get_to_ds_flag_be;
  1700. hal_soc->ops->hal_rx_get_mac_addr2_valid =
  1701. hal_rx_get_mac_addr2_valid_be;
  1702. hal_soc->ops->hal_rx_get_filter_category =
  1703. hal_rx_get_filter_category_be;
  1704. hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
  1705. hal_soc->ops->hal_reo_config = hal_reo_config_9224;
  1706. hal_soc->ops->hal_rx_msdu_flow_idx_get = hal_rx_msdu_flow_idx_get_be;
  1707. hal_soc->ops->hal_rx_msdu_flow_idx_invalid =
  1708. hal_rx_msdu_flow_idx_invalid_be;
  1709. hal_soc->ops->hal_rx_msdu_flow_idx_timeout =
  1710. hal_rx_msdu_flow_idx_timeout_be;
  1711. hal_soc->ops->hal_rx_msdu_fse_metadata_get =
  1712. hal_rx_msdu_fse_metadata_get_be;
  1713. hal_soc->ops->hal_rx_msdu_cce_match_get =
  1714. hal_rx_msdu_cce_match_get_be;
  1715. hal_soc->ops->hal_rx_msdu_cce_metadata_get =
  1716. hal_rx_msdu_cce_metadata_get_be;
  1717. hal_soc->ops->hal_rx_msdu_get_flow_params =
  1718. hal_rx_msdu_get_flow_params_be;
  1719. hal_soc->ops->hal_rx_tlv_get_tcp_chksum = hal_rx_tlv_get_tcp_chksum_be;
  1720. hal_soc->ops->hal_rx_get_rx_sequence = hal_rx_get_rx_sequence_be;
  1721. #if defined(QCA_WIFI_QCA9224) && defined(WLAN_CFR_ENABLE) && \
  1722. defined(WLAN_ENH_CFR_ENABLE)
  1723. hal_soc->ops->hal_rx_get_bb_info = hal_rx_get_bb_info_9224;
  1724. hal_soc->ops->hal_rx_get_rtt_info = hal_rx_get_rtt_info_9224;
  1725. #else
  1726. hal_soc->ops->hal_rx_get_bb_info = NULL;
  1727. hal_soc->ops->hal_rx_get_rtt_info = NULL;
  1728. #endif
  1729. /* rx - msdu fast path info fields */
  1730. hal_soc->ops->hal_rx_msdu_packet_metadata_get =
  1731. hal_rx_msdu_packet_metadata_get_generic_be;
  1732. hal_soc->ops->hal_rx_mpdu_start_tlv_tag_valid =
  1733. hal_rx_mpdu_start_tlv_tag_valid_be;
  1734. hal_soc->ops->hal_rx_wbm_err_msdu_continuation_get =
  1735. hal_rx_wbm_err_msdu_continuation_get_9224;
  1736. /* rx - TLV struct offsets */
  1737. hal_soc->ops->hal_rx_msdu_end_offset_get =
  1738. hal_rx_msdu_end_offset_get_generic;
  1739. hal_soc->ops->hal_rx_mpdu_start_offset_get =
  1740. hal_rx_mpdu_start_offset_get_generic;
  1741. #ifndef NO_RX_PKT_HDR_TLV
  1742. hal_soc->ops->hal_rx_pkt_tlv_offset_get =
  1743. hal_rx_pkt_tlv_offset_get_generic;
  1744. #endif
  1745. hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_9224;
  1746. hal_soc->ops->hal_rx_flow_get_tuple_info =
  1747. hal_rx_flow_get_tuple_info_be;
  1748. hal_soc->ops->hal_rx_flow_delete_entry =
  1749. hal_rx_flow_delete_entry_be;
  1750. hal_soc->ops->hal_rx_fst_get_fse_size = hal_rx_fst_get_fse_size_be;
  1751. hal_soc->ops->hal_compute_reo_remap_ix2_ix3 =
  1752. hal_compute_reo_remap_ix2_ix3_9224;
  1753. hal_soc->ops->hal_rx_msdu_get_reo_destination_indication =
  1754. hal_rx_msdu_get_reo_destination_indication_be;
  1755. hal_soc->ops->hal_rx_get_tlv_size = hal_rx_get_tlv_size_generic_be;
  1756. hal_soc->ops->hal_rx_msdu_is_wlan_mcast =
  1757. hal_rx_msdu_is_wlan_mcast_generic_be;
  1758. hal_soc->ops->hal_tx_get_num_tcl_banks = hal_tx_get_num_tcl_banks_9224;
  1759. hal_soc->ops->hal_rx_tlv_decap_format_get =
  1760. hal_rx_tlv_decap_format_get_be;
  1761. #ifdef RECEIVE_OFFLOAD
  1762. hal_soc->ops->hal_rx_tlv_get_offload_info =
  1763. hal_rx_tlv_get_offload_info_be;
  1764. hal_soc->ops->hal_rx_get_proto_params = hal_rx_get_proto_params_be;
  1765. hal_soc->ops->hal_rx_get_l3_l4_offsets = hal_rx_get_l3_l4_offsets_be;
  1766. #endif
  1767. hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get =
  1768. hal_rx_attn_phy_ppdu_id_get_be;
  1769. hal_soc->ops->hal_rx_tlv_msdu_done_get = hal_rx_tlv_msdu_done_get_be;
  1770. hal_soc->ops->hal_rx_tlv_msdu_len_get =
  1771. hal_rx_msdu_start_msdu_len_get_be;
  1772. hal_soc->ops->hal_rx_get_frame_ctrl_field =
  1773. hal_rx_get_frame_ctrl_field_be;
  1774. hal_soc->ops->hal_rx_tlv_csum_err_get = hal_rx_tlv_csum_err_get_be;
  1775. hal_soc->ops->hal_rx_mpdu_info_ampdu_flag_get =
  1776. hal_rx_mpdu_info_ampdu_flag_get_be;
  1777. hal_soc->ops->hal_rx_tlv_msdu_len_set =
  1778. hal_rx_msdu_start_msdu_len_set_be;
  1779. hal_soc->ops->hal_rx_tlv_sgi_get = hal_rx_tlv_sgi_get_be;
  1780. hal_soc->ops->hal_rx_tlv_rate_mcs_get = hal_rx_tlv_rate_mcs_get_be;
  1781. hal_soc->ops->hal_rx_tlv_bw_get = hal_rx_tlv_bw_get_be;
  1782. hal_soc->ops->hal_rx_tlv_get_pkt_type = hal_rx_tlv_get_pkt_type_be;
  1783. hal_soc->ops->hal_rx_tlv_mic_err_get = hal_rx_tlv_mic_err_get_be;
  1784. hal_soc->ops->hal_rx_tlv_decrypt_err_get =
  1785. hal_rx_tlv_decrypt_err_get_be;
  1786. hal_soc->ops->hal_rx_tlv_first_mpdu_get = hal_rx_tlv_first_mpdu_get_be;
  1787. hal_soc->ops->hal_rx_tlv_get_is_decrypted =
  1788. hal_rx_tlv_get_is_decrypted_be;
  1789. hal_soc->ops->hal_rx_msdu_get_keyid = hal_rx_msdu_get_keyid_be;
  1790. hal_soc->ops->hal_rx_tlv_get_freq = hal_rx_tlv_get_freq_be;
  1791. hal_soc->ops->hal_rx_priv_info_set_in_tlv =
  1792. hal_rx_priv_info_set_in_tlv_be;
  1793. hal_soc->ops->hal_rx_priv_info_get_from_tlv =
  1794. hal_rx_priv_info_get_from_tlv_be;
  1795. hal_soc->ops->hal_rx_pkt_hdr_get = hal_rx_pkt_hdr_get_be;
  1796. hal_soc->ops->hal_reo_setup = hal_reo_setup_9224;
  1797. #ifdef REO_SHARED_QREF_TABLE_EN
  1798. hal_soc->ops->hal_reo_shared_qaddr_setup = hal_reo_shared_qaddr_setup_be;
  1799. hal_soc->ops->hal_reo_shared_qaddr_init = hal_reo_shared_qaddr_init_be;
  1800. hal_soc->ops->hal_reo_shared_qaddr_detach = hal_reo_shared_qaddr_detach_be;
  1801. hal_soc->ops->hal_reo_shared_qaddr_write = hal_reo_shared_qaddr_write_be;
  1802. #endif
  1803. /* Overwrite the default BE ops */
  1804. hal_soc->ops->hal_get_reo_qdesc_size = hal_qcn9224_get_reo_qdesc_size;
  1805. /* TX MONITOR */
  1806. #ifdef QCA_MONITOR_2_0_SUPPORT
  1807. hal_soc->ops->hal_txmon_status_parse_tlv =
  1808. hal_txmon_status_parse_tlv_generic_be;
  1809. hal_soc->ops->hal_txmon_status_get_num_users =
  1810. hal_txmon_status_get_num_users_generic_be;
  1811. hal_soc->ops->hal_txmon_status_free_buffer =
  1812. hal_txmon_status_free_buffer_generic_be;
  1813. #endif /* QCA_MONITOR_2_0_SUPPORT */
  1814. };
  1815. struct hal_hw_srng_config hw_srng_table_9224[] = {
  1816. /* TODO: max_rings can populated by querying HW capabilities */
  1817. { /* REO_DST */
  1818. .start_ring_id = HAL_SRNG_REO2SW1,
  1819. .max_rings = 8,
  1820. .entry_size = sizeof(struct reo_destination_ring) >> 2,
  1821. .lmac_ring = FALSE,
  1822. .ring_dir = HAL_SRNG_DST_RING,
  1823. .reg_start = {
  1824. HWIO_REO_R0_REO2SW1_RING_BASE_LSB_ADDR(
  1825. REO_REG_REG_BASE),
  1826. HWIO_REO_R2_REO2SW1_RING_HP_ADDR(
  1827. REO_REG_REG_BASE)
  1828. },
  1829. .reg_size = {
  1830. HWIO_REO_R0_REO2SW2_RING_BASE_LSB_ADDR(0) -
  1831. HWIO_REO_R0_REO2SW1_RING_BASE_LSB_ADDR(0),
  1832. HWIO_REO_R2_REO2SW2_RING_HP_ADDR(0) -
  1833. HWIO_REO_R2_REO2SW1_RING_HP_ADDR(0),
  1834. },
  1835. .max_size =
  1836. HWIO_REO_R0_REO2SW1_RING_BASE_MSB_RING_SIZE_BMSK >>
  1837. HWIO_REO_R0_REO2SW1_RING_BASE_MSB_RING_SIZE_SHFT,
  1838. },
  1839. { /* REO_EXCEPTION */
  1840. /* Designating REO2SW0 ring as exception ring. This ring is
  1841. * similar to other REO2SW rings though it is named as REO2SW0.
  1842. * Any of theREO2SW rings can be used as exception ring.
  1843. */
  1844. .start_ring_id = HAL_SRNG_REO2SW0,
  1845. .max_rings = 1,
  1846. .entry_size = sizeof(struct reo_destination_ring) >> 2,
  1847. .lmac_ring = FALSE,
  1848. .ring_dir = HAL_SRNG_DST_RING,
  1849. .reg_start = {
  1850. HWIO_REO_R0_REO2SW0_RING_BASE_LSB_ADDR(
  1851. REO_REG_REG_BASE),
  1852. HWIO_REO_R2_REO2SW0_RING_HP_ADDR(
  1853. REO_REG_REG_BASE)
  1854. },
  1855. /* Single ring - provide ring size if multiple rings of this
  1856. * type are supported
  1857. */
  1858. .reg_size = {},
  1859. .max_size =
  1860. HWIO_REO_R0_REO2SW0_RING_BASE_MSB_RING_SIZE_BMSK >>
  1861. HWIO_REO_R0_REO2SW0_RING_BASE_MSB_RING_SIZE_SHFT,
  1862. },
  1863. { /* REO_REINJECT */
  1864. .start_ring_id = HAL_SRNG_SW2REO,
  1865. .max_rings = 4,
  1866. .entry_size = sizeof(struct reo_entrance_ring) >> 2,
  1867. .lmac_ring = FALSE,
  1868. .ring_dir = HAL_SRNG_SRC_RING,
  1869. .reg_start = {
  1870. HWIO_REO_R0_SW2REO_RING_BASE_LSB_ADDR(
  1871. REO_REG_REG_BASE),
  1872. HWIO_REO_R2_SW2REO_RING_HP_ADDR(
  1873. REO_REG_REG_BASE)
  1874. },
  1875. /* Single ring - provide ring size if multiple rings of this
  1876. * type are supported
  1877. */
  1878. .reg_size = {
  1879. HWIO_REO_R0_SW2REO1_RING_BASE_LSB_ADDR(0) -
  1880. HWIO_REO_R0_SW2REO_RING_BASE_LSB_ADDR(0),
  1881. HWIO_REO_R2_SW2REO1_RING_HP_ADDR(0) -
  1882. HWIO_REO_R2_SW2REO_RING_HP_ADDR(0)
  1883. },
  1884. .max_size = HWIO_REO_R0_SW2REO_RING_BASE_MSB_RING_SIZE_BMSK >>
  1885. HWIO_REO_R0_SW2REO_RING_BASE_MSB_RING_SIZE_SHFT,
  1886. },
  1887. { /* REO_CMD */
  1888. .start_ring_id = HAL_SRNG_REO_CMD,
  1889. .max_rings = 1,
  1890. .entry_size = (sizeof(struct tlv_32_hdr) +
  1891. sizeof(struct reo_get_queue_stats)) >> 2,
  1892. .lmac_ring = FALSE,
  1893. .ring_dir = HAL_SRNG_SRC_RING,
  1894. .reg_start = {
  1895. HWIO_REO_R0_REO_CMD_RING_BASE_LSB_ADDR(
  1896. REO_REG_REG_BASE),
  1897. HWIO_REO_R2_REO_CMD_RING_HP_ADDR(
  1898. REO_REG_REG_BASE),
  1899. },
  1900. /* Single ring - provide ring size if multiple rings of this
  1901. * type are supported
  1902. */
  1903. .reg_size = {},
  1904. .max_size = HWIO_REO_R0_REO_CMD_RING_BASE_MSB_RING_SIZE_BMSK >>
  1905. HWIO_REO_R0_REO_CMD_RING_BASE_MSB_RING_SIZE_SHFT,
  1906. },
  1907. { /* REO_STATUS */
  1908. .start_ring_id = HAL_SRNG_REO_STATUS,
  1909. .max_rings = 1,
  1910. .entry_size = (sizeof(struct tlv_32_hdr) +
  1911. sizeof(struct reo_get_queue_stats_status)) >> 2,
  1912. .lmac_ring = FALSE,
  1913. .ring_dir = HAL_SRNG_DST_RING,
  1914. .reg_start = {
  1915. HWIO_REO_R0_REO_STATUS_RING_BASE_LSB_ADDR(
  1916. REO_REG_REG_BASE),
  1917. HWIO_REO_R2_REO_STATUS_RING_HP_ADDR(
  1918. REO_REG_REG_BASE),
  1919. },
  1920. /* Single ring - provide ring size if multiple rings of this
  1921. * type are supported
  1922. */
  1923. .reg_size = {},
  1924. .max_size =
  1925. HWIO_REO_R0_REO_STATUS_RING_BASE_MSB_RING_SIZE_BMSK >>
  1926. HWIO_REO_R0_REO_STATUS_RING_BASE_MSB_RING_SIZE_SHFT,
  1927. },
  1928. { /* TCL_DATA */
  1929. .start_ring_id = HAL_SRNG_SW2TCL1,
  1930. .max_rings = 6,
  1931. .entry_size = sizeof(struct tcl_data_cmd) >> 2,
  1932. .lmac_ring = FALSE,
  1933. .ring_dir = HAL_SRNG_SRC_RING,
  1934. .reg_start = {
  1935. HWIO_TCL_R0_SW2TCL1_RING_BASE_LSB_ADDR(
  1936. MAC_TCL_REG_REG_BASE),
  1937. HWIO_TCL_R2_SW2TCL1_RING_HP_ADDR(
  1938. MAC_TCL_REG_REG_BASE),
  1939. },
  1940. .reg_size = {
  1941. HWIO_TCL_R0_SW2TCL2_RING_BASE_LSB_ADDR(0) -
  1942. HWIO_TCL_R0_SW2TCL1_RING_BASE_LSB_ADDR(0),
  1943. HWIO_TCL_R2_SW2TCL2_RING_HP_ADDR(0) -
  1944. HWIO_TCL_R2_SW2TCL1_RING_HP_ADDR(0),
  1945. },
  1946. .max_size =
  1947. HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_BMSK >>
  1948. HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_SHFT,
  1949. },
  1950. { /* TCL_CMD/CREDIT */
  1951. /* qca8074v2 and qcn9224 uses this ring for data commands */
  1952. .start_ring_id = HAL_SRNG_SW2TCL_CMD,
  1953. .max_rings = 1,
  1954. .entry_size = sizeof(struct tcl_data_cmd) >> 2,
  1955. .lmac_ring = FALSE,
  1956. .ring_dir = HAL_SRNG_SRC_RING,
  1957. .reg_start = {
  1958. HWIO_TCL_R0_SW2TCL_CREDIT_RING_BASE_LSB_ADDR(
  1959. MAC_TCL_REG_REG_BASE),
  1960. HWIO_TCL_R2_SW2TCL_CREDIT_RING_HP_ADDR(
  1961. MAC_TCL_REG_REG_BASE),
  1962. },
  1963. /* Single ring - provide ring size if multiple rings of this
  1964. * type are supported
  1965. */
  1966. .reg_size = {},
  1967. .max_size =
  1968. HWIO_TCL_R0_SW2TCL_CREDIT_RING_BASE_MSB_RING_SIZE_BMSK >>
  1969. HWIO_TCL_R0_SW2TCL_CREDIT_RING_BASE_MSB_RING_SIZE_SHFT,
  1970. },
  1971. { /* TCL_STATUS */
  1972. .start_ring_id = HAL_SRNG_TCL_STATUS,
  1973. .max_rings = 1,
  1974. .entry_size = (sizeof(struct tlv_32_hdr) +
  1975. sizeof(struct tcl_status_ring)) >> 2,
  1976. .lmac_ring = FALSE,
  1977. .ring_dir = HAL_SRNG_DST_RING,
  1978. .reg_start = {
  1979. HWIO_TCL_R0_TCL_STATUS1_RING_BASE_LSB_ADDR(
  1980. MAC_TCL_REG_REG_BASE),
  1981. HWIO_TCL_R2_TCL_STATUS1_RING_HP_ADDR(
  1982. MAC_TCL_REG_REG_BASE),
  1983. },
  1984. /* Single ring - provide ring size if multiple rings of this
  1985. * type are supported
  1986. */
  1987. .reg_size = {},
  1988. .max_size =
  1989. HWIO_TCL_R0_TCL_STATUS1_RING_BASE_MSB_RING_SIZE_BMSK >>
  1990. HWIO_TCL_R0_TCL_STATUS1_RING_BASE_MSB_RING_SIZE_SHFT,
  1991. },
  1992. { /* CE_SRC */
  1993. .start_ring_id = HAL_SRNG_CE_0_SRC,
  1994. .max_rings = 16,
  1995. .entry_size = sizeof(struct ce_src_desc) >> 2,
  1996. .lmac_ring = FALSE,
  1997. .ring_dir = HAL_SRNG_SRC_RING,
  1998. .reg_start = {
  1999. HWIO_WFSS_CE_CHANNEL_SRC_R0_SRC_RING_BASE_LSB_ADDR(
  2000. WFSS_CE_0_CHANNEL_SRC_REG_REG_BASE),
  2001. HWIO_WFSS_CE_CHANNEL_SRC_R2_SRC_RING_HP_ADDR(
  2002. WFSS_CE_0_CHANNEL_SRC_REG_REG_BASE),
  2003. },
  2004. .reg_size = {
  2005. WFSS_CE_1_CHANNEL_SRC_REG_REG_BASE -
  2006. WFSS_CE_0_CHANNEL_SRC_REG_REG_BASE,
  2007. WFSS_CE_1_CHANNEL_SRC_REG_REG_BASE -
  2008. WFSS_CE_0_CHANNEL_SRC_REG_REG_BASE,
  2009. },
  2010. .max_size =
  2011. HWIO_WFSS_CE_CHANNEL_SRC_R0_SRC_RING_BASE_MSB_RING_SIZE_BMSK >>
  2012. HWIO_WFSS_CE_CHANNEL_SRC_R0_SRC_RING_BASE_MSB_RING_SIZE_SHFT,
  2013. },
  2014. { /* CE_DST */
  2015. .start_ring_id = HAL_SRNG_CE_0_DST,
  2016. .max_rings = 16,
  2017. .entry_size = 8 >> 2,
  2018. /*TODO: entry_size above should actually be
  2019. * sizeof(struct ce_dst_desc) >> 2, but couldn't find definition
  2020. * of struct ce_dst_desc in HW header files
  2021. */
  2022. .lmac_ring = FALSE,
  2023. .ring_dir = HAL_SRNG_SRC_RING,
  2024. .reg_start = {
  2025. HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_LSB_ADDR(
  2026. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE),
  2027. HWIO_WFSS_CE_CHANNEL_DST_R2_DEST_RING_HP_ADDR(
  2028. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE),
  2029. },
  2030. .reg_size = {
  2031. WFSS_CE_1_CHANNEL_DST_REG_REG_BASE -
  2032. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE,
  2033. WFSS_CE_1_CHANNEL_DST_REG_REG_BASE -
  2034. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE,
  2035. },
  2036. .max_size =
  2037. HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_BMSK >>
  2038. HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_SHFT,
  2039. },
  2040. { /* CE_DST_STATUS */
  2041. .start_ring_id = HAL_SRNG_CE_0_DST_STATUS,
  2042. .max_rings = 16,
  2043. .entry_size = sizeof(struct ce_stat_desc) >> 2,
  2044. .lmac_ring = FALSE,
  2045. .ring_dir = HAL_SRNG_DST_RING,
  2046. .reg_start = {
  2047. HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_LSB_ADDR(
  2048. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE),
  2049. HWIO_WFSS_CE_CHANNEL_DST_R2_STATUS_RING_HP_ADDR(
  2050. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE),
  2051. },
  2052. /* TODO: check destination status ring registers */
  2053. .reg_size = {
  2054. WFSS_CE_1_CHANNEL_DST_REG_REG_BASE -
  2055. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE,
  2056. WFSS_CE_1_CHANNEL_DST_REG_REG_BASE -
  2057. WFSS_CE_0_CHANNEL_DST_REG_REG_BASE,
  2058. },
  2059. .max_size =
  2060. HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_MSB_RING_SIZE_BMSK >>
  2061. HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_MSB_RING_SIZE_SHFT,
  2062. },
  2063. { /* WBM_IDLE_LINK */
  2064. .start_ring_id = HAL_SRNG_WBM_IDLE_LINK,
  2065. .max_rings = 1,
  2066. .entry_size = sizeof(struct wbm_link_descriptor_ring) >> 2,
  2067. .lmac_ring = FALSE,
  2068. .ring_dir = HAL_SRNG_SRC_RING,
  2069. .reg_start = {
  2070. HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_LSB_ADDR(WBM_REG_REG_BASE),
  2071. HWIO_WBM_R2_WBM_IDLE_LINK_RING_HP_ADDR(WBM_REG_REG_BASE),
  2072. },
  2073. /* Single ring - provide ring size if multiple rings of this
  2074. * type are supported
  2075. */
  2076. .reg_size = {},
  2077. .max_size =
  2078. HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE_BMSK >>
  2079. HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE_SHFT,
  2080. },
  2081. { /* SW2WBM_RELEASE */
  2082. .start_ring_id = HAL_SRNG_WBM_SW_RELEASE,
  2083. .max_rings = 2,
  2084. .entry_size = sizeof(struct wbm_release_ring) >> 2,
  2085. .lmac_ring = FALSE,
  2086. .ring_dir = HAL_SRNG_SRC_RING,
  2087. .reg_start = {
  2088. HWIO_WBM_R0_SW_RELEASE_RING_BASE_LSB_ADDR(WBM_REG_REG_BASE),
  2089. HWIO_WBM_R2_SW_RELEASE_RING_HP_ADDR(WBM_REG_REG_BASE),
  2090. },
  2091. .reg_size = {
  2092. HWIO_WBM_R0_SW1_RELEASE_RING_BASE_LSB_ADDR(WBM_REG_REG_BASE) -
  2093. HWIO_WBM_R0_SW_RELEASE_RING_BASE_LSB_ADDR(WBM_REG_REG_BASE),
  2094. HWIO_WBM_R2_SW1_RELEASE_RING_HP_ADDR(WBM_REG_REG_BASE) -
  2095. HWIO_WBM_R2_SW_RELEASE_RING_HP_ADDR(WBM_REG_REG_BASE)
  2096. },
  2097. .max_size =
  2098. HWIO_WBM_R0_SW_RELEASE_RING_BASE_MSB_RING_SIZE_BMSK >>
  2099. HWIO_WBM_R0_SW_RELEASE_RING_BASE_MSB_RING_SIZE_SHFT,
  2100. },
  2101. { /* WBM2SW_RELEASE */
  2102. .start_ring_id = HAL_SRNG_WBM2SW0_RELEASE,
  2103. .max_rings = 8,
  2104. .entry_size = sizeof(struct wbm_release_ring) >> 2,
  2105. .lmac_ring = FALSE,
  2106. .ring_dir = HAL_SRNG_DST_RING,
  2107. .reg_start = {
  2108. HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_LSB_ADDR(
  2109. WBM_REG_REG_BASE),
  2110. HWIO_WBM_R2_WBM2SW0_RELEASE_RING_HP_ADDR(
  2111. WBM_REG_REG_BASE),
  2112. },
  2113. .reg_size = {
  2114. HWIO_WBM_R0_WBM2SW1_RELEASE_RING_BASE_LSB_ADDR(
  2115. WBM_REG_REG_BASE) -
  2116. HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_LSB_ADDR(
  2117. WBM_REG_REG_BASE),
  2118. HWIO_WBM_R2_WBM2SW1_RELEASE_RING_HP_ADDR(
  2119. WBM_REG_REG_BASE) -
  2120. HWIO_WBM_R2_WBM2SW0_RELEASE_RING_HP_ADDR(
  2121. WBM_REG_REG_BASE),
  2122. },
  2123. .max_size =
  2124. HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_MSB_RING_SIZE_BMSK >>
  2125. HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_MSB_RING_SIZE_SHFT,
  2126. },
  2127. { /* RXDMA_BUF */
  2128. .start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA0_BUF0,
  2129. #ifdef IPA_OFFLOAD
  2130. .max_rings = 3,
  2131. #else
  2132. .max_rings = 3,
  2133. #endif
  2134. .entry_size = sizeof(struct wbm_buffer_ring) >> 2,
  2135. .lmac_ring = TRUE,
  2136. .ring_dir = HAL_SRNG_SRC_RING,
  2137. /* reg_start is not set because LMAC rings are not accessed
  2138. * from host
  2139. */
  2140. .reg_start = {},
  2141. .reg_size = {},
  2142. .max_size = HAL_RXDMA_MAX_RING_SIZE,
  2143. },
  2144. { /* RXDMA_DST */
  2145. .start_ring_id = HAL_SRNG_WMAC1_RXDMA2SW0,
  2146. .max_rings = 0,
  2147. .entry_size = 0/*sizeof(struct reo_entrance_ring) >> 2*/,
  2148. .lmac_ring = TRUE,
  2149. .ring_dir = HAL_SRNG_DST_RING,
  2150. /* reg_start is not set because LMAC rings are not accessed
  2151. * from host
  2152. */
  2153. .reg_start = {},
  2154. .reg_size = {},
  2155. .max_size = HAL_RXDMA_MAX_RING_SIZE,
  2156. },
  2157. #ifdef QCA_MONITOR_2_0_SUPPORT
  2158. { /* RXDMA_MONITOR_BUF */
  2159. .start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA2_BUF,
  2160. .max_rings = 1,
  2161. .entry_size = sizeof(struct mon_ingress_ring) >> 2,
  2162. .lmac_ring = TRUE,
  2163. .ring_dir = HAL_SRNG_SRC_RING,
  2164. /* reg_start is not set because LMAC rings are not accessed
  2165. * from host
  2166. */
  2167. .reg_start = {},
  2168. .reg_size = {},
  2169. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2170. },
  2171. #else
  2172. {},
  2173. #endif
  2174. { /* RXDMA_MONITOR_STATUS */
  2175. .start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA1_STATBUF,
  2176. .max_rings = 0,
  2177. .entry_size = sizeof(struct wbm_buffer_ring) >> 2,
  2178. .lmac_ring = TRUE,
  2179. .ring_dir = HAL_SRNG_SRC_RING,
  2180. /* reg_start is not set because LMAC rings are not accessed
  2181. * from host
  2182. */
  2183. .reg_start = {},
  2184. .reg_size = {},
  2185. .max_size = HAL_RXDMA_MAX_RING_SIZE,
  2186. },
  2187. #ifdef QCA_MONITOR_2_0_SUPPORT
  2188. { /* RXDMA_MONITOR_DST */
  2189. .start_ring_id = HAL_SRNG_WMAC1_RXMON2SW0,
  2190. .max_rings = 1,
  2191. .entry_size = sizeof(struct mon_destination_ring) >> 2,
  2192. .lmac_ring = TRUE,
  2193. .ring_dir = HAL_SRNG_DST_RING,
  2194. /* reg_start is not set because LMAC rings are not accessed
  2195. * from host
  2196. */
  2197. .reg_start = {},
  2198. .reg_size = {},
  2199. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2200. },
  2201. #else
  2202. {},
  2203. #endif
  2204. { /* RXDMA_MONITOR_DESC */
  2205. .start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA1_DESC,
  2206. .max_rings = 0,
  2207. .entry_size = 0/*sizeof(struct sw_monitor_ring) >> 2*/,
  2208. .lmac_ring = TRUE,
  2209. .ring_dir = HAL_SRNG_DST_RING,
  2210. /* reg_start is not set because LMAC rings are not accessed
  2211. * from host
  2212. */
  2213. .reg_start = {},
  2214. .reg_size = {},
  2215. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2216. },
  2217. { /* DIR_BUF_RX_DMA_SRC */
  2218. .start_ring_id = HAL_SRNG_DIR_BUF_RX_SRC_DMA_RING,
  2219. /* one ring for spectral and one ring for cfr */
  2220. .max_rings = 2,
  2221. .entry_size = 2,
  2222. .lmac_ring = TRUE,
  2223. .ring_dir = HAL_SRNG_SRC_RING,
  2224. /* reg_start is not set because LMAC rings are not accessed
  2225. * from host
  2226. */
  2227. .reg_start = {},
  2228. .reg_size = {},
  2229. .max_size = HAL_RXDMA_MAX_RING_SIZE,
  2230. },
  2231. #ifdef WLAN_FEATURE_CIF_CFR
  2232. { /* WIFI_POS_SRC */
  2233. .start_ring_id = HAL_SRNG_WIFI_POS_SRC_DMA_RING,
  2234. .max_rings = 1,
  2235. .entry_size = sizeof(wmi_oem_dma_buf_release_entry) >> 2,
  2236. .lmac_ring = TRUE,
  2237. .ring_dir = HAL_SRNG_SRC_RING,
  2238. /* reg_start is not set because LMAC rings are not accessed
  2239. * from host
  2240. */
  2241. .reg_start = {},
  2242. .reg_size = {},
  2243. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2244. },
  2245. #endif
  2246. { /* REO2PPE */
  2247. .start_ring_id = HAL_SRNG_REO2PPE,
  2248. .max_rings = 1,
  2249. .entry_size = sizeof(struct reo_destination_ring) >> 2,
  2250. .lmac_ring = FALSE,
  2251. .ring_dir = HAL_SRNG_DST_RING,
  2252. .reg_start = {
  2253. HWIO_REO_R0_REO2PPE_RING_BASE_LSB_ADDR(
  2254. REO_REG_REG_BASE),
  2255. HWIO_REO_R2_REO2PPE_RING_HP_ADDR(
  2256. REO_REG_REG_BASE),
  2257. },
  2258. /* Single ring - provide ring size if multiple rings of this
  2259. * type are supported
  2260. */
  2261. .reg_size = {},
  2262. .max_size =
  2263. HWIO_REO_R0_REO2PPE_RING_BASE_LSB_RING_BASE_ADDR_LSB_BMSK >>
  2264. HWIO_REO_R0_REO2PPE_RING_BASE_LSB_RING_BASE_ADDR_LSB_SHFT,
  2265. },
  2266. { /* PPE2TCL */
  2267. .start_ring_id = HAL_SRNG_PPE2TCL1,
  2268. .max_rings = 1,
  2269. .entry_size = sizeof(struct tcl_entrance_from_ppe_ring) >> 2,
  2270. .lmac_ring = FALSE,
  2271. .ring_dir = HAL_SRNG_SRC_RING,
  2272. .reg_start = {
  2273. HWIO_TCL_R0_PPE2TCL1_RING_BASE_LSB_ADDR(
  2274. MAC_TCL_REG_REG_BASE),
  2275. HWIO_TCL_R2_PPE2TCL1_RING_HP_ADDR(
  2276. MAC_TCL_REG_REG_BASE),
  2277. },
  2278. .reg_size = {},
  2279. .max_size =
  2280. HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_BMSK >>
  2281. HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_SHFT,
  2282. },
  2283. { /* PPE_RELEASE */
  2284. .start_ring_id = HAL_SRNG_WBM_PPE_RELEASE,
  2285. .max_rings = 1,
  2286. .entry_size = sizeof(struct wbm_release_ring) >> 2,
  2287. .lmac_ring = FALSE,
  2288. .ring_dir = HAL_SRNG_SRC_RING,
  2289. .reg_start = {
  2290. HWIO_WBM_R0_PPE_RELEASE_RING_BASE_LSB_ADDR(WBM_REG_REG_BASE),
  2291. HWIO_WBM_R2_PPE_RELEASE_RING_HP_ADDR(WBM_REG_REG_BASE),
  2292. },
  2293. .reg_size = {},
  2294. .max_size =
  2295. HWIO_WBM_R0_PPE_RELEASE_RING_BASE_MSB_RING_SIZE_BMSK >>
  2296. HWIO_WBM_R0_PPE_RELEASE_RING_BASE_MSB_RING_SIZE_SHFT,
  2297. },
  2298. #ifdef QCA_MONITOR_2_0_SUPPORT
  2299. { /* TX_MONITOR_BUF */
  2300. .start_ring_id = HAL_SRNG_SW2TXMON_BUF0,
  2301. .max_rings = 1,
  2302. .entry_size = sizeof(struct mon_ingress_ring) >> 2,
  2303. .lmac_ring = TRUE,
  2304. .ring_dir = HAL_SRNG_SRC_RING,
  2305. /* reg_start is not set because LMAC rings are not accessed
  2306. * from host
  2307. */
  2308. .reg_start = {},
  2309. .reg_size = {},
  2310. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2311. },
  2312. { /* TX_MONITOR_DST */
  2313. .start_ring_id = HAL_SRNG_WMAC1_TXMON2SW0,
  2314. .max_rings = 1,
  2315. .entry_size = sizeof(struct mon_destination_ring) >> 2,
  2316. .lmac_ring = TRUE,
  2317. .ring_dir = HAL_SRNG_DST_RING,
  2318. /* reg_start is not set because LMAC rings are not accessed
  2319. * from host
  2320. */
  2321. .reg_start = {},
  2322. .reg_size = {},
  2323. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2324. },
  2325. #else
  2326. {},
  2327. {},
  2328. #endif
  2329. { /* SW2RXDMA */
  2330. .start_ring_id = HAL_SRNG_SW2RXDMA_BUF0,
  2331. .max_rings = 3,
  2332. .entry_size = sizeof(struct reo_entrance_ring) >> 2,
  2333. .lmac_ring = TRUE,
  2334. .ring_dir = HAL_SRNG_SRC_RING,
  2335. /* reg_start is not set because LMAC rings are not accessed
  2336. * from host
  2337. */
  2338. .reg_start = {},
  2339. .reg_size = {},
  2340. .max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
  2341. },
  2342. };
  2343. /**
  2344. * hal_srng_hw_reg_offset_init_qcn9224() - Initialize the HW srng reg offset
  2345. * applicable only for QCN9224
  2346. * @hal_soc: HAL Soc handle
  2347. *
  2348. * Return: None
  2349. */
  2350. static inline void hal_srng_hw_reg_offset_init_qcn9224(struct hal_soc *hal_soc)
  2351. {
  2352. int32_t *hw_reg_offset = hal_soc->hal_hw_reg_offset;
  2353. hw_reg_offset[DST_MSI2_BASE_LSB] = REG_OFFSET(DST, MSI2_BASE_LSB),
  2354. hw_reg_offset[DST_MSI2_BASE_MSB] = REG_OFFSET(DST, MSI2_BASE_MSB),
  2355. hw_reg_offset[DST_MSI2_DATA] = REG_OFFSET(DST, MSI2_DATA),
  2356. hw_reg_offset[DST_PRODUCER_INT2_SETUP] =
  2357. REG_OFFSET(DST, PRODUCER_INT2_SETUP);
  2358. }
  2359. /**
  2360. * hal_qcn9224_attach()- Attach 9224 target specific hal_soc ops,
  2361. * offset and srng table
  2362. * Return: void
  2363. */
  2364. void hal_qcn9224_attach(struct hal_soc *hal_soc)
  2365. {
  2366. hal_soc->hw_srng_table = hw_srng_table_9224;
  2367. hal_srng_hw_reg_offset_init_generic(hal_soc);
  2368. hal_srng_hw_reg_offset_init_qcn9224(hal_soc);
  2369. hal_hw_txrx_default_ops_attach_be(hal_soc);
  2370. hal_hw_txrx_ops_attach_qcn9224(hal_soc);
  2371. if (hal_soc->static_window_map)
  2372. hal_write_window_register(hal_soc);
  2373. hal_soc->dmac_cmn_src_rxbuf_ring = true;
  2374. }