wlan_cfg.h 81 KB

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