wlan_cfg.h 66 KB

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