wlan_cfg.h 66 KB

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