wlan_cfg.h 56 KB

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