blob: 250b872683e699e821880e754deb518e38a75083 [file] [log] [blame]
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +05301/*
Krunal Soni03ba0f52019-02-12 11:44:46 -08002 * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
Aniruddha Paul9d7dc272018-02-11 19:40:41 +05303 *
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +05304 * 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
19#ifndef __WLAN_CFG_H
20#define __WLAN_CFG_H
21
Ravi Joshi891d5202017-02-17 15:01:27 -080022/*
23 * Temporary place holders. These should come either from target config
24 * or platform configuration
25 */
Vevek Venkatesan4a6c3e82019-06-24 14:29:19 +053026#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
Chaithanya Garrepalliab234e52019-05-28 12:10:49 +053027#define WLAN_CFG_DST_RING_CACHED_DESC 0
Ravi Joshi891d5202017-02-17 15:01:27 -080028#define MAX_PDEV_CNT 1
Houston Hoffman648a9182017-05-21 23:27:50 -070029#define WLAN_CFG_INT_NUM_CONTEXTS 7
Venkata Sharath Chandra Manchala87479582018-08-01 12:45:34 -070030#define WLAN_CFG_RXDMA1_ENABLE 1
Pamidipati, Vijay9e340252017-08-14 16:24:17 +053031/*
32 * This mask defines how many transmit frames account for 1 NAPI work unit
33 * 0 means each tx completion is 1 unit
34 */
35#define DP_TX_NAPI_BUDGET_DIV_MASK 0
Venkata Sharath Chandra Manchala0ad4fda2018-03-01 13:45:46 -080036
37/* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
Venkata Sharath Chandra Manchala908de492019-07-18 10:45:54 -070038#define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
Venkata Sharath Chandra Manchala0ad4fda2018-03-01 13:45:46 -080039
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -080040#define NUM_RXDMA_RINGS_PER_PDEV 2
Ravi Joshi891d5202017-02-17 15:01:27 -080041#else
Chaithanya Garrepalliab234e52019-05-28 12:10:49 +053042#define WLAN_CFG_DST_RING_CACHED_DESC 1
Ravi Joshi891d5202017-02-17 15:01:27 -080043#define MAX_PDEV_CNT 3
Pamidipati, Vijaya59b5602018-11-08 10:09:03 +053044#define WLAN_CFG_INT_NUM_CONTEXTS 11
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -080045#define NUM_RXDMA_RINGS_PER_PDEV 1
Ravi Joshi891d5202017-02-17 15:01:27 -080046#endif
47
Akshay Kosigi283e2352019-06-19 14:33:47 +053048#define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
49
Ravi Joshi891d5202017-02-17 15:01:27 -080050/* Tx configuration */
51#define MAX_LINK_DESC_BANKS 8
52#define MAX_TXDESC_POOLS 4
53#define MAX_TCL_DATA_RINGS 4
Ravi Joshi891d5202017-02-17 15:01:27 -080054
55/* Rx configuration */
56#define MAX_RXDESC_POOLS 4
57#define MAX_REO_DEST_RINGS 4
Ravi Joshi891d5202017-02-17 15:01:27 -080058#define MAX_RX_MAC_RINGS 2
59
chenguo9bece1a2017-12-19 18:49:41 +080060/* DP process status */
Vevek Venkatesan4a6c3e82019-06-24 14:29:19 +053061#if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
chenguo9bece1a2017-12-19 18:49:41 +080062#define CONFIG_PROCESS_RX_STATUS 1
63#define CONFIG_PROCESS_TX_STATUS 1
64#else
65#define CONFIG_PROCESS_RX_STATUS 0
66#define CONFIG_PROCESS_TX_STATUS 0
67#endif
68
Ravi Joshi891d5202017-02-17 15:01:27 -080069/* Miscellaneous configuration */
70#define MAX_IDLE_SCATTER_BUFS 16
71#define DP_MAX_IRQ_PER_CONTEXT 12
Ravi Joshi891d5202017-02-17 15:01:27 -080072#define MAX_HTT_METADATA_LEN 32
73#define MAX_NUM_PEER_ID_PER_PEER 8
74#define DP_MAX_TIDS 17
75#define DP_NON_QOS_TID 16
76
Sumeet Rao76aa8d52019-06-20 12:23:14 -070077#define WLAN_CFG_RX_FST_MAX_SEARCH 2
78#define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
79
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +053080struct wlan_cfg_dp_pdev_ctxt;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -070081
Houston Hoffman648a9182017-05-21 23:27:50 -070082/**
Venkata Sharath Chandra Manchalacb6d0c02019-05-16 17:33:18 -070083 * struct wlan_srng_cfg - Per ring configuration parameters
84 * @timer_threshold: Config to control interrupts based on timer duration
85 * @batch_count_threshold: Config to control interrupts based on
86 * number of packets in the ring
87 * @low_threshold: Config to control low threshold interrupts for SRC rings
88 */
89struct wlan_srng_cfg {
90 uint32_t timer_threshold;
91 uint32_t batch_count_threshold;
92 uint32_t low_threshold;
93};
94
95/**
Houston Hoffman648a9182017-05-21 23:27:50 -070096 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
Mohit Khanna81179cb2018-08-16 20:50:43 -070097 * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
98 * @max_clients: Maximum number of peers/stations supported by device
99 * @max_alloc_size: Maximum allocation size for any dynamic memory
Houston Hoffman648a9182017-05-21 23:27:50 -0700100 * allocation request for this device
Mohit Khanna81179cb2018-08-16 20:50:43 -0700101 * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
102 * 1: Each TCL ring is mapped to one radio/pdev
103 * @num_tcl_data_rings: Number of TCL Data rings supported by device
104 * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
105 * 1: Each REO ring is mapped to one radio/pdev
106 * @num_tx_desc_pool: Number of Tx Descriptor pools
107 * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
108 * @num_tx_desc: Number of Tx Descriptors per pool
Shashikala Prabhu550e69c2019-03-13 17:41:17 +0530109 * @min_tx_desc: Minimum number of Tx Descriptors per pool
Mohit Khanna81179cb2018-08-16 20:50:43 -0700110 * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
111 * @max_peer_id: Maximum value of peer id that FW can assign for a client
112 * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
113 * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
114 * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
115 * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
Houston Hoffman648a9182017-05-21 23:27:50 -0700116 * NAPI/Intr context
Mohit Khanna81179cb2018-08-16 20:50:43 -0700117 * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
Houston Hoffman648a9182017-05-21 23:27:50 -0700118 * NAPI/Intr context
Mohit Khanna81179cb2018-08-16 20:50:43 -0700119 * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
Houston Hoffman648a9182017-05-21 23:27:50 -0700120 * NAPI/Intr context
Mohit Khanna81179cb2018-08-16 20:50:43 -0700121 * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
122 * each NAPI/Intr context
123 * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
124 * @lro_enabled: enable/disable lro feature
125 * @rx_hash: Enable hash based steering of rx packets
126 * @tso_enabled: enable/disable tso feature
127 * @lro_enabled: enable/disable LRO feature
128 * @sg_enabled: enable disable scatter gather feature
129 * @gro_enabled: enable disable GRO feature
130 * @ipa_enabled: Flag indicating if IPA is enabled
131 * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
132 * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
133 * @rawmode_enabled: Flag indicating if RAW mode is enabled
134 * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
135 * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
136 * @tcp_udp_checksumoffload: enable/disable checksum offload
137 * @nss_cfg: nss configuration
138 * @rx_defrag_min_timeout: rx defrag minimum timeout
139 * @wbm_release_ring: wbm release ring size
140 * @tcl_cmd_ring: tcl cmd ring size
141 * @tcl_status_ring: tcl status ring size
142 * @reo_reinject_ring: reo reinject ring
143 * @rx_release_ring: rx release ring size
144 * @reo_exception_ring: reo exception ring size
145 * @reo_cmd_ring: reo cmd ring size
146 * @reo_status_ring: reo status ting size
147 * @rxdma_refill_ring: rxdma refill ring size
148 * @rxdma_err_dst_ring: rxdma error detination ring size
149 * @raw_mode_war: enable/disable raw mode war
Mohit Khannae5a6e942018-11-28 14:22:48 -0800150 * @enable_data_stall_detection: flag to enable data stall detection
151 * @disable_intra_bss_fwd: flag to disable intra bss forwarding
152 * @rxdma1_enable: flag to indicate if rxdma1 is enabled
Prathyusha Guduri36ce8172019-07-19 19:43:39 +0530153 * @tx_desc_limit_0: tx_desc limit for 5G H
154 * @tx_desc_limit_1: tx_desc limit for 2G
155 * @tx_desc_limit_2: tx_desc limit for 5G L
Prathyusha Guduriaed67e12019-07-21 23:55:52 +0530156 * @tx_device_limit: tx device limit
Prathyusha Guduriabac9ee2019-07-24 23:49:45 +0530157 * @tx_sw_internode_queue: tx sw internode queue
Mohit Khannae5a6e942018-11-28 14:22:48 -0800158 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
159 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
160 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
161 * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
162 * dp_rx_process loop
Sumeet Rao76aa8d52019-06-20 12:23:14 -0700163 * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
Mohit Khannae5a6e942018-11-28 14:22:48 -0800164 * at end of tx_comp_handler loop.
Mainak Sen95502732019-07-25 00:48:59 +0530165 * @rx_sw_desc_weight: rx sw descriptor weight configuration
Sumeet Rao76aa8d52019-06-20 12:23:14 -0700166 * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
167 * flow tagging in monitor/mon-lite mode
168 * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
169 * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
170 * table should be used
171 * @rx_flow_search_table_size: indicates the number of flows in the flow search
172 * table
173 * @rx_flow_max_search: max skid length for each hash entry
174 * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
175 * 5 tuple flow entry
Houston Hoffman648a9182017-05-21 23:27:50 -0700176 */
177struct 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;
Manjunathappa Prakashe23acaf2017-11-10 00:17:24 -0800184 int per_pdev_lmac_ring;
Houston Hoffman648a9182017-05-21 23:27:50 -0700185 int num_reo_dest_rings;
186 int num_tx_desc_pool;
187 int num_tx_ext_desc_pool;
188 int num_tx_desc;
Shashikala Prabhu550e69c2019-03-13 17:41:17 +0530189 int min_tx_desc;
Houston Hoffman648a9182017-05-21 23:27:50 -0700190 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;
Keyur Parekh11865212018-10-12 18:03:12 -0700199 int int_timer_threshold_mon;
Houston Hoffman648a9182017-05-21 23:27:50 -0700200 int tx_ring_size;
201 int tx_comp_ring_size;
Vivek126db5d2018-07-25 22:05:04 +0530202 int tx_comp_ring_size_nss;
Houston Hoffman648a9182017-05-21 23:27:50 -0700203 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];
Keyur Parekh11865212018-10-12 18:03:12 -0700206 int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
207 int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
Houston Hoffman648a9182017-05-21 23:27:50 -0700208 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];
Karunakar Dasineni87f0c5d2017-10-29 21:54:21 -0700213 int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
Houston Hoffman648a9182017-05-21 23:27:50 -0700214 int hw_macid[MAX_PDEV_CNT];
215 int base_hw_macid;
Houston Hoffman648a9182017-05-21 23:27:50 -0700216 bool rx_hash;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700217 bool tso_enabled;
Akshay Kosigia4f6e172018-09-03 21:42:27 +0530218 bool lro_enabled;
219 bool sg_enabled;
220 bool gro_enabled;
Mohit Khanna81179cb2018-08-16 20:50:43 -0700221 bool ipa_enabled;
Akshay Kosigia4f6e172018-09-03 21:42:27 +0530222 bool ol_tx_csum_enabled;
223 bool ol_rx_csum_enabled;
224 bool rawmode_enabled;
225 bool peer_flow_ctrl_enabled;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700226 bool napi_enabled;
227 bool tcp_udp_checksumoffload;
psimhafc2f91b2018-01-10 15:30:03 -0800228 bool defrag_timeout_check;
Houston Hoffman648a9182017-05-21 23:27:50 -0700229 int nss_cfg;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700230 uint32_t tx_flow_stop_queue_threshold;
231 uint32_t tx_flow_start_queue_offset;
Vivek126db5d2018-07-25 22:05:04 +0530232 int rx_defrag_min_timeout;
Balamurugan Mahalingam54d16a92018-06-25 17:08:08 +0530233 int reo_dst_ring_size;
Vivek126db5d2018-07-25 22:05:04 +0530234 int wbm_release_ring;
235 int tcl_cmd_ring;
236 int tcl_status_ring;
237 int reo_reinject_ring;
238 int rx_release_ring;
239 int reo_exception_ring;
240 int reo_cmd_ring;
241 int reo_status_ring;
Vivek126db5d2018-07-25 22:05:04 +0530242 int rxdma_refill_ring;
243 int rxdma_err_dst_ring;
Krunal Soni03ba0f52019-02-12 11:44:46 -0800244 uint32_t per_pkt_trace;
Venkateswara Swamy Bandaru6ca41122018-08-03 16:07:06 +0530245 bool raw_mode_war;
jitiphil60ac9aa2018-10-05 19:54:04 +0530246 bool enable_data_stall_detection;
247 bool disable_intra_bss_fwd;
Venkata Sharath Chandra Manchala87479582018-08-01 12:45:34 -0700248 bool rxdma1_enable;
Tallapragada Kalyana7023622018-12-03 19:29:52 +0530249 int max_ast_idx;
Prathyusha Guduri36ce8172019-07-19 19:43:39 +0530250 int tx_desc_limit_0;
251 int tx_desc_limit_1;
252 int tx_desc_limit_2;
Prathyusha Guduriaed67e12019-07-21 23:55:52 +0530253 int tx_device_limit;
Prathyusha Guduriabac9ee2019-07-24 23:49:45 +0530254 int tx_sw_internode_queue;
Ruben Columbusb7a1c572019-08-12 11:11:29 -0700255 int mon_drop_thresh;
Mohit Khannae5a6e942018-11-28 14:22:48 -0800256#ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
257 uint32_t tx_comp_loop_pkt_limit;
258 uint32_t rx_reap_loop_pkt_limit;
259 uint32_t rx_hp_oos_update_limit;
260 bool rx_enable_eol_data_check;
261 bool tx_comp_enable_eol_data_check;
262#endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
Mainak Sen95502732019-07-25 00:48:59 +0530263 int rx_sw_desc_weight;
Sumeet Rao76aa8d52019-06-20 12:23:14 -0700264 bool is_rx_mon_protocol_flow_tag_enabled;
265 bool is_rx_flow_tag_enabled;
266 bool is_rx_flow_search_table_per_pdev;
267 uint16_t rx_flow_search_table_size;
268 uint16_t rx_flow_max_search;
269 uint8_t *rx_toeplitz_hash_key;
Houston Hoffman648a9182017-05-21 23:27:50 -0700270};
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530271
272/**
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -0700273 * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
274 * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
275 * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
276 * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
277 * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
278 * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
279 */
280struct wlan_cfg_dp_pdev_ctxt {
281 int rx_dma_buf_ring_size;
282 int dma_mon_buf_ring_size;
283 int dma_mon_dest_ring_size;
284 int dma_mon_status_ring_size;
285 int rxdma_monitor_desc_ring;
286 int num_mac_rings;
287 int nss_enabled;
288};
289
290/**
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530291 * wlan_cfg_soc_attach() - Attach configuration interface for SoC
Vivek126db5d2018-07-25 22:05:04 +0530292 * @ctrl_obj - PSOC object
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530293 *
294 * Allocates context for Soc configuration parameters,
295 * Read configuration information from device tree/ini file and
296 * returns back handle
297 *
298 * Return: Handle to configuration context
299 */
Akshay Kosigieec6db92019-07-02 14:25:54 +0530300struct wlan_cfg_dp_soc_ctxt *
301wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530302
303/**
304 * wlan_cfg_soc_detach() - Detach soc configuration handle
305 * @wlan_cfg_ctx: soc configuration handle
306 *
307 * De-allocates memory allocated for SoC configuration
308 *
309 * Return:none
310 */
311void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
312
313/**
314 * wlan_cfg_pdev_attach() Attach configuration interface for pdev
Vivek126db5d2018-07-25 22:05:04 +0530315 * @ctrl_obj - PSOC object
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530316 *
317 * Allocates context for pdev configuration parameters,
318 * Read configuration information from device tree/ini file and
319 * returns back handle
320 *
321 * Return: Handle to configuration context
322 */
Akshay Kosigieec6db92019-07-02 14:25:54 +0530323struct wlan_cfg_dp_pdev_ctxt *
324wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530325
326/**
327 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
328 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
329 *
330 * Return: void
331 */
332void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
333
Jeff Johnson590aeb62017-01-05 14:23:08 -0800334void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
335void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
336 int context, int mask);
337void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
338 int context, int mask);
339void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
340 int context, int mask);
341void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
342 int context, int mask);
343void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
344 int mask);
Pamidipati, Vijay6b0d2a82017-06-09 04:46:32 +0530345void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
Tallapragada Kalyana7023622018-12-03 19:29:52 +0530346void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
347int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
Ruben Columbusb7a1c572019-08-12 11:11:29 -0700348int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
Nandha Kishore Easwaran82ac62e2017-06-20 17:55:07 +0530349int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
350 int context, int mask);
351int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
352 int context, int mask);
353int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
354 int context, int mask);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530355/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800356 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530357 * @wlan_cfg_ctx - Configuration Handle
358 *
359 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
360 * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
361 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
362 * that are processed by the handler.
363 *
364 * Return: num_contexts
365 */
366int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
367
368/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800369 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
370 * interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530371 * @wlan_cfg_ctx - Configuration Handle
372 * @context - Numerical ID identifying the Interrupt/NAPI context
373 *
374 * Return: int_tx_ring_mask[context]
375 */
376int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
377 int context);
378
379/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800380 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
381 * interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530382 * @wlan_cfg_ctx - Configuration Handle
383 * @context - Numerical ID identifying the Interrupt/NAPI context
384 *
385 * Return: int_rx_ring_mask[context]
386 */
387int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
388 int context);
389
390/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800391 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
392 * mapped to an interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530393 * @wlan_cfg_ctx - Configuration Handle
394 * @context - Numerical ID identifying the Interrupt/NAPI context
395 *
396 * Return: int_rx_mon_ring_mask[context]
397 */
398int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
399 int context);
400
401/**
Karunakar Dasineni10185472017-06-19 16:32:06 -0700402 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
403 * for the given interrupt context
404 * @wlan_cfg_ctx - Configuration Handle
405 * @context - Numerical ID identifying the Interrupt/NAPI context
406 *
407 */
408void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
409 int context, int mask);
410
411/**
412 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
413 * mapped to an interrupt context
414 * @wlan_cfg_ctx - Configuration Handle
415 * @context - Numerical ID identifying the Interrupt/NAPI context
416 *
417 * Return: int_rxdma2host_ring_mask[context]
418 */
419int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
420 int context);
421
422/**
Karunakar Dasineni87f0c5d2017-10-29 21:54:21 -0700423 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
424 * for the given interrupt context
425 * @wlan_cfg_ctx - Configuration Handle
426 * @context - Numerical ID identifying the Interrupt/NAPI context
427 *
428 */
429void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
430 int context, int mask);
431
432/**
433 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
434 * mapped to an interrupt context
435 * @wlan_cfg_ctx - Configuration Handle
436 * @context - Numerical ID identifying the Interrupt/NAPI context
437 *
438 * Return: int_host2rxdma_ring_mask[context]
439 */
440int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
441 int context);
442
443/**
Keyur Parekh11865212018-10-12 18:03:12 -0700444 * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
445 * interrupt mask for the given interrupt context
446 * @wlan_cfg_ctx - Configuration Handle
447 * @context - Numerical ID identifying the Interrupt/NAPI context
448 *
449 */
450void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
451 int context, int mask);
452
453/**
454 * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
455 * interrupt mask mapped to an interrupt context
456 * @wlan_cfg_ctx - Configuration Handle
457 * @context - Numerical ID identifying the Interrupt/NAPI context
458 *
459 * Return: int_host2rxdma_mon_ring_mask[context]
460 */
461int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
462 int context);
463
464/**
465 * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
466 * destination ring interrupt mask
467 * for the given interrupt context
468 * @wlan_cfg_ctx - Configuration Handle
469 * @context - Numerical ID identifying the Interrupt/NAPI context
470 *
471 */
472void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
473 int context, int mask);
474
475/**
476 * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
477 * destination ring interrupt mask
478 * mapped to an interrupt context
479 * @wlan_cfg_ctx - Configuration Handle
480 * @context - Numerical ID identifying the Interrupt/NAPI context
481 *
482 * Return: int_rxdma2host_mon_ring_mask[context]
483 */
484int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
485 int context);
486
487/**
Karunakar Dasineni10185472017-06-19 16:32:06 -0700488 * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
489 *
490 * @wlan_cfg_ctx - Configuration Handle
491 * @pdev_idx - Index of SW PDEV
492 * @hw_macid - HW MAC Id
493 *
494 */
495void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
496 int hw_macid);
497
498/**
499 * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
500 *
501 * @wlan_cfg_ctx - Configuration Handle
502 * @pdev_idx - Index of SW PDEV
503 *
504 * Return: HW MAC Id
505 */
506int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
507
508/**
509 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
510 * PDEV index
511 *
512 * @wlan_cfg_ctx - Configuration Handle
513 * @pdev_idx - Index of SW PDEV
514 *
515 * Return: HW MAC index
516 */
517int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
518
519/**
Houston Hoffman648a9182017-05-21 23:27:50 -0700520 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
521 * mapped to an interrupt context
522 * @wlan_cfg_ctx - Configuration Handle
523 * @context - Numerical ID identifying the Interrupt/NAPI context
524 *
525 * Return: int_rx_err_ring_mask[context]
526 */
527int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
528 context);
529
530/**
531 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
532 * mapped to an interrupt context
533 * @wlan_cfg_ctx - Configuration Handle
534 * @context - Numerical ID identifying the Interrupt/NAPI context
535 *
536 * Return: int_wbm_rel_ring_mask[context]
537 */
538int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
539 context);
540
541/**
542 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
543 * mapped to an interrupt context
544 * @wlan_cfg_ctx - Configuration Handle
545 * @context - Numerical ID identifying the Interrupt/NAPI context
546 *
547 * Return: int_reo_status_ring_mask[context]
548 */
549int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
550 context);
551
552/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800553 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530554 * mapped to an interrupt context
555 * @wlan_cfg_ctx - Configuration Handle
556 * @context - Numerical ID identifying the Interrupt/NAPI context
557 *
558 * Return: int_ce_ring_mask[context]
559 */
560int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
561 int context);
562
563/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800564 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
565 * supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530566 * @wlan_cfg_ctx - Configuration Handle
567 *
568 * Return: max_clients
569 */
570uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
571
572/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800573 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530574 * memory allocation request for this device
575 * @wlan_cfg_ctx - Configuration Handle
576 *
577 * Return: max_alloc_size
578 */
579uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
580
581/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800582 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530583 * one per radio
584 * @wlan_cfg_ctx - Configuration Handle
585 *
586 * Return: per_pdev_tx_ring
587 */
588int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
589
590/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800591 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530592 * @wlan_cfg_ctx
593 *
594 * Return: num_tcl_data_rings
595 */
596int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
597
598/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800599 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530600 * one per radio
601 * @wlan_cfg_ctx
602 *
603 * Return: per_pdev_rx_ring
604 */
605int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
606
607/*
Manjunathappa Prakashe23acaf2017-11-10 00:17:24 -0800608 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
609 * one per radio
610 * @wlan_cfg_ctx
611 *
612 * Return: return 1 if per pdev error ring else 0
613 */
614int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
615
616/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800617 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530618 * @wlan_cfg_ctx - Configuration Handle
619 *
620 * Return: num_reo_dest_rings
621 */
622int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
623
624/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800625 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530626 * @wlan_cfg_ctx - Configuration Handle
627 *
628 * Return: htt_pkt_type_ethernet
629 */
630int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
631
632/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800633 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
634 * device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530635 * @wlan_cfg_ctx - Configuration Handle
636 *
637 * Return: num_tx_desc_pool
638 */
639int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
640
641/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530642 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
643 * device
644 * @wlan_cfg_ctx - Configuration Handle
645 * @num_pool - Number of pool
646 */
647void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
648
649/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800650 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
651 * pools
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530652 * @wlan_cfg_ctx - Configuration Handle
653 *
654 * Return: num_tx_ext_desc_pool
655 */
656int wlan_cfg_get_num_tx_ext_desc_pool(
657 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
658
659/*
Balamurugan Mahalingam54d16a92018-06-25 17:08:08 +0530660 * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
661 *
662 * @wlan_cfg_ctx - Configuration Handle
663 *
664 * Return: reo_dst_ring_size
665 */
666int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
667
668/*
669 * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
670 *
671 * @wlan_cfg_ctx - Configuration Handle
672 * @reo_dst_ring_size - REO Destination ring size
673 */
674void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
675 int reo_dst_ring_size);
676
677/*
Venkateswara Swamy Bandaru6ca41122018-08-03 16:07:06 +0530678 * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
679 *
680 * @wlan_cfg_ctx - Configuration Handle
681 * @raw_mode_war - raw mode war configuration
682 */
683void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
684 bool raw_mode_war);
685
686/*
687 * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
688 *
689 * @wlan_cfg_ctx - Configuration Handle
690 *
691 * Return: reo_dst_ring_size
692 */
693bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
694
695/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530696 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
697 * pools
698 * @wlan_cfg_ctx - Configuration Handle
699 * @num_pool - Number of pool
700 */
701void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
702
703/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800704 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530705 * @wlan_cfg_ctx - Configuration Handle
706 *
707 * Return: num_tx_desc
708 */
709int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
710
711/*
Shashikala Prabhu550e69c2019-03-13 17:41:17 +0530712 * 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 */
717int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
718
719/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530720 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
721 *
722 * @wlan_cfg_ctx - Configuration Handle
723 * @num_desc: Number of descriptor
724 */
725void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
726
727/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800728 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
729 * per pool
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530730 * @wlan_cfg_ctx - Configuration Handle
731 *
732 * Return: num_tx_ext_desc
733 */
734int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
735
736/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530737 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
738 * per pool
739 * @wlan_cfg_ctx - Configuration Handle
740 * @num_desc: Number of descriptor
741 */
742void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
743
744/*
Jeff Johnson590aeb62017-01-05 14:23:08 -0800745 * wlan_cfg_max_peer_id() - Get maximum peer ID
746 * @cfg: Configuration Handle
747 *
748 * Return: maximum peer ID
749 */
750uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
751
752/*
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530753 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
754 * @wlan_cfg_pdev_ctx
755 *
756 * Return: dma_mon_buf_ring_size
757 */
758int wlan_cfg_get_dma_mon_buf_ring_size(
759 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
760
761/*
762 * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
Ravi Joshifb39e002017-02-11 21:18:40 -0800763 * Destination ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530764 * @wlan_cfg_pdev_ctx
765 *
766 * Return: dma_mon_dest_size
767 */
768int wlan_cfg_get_dma_mon_dest_ring_size(
769 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
770
771/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800772 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530773 * @wlan_cfg_pdev_ctx
774 *
775 * Return: dma_mon_stat_ring_size
776 */
777int wlan_cfg_get_dma_mon_stat_ring_size(
778 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
779
780/*
Vivek126db5d2018-07-25 22:05:04 +0530781 * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
782 * @wlan_cfg_soc_ctx
783 *
784 * Return: rxdma monitor desc ring size
785 */
786int
787wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
788
789/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800790 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530791 * @wlan_cfg_pdev_ctx
792 *
793 * Return: rx_dma_buf_ring_size
794 */
795int wlan_cfg_get_rx_dma_buf_ring_size(
796 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
797
Dhanashri Atred4032ab2017-01-17 15:05:41 -0800798/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800799 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
Dhanashri Atred4032ab2017-01-17 15:05:41 -0800800 * per pdev
801 * @wlan_cfg_pdev_ctx
802 *
803 * Return: number of mac DMA rings per pdev
804 */
805int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
Dhanashri Atre14049172016-11-11 18:32:36 -0800806
807/*
808 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
Mohit Khanna81179cb2018-08-16 20:50:43 -0700809 * @wlan_cfg_dp_soc_ctxt
Dhanashri Atre14049172016-11-11 18:32:36 -0800810 *
811 * Return: true - LRO enabled false - LRO disabled
812 */
813bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
814
815/*
Mohit Khanna16816ae2018-10-30 14:12:03 -0700816 * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
817 * @wlan_cfg_dp_soc_ctxt
818 *
819 * Return: true - GRO enabled false - GRO disabled
820 */
821bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
822
823/*
Mohit Khanna81179cb2018-08-16 20:50:43 -0700824 * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
825 * @wlan_cfg_dp_soc_ctxt
Dhanashri Atre14049172016-11-11 18:32:36 -0800826 *
827 * Return: true - enabled false - disabled
828 */
829bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
830
Bharat Kumar M9a5d5372017-05-08 17:41:42 +0530831/*
Mohit Khanna81179cb2018-08-16 20:50:43 -0700832 * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
833 * @wlan_cfg_dp_soc_ctxt
834 *
835 * Return: true - enabled false - disabled
836 */
837bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
838
839/*
Tallapragada Kalyan4c183b82017-09-13 23:48:14 +0530840 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
841 * @wlan_cfg_soc_ctx
842 * @rx_hash
843 */
844void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
845
846/*
Bharat Kumar M9a5d5372017-05-08 17:41:42 +0530847 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
848 * @wlan_cfg_pdev_ctx
849 *
850 * Return: 1 - enabled 0 - disabled
851 */
852int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
853
854/*
855 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
856 * @wlan_cfg_pdev_ctx
857 */
858void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
859
860/*
861 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
862 * @wlan_cfg_pdev_ctx
863 *
864 * Return: nss_cfg
865 */
866int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
867
868/*
869 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
870 * @wlan_cfg_pdev_ctx
871 *
872 */
873void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
Pamidipati, Vijay45b1df22017-06-21 03:20:25 +0530874
Pamidipati, Vijay45b1df22017-06-21 03:20:25 +0530875/*
876 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
877 * @wlan_cfg_soc_ctx
878 *
879 * Return: Batch threshold
880 */
881int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
882
883/*
884 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
885 * @wlan_cfg_soc_ctx
886 *
887 * Return: Timer threshold
888 */
889int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
890
891/*
892 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
893 * @wlan_cfg_soc_ctx
894 *
895 * Return: Batch threshold
896 */
897int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
898
899/*
900 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
901 * @wlan_cfg_soc_ctx
902 *
903 * Return: Timer threshold
904 */
905int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
906
907/*
908 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
909 * @wlan_cfg_soc_ctx
910 *
911 * Return: Batch threshold
912 */
913int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
914
915/*
916 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
917 * @wlan_cfg_soc_ctx
918 *
919 * Return: Timer threshold
920 */
921int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
Pamidipati, Vijaybea353e2017-07-05 03:09:20 +0530922
923/*
Keyur Parekh11865212018-10-12 18:03:12 -0700924 * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
925 * @wlan_cfg_soc_ctx
926 *
927 * Return: Timer threshold
928 */
929int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
930
931/*
chenguo8d0c2192017-12-01 19:35:53 +0800932 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
933 * @wlan_cfg_soc_ctx
934 *
935 * Return: Checksum offload enable or disable
936 */
937int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
938
939/*
Pamidipati, Vijaybea353e2017-07-05 03:09:20 +0530940 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
941 * @wlan_cfg_soc_ctx
942 *
943 * Return: Tx Ring Size
944 */
945int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
946
947/*
948 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
949 * @wlan_cfg_soc_ctx
950 *
951 * Return: Tx Completion ring size
952 */
953int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
Vivek126db5d2018-07-25 22:05:04 +0530954
955/*
956 * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
957 * @wlan_cfg_soc_ctx
958 *
959 * Return: wbm_release_ring size
960 */
961int
962wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
963
964/*
965 * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
966 * @wlan_cfg_soc_ctx
967 *
968 * Return: tcl_cmd_ring size
969 */
970int
971wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
972
973/*
974 * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
975 * @wlan_cfg_soc_ctx
976 *
977 * Return: tcl_status_ring size
978 */
979int
980wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
981
982/*
983 * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
984 * @wlan_cfg_soc_ctx
985 *
986 * Return: reo_reinject_ring size
987 */
988int
989wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
990
991/*
992 * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
993 * @wlan_cfg_soc_ctx
994 *
995 * Return: rx_release_ring size
996 */
997int
998wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
999
1000/*
1001 * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
1002 * @wlan_cfg_soc_ctx
1003 *
1004 * Return: reo_exception_ring size
1005 */
1006int
1007wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1008
1009/*
1010 * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
1011 * @wlan_cfg_soc_ctx
1012 *
1013 * Return: reo_cmd_ring size
1014 */
1015int
1016wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1017
1018/*
1019 * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
1020 * @wlan_cfg_soc_ctx
1021 *
1022 * Return: reo_status_ring size
1023 */
1024int
1025wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1026
1027/*
Prathyusha Guduri36ce8172019-07-19 19:43:39 +05301028 * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
1029 * @wlan_cfg_soc_ctx
1030 *
1031 * Return: tx desc limit for 5G H
1032 */
1033int
1034wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
1035
1036/*
1037 * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
1038 * @wlan_cfg_soc_ctx
1039 *
1040 * Return: tx desc limit for 2G
1041 */
1042int
1043wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
1044
1045/*
1046 * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
1047 * @wlan_cfg_soc_ctx
1048 *
1049 * Return: tx desc limit for 5G L
1050 */
1051int
1052wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
1053
1054/*
Prathyusha Guduriaed67e12019-07-21 23:55:52 +05301055 * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
1056 * @wlan_cfg_soc_ctx
1057 *
1058 * Return: tx device limit
1059 */
1060int
1061wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
1062
1063/*
Prathyusha Guduriabac9ee2019-07-24 23:49:45 +05301064 * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
1065 * @wlan_cfg_soc_ctx
1066 *
1067 * Return: tx sw internode queue
1068 */
1069int
1070wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
1071
1072/*
Vivek126db5d2018-07-25 22:05:04 +05301073 * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
1074 * @wlan_cfg_soc_ctx
1075 *
1076 * Return: rxdma refill ring size
1077 */
1078int
1079wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1080
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 */
1087int
1088wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1089
Akshay Kosigia4f6e172018-09-03 21:42:27 +05301090/*
Mainak Sen95502732019-07-25 00:48:59 +05301091 * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
1092 * @wlan_cfg_soc_ctx
1093 *
1094 * Return: rx_sw_desc_weight
1095 */
1096int
1097wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
1098
1099/*
Akshay Kosigia4f6e172018-09-03 21:42:27 +05301100 * wlan_cfg_get_dp_caps - Get dp capablities
1101 * @wlan_cfg_soc_ctx
1102 * @dp_caps: enum for dp capablities
1103 *
1104 * Return: bool if a dp capabilities is enabled
1105 */
1106bool
1107wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
1108 enum cdp_capabilities dp_caps);
Venkata Sharath Chandra Manchalacb6d0c02019-05-16 17:33:18 -07001109
1110/**
1111 * wlan_set_srng_cfg() - Fill per ring specific
1112 * configuration parameters
1113 * @wlan_cfg: global srng configuration table
1114 *
1115 * Return: None
1116 */
1117void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
1118
Manjunathappa Prakashced7ea62017-07-02 03:02:15 -07001119#ifdef QCA_LL_TX_FLOW_CONTROL_V2
1120int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
1121
1122int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
1123#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
psimhafc2f91b2018-01-10 15:30:03 -08001124int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
1125
1126int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
Mohit Khannae5a6e942018-11-28 14:22:48 -08001127
Sumeet Rao76aa8d52019-06-20 12:23:14 -07001128/**
1129 * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
1130 * in number of entries
1131 *
1132 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1133 *
1134 * Return: rx_fst_size
1135 */
1136uint16_t
1137wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1138
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 */
1146uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
1147
1148/**
1149 * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
1150 * search
1151 *
1152 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1153 *
1154 * Return: 320-bit Hash Key
1155 */
1156uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
1157
1158/**
1159 * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
1160 * DP soc context
1161 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1162 * @val: Rx flow tag feature flag value
1163 *
1164 * Return: None
1165 */
1166void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1167 bool val);
1168
1169/**
1170 * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
1171 * DP soc context
1172 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1173 *
1174 * Return: true if feature is enabled, else false
1175 */
1176bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1177
1178/**
1179 * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
1180 * Rx FST is per pdev
1181 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1182 * @val: boolean flag indicating Rx FST per pdev or per SOC
1183 *
1184 * Return: None
1185 */
1186void
1187wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
1188 bool val);
1189
1190/**
1191 * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
1192 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1193 *
1194 * Return: true if Rx FST is per pdev, else false
1195 */
1196bool
1197wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
1198
1199/**
1200 * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
1201 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1202 * @val: Rx FST size in number of entries
1203 *
1204 * Return: None
1205 */
1206void
1207wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1208 uint16_t val);
1209
1210/**
1211 * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
1212 * in DP soc context
1213 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1214 * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
1215 *
1216 * Return: None
1217 */
1218void
1219wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1220 bool val);
1221
1222/**
1223 * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
1224 * from DP soc context
1225 * @wlan_cfg_dp_soc_ctxt: soc configuration context
1226 *
1227 * Return: true if feature is enabled in monitor mode for protocol or flow
1228 * tagging in INI, false otherwise
1229 */
1230bool
1231wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +05301232#endif