xref: /wlan-dirver/qca-wifi-host-cmn/hif/inc/cfg_hif.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /**
2  * Copyright (c) 2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef _CFG_HIF_H_
21 #define _CFG_HIF_H_
22 
23 /* Min/Max/default CE status srng timer threshold */
24 #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN 0
25 #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX 4096
26 #ifdef WLAN_WAR_CE_DISABLE_SRNG_TIMER_IRQ
27 #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 0
28 #else
29 #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 4096
30 #endif
31 
32 /* Min/Max/default CE status srng batch count threshold */
33 #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN 0
34 #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX 512
35 #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT 1
36 
37 #ifdef WLAN_CE_INTERRUPT_THRESHOLD_CONFIG
38 /**
39  * <ini>
40  * ce_status_ring_timer_thresh - ce status srng timer threshold
41  * @Min: 0
42  * @Max: 4096
43  * @Default: 0
44  *
45  * This ini specifies the timer threshold for CE status srng to
46  * indicate the interrupt to be fired whenever the timer threshold
47  * runs out.
48  *
49  * Supported Feature: interrupt threshold for CE status srng
50  *
51  * Usage: Internal
52  *
53  * </ini>
54  */
55 #define CFG_CE_STATUS_RING_TIMER_THRESHOLD \
56 	CFG_INI_UINT("ce_status_ring_timer_threshold", \
57 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN, \
58 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX, \
59 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT, \
60 		     CFG_VALUE_OR_DEFAULT, \
61 		     "CE Status ring timer threshold")
62 
63 /**
64  * <ini>
65  * ce_status_ring_batch_count_thresh - ce status srng batch count threshold
66  * @Min: 0
67  * @Max: 512
68  * @Default: 1
69  *
70  * This ini specifies the batch count threshold for CE status srng to
71  * indicate the interrupt to be fired for a given number of packets in
72  * the ring.
73  *
74  * Supported Feature: interrupt threshold for CE status srng
75  *
76  * Usage: Internal
77  *
78  * </ini>
79  */
80 #define CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD \
81 	CFG_INI_UINT("ce_status_ring_batch_count_threshold", \
82 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN, \
83 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX, \
84 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT, \
85 		     CFG_VALUE_OR_DEFAULT, \
86 		     "CE Status ring batch count threshold")
87 
88 #define CFG_HIF \
89 	CFG(CFG_CE_STATUS_RING_TIMER_THRESHOLD) \
90 	CFG(CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD)
91 #else
92 #define CFG_HIF
93 #endif /* WLAN_CE_INTERRUPT_THRESHOLD_CONFIG */
94 #endif /* _CFG_HIF_H_ */
95