wlan_cfg.h 82 KB

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