wlan_cfg.h 76 KB

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