wlan_cfg.h 66 KB

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