wlan_cfg.h 40 KB

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