wlan_cfg.h 51 KB

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