blob: a0565f7534f949b1993bfe005dc0cf456fe71297 [file] [log] [blame]
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +05301/*
psimhafc2f91b2018-01-10 15:30:03 -08002* * Copyright (c) 2013-2018 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 */
26#if defined(CONFIG_MCL)
27#define MAX_PDEV_CNT 1
Houston Hoffman648a9182017-05-21 23:27:50 -070028#define WLAN_CFG_INT_NUM_CONTEXTS 7
Pamidipati, Vijay9e340252017-08-14 16:24:17 +053029/*
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
Venkata Sharath Chandra Manchala0ad4fda2018-03-01 13:45:46 -080034
35/* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
36#define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
37
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -080038#define NUM_RXDMA_RINGS_PER_PDEV 2
Ravi Joshi891d5202017-02-17 15:01:27 -080039#else
40#define MAX_PDEV_CNT 3
Karunakar Dasineni860938e2018-03-14 17:28:15 -070041#define WLAN_CFG_INT_NUM_CONTEXTS 7
Pamidipati, Vijay9e340252017-08-14 16:24:17 +053042/*
43 * This mask defines how many transmit frames account for 1 NAPI work unit
44 * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
45 */
46#define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
Venkata Sharath Chandra Manchala0ad4fda2018-03-01 13:45:46 -080047
48/* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
49#define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
50
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -080051#define NUM_RXDMA_RINGS_PER_PDEV 1
Ravi Joshi891d5202017-02-17 15:01:27 -080052#endif
53
54/* Tx configuration */
55#define MAX_LINK_DESC_BANKS 8
56#define MAX_TXDESC_POOLS 4
57#define MAX_TCL_DATA_RINGS 4
Ravi Joshi891d5202017-02-17 15:01:27 -080058
59/* Rx configuration */
60#define MAX_RXDESC_POOLS 4
61#define MAX_REO_DEST_RINGS 4
Ravi Joshi891d5202017-02-17 15:01:27 -080062#define MAX_RX_MAC_RINGS 2
63
chenguo9bece1a2017-12-19 18:49:41 +080064/* DP process status */
65#ifdef CONFIG_MCL
66#define CONFIG_PROCESS_RX_STATUS 1
67#define CONFIG_PROCESS_TX_STATUS 1
68#else
69#define CONFIG_PROCESS_RX_STATUS 0
70#define CONFIG_PROCESS_TX_STATUS 0
71#endif
72
Ravi Joshi891d5202017-02-17 15:01:27 -080073/* Miscellaneous configuration */
74#define MAX_IDLE_SCATTER_BUFS 16
75#define DP_MAX_IRQ_PER_CONTEXT 12
76#define DP_MAX_INTERRUPT_CONTEXTS 8
77#define DP_MAX_INTERRUPT_CONTEXTS 8
78#define MAX_HTT_METADATA_LEN 32
79#define MAX_NUM_PEER_ID_PER_PEER 8
80#define DP_MAX_TIDS 17
81#define DP_NON_QOS_TID 16
82
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +053083struct wlan_cfg_dp_pdev_ctxt;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -070084
Houston Hoffman648a9182017-05-21 23:27:50 -070085/**
86 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
87 * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
88 * @max_clients - Maximum number of peers/stations supported by device
89 * @max_alloc_size - Maximum allocation size for any dynamic memory
90 * allocation request for this device
91 * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio
92 * 1 - Each TCL ring is mapped to one radio/pdev
93 * @num_tcl_data_rings - Number of TCL Data rings supported by device
94 * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio
95 * 1 - Each REO ring is mapped to one radio/pdev
96 * @num_tx_desc_pool - Number of Tx Descriptor pools
97 * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools
98 * @num_tx_desc - Number of Tx Descriptors per pool
99 * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool
100 * @max_peer_id - Maximum value of peer id that FW can assign for a client
101 * @htt_packet_type - Default 802.11 encapsulation type for any VAP created
102 * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context
103 * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context
104 * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each
105 * NAPI/Intr context
106 * @int_rx_err_ring_mask - Bitmap of Rx err ring interrupts mapped to each
107 * NAPI/Intr context
108 * @int_wbm_rel_ring_mask - Bitmap of wbm rel ring interrupts mapped to each
109 * NAPI/Intr context
110 * @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
111 * NAPI/Intr context
112 * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700113 * @lro_enabled - enable/disable lro feature
Houston Hoffman648a9182017-05-21 23:27:50 -0700114 * @rx_hash - Enable hash based steering of rx packets
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700115 * @tso_enabled - enable/disable tso feature
116 * @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets
117 * @tcp_Udp_Checksumoffload - enable/disable checksum offload
Houston Hoffman648a9182017-05-21 23:27:50 -0700118 * @nss_cfg - nss configuration
119 */
120struct wlan_cfg_dp_soc_ctxt {
121 int num_int_ctxts;
122 int max_clients;
123 int max_alloc_size;
124 int per_pdev_tx_ring;
125 int num_tcl_data_rings;
126 int per_pdev_rx_ring;
Manjunathappa Prakashe23acaf2017-11-10 00:17:24 -0800127 int per_pdev_lmac_ring;
Houston Hoffman648a9182017-05-21 23:27:50 -0700128 int num_reo_dest_rings;
129 int num_tx_desc_pool;
130 int num_tx_ext_desc_pool;
131 int num_tx_desc;
132 int num_tx_ext_desc;
133 int max_peer_id;
134 int htt_packet_type;
135 int int_batch_threshold_tx;
136 int int_timer_threshold_tx;
137 int int_batch_threshold_rx;
138 int int_timer_threshold_rx;
139 int int_batch_threshold_other;
140 int int_timer_threshold_other;
141 int tx_ring_size;
142 int tx_comp_ring_size;
143 int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
144 int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
145 int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
146 int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
147 int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
148 int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
149 int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
150 int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
Karunakar Dasineni87f0c5d2017-10-29 21:54:21 -0700151 int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
Houston Hoffman648a9182017-05-21 23:27:50 -0700152 int hw_macid[MAX_PDEV_CNT];
153 int base_hw_macid;
154 bool lro_enabled;
155 bool rx_hash;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700156 bool tso_enabled;
157 bool napi_enabled;
158 bool tcp_udp_checksumoffload;
psimhafc2f91b2018-01-10 15:30:03 -0800159 bool defrag_timeout_check;
Houston Hoffman648a9182017-05-21 23:27:50 -0700160 int nss_cfg;
161#ifdef QCA_LL_TX_FLOW_CONTROL_V2
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -0700162 uint32_t tx_flow_stop_queue_threshold;
163 uint32_t tx_flow_start_queue_offset;
Houston Hoffman648a9182017-05-21 23:27:50 -0700164#endif
psimhafc2f91b2018-01-10 15:30:03 -0800165 uint32_t rx_defrag_min_timeout;
Houston Hoffman648a9182017-05-21 23:27:50 -0700166};
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530167
168/**
169 * wlan_cfg_soc_attach() - Attach configuration interface for SoC
170 *
171 * Allocates context for Soc configuration parameters,
172 * Read configuration information from device tree/ini file and
173 * returns back handle
174 *
175 * Return: Handle to configuration context
176 */
177struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void);
178
179/**
180 * wlan_cfg_soc_detach() - Detach soc configuration handle
181 * @wlan_cfg_ctx: soc configuration handle
182 *
183 * De-allocates memory allocated for SoC configuration
184 *
185 * Return:none
186 */
187void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
188
189/**
190 * wlan_cfg_pdev_attach() Attach configuration interface for pdev
191 *
192 * Allocates context for pdev configuration parameters,
193 * Read configuration information from device tree/ini file and
194 * returns back handle
195 *
196 * Return: Handle to configuration context
197 */
198struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void);
199
200/**
201 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
202 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
203 *
204 * Return: void
205 */
206void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
207
Jeff Johnson590aeb62017-01-05 14:23:08 -0800208void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
209void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
210 int context, int mask);
211void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
212 int context, int mask);
213void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
214 int context, int mask);
215void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
216 int context, int mask);
217void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
218 int mask);
Pamidipati, Vijay6b0d2a82017-06-09 04:46:32 +0530219void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
220
Nandha Kishore Easwaran82ac62e2017-06-20 17:55:07 +0530221int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
222 int context, int mask);
223int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
224 int context, int mask);
225int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
226 int context, int mask);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530227/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800228 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530229 * @wlan_cfg_ctx - Configuration Handle
230 *
231 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
232 * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
233 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
234 * that are processed by the handler.
235 *
236 * Return: num_contexts
237 */
238int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
239
240/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800241 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
242 * interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530243 * @wlan_cfg_ctx - Configuration Handle
244 * @context - Numerical ID identifying the Interrupt/NAPI context
245 *
246 * Return: int_tx_ring_mask[context]
247 */
248int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
249 int context);
250
251/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800252 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
253 * interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530254 * @wlan_cfg_ctx - Configuration Handle
255 * @context - Numerical ID identifying the Interrupt/NAPI context
256 *
257 * Return: int_rx_ring_mask[context]
258 */
259int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
260 int context);
261
262/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800263 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
264 * mapped to an interrupt context
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530265 * @wlan_cfg_ctx - Configuration Handle
266 * @context - Numerical ID identifying the Interrupt/NAPI context
267 *
268 * Return: int_rx_mon_ring_mask[context]
269 */
270int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
271 int context);
272
273/**
Karunakar Dasineni10185472017-06-19 16:32:06 -0700274 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
275 * for the given interrupt context
276 * @wlan_cfg_ctx - Configuration Handle
277 * @context - Numerical ID identifying the Interrupt/NAPI context
278 *
279 */
280void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
281 int context, int mask);
282
283/**
284 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
285 * mapped to an interrupt context
286 * @wlan_cfg_ctx - Configuration Handle
287 * @context - Numerical ID identifying the Interrupt/NAPI context
288 *
289 * Return: int_rxdma2host_ring_mask[context]
290 */
291int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
292 int context);
293
294/**
Karunakar Dasineni87f0c5d2017-10-29 21:54:21 -0700295 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
296 * for the given interrupt context
297 * @wlan_cfg_ctx - Configuration Handle
298 * @context - Numerical ID identifying the Interrupt/NAPI context
299 *
300 */
301void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
302 int context, int mask);
303
304/**
305 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
306 * mapped to an interrupt context
307 * @wlan_cfg_ctx - Configuration Handle
308 * @context - Numerical ID identifying the Interrupt/NAPI context
309 *
310 * Return: int_host2rxdma_ring_mask[context]
311 */
312int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
313 int context);
314
315/**
Karunakar Dasineni10185472017-06-19 16:32:06 -0700316 * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
317 *
318 * @wlan_cfg_ctx - Configuration Handle
319 * @pdev_idx - Index of SW PDEV
320 * @hw_macid - HW MAC Id
321 *
322 */
323void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
324 int hw_macid);
325
326/**
327 * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
328 *
329 * @wlan_cfg_ctx - Configuration Handle
330 * @pdev_idx - Index of SW PDEV
331 *
332 * Return: HW MAC Id
333 */
334int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
335
336/**
337 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
338 * PDEV index
339 *
340 * @wlan_cfg_ctx - Configuration Handle
341 * @pdev_idx - Index of SW PDEV
342 *
343 * Return: HW MAC index
344 */
345int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
346
347/**
Houston Hoffman648a9182017-05-21 23:27:50 -0700348 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
349 * mapped to an interrupt context
350 * @wlan_cfg_ctx - Configuration Handle
351 * @context - Numerical ID identifying the Interrupt/NAPI context
352 *
353 * Return: int_rx_err_ring_mask[context]
354 */
355int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
356 context);
357
358/**
359 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
360 * mapped to an interrupt context
361 * @wlan_cfg_ctx - Configuration Handle
362 * @context - Numerical ID identifying the Interrupt/NAPI context
363 *
364 * Return: int_wbm_rel_ring_mask[context]
365 */
366int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
367 context);
368
369/**
370 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
371 * mapped to an interrupt context
372 * @wlan_cfg_ctx - Configuration Handle
373 * @context - Numerical ID identifying the Interrupt/NAPI context
374 *
375 * Return: int_reo_status_ring_mask[context]
376 */
377int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
378 context);
379
380/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800381 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530382 * mapped to an interrupt context
383 * @wlan_cfg_ctx - Configuration Handle
384 * @context - Numerical ID identifying the Interrupt/NAPI context
385 *
386 * Return: int_ce_ring_mask[context]
387 */
388int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
389 int context);
390
391/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800392 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
393 * supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530394 * @wlan_cfg_ctx - Configuration Handle
395 *
396 * Return: max_clients
397 */
398uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
399
400/**
Ravi Joshifb39e002017-02-11 21:18:40 -0800401 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530402 * memory allocation request for this device
403 * @wlan_cfg_ctx - Configuration Handle
404 *
405 * Return: max_alloc_size
406 */
407uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
408
409/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800410 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530411 * one per radio
412 * @wlan_cfg_ctx - Configuration Handle
413 *
414 * Return: per_pdev_tx_ring
415 */
416int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
417
418/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800419 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530420 * @wlan_cfg_ctx
421 *
422 * Return: num_tcl_data_rings
423 */
424int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
425
426/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800427 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530428 * one per radio
429 * @wlan_cfg_ctx
430 *
431 * Return: per_pdev_rx_ring
432 */
433int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
434
435/*
Manjunathappa Prakashe23acaf2017-11-10 00:17:24 -0800436 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
437 * one per radio
438 * @wlan_cfg_ctx
439 *
440 * Return: return 1 if per pdev error ring else 0
441 */
442int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
443
444/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800445 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530446 * @wlan_cfg_ctx - Configuration Handle
447 *
448 * Return: num_reo_dest_rings
449 */
450int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
451
452/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800453 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530454 * @wlan_cfg_ctx - Configuration Handle
455 *
456 * Return: htt_pkt_type_ethernet
457 */
458int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
459
460/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800461 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
462 * device
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530463 * @wlan_cfg_ctx - Configuration Handle
464 *
465 * Return: num_tx_desc_pool
466 */
467int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
468
469/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530470 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
471 * device
472 * @wlan_cfg_ctx - Configuration Handle
473 * @num_pool - Number of pool
474 */
475void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
476
477/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800478 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
479 * pools
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530480 * @wlan_cfg_ctx - Configuration Handle
481 *
482 * Return: num_tx_ext_desc_pool
483 */
484int wlan_cfg_get_num_tx_ext_desc_pool(
485 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
486
487/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530488 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
489 * pools
490 * @wlan_cfg_ctx - Configuration Handle
491 * @num_pool - Number of pool
492 */
493void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
494
495/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800496 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530497 * @wlan_cfg_ctx - Configuration Handle
498 *
499 * Return: num_tx_desc
500 */
501int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
502
503/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530504 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
505 *
506 * @wlan_cfg_ctx - Configuration Handle
507 * @num_desc: Number of descriptor
508 */
509void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
510
511/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800512 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
513 * per pool
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530514 * @wlan_cfg_ctx - Configuration Handle
515 *
516 * Return: num_tx_ext_desc
517 */
518int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
519
520/*
Aniruddha Paul9d7dc272018-02-11 19:40:41 +0530521 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
522 * per pool
523 * @wlan_cfg_ctx - Configuration Handle
524 * @num_desc: Number of descriptor
525 */
526void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
527
528/*
Jeff Johnson590aeb62017-01-05 14:23:08 -0800529 * wlan_cfg_max_peer_id() - Get maximum peer ID
530 * @cfg: Configuration Handle
531 *
532 * Return: maximum peer ID
533 */
534uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
535
536/*
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530537 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
538 * @wlan_cfg_pdev_ctx
539 *
540 * Return: dma_mon_buf_ring_size
541 */
542int wlan_cfg_get_dma_mon_buf_ring_size(
543 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
544
545/*
546 * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
Ravi Joshifb39e002017-02-11 21:18:40 -0800547 * Destination ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530548 * @wlan_cfg_pdev_ctx
549 *
550 * Return: dma_mon_dest_size
551 */
552int wlan_cfg_get_dma_mon_dest_ring_size(
553 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
554
555/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800556 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530557 * @wlan_cfg_pdev_ctx
558 *
559 * Return: dma_mon_stat_ring_size
560 */
561int wlan_cfg_get_dma_mon_stat_ring_size(
562 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
563
564/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800565 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530566 * @wlan_cfg_pdev_ctx
567 *
568 * Return: rx_dma_buf_ring_size
569 */
570int wlan_cfg_get_rx_dma_buf_ring_size(
571 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
572
Dhanashri Atred4032ab2017-01-17 15:05:41 -0800573/*
Ravi Joshifb39e002017-02-11 21:18:40 -0800574 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
Dhanashri Atred4032ab2017-01-17 15:05:41 -0800575 * per pdev
576 * @wlan_cfg_pdev_ctx
577 *
578 * Return: number of mac DMA rings per pdev
579 */
580int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
Dhanashri Atre14049172016-11-11 18:32:36 -0800581
582/*
583 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
584 * @wlan_cfg_pdev_ctx
585 *
586 * Return: true - LRO enabled false - LRO disabled
587 */
588bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
589
590/*
591 * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled
592 * @wlan_cfg_pdev_ctx
593 *
594 * Return: true - enabled false - disabled
595 */
596bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
597
Bharat Kumar M9a5d5372017-05-08 17:41:42 +0530598/*
Tallapragada Kalyan4c183b82017-09-13 23:48:14 +0530599 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
600 * @wlan_cfg_soc_ctx
601 * @rx_hash
602 */
603void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
604
605/*
Bharat Kumar M9a5d5372017-05-08 17:41:42 +0530606 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
607 * @wlan_cfg_pdev_ctx
608 *
609 * Return: 1 - enabled 0 - disabled
610 */
611int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
612
613/*
614 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
615 * @wlan_cfg_pdev_ctx
616 */
617void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
618
619/*
620 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
621 * @wlan_cfg_pdev_ctx
622 *
623 * Return: nss_cfg
624 */
625int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
626
627/*
628 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
629 * @wlan_cfg_pdev_ctx
630 *
631 */
632void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
Pamidipati, Vijay45b1df22017-06-21 03:20:25 +0530633
Pamidipati, Vijay45b1df22017-06-21 03:20:25 +0530634/*
635 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
636 * @wlan_cfg_soc_ctx
637 *
638 * Return: Batch threshold
639 */
640int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
641
642/*
643 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
644 * @wlan_cfg_soc_ctx
645 *
646 * Return: Timer threshold
647 */
648int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
649
650/*
651 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
652 * @wlan_cfg_soc_ctx
653 *
654 * Return: Batch threshold
655 */
656int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
657
658/*
659 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
660 * @wlan_cfg_soc_ctx
661 *
662 * Return: Timer threshold
663 */
664int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
665
666/*
667 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
668 * @wlan_cfg_soc_ctx
669 *
670 * Return: Batch threshold
671 */
672int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
673
674/*
675 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
676 * @wlan_cfg_soc_ctx
677 *
678 * Return: Timer threshold
679 */
680int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
Pamidipati, Vijaybea353e2017-07-05 03:09:20 +0530681
682/*
chenguo8d0c2192017-12-01 19:35:53 +0800683 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
684 * @wlan_cfg_soc_ctx
685 *
686 * Return: Checksum offload enable or disable
687 */
688int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
689
690/*
Pamidipati, Vijaybea353e2017-07-05 03:09:20 +0530691 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
692 * @wlan_cfg_soc_ctx
693 *
694 * Return: Tx Ring Size
695 */
696int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
697
698/*
699 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
700 * @wlan_cfg_soc_ctx
701 *
702 * Return: Tx Completion ring size
703 */
704int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
Manjunathappa Prakashced7ea62017-07-02 03:02:15 -0700705#ifdef QCA_LL_TX_FLOW_CONTROL_V2
706int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
707
708int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
709#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
psimhafc2f91b2018-01-10 15:30:03 -0800710int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
711
712int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
Vijay Pamidipatid41d6d62016-10-19 21:19:00 +0530713#endif