wlan_cfg.h 80 KB

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