wlan_cfg.h 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153
  1. /*
  2. * Copyright (c) 2013-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. #ifndef __WLAN_CFG_H
  20. #define __WLAN_CFG_H
  21. #include <wlan_init_cfg.h>
  22. /* DP process status */
  23. #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
  24. #define CONFIG_PROCESS_RX_STATUS 1
  25. #define CONFIG_PROCESS_TX_STATUS 1
  26. #else
  27. #define CONFIG_PROCESS_RX_STATUS 0
  28. #define CONFIG_PROCESS_TX_STATUS 0
  29. #endif
  30. /* Miscellaneous configuration */
  31. #define MAX_IDLE_SCATTER_BUFS 16
  32. #define DP_MAX_IRQ_PER_CONTEXT 12
  33. #define MAX_HTT_METADATA_LEN 32
  34. #define DP_MAX_TIDS 17
  35. #define DP_NON_QOS_TID 16
  36. #define DP_NULL_DATA_TID 17
  37. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  38. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  39. #define INVALID_PDEV_ID 0xFF
  40. #define WLAN_CFG_RX_RING_MASK_0 0x1
  41. #define WLAN_CFG_RX_RING_MASK_1 0x2
  42. #define WLAN_CFG_RX_RING_MASK_2 0x4
  43. #define WLAN_CFG_RX_RING_MASK_3 0x8
  44. #define WLAN_CFG_RX_RING_MASK_4 0x10
  45. #define WLAN_CFG_RX_RING_MASK_5 0x20
  46. #define WLAN_CFG_RX_RING_MASK_6 0x40
  47. #define WLAN_CFG_RX_RING_MASK_7 0x80
  48. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  49. #ifdef IPA_OFFLOAD
  50. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
  51. WLAN_CFG_RX_RING_MASK_1 | \
  52. WLAN_CFG_RX_RING_MASK_2)
  53. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
  54. WLAN_CFG_RX_RING_MASK_5 | \
  55. WLAN_CFG_RX_RING_MASK_6)
  56. #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
  57. WLAN_CFG_TX_RING_MASK_6 | \
  58. WLAN_CFG_TX_RING_MASK_7)
  59. #else
  60. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
  61. WLAN_CFG_RX_RING_MASK_1 | \
  62. WLAN_CFG_RX_RING_MASK_2 | \
  63. WLAN_CFG_RX_RING_MASK_3)
  64. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
  65. WLAN_CFG_RX_RING_MASK_5 | \
  66. WLAN_CFG_RX_RING_MASK_6 | \
  67. WLAN_CFG_RX_RING_MASK_7)
  68. #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
  69. WLAN_CFG_TX_RING_MASK_4 | \
  70. WLAN_CFG_TX_RING_MASK_2 | \
  71. WLAN_CFG_TX_RING_MASK_6 | \
  72. WLAN_CFG_TX_RING_MASK_7)
  73. #endif
  74. #endif
  75. /* Max number of chips that can participate in MLO */
  76. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  77. #define WLAN_MAX_MLO_CHIPS 3
  78. #define WLAN_MAX_MLO_LINKS_PER_SOC 2
  79. #else
  80. #define WLAN_MAX_MLO_CHIPS 1
  81. #endif
  82. struct wlan_cfg_dp_pdev_ctxt;
  83. /**
  84. * struct wlan_cfg_tcl_wbm_ring_num_map - TCL WBM Ring number mapping
  85. * @tcl_ring_num - TCL Ring number
  86. * @wbm_ring_num - WBM Ring number
  87. * @wbm_ring_num - WBM RBM ID to be used when enqueuing to TCL
  88. * @for_ipa - whether this TCL/WBM for IPA use or not
  89. */
  90. struct wlan_cfg_tcl_wbm_ring_num_map {
  91. uint8_t tcl_ring_num;
  92. uint8_t wbm_ring_num;
  93. uint8_t wbm_rbm_id;
  94. uint8_t for_ipa;
  95. };
  96. /**
  97. * struct wlan_srng_cfg - Per ring configuration parameters
  98. * @timer_threshold: Config to control interrupts based on timer duration
  99. * @batch_count_threshold: Config to control interrupts based on
  100. * number of packets in the ring
  101. * @low_threshold: Config to control low threshold interrupts for SRC rings
  102. */
  103. struct wlan_srng_cfg {
  104. uint32_t timer_threshold;
  105. uint32_t batch_count_threshold;
  106. uint32_t low_threshold;
  107. };
  108. /**
  109. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  110. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  111. * @max_clients: Maximum number of peers/stations supported by device
  112. * @max_alloc_size: Maximum allocation size for any dynamic memory
  113. * allocation request for this device
  114. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  115. * 1: Each TCL ring is mapped to one radio/pdev
  116. * @num_tx_comp_rings: Number of Tx comp rings supported by device
  117. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  118. * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
  119. * 1: Each REO ring is mapped to one radio/pdev
  120. * @num_tx_desc_pool: Number of Tx Descriptor pools
  121. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  122. * @num_tx_desc: Number of Tx Descriptors per pool
  123. * @min_tx_desc: Minimum number of Tx Descriptors per pool
  124. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  125. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  126. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  127. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  128. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  129. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  130. * NAPI/Intr context
  131. * @int_tx_mon_ring_mask: Bitmap of Tx monitor ring interrupts mapped to each
  132. * NAPI/Intr context
  133. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  134. * NAPI/Intr context
  135. * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  136. * NAPI/Intr context
  137. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  138. * each NAPI/Intr context
  139. * @int_rxdma2host_ring_mask:
  140. * @int_host2rxdma_ring_mask:
  141. * @int_rx_ring_near_full_irq_1_mask: Bitmap of REO DST ring near full interrupt
  142. * mapped to each NAPI/INTR context
  143. * @int_rx_ring_near_full_irq_2_mask: Bitmap of REO DST ring near full interrupt
  144. * mapped to each NAPI/INTR context
  145. * @int_tx_ring_near_full_irq_mask: Bitmap of Tx completion ring near full
  146. * interrupt mapped to each NAPI/INTR context
  147. * @int_host2txmon_ring_mask: Bitmap of Tx monitor source ring interrupt
  148. * mapped to each NAPI/INTR context
  149. * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
  150. * @lro_enabled: enable/disable lro feature
  151. * @rx_hash: Enable hash based steering of rx packets
  152. * @tso_enabled: enable/disable tso feature
  153. * @lro_enabled: enable/disable LRO feature
  154. * @sg_enabled: enable disable scatter gather feature
  155. * @gro_enabled: enable disable GRO feature
  156. * @force_gro_enabled: force enable GRO feature
  157. * @ipa_enabled: Flag indicating if IPA is enabled
  158. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  159. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  160. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  161. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  162. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  163. * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
  164. * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
  165. * @tcp_udp_checksumoffload: enable/disable checksum offload
  166. * @nss_cfg: nss configuration
  167. * @rx_defrag_min_timeout: rx defrag minimum timeout
  168. * @wbm_release_ring: wbm release ring size
  169. * @tcl_cmd_credit_ring: tcl command/credit ring size
  170. * @tcl_status_ring: tcl status ring size
  171. * @reo_reinject_ring: reo reinject ring
  172. * @rx_release_ring: rx release ring size
  173. * @reo_exception_ring: reo exception ring size
  174. * @reo_cmd_ring: reo cmd ring size
  175. * @reo_status_ring: reo status ting size
  176. * @rxdma_refill_ring: rxdma refill ring size
  177. * @rxdma_err_dst_ring: rxdma error detination ring size
  178. * @raw_mode_war: enable/disable raw mode war
  179. * @enable_data_stall_detection: enable/disable specific data stall detection
  180. * @disable_intra_bss_fwd: flag to disable intra bss forwarding
  181. * @rxdma1_enable: flag to indicate if rxdma1 is enabled
  182. * @delay_mon_replenish: delay monitor buffer replenish
  183. * @tx_desc_limit_0: tx_desc limit for 5G H
  184. * @tx_desc_limit_1: tx_desc limit for 2G
  185. * @tx_desc_limit_2: tx_desc limit for 5G L
  186. * @tx_device_limit: tx device limit
  187. * @tx_sw_internode_queue: tx sw internode queue
  188. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  189. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  190. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  191. * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
  192. * dp_rx_process loop
  193. * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
  194. * at end of tx_comp_handler loop.
  195. * @rx_sw_desc_weight: rx sw descriptor weight configuration
  196. * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
  197. * flow tagging in monitor/mon-lite mode
  198. * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
  199. * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
  200. * table should be used
  201. * @rx_flow_search_table_size: indicates the number of flows in the flow search
  202. * table
  203. * @rx_flow_max_search: max skid length for each hash entry
  204. * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
  205. * 5 tuple flow entry
  206. * @pktlog_buffer_size: packet log buffer size
  207. * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
  208. * @pext_stats_enabled: Flag to enable and disabled peer extended stats
  209. * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
  210. * pool support
  211. * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer
  212. * pool support
  213. * @rx_pending_high_threshold: threshold of starting pkt drop
  214. * @rx_pending_low_threshold: threshold of stopping pkt drop
  215. * @is_swlm_enabled: flag to enable/disable SWLM
  216. * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check
  217. * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW
  218. * @ipa_tx_ring_size: IPA tx ring size
  219. * @ipa_tx_comp_ring_size: IPA tx completion ring size
  220. * @ipa_tx_alt_ring_size: IPA tx alt ring size
  221. * @ipa_tx_alt_comp_ring_size: IPA tx alt completion ring size
  222. * @hw_cc_conv_enabled: cookie conversion enabled
  223. * @tcl_wbm_map_array: TCL-WBM map array
  224. * @pkt_capture_mode: Packet capture mode config
  225. * @rx_mon_buf_ring_size: Rx monitor buf ring size
  226. * @tx_mon_buf_ring_size: Tx monitor buf ring size
  227. * @tx_rings_grp_bitmap: bitmap of group intr contexts which have
  228. * non-zero tx ring mask
  229. * @mlo_chip_rx_ring_map: map of chip_id to rx ring map
  230. * @mlo_chip_default_rx_ring_id: default rx_ring of chip when hash is not found
  231. * @lmac_peer_id_msb: value used for hash based routing
  232. * @vdev_stats_hw_offload_config: HW vdev stats config
  233. * @vdev_stats_hw_offload_timer: HW vdev stats timer duration
  234. * @txmon_hw_support: TxMON HW support
  235. * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings
  236. */
  237. struct wlan_cfg_dp_soc_ctxt {
  238. int num_int_ctxts;
  239. int max_clients;
  240. int max_alloc_size;
  241. int per_pdev_tx_ring;
  242. int num_tx_comp_rings;
  243. int num_tcl_data_rings;
  244. int num_nss_tcl_data_rings;
  245. int per_pdev_rx_ring;
  246. int per_pdev_lmac_ring;
  247. int num_reo_dest_rings;
  248. int num_nss_reo_dest_rings;
  249. int num_tx_desc_pool;
  250. int num_tx_ext_desc_pool;
  251. int num_tx_desc;
  252. int min_tx_desc;
  253. int num_tx_ext_desc;
  254. int max_peer_id;
  255. int htt_packet_type;
  256. int int_batch_threshold_tx;
  257. int int_timer_threshold_tx;
  258. int int_batch_threshold_rx;
  259. int int_timer_threshold_rx;
  260. int int_batch_threshold_other;
  261. int int_timer_threshold_other;
  262. int int_timer_threshold_mon;
  263. int tx_ring_size;
  264. int tx_comp_ring_size;
  265. int tx_comp_ring_size_nss;
  266. uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  267. uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  268. uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  269. uint8_t int_tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  270. uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  271. uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  272. uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  273. uint8_t int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  274. uint8_t int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  275. uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  276. uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  277. uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  278. uint8_t int_rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  279. uint8_t int_rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  280. uint8_t int_tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  281. uint8_t int_host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  282. int hw_macid[MAX_PDEV_CNT];
  283. int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
  284. int base_hw_macid;
  285. bool rx_hash;
  286. bool tso_enabled;
  287. bool lro_enabled;
  288. bool sg_enabled;
  289. bool gro_enabled;
  290. bool force_gro_enabled;
  291. bool ipa_enabled;
  292. bool ol_tx_csum_enabled;
  293. bool ol_rx_csum_enabled;
  294. bool rawmode_enabled;
  295. bool peer_flow_ctrl_enabled;
  296. bool napi_enabled;
  297. bool p2p_tcp_udp_checksumoffload;
  298. bool nan_tcp_udp_checksumoffload;
  299. bool tcp_udp_checksumoffload;
  300. bool legacy_mode_checksumoffload_disable;
  301. bool defrag_timeout_check;
  302. int nss_cfg;
  303. uint32_t tx_flow_stop_queue_threshold;
  304. uint32_t tx_flow_start_queue_offset;
  305. int rx_defrag_min_timeout;
  306. int reo_dst_ring_size;
  307. int wbm_release_ring;
  308. int tcl_cmd_credit_ring;
  309. int tcl_status_ring;
  310. int reo_reinject_ring;
  311. int rx_release_ring;
  312. int reo_exception_ring;
  313. int reo_cmd_ring;
  314. int reo_status_ring;
  315. int rxdma_refill_ring;
  316. int rxdma_err_dst_ring;
  317. uint32_t per_pkt_trace;
  318. bool raw_mode_war;
  319. uint32_t enable_data_stall_detection;
  320. bool disable_intra_bss_fwd;
  321. bool rxdma1_enable;
  322. bool delay_mon_replenish;
  323. int max_ast_idx;
  324. int tx_desc_limit_0;
  325. int tx_desc_limit_1;
  326. int tx_desc_limit_2;
  327. int tx_device_limit;
  328. int tx_sw_internode_queue;
  329. int mon_drop_thresh;
  330. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  331. uint32_t tx_comp_loop_pkt_limit;
  332. uint32_t rx_reap_loop_pkt_limit;
  333. uint32_t rx_hp_oos_update_limit;
  334. bool rx_enable_eol_data_check;
  335. bool tx_comp_enable_eol_data_check;
  336. #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
  337. int rx_sw_desc_weight;
  338. int rx_sw_desc_num;
  339. bool is_rx_mon_protocol_flow_tag_enabled;
  340. bool is_rx_flow_tag_enabled;
  341. bool is_rx_flow_search_table_per_pdev;
  342. uint16_t rx_flow_search_table_size;
  343. uint16_t rx_flow_max_search;
  344. uint8_t *rx_toeplitz_hash_key;
  345. uint8_t pktlog_buffer_size;
  346. uint8_t is_rx_fisa_enabled;
  347. bool is_rx_fisa_lru_del_enabled;
  348. bool is_tso_desc_attach_defer;
  349. uint32_t delayed_replenish_entries;
  350. uint32_t reo_rings_mapping;
  351. bool pext_stats_enabled;
  352. bool is_rx_buff_pool_enabled;
  353. bool is_rx_refill_buff_pool_enabled;
  354. uint32_t rx_pending_high_threshold;
  355. uint32_t rx_pending_low_threshold;
  356. bool is_poll_mode_enabled;
  357. uint8_t is_swlm_enabled;
  358. bool fst_in_cmem;
  359. bool tx_per_pkt_vdev_id_check;
  360. uint8_t radio0_rx_default_reo;
  361. uint8_t radio1_rx_default_reo;
  362. uint8_t radio2_rx_default_reo;
  363. bool wow_check_rx_pending_enable;
  364. #ifdef IPA_OFFLOAD
  365. uint32_t ipa_tx_ring_size;
  366. uint32_t ipa_tx_comp_ring_size;
  367. #ifdef IPA_WDI3_TX_TWO_PIPES
  368. int ipa_tx_alt_ring_size;
  369. int ipa_tx_alt_comp_ring_size;
  370. #endif /* IPA_WDI3_TX_TWO_PIPES */
  371. #endif /* IPA_OFFLOAD */
  372. bool hw_cc_enabled;
  373. struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array;
  374. #ifdef WLAN_SUPPORT_PPEDS
  375. bool ppe_enable;
  376. int reo2ppe_ring;
  377. int ppe2tcl_ring;
  378. int ppe_release_ring;
  379. #endif
  380. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  381. uint32_t pkt_capture_mode;
  382. #endif
  383. uint32_t rx_mon_buf_ring_size;
  384. uint32_t tx_mon_buf_ring_size;
  385. uint8_t rx_rel_wbm2sw_ring_id;
  386. uint32_t tx_rings_grp_bitmap;
  387. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  388. uint8_t mlo_chip_rx_ring_map[WLAN_MAX_MLO_CHIPS];
  389. uint8_t mlo_chip_default_rx_ring_id[WLAN_MAX_MLO_CHIPS];
  390. uint8_t lmac_peer_id_msb[WLAN_MAX_MLO_CHIPS];
  391. #endif
  392. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  393. bool vdev_stats_hw_offload_config;
  394. int vdev_stats_hw_offload_timer;
  395. #endif
  396. uint8_t num_rxdma_dst_rings_per_pdev;
  397. bool txmon_hw_support;
  398. uint8_t num_rxdma_status_rings_per_pdev;
  399. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  400. uint32_t tx_capt_max_mem_allowed;
  401. #endif
  402. #ifdef CONFIG_SAWF
  403. bool sawf_enabled;
  404. #endif
  405. };
  406. /**
  407. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  408. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  409. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  410. * @dma_rx_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  411. * @dma_tx_mon_dest_ring_size - Size of Tx Monitor Destination ring
  412. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  413. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  414. * @dma_tx_mon_buf_ring_size - Tx monitor BUF Ring size
  415. */
  416. struct wlan_cfg_dp_pdev_ctxt {
  417. int rx_dma_buf_ring_size;
  418. int dma_mon_buf_ring_size;
  419. int dma_rx_mon_dest_ring_size;
  420. int dma_tx_mon_dest_ring_size;
  421. int dma_mon_status_ring_size;
  422. int rxdma_monitor_desc_ring;
  423. int num_mac_rings;
  424. int nss_enabled;
  425. int dma_tx_mon_buf_ring_size;
  426. };
  427. /**
  428. * struct wlan_dp_prealloc_cfg - DP prealloc related config
  429. * @num_tx_ring_entries: num of tcl data ring entries
  430. * @num_tx_comp_ring_entries: num of tx comp ring entries
  431. * @num_wbm_rel_ring_entries: num of wbm err ring entries
  432. * @num_rxdma_err_dst_ring_entries: num of rxdma err ring entries
  433. * @num_reo_exception_ring_entries: num of rx exception ring entries
  434. * @num_tx_desc: num of tx descriptors
  435. * @num_tx_ext_desc: num of tx ext descriptors
  436. */
  437. struct wlan_dp_prealloc_cfg {
  438. int num_tx_ring_entries;
  439. int num_tx_comp_ring_entries;
  440. int num_wbm_rel_ring_entries;
  441. int num_rxdma_err_dst_ring_entries;
  442. int num_reo_exception_ring_entries;
  443. int num_tx_desc;
  444. int num_tx_ext_desc;
  445. };
  446. /**
  447. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  448. * @ctrl_obj - PSOC object
  449. *
  450. * Allocates context for Soc configuration parameters,
  451. * Read configuration information from device tree/ini file and
  452. * returns back handle
  453. *
  454. * Return: Handle to configuration context
  455. */
  456. struct wlan_cfg_dp_soc_ctxt *
  457. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  458. /**
  459. * wlan_cfg_soc_detach() - Detach soc configuration handle
  460. * @wlan_cfg_ctx: soc configuration handle
  461. *
  462. * De-allocates memory allocated for SoC configuration
  463. *
  464. * Return:none
  465. */
  466. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  467. /**
  468. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  469. * @ctrl_obj - PSOC object
  470. *
  471. * Allocates context for pdev configuration parameters,
  472. * Read configuration information from device tree/ini file and
  473. * returns back handle
  474. *
  475. * Return: Handle to configuration context
  476. */
  477. struct wlan_cfg_dp_pdev_ctxt *
  478. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  479. /**
  480. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  481. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  482. *
  483. * Return: void
  484. */
  485. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  486. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  487. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  488. int context, int mask);
  489. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  490. int context, int mask);
  491. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  492. int context, int mask);
  493. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  494. int context, int mask);
  495. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  496. int mask);
  497. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  498. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  499. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  500. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
  501. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  502. int context, int mask);
  503. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  504. int context, int mask);
  505. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  506. int context, int mask);
  507. /**
  508. * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
  509. * for monitor buffer ring at initialization
  510. * @wlan_cfg_ctx - Configuration Handle
  511. * @replenish_entries - number of entries to replenish at initialization
  512. *
  513. */
  514. void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  515. *wlan_cfg_ctx,
  516. uint32_t replenish_entries);
  517. /**
  518. * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
  519. * for monitor buffer ring at initialization
  520. * @wlan_cfg_ctx - Configuration Handle
  521. * @replenish_entries - number of entries to replenish at initialization
  522. *
  523. * Return: delayed_replenish_entries;
  524. */
  525. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  526. *wlan_cfg_ctx);
  527. /**
  528. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  529. * @wlan_cfg_ctx - Configuration Handle
  530. *
  531. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  532. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  533. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  534. * that are processed by the handler.
  535. *
  536. * Return: num_contexts
  537. */
  538. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  539. /**
  540. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  541. * interrupt context
  542. * @wlan_cfg_ctx - Configuration Handle
  543. * @context - Numerical ID identifying the Interrupt/NAPI context
  544. *
  545. * Return: int_tx_ring_mask[context]
  546. */
  547. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  548. int context);
  549. /**
  550. * wlan_cfg_get_tcl_wbm_ring_num_for_index() - Get TCL/WBM ring number for index
  551. * @wlan_cfg_ctx - Configuration Handle
  552. * @index: index for which TCL/WBM ring numbers are needed
  553. * @tcl: pointer to TCL ring number, to be filled
  554. * @wbm: pointer to WBM ring number to be filled
  555. *
  556. * The function fills in tcl/wbm input pointers with TCL/WBM ring numbers for a
  557. * given index corresponding to soc->tcl_data_ring or soc->tx_comp_ring. This
  558. * is needed since WBM/TCL rings may not be sequentially available for HOST
  559. * to use. The function returns values as stored in tcl_wbm_map_array global
  560. * array.
  561. *
  562. * Return: None
  563. */
  564. static inline
  565. void wlan_cfg_get_tcl_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  566. int index, int *tcl, int *wbm)
  567. {
  568. *tcl = wlan_cfg_ctx->tcl_wbm_map_array[index].tcl_ring_num;
  569. *wbm = wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
  570. }
  571. /**
  572. * wlan_cfg_get_wbm_ring_num_for_index() - Get WBM ring number for index
  573. * @wlan_cfg_ctx - Configuration Handle
  574. * @index: index for which WBM ring numbers is needed
  575. *
  576. * Return: WBM Ring number for the index
  577. */
  578. static inline
  579. int wlan_cfg_get_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  580. int index)
  581. {
  582. return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
  583. }
  584. /**
  585. * wlan_cfg_get_rbm_id_for_index() - Get WBM RBM ID for TX ring index
  586. * @wlan_cfg_ctx - Configuration Handle
  587. * @index: TCL index for which WBM rbm value is needed
  588. *
  589. * The function fills in wbm rbm value corresponding to a TX ring index in
  590. * soc->tcl_data_ring. This is needed since WBM ring numbers donot map
  591. * sequentially to wbm rbm values.
  592. * The function returns rbm id values as stored in tcl_wbm_map_array global
  593. * array.
  594. *
  595. * Return: WBM rbm value corresnponding to TX ring index
  596. */
  597. static inline
  598. int wlan_cfg_get_rbm_id_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, int index)
  599. {
  600. return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_rbm_id;
  601. }
  602. /**
  603. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  604. * interrupt context
  605. * @wlan_cfg_ctx - Configuration Handle
  606. * @context - Numerical ID identifying the Interrupt/NAPI context
  607. *
  608. * Return: int_rx_ring_mask[context]
  609. */
  610. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  611. int context);
  612. /**
  613. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  614. * mapped to an interrupt context
  615. * @wlan_cfg_ctx - Configuration Handle
  616. * @context - Numerical ID identifying the Interrupt/NAPI context
  617. *
  618. * Return: int_rx_mon_ring_mask[context]
  619. */
  620. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  621. int context);
  622. /**
  623. * wlan_cfg_set_tx_mon_ring_mask() - Set Tx monitor ring interrupt mask
  624. * mapped to an interrupt context
  625. * @wlan_cfg_ctx - Configuration Handle
  626. * @context - Numerical ID identifying the Interrupt/NAPI context
  627. * @mask: Interrupt mask
  628. *
  629. * Return: None
  630. */
  631. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  632. int context, int mask);
  633. /**
  634. * wlan_cfg_get_tx_mon_ring_mask() - Return Tx monitor ring interrupt mask
  635. * mapped to an interrupt context
  636. * @wlan_cfg_ctx - Configuration Handle
  637. * @context - Numerical ID identifying the Interrupt/NAPI context
  638. *
  639. * Return: int_tx_mon_ring_mask[context]
  640. */
  641. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  642. int context);
  643. /**
  644. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  645. * for the given interrupt context
  646. * @wlan_cfg_ctx - Configuration Handle
  647. * @context - Numerical ID identifying the Interrupt/NAPI context
  648. *
  649. */
  650. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  651. int context, int mask);
  652. /**
  653. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  654. * mapped to an interrupt context
  655. * @wlan_cfg_ctx - Configuration Handle
  656. * @context - Numerical ID identifying the Interrupt/NAPI context
  657. *
  658. * Return: int_rxdma2host_ring_mask[context]
  659. */
  660. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  661. int context);
  662. /**
  663. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  664. * for the given interrupt context
  665. * @wlan_cfg_ctx - Configuration Handle
  666. * @context - Numerical ID identifying the Interrupt/NAPI context
  667. *
  668. */
  669. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  670. int context, int mask);
  671. /**
  672. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  673. * mapped to an interrupt context
  674. * @wlan_cfg_ctx - Configuration Handle
  675. * @context - Numerical ID identifying the Interrupt/NAPI context
  676. *
  677. * Return: int_host2rxdma_ring_mask[context]
  678. */
  679. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  680. int context);
  681. /**
  682. * wlan_cfg_get_rx_near_full_grp_1_mask() - Return REO near full interrupt mask
  683. * mapped to an interrupt context
  684. * @cfg: Configuration Handle
  685. * @context - Numerical ID identifying the Interrupt/NAPI context
  686. *
  687. * Return: REO near full interrupt mask[context]
  688. */
  689. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  690. int context);
  691. /**
  692. * wlan_cfg_get_rx_near_full_grp_2_mask() - Return REO near full interrupt mask
  693. * mapped to an interrupt context
  694. * @cfg: Configuration Handle
  695. * @context - Numerical ID identifying the Interrupt/NAPI context
  696. *
  697. * Return: REO near full interrupt mask[context]
  698. */
  699. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  700. int context);
  701. /**
  702. * wlan_cfg_get_tx_ring_near_full_mask() - Return tx completion ring near full
  703. * interrupt mask mapped to an interrupt context
  704. * @cfg: Configuration Handle
  705. * @context - Numerical ID identifying the Interrupt/NAPI context
  706. *
  707. * Return: tx completion near full interrupt mask[context]
  708. */
  709. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  710. int context);
  711. /**
  712. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  713. * interrupt mask for the given interrupt context
  714. * @wlan_cfg_ctx - Configuration Handle
  715. * @context - Numerical ID identifying the Interrupt/NAPI context
  716. *
  717. */
  718. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  719. int context, int mask);
  720. /**
  721. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  722. * interrupt mask mapped to an interrupt context
  723. * @wlan_cfg_ctx - Configuration Handle
  724. * @context - Numerical ID identifying the Interrupt/NAPI context
  725. *
  726. * Return: int_host2rxdma_mon_ring_mask[context]
  727. */
  728. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  729. int context);
  730. /**
  731. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  732. * destination ring interrupt mask
  733. * for the given interrupt context
  734. * @wlan_cfg_ctx - Configuration Handle
  735. * @context - Numerical ID identifying the Interrupt/NAPI context
  736. *
  737. */
  738. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  739. int context, int mask);
  740. /**
  741. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  742. * destination ring interrupt mask
  743. * mapped to an interrupt context
  744. * @wlan_cfg_ctx - Configuration Handle
  745. * @context - Numerical ID identifying the Interrupt/NAPI context
  746. *
  747. * Return: int_rxdma2host_mon_ring_mask[context]
  748. */
  749. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  750. int context);
  751. /**
  752. * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
  753. *
  754. * @wlan_cfg_ctx - Configuration Handle
  755. * @pdev_idx - Index of SW PDEV
  756. * @hw_macid - HW MAC Id
  757. *
  758. */
  759. void wlan_cfg_set_hw_mac_idx
  760. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  761. /**
  762. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  763. * PDEV index
  764. *
  765. * @wlan_cfg_ctx - Configuration Handle
  766. * @pdev_idx - Index of SW PDEV
  767. *
  768. * Return: HW MAC index
  769. */
  770. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  771. /**
  772. * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
  773. *
  774. * @wlan_cfg_ctx - Configuration Handle
  775. * @hw_macid - Index of hw mac
  776. *
  777. * Return: PDEV ID
  778. */
  779. int
  780. wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  781. /**
  782. * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
  783. * hw mac index
  784. *
  785. * @wlan_cfg_ctx - Configuration Handle
  786. * @pdev_idx - Index of SW PDEV
  787. * @hw_macid - Index of hw mac
  788. *
  789. * Return: PDEV index
  790. */
  791. void wlan_cfg_set_pdev_idx
  792. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  793. /**
  794. * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
  795. * hw mac index
  796. *
  797. * @wlan_cfg_ctx - Configuration Handle
  798. * @hw_macid - Index of hw mac
  799. *
  800. * Return: PDEV index
  801. */
  802. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  803. /**
  804. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  805. * mapped to an interrupt context
  806. * @wlan_cfg_ctx - Configuration Handle
  807. * @context - Numerical ID identifying the Interrupt/NAPI context
  808. *
  809. * Return: int_rx_err_ring_mask[context]
  810. */
  811. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  812. context);
  813. /**
  814. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  815. * mapped to an interrupt context
  816. * @wlan_cfg_ctx - Configuration Handle
  817. * @context - Numerical ID identifying the Interrupt/NAPI context
  818. *
  819. * Return: int_wbm_rel_ring_mask[context]
  820. */
  821. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  822. context);
  823. /**
  824. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  825. * mapped to an interrupt context
  826. * @wlan_cfg_ctx - Configuration Handle
  827. * @context - Numerical ID identifying the Interrupt/NAPI context
  828. *
  829. * Return: int_reo_status_ring_mask[context]
  830. */
  831. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  832. context);
  833. /**
  834. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  835. * mapped to an interrupt context
  836. * @wlan_cfg_ctx - Configuration Handle
  837. * @context - Numerical ID identifying the Interrupt/NAPI context
  838. *
  839. * Return: int_ce_ring_mask[context]
  840. */
  841. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  842. int context);
  843. /**
  844. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  845. * supported by device
  846. * @wlan_cfg_ctx - Configuration Handle
  847. *
  848. * Return: max_clients
  849. */
  850. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  851. /**
  852. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  853. * memory allocation request for this device
  854. * @wlan_cfg_ctx - Configuration Handle
  855. *
  856. * Return: max_alloc_size
  857. */
  858. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  859. /*
  860. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  861. * one per radio
  862. * @wlan_cfg_ctx - Configuration Handle
  863. *
  864. * Return: per_pdev_tx_ring
  865. */
  866. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  867. /*
  868. * wlan_cfg_num_tx_comp_rings() - Number of Tx comp rings (HOST mode)
  869. * @wlan_cfg_ctx
  870. *
  871. * Return: num_tx_comp_rings
  872. */
  873. int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  874. /*
  875. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode)
  876. * @wlan_cfg_ctx
  877. *
  878. * Return: num_tcl_data_rings
  879. */
  880. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  881. /*
  882. * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload)
  883. * @wlan_cfg_ctx
  884. *
  885. * Return: num_tcl_data_rings
  886. */
  887. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  888. /*
  889. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  890. * one per radio
  891. * @wlan_cfg_ctx
  892. *
  893. * Return: per_pdev_rx_ring
  894. */
  895. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  896. /*
  897. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  898. * one per radio
  899. * @wlan_cfg_ctx
  900. *
  901. * Return: return 1 if per pdev error ring else 0
  902. */
  903. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  904. /*
  905. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode)
  906. * @wlan_cfg_ctx - Configuration Handle
  907. *
  908. * Return: num_reo_dest_rings
  909. */
  910. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  911. /*
  912. * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload)
  913. * @wlan_cfg_ctx - Configuration Handle
  914. *
  915. * Return: num_reo_dest_rings
  916. */
  917. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  918. /*
  919. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  920. * @wlan_cfg_ctx - Configuration Handle
  921. *
  922. * Return: htt_pkt_type_ethernet
  923. */
  924. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  925. /*
  926. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  927. * device
  928. * @wlan_cfg_ctx - Configuration Handle
  929. *
  930. * Return: num_tx_desc_pool
  931. */
  932. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  933. /*
  934. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  935. * device
  936. * @wlan_cfg_ctx - Configuration Handle
  937. * @num_pool - Number of pool
  938. */
  939. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  940. /*
  941. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  942. * pools
  943. * @wlan_cfg_ctx - Configuration Handle
  944. *
  945. * Return: num_tx_ext_desc_pool
  946. */
  947. int wlan_cfg_get_num_tx_ext_desc_pool(
  948. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  949. /*
  950. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  951. *
  952. * @wlan_cfg_ctx - Configuration Handle
  953. *
  954. * Return: reo_dst_ring_size
  955. */
  956. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  957. /*
  958. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  959. *
  960. * @wlan_cfg_ctx - Configuration Handle
  961. * @reo_dst_ring_size - REO Destination ring size
  962. */
  963. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  964. int reo_dst_ring_size);
  965. /*
  966. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  967. *
  968. * @wlan_cfg_ctx - Configuration Handle
  969. * @raw_mode_war - raw mode war configuration
  970. */
  971. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  972. bool raw_mode_war);
  973. /*
  974. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  975. *
  976. * @wlan_cfg_ctx - Configuration Handle
  977. *
  978. * Return: reo_dst_ring_size
  979. */
  980. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  981. /*
  982. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  983. * pools
  984. * @wlan_cfg_ctx - Configuration Handle
  985. * @num_pool - Number of pool
  986. */
  987. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  988. /*
  989. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  990. * @wlan_cfg_ctx - Configuration Handle
  991. *
  992. * Return: num_tx_desc
  993. */
  994. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  995. /*
  996. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  997. * @wlan_cfg_ctx - Configuration Handle
  998. *
  999. * Return: num_tx_desc
  1000. */
  1001. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1002. /*
  1003. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  1004. *
  1005. * @wlan_cfg_ctx - Configuration Handle
  1006. * @num_desc: Number of descriptor
  1007. */
  1008. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  1009. /*
  1010. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  1011. * per pool
  1012. * @wlan_cfg_ctx - Configuration Handle
  1013. *
  1014. * Return: num_tx_ext_desc
  1015. */
  1016. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1017. /*
  1018. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  1019. * per pool
  1020. * @wlan_cfg_ctx - Configuration Handle
  1021. * @num_desc: Number of descriptor
  1022. */
  1023. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  1024. /*
  1025. * wlan_cfg_max_peer_id() - Get maximum peer ID
  1026. * @cfg: Configuration Handle
  1027. *
  1028. * Return: maximum peer ID
  1029. */
  1030. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  1031. /*
  1032. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  1033. * @wlan_cfg_pdev_ctx
  1034. *
  1035. * Return: dma_mon_buf_ring_size
  1036. */
  1037. int wlan_cfg_get_dma_mon_buf_ring_size(
  1038. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1039. /*
  1040. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  1041. * @wlan_cfg_pdev_ctx
  1042. *
  1043. * Return: dma_mon_stat_ring_size
  1044. */
  1045. int wlan_cfg_get_dma_mon_stat_ring_size(
  1046. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1047. /*
  1048. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  1049. * @wlan_cfg_soc_ctx
  1050. *
  1051. * Return: rxdma monitor desc ring size
  1052. */
  1053. int
  1054. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1055. /*
  1056. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  1057. * @wlan_cfg_pdev_ctx
  1058. *
  1059. * Return: rx_dma_buf_ring_size
  1060. */
  1061. int wlan_cfg_get_rx_dma_buf_ring_size(
  1062. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1063. /*
  1064. * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
  1065. * @wlan_cfg_pdev_ctx
  1066. *
  1067. * Return: rx_pending_high_threshold
  1068. */
  1069. uint32_t
  1070. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  1071. /*
  1072. * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
  1073. * @wlan_cfg_pdev_ctx
  1074. *
  1075. * Return: rx_pending_low_threshold
  1076. */
  1077. uint32_t
  1078. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  1079. /*
  1080. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  1081. * per pdev
  1082. * @wlan_cfg_pdev_ctx
  1083. *
  1084. * Return: number of mac DMA rings per pdev
  1085. */
  1086. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1087. /*
  1088. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  1089. * @wlan_cfg_dp_soc_ctxt
  1090. *
  1091. * Return: true - LRO enabled false - LRO disabled
  1092. */
  1093. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1094. /*
  1095. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  1096. * @wlan_cfg_dp_soc_ctxt
  1097. *
  1098. * Return: true - GRO enabled false - GRO disabled
  1099. */
  1100. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1101. /*
  1102. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  1103. * @wlan_cfg_dp_soc_ctxt
  1104. *
  1105. * Return: true - enabled false - disabled
  1106. */
  1107. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1108. /*
  1109. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  1110. * @wlan_cfg_dp_soc_ctxt
  1111. *
  1112. * Return: true - enabled false - disabled
  1113. */
  1114. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1115. /*
  1116. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  1117. * @wlan_cfg_soc_ctx
  1118. * @rx_hash
  1119. */
  1120. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  1121. /*
  1122. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  1123. * @wlan_cfg_pdev_ctx
  1124. *
  1125. * Return: 1 - enabled 0 - disabled
  1126. */
  1127. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1128. /*
  1129. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  1130. * @wlan_cfg_pdev_ctx
  1131. */
  1132. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  1133. /*
  1134. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  1135. * @wlan_cfg_pdev_ctx
  1136. *
  1137. * Return: nss_cfg
  1138. */
  1139. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  1140. /*
  1141. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  1142. * @wlan_cfg_pdev_ctx
  1143. *
  1144. */
  1145. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  1146. /*
  1147. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  1148. * @wlan_cfg_soc_ctx
  1149. *
  1150. * Return: Batch threshold
  1151. */
  1152. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1153. /*
  1154. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  1155. * @wlan_cfg_soc_ctx
  1156. *
  1157. * Return: Timer threshold
  1158. */
  1159. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1160. /*
  1161. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  1162. * @wlan_cfg_soc_ctx
  1163. *
  1164. * Return: Batch threshold
  1165. */
  1166. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1167. /*
  1168. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  1169. * @wlan_cfg_soc_ctx
  1170. *
  1171. * Return: Timer threshold
  1172. */
  1173. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1174. /*
  1175. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  1176. * @wlan_cfg_soc_ctx
  1177. *
  1178. * Return: Batch threshold
  1179. */
  1180. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  1181. /*
  1182. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  1183. * @wlan_cfg_soc_ctx
  1184. *
  1185. * Return: Timer threshold
  1186. */
  1187. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  1188. /*
  1189. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  1190. * @wlan_cfg_soc_ctx
  1191. *
  1192. * Return: Timer threshold
  1193. */
  1194. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  1195. /*
  1196. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  1197. * @wlan_cfg_soc_ctx
  1198. *
  1199. * Return: Checksum offload enable or disable
  1200. */
  1201. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1202. /*
  1203. * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
  1204. * @wlan_cfg_soc_ctx
  1205. *
  1206. * Return: Checksum offload enable or disable value for NAN mode
  1207. */
  1208. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1209. /*
  1210. * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
  1211. * @wlan_cfg_soc_ctx
  1212. *
  1213. * Return: Checksum offload enable or disable value for P2P mode
  1214. */
  1215. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1216. /*
  1217. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  1218. * @wlan_cfg_soc_ctx
  1219. *
  1220. * Return: Tx Ring Size
  1221. */
  1222. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1223. /*
  1224. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  1225. * @wlan_cfg_soc_ctx
  1226. *
  1227. * Return: Tx Completion ring size
  1228. */
  1229. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1230. /*
  1231. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  1232. * @wlan_cfg_soc_ctx
  1233. *
  1234. * Return: wbm_release_ring size
  1235. */
  1236. int
  1237. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1238. /*
  1239. * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
  1240. * @wlan_cfg_soc_ctx
  1241. *
  1242. * Return: tcl_cmd_credit_ring size
  1243. */
  1244. int
  1245. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1246. /*
  1247. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  1248. * @wlan_cfg_soc_ctx
  1249. *
  1250. * Return: tcl_status_ring size
  1251. */
  1252. int
  1253. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1254. /*
  1255. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  1256. * @wlan_cfg_soc_ctx
  1257. *
  1258. * Return: reo_reinject_ring size
  1259. */
  1260. int
  1261. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1262. /*
  1263. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  1264. * @wlan_cfg_soc_ctx
  1265. *
  1266. * Return: rx_release_ring size
  1267. */
  1268. int
  1269. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1270. /*
  1271. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  1272. * @wlan_cfg_soc_ctx
  1273. *
  1274. * Return: reo_exception_ring size
  1275. */
  1276. int
  1277. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1278. /*
  1279. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  1280. * @wlan_cfg_soc_ctx
  1281. *
  1282. * Return: reo_cmd_ring size
  1283. */
  1284. int
  1285. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1286. /*
  1287. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  1288. * @wlan_cfg_soc_ctx
  1289. *
  1290. * Return: reo_status_ring size
  1291. */
  1292. int
  1293. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1294. /*
  1295. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  1296. * @wlan_cfg_soc_ctx
  1297. *
  1298. * Return: tx desc limit for 5G H
  1299. */
  1300. int
  1301. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  1302. /*
  1303. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  1304. * @wlan_cfg_soc_ctx
  1305. *
  1306. * Return: tx desc limit for 2G
  1307. */
  1308. int
  1309. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  1310. /*
  1311. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  1312. * @wlan_cfg_soc_ctx
  1313. *
  1314. * Return: tx desc limit for 5G L
  1315. */
  1316. int
  1317. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  1318. /*
  1319. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  1320. * @wlan_cfg_soc_ctx
  1321. *
  1322. * Return: tx device limit
  1323. */
  1324. int
  1325. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1326. /*
  1327. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  1328. * @wlan_cfg_soc_ctx
  1329. *
  1330. * Return: tx sw internode queue
  1331. */
  1332. int
  1333. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  1334. /*
  1335. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  1336. * @wlan_cfg_soc_ctx
  1337. *
  1338. * Return: rxdma refill ring size
  1339. */
  1340. int
  1341. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1342. /*
  1343. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  1344. * @wlan_cfg_soc_ctx
  1345. *
  1346. * Return: rxdma error dst ring size
  1347. */
  1348. int
  1349. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1350. /*
  1351. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  1352. * @wlan_cfg_soc_ctx
  1353. *
  1354. * Return: rx_sw_desc_weight
  1355. */
  1356. int
  1357. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  1358. /*
  1359. * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
  1360. * @wlan_cfg_soc_ctx
  1361. *
  1362. * Return: rx_sw_desc_num
  1363. */
  1364. int
  1365. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
  1366. /*
  1367. * wlan_cfg_get_dp_caps - Get dp capablities
  1368. * @wlan_cfg_soc_ctx
  1369. * @dp_caps: enum for dp capablities
  1370. *
  1371. * Return: bool if a dp capabilities is enabled
  1372. */
  1373. bool
  1374. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1375. enum cdp_capabilities dp_caps);
  1376. /**
  1377. * wlan_set_srng_cfg() - Fill per ring specific
  1378. * configuration parameters
  1379. * @wlan_cfg: global srng configuration table
  1380. *
  1381. * Return: None
  1382. */
  1383. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1384. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1385. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1386. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1387. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1388. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1389. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1390. /**
  1391. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1392. * in number of entries
  1393. *
  1394. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1395. *
  1396. * Return: rx_fst_size
  1397. */
  1398. uint16_t
  1399. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1400. /**
  1401. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1402. *
  1403. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1404. *
  1405. * Return: max_search
  1406. */
  1407. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1408. /**
  1409. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1410. * search
  1411. *
  1412. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1413. *
  1414. * Return: 320-bit Hash Key
  1415. */
  1416. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1417. /**
  1418. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1419. * DP soc context
  1420. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1421. * @val: Rx flow tag feature flag value
  1422. *
  1423. * Return: None
  1424. */
  1425. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1426. bool val);
  1427. /**
  1428. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1429. * DP soc context
  1430. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1431. *
  1432. * Return: true if feature is enabled, else false
  1433. */
  1434. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1435. /**
  1436. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1437. * Rx FST is per pdev
  1438. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1439. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1440. *
  1441. * Return: None
  1442. */
  1443. void
  1444. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1445. bool val);
  1446. /**
  1447. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1448. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1449. *
  1450. * Return: true if Rx FST is per pdev, else false
  1451. */
  1452. bool
  1453. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1454. /**
  1455. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1456. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1457. * @val: Rx FST size in number of entries
  1458. *
  1459. * Return: None
  1460. */
  1461. void
  1462. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1463. uint16_t val);
  1464. /**
  1465. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1466. * in DP soc context
  1467. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1468. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1469. *
  1470. * Return: None
  1471. */
  1472. void
  1473. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1474. bool val);
  1475. /**
  1476. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1477. * from DP soc context
  1478. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1479. *
  1480. * Return: true if feature is enabled in monitor mode for protocol or flow
  1481. * tagging in INI, false otherwise
  1482. */
  1483. bool
  1484. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1485. /**
  1486. * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt
  1487. * vdev id check in tx.
  1488. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1489. * @val: feature flag value
  1490. *
  1491. * Return: None
  1492. */
  1493. void
  1494. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1495. bool val);
  1496. /**
  1497. * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if
  1498. * perpkt vdev id check is enabled in tx.
  1499. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1500. *
  1501. * Return: true if feature is enabled, false otherwise
  1502. */
  1503. bool
  1504. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1505. /**
  1506. * wlan_cfg_fill_interrupt_mask() - set interrupt mask
  1507. *
  1508. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1509. * @num_dp_msi: Number of DP interrupts available (0 for integrated)
  1510. * @interrupt_mode: Type of interrupt
  1511. * @is_monitor_mode: is monitor mode enabled
  1512. *
  1513. * Return: void
  1514. */
  1515. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1516. int num_dp_msi, int interrupt_mode,
  1517. bool is_monitor_mode);
  1518. /**
  1519. * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
  1520. *
  1521. *
  1522. * @cfg: soc configuration context
  1523. *
  1524. * Return: true if enabled, false otherwise.
  1525. */
  1526. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1527. /**
  1528. * wlan_cfg_is_rx_fisa_lru_del_enabled() - Get Rx FISA LRU del enabled flag
  1529. *
  1530. *
  1531. * @cfg: soc configuration context
  1532. *
  1533. * Return: true if enabled, false otherwise.
  1534. */
  1535. bool wlan_cfg_is_rx_fisa_lru_del_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1536. /**
  1537. * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
  1538. *
  1539. *
  1540. * @cfg: soc configuration context
  1541. *
  1542. * Return: true if enabled, false otherwise.
  1543. */
  1544. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1545. /**
  1546. * wlan_cfg_is_rx_refill_buffer_pool_enabled() - Get RX refill buffer pool enabled flag
  1547. *
  1548. *
  1549. * @cfg: soc configuration context
  1550. *
  1551. * Return: true if enabled, false otherwise.
  1552. */
  1553. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1554. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1555. bool val);
  1556. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
  1557. /**
  1558. * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
  1559. *
  1560. *
  1561. * @cfg: soc configuration context
  1562. *
  1563. * Return: reo ring bitmap.
  1564. */
  1565. uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
  1566. /**
  1567. * wlan_cfg_set_peer_ext_stats() - set peer extended stats
  1568. *
  1569. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1570. * @val: Flag value read from INI
  1571. *
  1572. * Return: void
  1573. */
  1574. void
  1575. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1576. bool val);
  1577. /**
  1578. * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
  1579. * stats are enabled
  1580. *
  1581. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1582. *
  1583. * Return: bool
  1584. */
  1585. bool
  1586. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1587. /**
  1588. * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
  1589. *
  1590. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1591. *
  1592. * Return: bool
  1593. */
  1594. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1595. /**
  1596. * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled
  1597. * @cfg: soc configuration context
  1598. *
  1599. * Return: true if enabled, false otherwise.
  1600. */
  1601. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1602. /**
  1603. * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
  1604. * @cfg: soc configuration context
  1605. *
  1606. * Return: true if enabled, false otherwise.
  1607. */
  1608. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1609. #ifdef IPA_OFFLOAD
  1610. /*
  1611. * wlan_cfg_ipa_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  1612. * @wlan_cfg_soc_ctx: dp cfg context
  1613. *
  1614. * Return: IPA Tx Ring Size
  1615. */
  1616. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1617. /*
  1618. * wlan_cfg_ipa_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  1619. * @wlan_cfg_soc_ctx: dp cfg context
  1620. *
  1621. * Return: IPA Tx Completion ring size
  1622. */
  1623. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1624. /*
  1625. * wlan_cfg_ipa_tx_alt_ring_size - Get Tx alt DMA ring size (TCL Data Ring)
  1626. * @wlan_cfg_soc_ctx: dp cfg context
  1627. *
  1628. * Return: IPA Tx alt Ring Size
  1629. */
  1630. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1631. /*
  1632. * wlan_cfg_ipa_tx_alt_comp_ring_size - Get Tx alt comp DMA ring size
  1633. * (TCL Data Ring)
  1634. * @wlan_cfg_soc_ctx: dp cfg context
  1635. *
  1636. * Return: IPA Tx alt comp Ring Size
  1637. */
  1638. int
  1639. wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1640. #else
  1641. static inline
  1642. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1643. {
  1644. return 0;
  1645. }
  1646. static inline
  1647. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1648. {
  1649. return 0;
  1650. }
  1651. #endif
  1652. /**
  1653. * wlan_cfg_radio0_default_reo_get - Get Radio0 default REO
  1654. * @cfg: soc configuration context
  1655. *
  1656. * Return: None
  1657. */
  1658. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1659. /**
  1660. * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO
  1661. * @cfg: soc configuration context
  1662. *
  1663. * Return: None
  1664. */
  1665. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1666. /**
  1667. * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO
  1668. * @cfg: soc configuration context
  1669. *
  1670. * Return: None
  1671. */
  1672. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1673. /**
  1674. * wlan_cfg_set_rxdma1_enable() - Enable rxdma1
  1675. * @cfg: soc configuration context
  1676. *
  1677. * Return: None
  1678. */
  1679. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1680. /**
  1681. * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish
  1682. * is enabled
  1683. * @cfg: soc configuration context
  1684. *
  1685. * Return: true if enabled, false otherwise.
  1686. */
  1687. bool
  1688. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg);
  1689. /**
  1690. * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish
  1691. * @cfg: soc configuration context
  1692. * @val: val to set
  1693. *
  1694. * Return: None
  1695. */
  1696. void
  1697. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val);
  1698. /**
  1699. * wlan_cfg_dp_soc_ctx_dump() - Dump few DP cfg soc parameters
  1700. * @cfg: soc configuration context
  1701. *
  1702. * Return:
  1703. */
  1704. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg);
  1705. #ifdef WLAN_SUPPORT_PPEDS
  1706. /*
  1707. * wlan_cfg_get_dp_soc_is_ppe_enabled() - API to get ppe enable flag
  1708. * @wlan_cfg_ctx - Configuration Handle
  1709. *
  1710. * Return: true if ppe is enabled else return false
  1711. */
  1712. bool
  1713. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1714. /*
  1715. * wlan_cfg_get_dp_soc_reo2ppe_ring_size() - get ppe rx ring size
  1716. * @wlan_cfg_ctx - Configuration Handle
  1717. *
  1718. * Return: size of reo2ppe ring
  1719. */
  1720. int
  1721. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1722. /*
  1723. * wlan_cfg_get_dp_soc_ppe2tcl_ring_size() - get ppe tx ring size
  1724. * @wlan_cfg_ctx - Configuration Handle
  1725. *
  1726. * Return: size of ppe2tcl ring
  1727. */
  1728. int
  1729. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1730. /*
  1731. * wlan_cfg_get_dp_soc_ppe_release_ring_size() - get ppe tx comp ring size
  1732. * @wlan_cfg_ctx - Configuration Handle
  1733. *
  1734. * Return: size of ppe release ring
  1735. */
  1736. int
  1737. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1738. #else
  1739. static inline bool
  1740. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1741. {
  1742. return false;
  1743. }
  1744. static inline int
  1745. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1746. {
  1747. return 0;
  1748. }
  1749. static inline int
  1750. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1751. {
  1752. return 0;
  1753. }
  1754. static inline int
  1755. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1756. {
  1757. return 0;
  1758. }
  1759. #endif
  1760. /**
  1761. * wlan_cfg_get_prealloc_cfg() - Get dp prealloc related cfg param
  1762. * @ctrl_psoc - PSOC object
  1763. * @cfg - cfg ctx where values will be populated
  1764. *
  1765. * Return: None
  1766. */
  1767. void
  1768. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1769. struct wlan_dp_prealloc_cfg *cfg);
  1770. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1771. /**
  1772. * wlan_cfg_get_pkt_capture_mode() - Get packet capture mode config
  1773. * @cfg: config context
  1774. *
  1775. * Return: value of packet capture mode
  1776. */
  1777. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg);
  1778. #else
  1779. static inline
  1780. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  1781. {
  1782. return 0;
  1783. }
  1784. #endif
  1785. /**
  1786. * wlan_cfg_get_dp_soc_rx_mon_buf_ring_size() - Rx MON buf ring size
  1787. * @cfg: Configuration Handle
  1788. *
  1789. * Return: Size of Rx MON buf ring size
  1790. */
  1791. uint32_t
  1792. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1793. /**
  1794. * wlan_cfg_get_dp_soc_tx_mon_buf_ring_size() - Tx MON buf ring size
  1795. * @cfg: Configuration Handle
  1796. *
  1797. * Return: Size of Tx MON buf ring size
  1798. */
  1799. uint32_t
  1800. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1801. /**
  1802. * wlan_cfg_get_dma_rx_mon_dest_ring_size() - Rx MON dest ring size
  1803. * @cfg: Configuration Handle
  1804. *
  1805. * Return: Size of Rx MON dest ring size
  1806. */
  1807. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1808. /**
  1809. * wlan_cfg_get_dma_tx_mon_dest_ring_size() - Tx MON dest ring size
  1810. * @cfg: Configuration Handle
  1811. *
  1812. * Return: Size of Tx MON dest ring size
  1813. */
  1814. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1815. /*
  1816. * wlan_cfg_get_rx_rel_ring_id() - get wbm2sw ring id for Rx release ring
  1817. * @wlan_cfg_ctx - Configuration Handle
  1818. *
  1819. * Return: wbm2sw ring id
  1820. */
  1821. uint8_t
  1822. wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  1823. /**
  1824. * wlan_cfg_set_rx_rel_ring_id() - set wbm2sw ring id for Rx release ring
  1825. * @cfg: soc configuration context
  1826. *
  1827. * Return: None
  1828. */
  1829. void
  1830. wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1831. uint8_t wbm2sw_ring_id);
  1832. /**
  1833. * wlan_cfg_set_vdev_stats_hw_offload_config() - Set hw vdev stats offload
  1834. * config
  1835. * @cfg: config context
  1836. * @value: value to be set
  1837. *
  1838. * Return: none
  1839. */
  1840. void
  1841. wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
  1842. bool value);
  1843. /**
  1844. * wlan_cfg_get_vdev_stats_hw_offload_config() - Get hw vdev stats offload
  1845. * config
  1846. * @cfg: config context
  1847. *
  1848. * Return: value of hw vdev stats config
  1849. */
  1850. bool
  1851. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg);
  1852. /**
  1853. * wlan_cfg_get_vdev_stats_hw_offload_timer()- Get hw vdev stats timer duration
  1854. * @cfg: config context
  1855. *
  1856. * Return: value of hw vdev stats timer duration
  1857. */
  1858. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg);
  1859. /**
  1860. * wlan_cfg_set_sawf_config() - Set SAWF config enable/disable
  1861. * @cfg: config context
  1862. * @value: value to be set
  1863. *
  1864. * Return: none
  1865. */
  1866. void
  1867. wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool value);
  1868. /**
  1869. * wlan_cfg_get_sawf_config() - Get SAWF config enable/disable
  1870. * @cfg: config context
  1871. *
  1872. * Return: true or false
  1873. */
  1874. bool
  1875. wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg);
  1876. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  1877. /**
  1878. * wlan_cfg_mlo_rx_ring_map_get_by_chip_id() - get rx ring map
  1879. * @cfg: soc configuration context
  1880. * @chip_id: mlo_chip_id
  1881. *
  1882. * Return: rx_ring_map
  1883. */
  1884. uint8_t
  1885. wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1886. uint8_t chip_id);
  1887. /**
  1888. * wlan_cfg_mlo_default_rx_ring_get_by_chip_id() - get default RX ring
  1889. * @cfg: soc configuration context
  1890. * @chip_id: mlo_chip_id
  1891. *
  1892. * Return: default rx ring
  1893. */
  1894. uint8_t
  1895. wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1896. uint8_t chip_id);
  1897. /**
  1898. * wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id() - get chip's lmac_peer_id_msb
  1899. * @cfg: soc configuration context
  1900. * @chip_id: mlo_chip_id
  1901. *
  1902. * Return: lmac_peer_id_msb
  1903. */
  1904. uint8_t
  1905. wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1906. uint8_t chip_id);
  1907. #endif
  1908. /*
  1909. * wlan_cfg_set_host2txmon_ring_mask() - Set host2txmon ring
  1910. * interrupt mask mapped to an interrupt context
  1911. * @wlan_cfg_ctx - Configuration Handle
  1912. *
  1913. * Return: None
  1914. */
  1915. void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1916. int context, int mask);
  1917. /**
  1918. * wlan_cfg_get_host2txmon_ring_mask() - Return host2txmon ring
  1919. * interrupt mask mapped to an interrupt context
  1920. * @wlan_cfg_ctx - Configuration Handle
  1921. * @context - Numerical ID identifying the Interrupt/NAPI context
  1922. *
  1923. * Return: int_host2txmon_ring_mask[context]
  1924. */
  1925. int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1926. int context);
  1927. /**
  1928. * wlan_cfg_set_txmon_hw_support () - Set txmon hw support
  1929. * @cfg: Configuration Handle
  1930. * @txmon_hw_support: value to set
  1931. *
  1932. * Return: None
  1933. */
  1934. void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg,
  1935. bool txmon_hw_support);
  1936. /**
  1937. * wlan_cfg_get_txmon_hw_support () - Get txmon hw support
  1938. * @cfg: Configuration Handle
  1939. *
  1940. * Return: txmon_hw_support
  1941. */
  1942. bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg);
  1943. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  1944. /*
  1945. * wlan_cfg_get_tx_capt_max_mem - Get max memory allowed for TX capture feature
  1946. * @wlan_cfg_soc_ctx
  1947. *
  1948. * Return: user given size in bytes
  1949. */
  1950. static inline int
  1951. wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg)
  1952. {
  1953. return cfg->tx_capt_max_mem_allowed;
  1954. }
  1955. #endif /* WLAN_TX_PKT_CAPTURE_ENH */
  1956. #endif /*__WLAN_CFG_H*/