wlan_cfg.h 69 KB

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