wlan_cfg.h 81 KB

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