wlan_cfg.h 58 KB

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