wlan_cfg.h 53 KB

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