wlan_cfg.h 58 KB

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