wlan_cfg.h 71 KB

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