wlan_cfg.h 64 KB

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