wlan_cfg.h 72 KB

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