wlan_cfg.h 82 KB

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