wlan_cfg.h 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  1. /*
  2. * Copyright (c) 2013-2020 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. /*
  21. * Temporary place holders. These should come either from target config
  22. * or platform configuration
  23. */
  24. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  25. #define WLAN_CFG_DST_RING_CACHED_DESC 0
  26. #define MAX_PDEV_CNT 1
  27. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  28. #define WLAN_CFG_RXDMA1_ENABLE 1
  29. /*
  30. * This mask defines how many transmit frames account for 1 NAPI work unit
  31. * 0 means each tx completion is 1 unit
  32. */
  33. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  34. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  35. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
  36. #define NUM_RXDMA_RINGS_PER_PDEV 2
  37. /*Maximum Number of LMAC instances*/
  38. #define MAX_NUM_LMAC_HW 2
  39. #else
  40. #define WLAN_CFG_DST_RING_CACHED_DESC 1
  41. #define MAX_PDEV_CNT 3
  42. #define WLAN_CFG_INT_NUM_CONTEXTS 11
  43. #define NUM_RXDMA_RINGS_PER_PDEV 1
  44. #define MAX_NUM_LMAC_HW 3
  45. #endif
  46. #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
  47. /* Tx configuration */
  48. #define MAX_LINK_DESC_BANKS 8
  49. #define MAX_TXDESC_POOLS 4
  50. #define MAX_TCL_DATA_RINGS 4
  51. /* Rx configuration */
  52. #define MAX_RXDESC_POOLS 4
  53. #define MAX_REO_DEST_RINGS 4
  54. #define MAX_RX_MAC_RINGS 2
  55. /* DP process status */
  56. #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
  57. #define CONFIG_PROCESS_RX_STATUS 1
  58. #define CONFIG_PROCESS_TX_STATUS 1
  59. #else
  60. #define CONFIG_PROCESS_RX_STATUS 0
  61. #define CONFIG_PROCESS_TX_STATUS 0
  62. #endif
  63. /* Miscellaneous configuration */
  64. #define MAX_IDLE_SCATTER_BUFS 16
  65. #define DP_MAX_IRQ_PER_CONTEXT 12
  66. #define MAX_HTT_METADATA_LEN 32
  67. #define DP_MAX_TIDS 17
  68. #define DP_NON_QOS_TID 16
  69. #define DP_NULL_DATA_TID 17
  70. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  71. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  72. #define INVALID_PDEV_ID 0xFF
  73. struct wlan_cfg_dp_pdev_ctxt;
  74. /**
  75. * struct wlan_srng_cfg - Per ring configuration parameters
  76. * @timer_threshold: Config to control interrupts based on timer duration
  77. * @batch_count_threshold: Config to control interrupts based on
  78. * number of packets in the ring
  79. * @low_threshold: Config to control low threshold interrupts for SRC rings
  80. */
  81. struct wlan_srng_cfg {
  82. uint32_t timer_threshold;
  83. uint32_t batch_count_threshold;
  84. uint32_t low_threshold;
  85. };
  86. /**
  87. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  88. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  89. * @max_clients: Maximum number of peers/stations supported by device
  90. * @max_alloc_size: Maximum allocation size for any dynamic memory
  91. * allocation request for this device
  92. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  93. * 1: Each TCL ring is mapped to one radio/pdev
  94. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  95. * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
  96. * 1: Each REO ring is mapped to one radio/pdev
  97. * @num_tx_desc_pool: Number of Tx Descriptor pools
  98. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  99. * @num_tx_desc: Number of Tx Descriptors per pool
  100. * @min_tx_desc: Minimum number of Tx Descriptors per pool
  101. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  102. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  103. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  104. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  105. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  106. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  107. * NAPI/Intr context
  108. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  109. * NAPI/Intr context
  110. * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  111. * NAPI/Intr context
  112. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  113. * each NAPI/Intr context
  114. * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
  115. * @lro_enabled: enable/disable lro feature
  116. * @rx_hash: Enable hash based steering of rx packets
  117. * @tso_enabled: enable/disable tso feature
  118. * @lro_enabled: enable/disable LRO feature
  119. * @sg_enabled: enable disable scatter gather feature
  120. * @gro_enabled: enable disable GRO feature
  121. * @ipa_enabled: Flag indicating if IPA is enabled
  122. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  123. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  124. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  125. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  126. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  127. * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
  128. * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
  129. * @tcp_udp_checksumoffload: enable/disable checksum offload
  130. * @nss_cfg: nss configuration
  131. * @rx_defrag_min_timeout: rx defrag minimum timeout
  132. * @wbm_release_ring: wbm release ring size
  133. * @tcl_cmd_credit_ring: tcl command/credit ring size
  134. * @tcl_status_ring: tcl status ring size
  135. * @reo_reinject_ring: reo reinject ring
  136. * @rx_release_ring: rx release ring size
  137. * @reo_exception_ring: reo exception ring size
  138. * @reo_cmd_ring: reo cmd ring size
  139. * @reo_status_ring: reo status ting size
  140. * @rxdma_refill_ring: rxdma refill ring size
  141. * @rxdma_err_dst_ring: rxdma error detination ring size
  142. * @raw_mode_war: enable/disable raw mode war
  143. * @enable_data_stall_detection: flag to enable data stall detection
  144. * @disable_intra_bss_fwd: flag to disable intra bss forwarding
  145. * @rxdma1_enable: flag to indicate if rxdma1 is enabled
  146. * @tx_desc_limit_0: tx_desc limit for 5G H
  147. * @tx_desc_limit_1: tx_desc limit for 2G
  148. * @tx_desc_limit_2: tx_desc limit for 5G L
  149. * @tx_device_limit: tx device limit
  150. * @tx_sw_internode_queue: tx sw internode queue
  151. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  152. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  153. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  154. * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
  155. * dp_rx_process loop
  156. * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
  157. * at end of tx_comp_handler loop.
  158. * @rx_sw_desc_weight: rx sw descriptor weight configuration
  159. * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
  160. * flow tagging in monitor/mon-lite mode
  161. * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
  162. * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
  163. * table should be used
  164. * @rx_flow_search_table_size: indicates the number of flows in the flow search
  165. * table
  166. * @rx_flow_max_search: max skid length for each hash entry
  167. * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
  168. * 5 tuple flow entry
  169. * @pktlog_buffer_size: packet log buffer size
  170. * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
  171. * @pext_stats_enabled: Flag to enable and disabled peer extended stats
  172. * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
  173. * pool support
  174. * @rx_pending_high_threshold: threshold of starting pkt drop
  175. * @rx_pending_low_threshold: threshold of stopping pkt drop
  176. */
  177. struct wlan_cfg_dp_soc_ctxt {
  178. int num_int_ctxts;
  179. int max_clients;
  180. int max_alloc_size;
  181. int per_pdev_tx_ring;
  182. int num_tcl_data_rings;
  183. int per_pdev_rx_ring;
  184. int per_pdev_lmac_ring;
  185. int num_reo_dest_rings;
  186. int num_tx_desc_pool;
  187. int num_tx_ext_desc_pool;
  188. int num_tx_desc;
  189. int min_tx_desc;
  190. int num_tx_ext_desc;
  191. int max_peer_id;
  192. int htt_packet_type;
  193. int int_batch_threshold_tx;
  194. int int_timer_threshold_tx;
  195. int int_batch_threshold_rx;
  196. int int_timer_threshold_rx;
  197. int int_batch_threshold_other;
  198. int int_timer_threshold_other;
  199. int int_timer_threshold_mon;
  200. int tx_ring_size;
  201. int tx_comp_ring_size;
  202. int tx_comp_ring_size_nss;
  203. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  204. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  205. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  206. int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  207. int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  208. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  209. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  210. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  211. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  212. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  213. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  214. int hw_macid[MAX_PDEV_CNT];
  215. int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
  216. int base_hw_macid;
  217. bool rx_hash;
  218. bool tso_enabled;
  219. bool lro_enabled;
  220. bool sg_enabled;
  221. bool gro_enabled;
  222. bool ipa_enabled;
  223. bool ol_tx_csum_enabled;
  224. bool ol_rx_csum_enabled;
  225. bool rawmode_enabled;
  226. bool peer_flow_ctrl_enabled;
  227. bool napi_enabled;
  228. bool p2p_tcp_udp_checksumoffload;
  229. bool nan_tcp_udp_checksumoffload;
  230. bool tcp_udp_checksumoffload;
  231. bool defrag_timeout_check;
  232. int nss_cfg;
  233. uint32_t tx_flow_stop_queue_threshold;
  234. uint32_t tx_flow_start_queue_offset;
  235. int rx_defrag_min_timeout;
  236. int reo_dst_ring_size;
  237. int wbm_release_ring;
  238. int tcl_cmd_credit_ring;
  239. int tcl_status_ring;
  240. int reo_reinject_ring;
  241. int rx_release_ring;
  242. int reo_exception_ring;
  243. int reo_cmd_ring;
  244. int reo_status_ring;
  245. int rxdma_refill_ring;
  246. int rxdma_err_dst_ring;
  247. uint32_t per_pkt_trace;
  248. bool raw_mode_war;
  249. bool enable_data_stall_detection;
  250. bool disable_intra_bss_fwd;
  251. bool rxdma1_enable;
  252. int max_ast_idx;
  253. int tx_desc_limit_0;
  254. int tx_desc_limit_1;
  255. int tx_desc_limit_2;
  256. int tx_device_limit;
  257. int tx_sw_internode_queue;
  258. int mon_drop_thresh;
  259. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  260. uint32_t tx_comp_loop_pkt_limit;
  261. uint32_t rx_reap_loop_pkt_limit;
  262. uint32_t rx_hp_oos_update_limit;
  263. bool rx_enable_eol_data_check;
  264. bool tx_comp_enable_eol_data_check;
  265. #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
  266. int rx_sw_desc_weight;
  267. int rx_sw_desc_num;
  268. bool is_rx_mon_protocol_flow_tag_enabled;
  269. bool is_rx_flow_tag_enabled;
  270. bool is_rx_flow_search_table_per_pdev;
  271. uint16_t rx_flow_search_table_size;
  272. uint16_t rx_flow_max_search;
  273. uint8_t *rx_toeplitz_hash_key;
  274. uint8_t pktlog_buffer_size;
  275. uint8_t is_rx_fisa_enabled;
  276. bool is_tso_desc_attach_defer;
  277. uint32_t delayed_replenish_entries;
  278. uint32_t reo_rings_mapping;
  279. bool pext_stats_enabled;
  280. bool is_rx_buff_pool_enabled;
  281. uint32_t rx_pending_high_threshold;
  282. uint32_t rx_pending_low_threshold;
  283. };
  284. /**
  285. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  286. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  287. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  288. * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  289. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  290. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  291. */
  292. struct wlan_cfg_dp_pdev_ctxt {
  293. int rx_dma_buf_ring_size;
  294. int dma_mon_buf_ring_size;
  295. int dma_mon_dest_ring_size;
  296. int dma_mon_status_ring_size;
  297. int rxdma_monitor_desc_ring;
  298. int num_mac_rings;
  299. int nss_enabled;
  300. };
  301. /**
  302. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  303. * @ctrl_obj - PSOC object
  304. *
  305. * Allocates context for Soc configuration parameters,
  306. * Read configuration information from device tree/ini file and
  307. * returns back handle
  308. *
  309. * Return: Handle to configuration context
  310. */
  311. struct wlan_cfg_dp_soc_ctxt *
  312. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  313. /**
  314. * wlan_cfg_soc_detach() - Detach soc configuration handle
  315. * @wlan_cfg_ctx: soc configuration handle
  316. *
  317. * De-allocates memory allocated for SoC configuration
  318. *
  319. * Return:none
  320. */
  321. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  322. /**
  323. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  324. * @ctrl_obj - PSOC object
  325. *
  326. * Allocates context for pdev configuration parameters,
  327. * Read configuration information from device tree/ini file and
  328. * returns back handle
  329. *
  330. * Return: Handle to configuration context
  331. */
  332. struct wlan_cfg_dp_pdev_ctxt *
  333. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  334. /**
  335. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  336. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  337. *
  338. * Return: void
  339. */
  340. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  341. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  342. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  343. int context, int mask);
  344. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  345. int context, int mask);
  346. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  347. int context, int mask);
  348. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  349. int context, int mask);
  350. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  351. int mask);
  352. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  353. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  354. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  355. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
  356. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  357. int context, int mask);
  358. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  359. int context, int mask);
  360. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  361. int context, int mask);
  362. /**
  363. * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
  364. * for monitor buffer ring at initialization
  365. * @wlan_cfg_ctx - Configuration Handle
  366. * @replenish_entries - number of entries to replenish at initialization
  367. *
  368. */
  369. void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  370. *wlan_cfg_ctx,
  371. uint32_t replenish_entries);
  372. /**
  373. * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
  374. * for monitor buffer ring at initialization
  375. * @wlan_cfg_ctx - Configuration Handle
  376. * @replenish_entries - number of entries to replenish at initialization
  377. *
  378. * Return: delayed_replenish_entries;
  379. */
  380. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  381. *wlan_cfg_ctx);
  382. /**
  383. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  384. * @wlan_cfg_ctx - Configuration Handle
  385. *
  386. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  387. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  388. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  389. * that are processed by the handler.
  390. *
  391. * Return: num_contexts
  392. */
  393. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  394. /**
  395. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  396. * interrupt context
  397. * @wlan_cfg_ctx - Configuration Handle
  398. * @context - Numerical ID identifying the Interrupt/NAPI context
  399. *
  400. * Return: int_tx_ring_mask[context]
  401. */
  402. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  403. int context);
  404. /**
  405. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  406. * interrupt context
  407. * @wlan_cfg_ctx - Configuration Handle
  408. * @context - Numerical ID identifying the Interrupt/NAPI context
  409. *
  410. * Return: int_rx_ring_mask[context]
  411. */
  412. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  413. int context);
  414. /**
  415. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  416. * mapped to an interrupt context
  417. * @wlan_cfg_ctx - Configuration Handle
  418. * @context - Numerical ID identifying the Interrupt/NAPI context
  419. *
  420. * Return: int_rx_mon_ring_mask[context]
  421. */
  422. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  423. int context);
  424. /**
  425. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  426. * for the given interrupt context
  427. * @wlan_cfg_ctx - Configuration Handle
  428. * @context - Numerical ID identifying the Interrupt/NAPI context
  429. *
  430. */
  431. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  432. int context, int mask);
  433. /**
  434. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  435. * mapped to an interrupt context
  436. * @wlan_cfg_ctx - Configuration Handle
  437. * @context - Numerical ID identifying the Interrupt/NAPI context
  438. *
  439. * Return: int_rxdma2host_ring_mask[context]
  440. */
  441. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  442. int context);
  443. /**
  444. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  445. * for the given interrupt context
  446. * @wlan_cfg_ctx - Configuration Handle
  447. * @context - Numerical ID identifying the Interrupt/NAPI context
  448. *
  449. */
  450. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  451. int context, int mask);
  452. /**
  453. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  454. * mapped to an interrupt context
  455. * @wlan_cfg_ctx - Configuration Handle
  456. * @context - Numerical ID identifying the Interrupt/NAPI context
  457. *
  458. * Return: int_host2rxdma_ring_mask[context]
  459. */
  460. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  461. int context);
  462. /**
  463. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  464. * interrupt mask for the given interrupt context
  465. * @wlan_cfg_ctx - Configuration Handle
  466. * @context - Numerical ID identifying the Interrupt/NAPI context
  467. *
  468. */
  469. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  470. int context, int mask);
  471. /**
  472. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  473. * interrupt mask mapped to an interrupt context
  474. * @wlan_cfg_ctx - Configuration Handle
  475. * @context - Numerical ID identifying the Interrupt/NAPI context
  476. *
  477. * Return: int_host2rxdma_mon_ring_mask[context]
  478. */
  479. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  480. int context);
  481. /**
  482. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  483. * destination ring interrupt mask
  484. * for the given interrupt context
  485. * @wlan_cfg_ctx - Configuration Handle
  486. * @context - Numerical ID identifying the Interrupt/NAPI context
  487. *
  488. */
  489. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  490. int context, int mask);
  491. /**
  492. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  493. * destination 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_rxdma2host_mon_ring_mask[context]
  499. */
  500. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  501. int context);
  502. /**
  503. * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
  504. *
  505. * @wlan_cfg_ctx - Configuration Handle
  506. * @pdev_idx - Index of SW PDEV
  507. * @hw_macid - HW MAC Id
  508. *
  509. */
  510. void wlan_cfg_set_hw_mac_idx
  511. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  512. /**
  513. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  514. * PDEV index
  515. *
  516. * @wlan_cfg_ctx - Configuration Handle
  517. * @pdev_idx - Index of SW PDEV
  518. *
  519. * Return: HW MAC index
  520. */
  521. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  522. /**
  523. * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
  524. *
  525. * @wlan_cfg_ctx - Configuration Handle
  526. * @hw_macid - Index of hw mac
  527. *
  528. * Return: PDEV ID
  529. */
  530. int
  531. wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  532. /**
  533. * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
  534. * hw mac index
  535. *
  536. * @wlan_cfg_ctx - Configuration Handle
  537. * @pdev_idx - Index of SW PDEV
  538. * @hw_macid - Index of hw mac
  539. *
  540. * Return: PDEV index
  541. */
  542. void wlan_cfg_set_pdev_idx
  543. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  544. /**
  545. * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
  546. * hw mac index
  547. *
  548. * @wlan_cfg_ctx - Configuration Handle
  549. * @hw_macid - Index of hw mac
  550. *
  551. * Return: PDEV index
  552. */
  553. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  554. /**
  555. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  556. * mapped to an interrupt context
  557. * @wlan_cfg_ctx - Configuration Handle
  558. * @context - Numerical ID identifying the Interrupt/NAPI context
  559. *
  560. * Return: int_rx_err_ring_mask[context]
  561. */
  562. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  563. context);
  564. /**
  565. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  566. * mapped to an interrupt context
  567. * @wlan_cfg_ctx - Configuration Handle
  568. * @context - Numerical ID identifying the Interrupt/NAPI context
  569. *
  570. * Return: int_wbm_rel_ring_mask[context]
  571. */
  572. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  573. context);
  574. /**
  575. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  576. * mapped to an interrupt context
  577. * @wlan_cfg_ctx - Configuration Handle
  578. * @context - Numerical ID identifying the Interrupt/NAPI context
  579. *
  580. * Return: int_reo_status_ring_mask[context]
  581. */
  582. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  583. context);
  584. /**
  585. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  586. * mapped to an interrupt context
  587. * @wlan_cfg_ctx - Configuration Handle
  588. * @context - Numerical ID identifying the Interrupt/NAPI context
  589. *
  590. * Return: int_ce_ring_mask[context]
  591. */
  592. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  593. int context);
  594. /**
  595. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  596. * supported by device
  597. * @wlan_cfg_ctx - Configuration Handle
  598. *
  599. * Return: max_clients
  600. */
  601. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  602. /**
  603. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  604. * memory allocation request for this device
  605. * @wlan_cfg_ctx - Configuration Handle
  606. *
  607. * Return: max_alloc_size
  608. */
  609. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  610. /*
  611. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  612. * one per radio
  613. * @wlan_cfg_ctx - Configuration Handle
  614. *
  615. * Return: per_pdev_tx_ring
  616. */
  617. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  618. /*
  619. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  620. * @wlan_cfg_ctx
  621. *
  622. * Return: num_tcl_data_rings
  623. */
  624. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  625. /*
  626. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  627. * one per radio
  628. * @wlan_cfg_ctx
  629. *
  630. * Return: per_pdev_rx_ring
  631. */
  632. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  633. /*
  634. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  635. * one per radio
  636. * @wlan_cfg_ctx
  637. *
  638. * Return: return 1 if per pdev error ring else 0
  639. */
  640. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  641. /*
  642. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  643. * @wlan_cfg_ctx - Configuration Handle
  644. *
  645. * Return: num_reo_dest_rings
  646. */
  647. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  648. /*
  649. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  650. * @wlan_cfg_ctx - Configuration Handle
  651. *
  652. * Return: htt_pkt_type_ethernet
  653. */
  654. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  655. /*
  656. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  657. * device
  658. * @wlan_cfg_ctx - Configuration Handle
  659. *
  660. * Return: num_tx_desc_pool
  661. */
  662. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  663. /*
  664. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  665. * device
  666. * @wlan_cfg_ctx - Configuration Handle
  667. * @num_pool - Number of pool
  668. */
  669. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  670. /*
  671. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  672. * pools
  673. * @wlan_cfg_ctx - Configuration Handle
  674. *
  675. * Return: num_tx_ext_desc_pool
  676. */
  677. int wlan_cfg_get_num_tx_ext_desc_pool(
  678. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  679. /*
  680. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  681. *
  682. * @wlan_cfg_ctx - Configuration Handle
  683. *
  684. * Return: reo_dst_ring_size
  685. */
  686. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  687. /*
  688. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  689. *
  690. * @wlan_cfg_ctx - Configuration Handle
  691. * @reo_dst_ring_size - REO Destination ring size
  692. */
  693. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  694. int reo_dst_ring_size);
  695. /*
  696. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  697. *
  698. * @wlan_cfg_ctx - Configuration Handle
  699. * @raw_mode_war - raw mode war configuration
  700. */
  701. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  702. bool raw_mode_war);
  703. /*
  704. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  705. *
  706. * @wlan_cfg_ctx - Configuration Handle
  707. *
  708. * Return: reo_dst_ring_size
  709. */
  710. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  711. /*
  712. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  713. * pools
  714. * @wlan_cfg_ctx - Configuration Handle
  715. * @num_pool - Number of pool
  716. */
  717. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  718. /*
  719. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  720. * @wlan_cfg_ctx - Configuration Handle
  721. *
  722. * Return: num_tx_desc
  723. */
  724. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  725. /*
  726. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  727. * @wlan_cfg_ctx - Configuration Handle
  728. *
  729. * Return: num_tx_desc
  730. */
  731. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  732. /*
  733. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  734. *
  735. * @wlan_cfg_ctx - Configuration Handle
  736. * @num_desc: Number of descriptor
  737. */
  738. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  739. /*
  740. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  741. * per pool
  742. * @wlan_cfg_ctx - Configuration Handle
  743. *
  744. * Return: num_tx_ext_desc
  745. */
  746. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  747. /*
  748. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  749. * per pool
  750. * @wlan_cfg_ctx - Configuration Handle
  751. * @num_desc: Number of descriptor
  752. */
  753. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  754. /*
  755. * wlan_cfg_max_peer_id() - Get maximum peer ID
  756. * @cfg: Configuration Handle
  757. *
  758. * Return: maximum peer ID
  759. */
  760. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  761. /*
  762. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  763. * @wlan_cfg_pdev_ctx
  764. *
  765. * Return: dma_mon_buf_ring_size
  766. */
  767. int wlan_cfg_get_dma_mon_buf_ring_size(
  768. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  769. /*
  770. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  771. * Destination ring
  772. * @wlan_cfg_pdev_ctx
  773. *
  774. * Return: dma_mon_dest_size
  775. */
  776. int wlan_cfg_get_dma_mon_dest_ring_size(
  777. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  778. /*
  779. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  780. * @wlan_cfg_pdev_ctx
  781. *
  782. * Return: dma_mon_stat_ring_size
  783. */
  784. int wlan_cfg_get_dma_mon_stat_ring_size(
  785. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  786. /*
  787. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  788. * @wlan_cfg_soc_ctx
  789. *
  790. * Return: rxdma monitor desc ring size
  791. */
  792. int
  793. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  794. /*
  795. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  796. * @wlan_cfg_pdev_ctx
  797. *
  798. * Return: rx_dma_buf_ring_size
  799. */
  800. int wlan_cfg_get_rx_dma_buf_ring_size(
  801. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  802. /*
  803. * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
  804. * @wlan_cfg_pdev_ctx
  805. *
  806. * Return: rx_pending_high_threshold
  807. */
  808. uint32_t
  809. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  810. /*
  811. * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
  812. * @wlan_cfg_pdev_ctx
  813. *
  814. * Return: rx_pending_low_threshold
  815. */
  816. uint32_t
  817. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  818. /*
  819. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  820. * per pdev
  821. * @wlan_cfg_pdev_ctx
  822. *
  823. * Return: number of mac DMA rings per pdev
  824. */
  825. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  826. /*
  827. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  828. * @wlan_cfg_dp_soc_ctxt
  829. *
  830. * Return: true - LRO enabled false - LRO disabled
  831. */
  832. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  833. /*
  834. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  835. * @wlan_cfg_dp_soc_ctxt
  836. *
  837. * Return: true - GRO enabled false - GRO disabled
  838. */
  839. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  840. /*
  841. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  842. * @wlan_cfg_dp_soc_ctxt
  843. *
  844. * Return: true - enabled false - disabled
  845. */
  846. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  847. /*
  848. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  849. * @wlan_cfg_dp_soc_ctxt
  850. *
  851. * Return: true - enabled false - disabled
  852. */
  853. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  854. /*
  855. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  856. * @wlan_cfg_soc_ctx
  857. * @rx_hash
  858. */
  859. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  860. /*
  861. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  862. * @wlan_cfg_pdev_ctx
  863. *
  864. * Return: 1 - enabled 0 - disabled
  865. */
  866. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  867. /*
  868. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  869. * @wlan_cfg_pdev_ctx
  870. */
  871. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  872. /*
  873. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  874. * @wlan_cfg_pdev_ctx
  875. *
  876. * Return: nss_cfg
  877. */
  878. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  879. /*
  880. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  881. * @wlan_cfg_pdev_ctx
  882. *
  883. */
  884. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  885. /*
  886. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  887. * @wlan_cfg_soc_ctx
  888. *
  889. * Return: Batch threshold
  890. */
  891. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  892. /*
  893. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  894. * @wlan_cfg_soc_ctx
  895. *
  896. * Return: Timer threshold
  897. */
  898. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  899. /*
  900. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  901. * @wlan_cfg_soc_ctx
  902. *
  903. * Return: Batch threshold
  904. */
  905. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  906. /*
  907. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  908. * @wlan_cfg_soc_ctx
  909. *
  910. * Return: Timer threshold
  911. */
  912. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  913. /*
  914. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  915. * @wlan_cfg_soc_ctx
  916. *
  917. * Return: Batch threshold
  918. */
  919. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  920. /*
  921. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  922. * @wlan_cfg_soc_ctx
  923. *
  924. * Return: Timer threshold
  925. */
  926. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  927. /*
  928. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  929. * @wlan_cfg_soc_ctx
  930. *
  931. * Return: Timer threshold
  932. */
  933. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  934. /*
  935. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  936. * @wlan_cfg_soc_ctx
  937. *
  938. * Return: Checksum offload enable or disable
  939. */
  940. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  941. /*
  942. * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
  943. * @wlan_cfg_soc_ctx
  944. *
  945. * Return: Checksum offload enable or disable value for NAN mode
  946. */
  947. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  948. /*
  949. * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
  950. * @wlan_cfg_soc_ctx
  951. *
  952. * Return: Checksum offload enable or disable value for P2P mode
  953. */
  954. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  955. /*
  956. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  957. * @wlan_cfg_soc_ctx
  958. *
  959. * Return: Tx Ring Size
  960. */
  961. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  962. /*
  963. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  964. * @wlan_cfg_soc_ctx
  965. *
  966. * Return: Tx Completion ring size
  967. */
  968. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  969. /*
  970. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  971. * @wlan_cfg_soc_ctx
  972. *
  973. * Return: wbm_release_ring size
  974. */
  975. int
  976. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  977. /*
  978. * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
  979. * @wlan_cfg_soc_ctx
  980. *
  981. * Return: tcl_cmd_credit_ring size
  982. */
  983. int
  984. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  985. /*
  986. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  987. * @wlan_cfg_soc_ctx
  988. *
  989. * Return: tcl_status_ring size
  990. */
  991. int
  992. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  993. /*
  994. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  995. * @wlan_cfg_soc_ctx
  996. *
  997. * Return: reo_reinject_ring size
  998. */
  999. int
  1000. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1001. /*
  1002. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  1003. * @wlan_cfg_soc_ctx
  1004. *
  1005. * Return: rx_release_ring size
  1006. */
  1007. int
  1008. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1009. /*
  1010. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  1011. * @wlan_cfg_soc_ctx
  1012. *
  1013. * Return: reo_exception_ring size
  1014. */
  1015. int
  1016. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1017. /*
  1018. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  1019. * @wlan_cfg_soc_ctx
  1020. *
  1021. * Return: reo_cmd_ring size
  1022. */
  1023. int
  1024. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1025. /*
  1026. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  1027. * @wlan_cfg_soc_ctx
  1028. *
  1029. * Return: reo_status_ring size
  1030. */
  1031. int
  1032. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1033. /*
  1034. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  1035. * @wlan_cfg_soc_ctx
  1036. *
  1037. * Return: tx desc limit for 5G H
  1038. */
  1039. int
  1040. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  1041. /*
  1042. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  1043. * @wlan_cfg_soc_ctx
  1044. *
  1045. * Return: tx desc limit for 2G
  1046. */
  1047. int
  1048. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  1049. /*
  1050. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  1051. * @wlan_cfg_soc_ctx
  1052. *
  1053. * Return: tx desc limit for 5G L
  1054. */
  1055. int
  1056. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  1057. /*
  1058. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  1059. * @wlan_cfg_soc_ctx
  1060. *
  1061. * Return: tx device limit
  1062. */
  1063. int
  1064. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1065. /*
  1066. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  1067. * @wlan_cfg_soc_ctx
  1068. *
  1069. * Return: tx sw internode queue
  1070. */
  1071. int
  1072. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  1073. /*
  1074. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  1075. * @wlan_cfg_soc_ctx
  1076. *
  1077. * Return: rxdma refill ring size
  1078. */
  1079. int
  1080. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1081. /*
  1082. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  1083. * @wlan_cfg_soc_ctx
  1084. *
  1085. * Return: rxdma error dst ring size
  1086. */
  1087. int
  1088. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1089. /*
  1090. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  1091. * @wlan_cfg_soc_ctx
  1092. *
  1093. * Return: rx_sw_desc_weight
  1094. */
  1095. int
  1096. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  1097. /*
  1098. * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
  1099. * @wlan_cfg_soc_ctx
  1100. *
  1101. * Return: rx_sw_desc_num
  1102. */
  1103. int
  1104. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
  1105. /*
  1106. * wlan_cfg_get_dp_caps - Get dp capablities
  1107. * @wlan_cfg_soc_ctx
  1108. * @dp_caps: enum for dp capablities
  1109. *
  1110. * Return: bool if a dp capabilities is enabled
  1111. */
  1112. bool
  1113. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1114. enum cdp_capabilities dp_caps);
  1115. /**
  1116. * wlan_set_srng_cfg() - Fill per ring specific
  1117. * configuration parameters
  1118. * @wlan_cfg: global srng configuration table
  1119. *
  1120. * Return: None
  1121. */
  1122. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1123. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1124. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1125. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1126. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1127. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1128. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1129. /**
  1130. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1131. * in number of entries
  1132. *
  1133. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1134. *
  1135. * Return: rx_fst_size
  1136. */
  1137. uint16_t
  1138. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1139. /**
  1140. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1141. *
  1142. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1143. *
  1144. * Return: max_search
  1145. */
  1146. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1147. /**
  1148. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1149. * search
  1150. *
  1151. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1152. *
  1153. * Return: 320-bit Hash Key
  1154. */
  1155. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1156. /**
  1157. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1158. * DP soc context
  1159. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1160. * @val: Rx flow tag feature flag value
  1161. *
  1162. * Return: None
  1163. */
  1164. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1165. bool val);
  1166. /**
  1167. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1168. * DP soc context
  1169. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1170. *
  1171. * Return: true if feature is enabled, else false
  1172. */
  1173. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1174. /**
  1175. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1176. * Rx FST is per pdev
  1177. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1178. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1179. *
  1180. * Return: None
  1181. */
  1182. void
  1183. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1184. bool val);
  1185. /**
  1186. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1187. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1188. *
  1189. * Return: true if Rx FST is per pdev, else false
  1190. */
  1191. bool
  1192. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1193. /**
  1194. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1195. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1196. * @val: Rx FST size in number of entries
  1197. *
  1198. * Return: None
  1199. */
  1200. void
  1201. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1202. uint16_t val);
  1203. /**
  1204. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1205. * in DP soc context
  1206. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1207. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1208. *
  1209. * Return: None
  1210. */
  1211. void
  1212. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1213. bool val);
  1214. /**
  1215. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1216. * from DP soc context
  1217. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1218. *
  1219. * Return: true if feature is enabled in monitor mode for protocol or flow
  1220. * tagging in INI, false otherwise
  1221. */
  1222. bool
  1223. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1224. /**
  1225. * wlan_cfg_fill_interrupt_mask() - set interrupt mask
  1226. *
  1227. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1228. * @interrupt_mode: interrupt_mode: MSI/LEGACY
  1229. * @is_monitor_mode: is monitor mode enabled
  1230. *
  1231. * Return: void
  1232. */
  1233. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1234. int interrupt_mode, bool is_monitor_mode);
  1235. /**
  1236. * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
  1237. *
  1238. *
  1239. * @cfg: soc configuration context
  1240. *
  1241. * Return: true if enabled, false otherwise.
  1242. */
  1243. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1244. /**
  1245. * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
  1246. *
  1247. *
  1248. * @cfg: soc configuration context
  1249. *
  1250. * Return: true if enabled, false otherwise.
  1251. */
  1252. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1253. #endif
  1254. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1255. bool val);
  1256. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
  1257. /**
  1258. * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
  1259. *
  1260. *
  1261. * @cfg: soc configuration context
  1262. *
  1263. * Return: reo ring bitmap.
  1264. */
  1265. uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
  1266. /**
  1267. * wlan_cfg_set_peer_ext_stats() - set peer extended stats
  1268. *
  1269. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1270. * @val: Flag value read from INI
  1271. *
  1272. * Return: void
  1273. */
  1274. void
  1275. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1276. bool val);
  1277. /**
  1278. * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
  1279. * stats are enabled
  1280. *
  1281. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1282. *
  1283. * Return: bool
  1284. */
  1285. bool
  1286. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);