xref: /wlan-driver/qca-wifi-host-cmn/hif/inc/cfg_hif.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #ifndef _CFG_HIF_H_
21*5113495bSYour Name #define _CFG_HIF_H_
22*5113495bSYour Name 
23*5113495bSYour Name /* Min/Max/default CE status srng timer threshold */
24*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN 0
25*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX 4096
26*5113495bSYour Name #ifdef WLAN_WAR_CE_DISABLE_SRNG_TIMER_IRQ
27*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 0
28*5113495bSYour Name #else
29*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 4096
30*5113495bSYour Name #endif
31*5113495bSYour Name 
32*5113495bSYour Name /* Min/Max/default CE status srng batch count threshold */
33*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN 0
34*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX 512
35*5113495bSYour Name #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT 1
36*5113495bSYour Name 
37*5113495bSYour Name #ifdef WLAN_CE_INTERRUPT_THRESHOLD_CONFIG
38*5113495bSYour Name /*
39*5113495bSYour Name  * <ini>
40*5113495bSYour Name  * ce_status_ring_timer_thresh - ce status srng timer threshold
41*5113495bSYour Name  * @Min: 0
42*5113495bSYour Name  * @Max: 4096
43*5113495bSYour Name  * @Default: 0
44*5113495bSYour Name  *
45*5113495bSYour Name  * This ini specifies the timer threshold for CE status srng to
46*5113495bSYour Name  * indicate the interrupt to be fired whenever the timer threshold
47*5113495bSYour Name  * runs out.
48*5113495bSYour Name  *
49*5113495bSYour Name  * Supported Feature: interrupt threshold for CE status srng
50*5113495bSYour Name  *
51*5113495bSYour Name  * Usage: Internal
52*5113495bSYour Name  *
53*5113495bSYour Name  * </ini>
54*5113495bSYour Name  */
55*5113495bSYour Name #define CFG_CE_STATUS_RING_TIMER_THRESHOLD \
56*5113495bSYour Name 	CFG_INI_UINT("ce_status_ring_timer_threshold", \
57*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN, \
58*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX, \
59*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT, \
60*5113495bSYour Name 		     CFG_VALUE_OR_DEFAULT, \
61*5113495bSYour Name 		     "CE Status ring timer threshold")
62*5113495bSYour Name 
63*5113495bSYour Name #define CFG_RING_TIMER_THRESHOLD CFG(CFG_CE_STATUS_RING_TIMER_THRESHOLD)
64*5113495bSYour Name 
65*5113495bSYour Name /*
66*5113495bSYour Name  * <ini>
67*5113495bSYour Name  * ce_status_ring_batch_count_thresh - ce status srng batch count threshold
68*5113495bSYour Name  * @Min: 0
69*5113495bSYour Name  * @Max: 512
70*5113495bSYour Name  * @Default: 1
71*5113495bSYour Name  *
72*5113495bSYour Name  * This ini specifies the batch count threshold for CE status srng to
73*5113495bSYour Name  * indicate the interrupt to be fired for a given number of packets in
74*5113495bSYour Name  * the ring.
75*5113495bSYour Name  *
76*5113495bSYour Name  * Supported Feature: interrupt threshold for CE status srng
77*5113495bSYour Name  *
78*5113495bSYour Name  * Usage: Internal
79*5113495bSYour Name  *
80*5113495bSYour Name  * </ini>
81*5113495bSYour Name  */
82*5113495bSYour Name #define CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD \
83*5113495bSYour Name 	CFG_INI_UINT("ce_status_ring_batch_count_threshold", \
84*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN, \
85*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX, \
86*5113495bSYour Name 		     WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT, \
87*5113495bSYour Name 		     CFG_VALUE_OR_DEFAULT, \
88*5113495bSYour Name 		     "CE Status ring batch count threshold")
89*5113495bSYour Name 
90*5113495bSYour Name #define CFG_BATCH_COUNT_THRESHOLD CFG(CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD)
91*5113495bSYour Name 
92*5113495bSYour Name #else
93*5113495bSYour Name #define CFG_RING_TIMER_THRESHOLD
94*5113495bSYour Name #define CFG_BATCH_COUNT_THRESHOLD
95*5113495bSYour Name #endif /* WLAN_CE_INTERRUPT_THRESHOLD_CONFIG */
96*5113495bSYour Name 
97*5113495bSYour Name /*
98*5113495bSYour Name  * <ini>
99*5113495bSYour Name  * gDisableWakeIrq - Disable wake IRQ or not
100*5113495bSYour Name  * @Min: 0
101*5113495bSYour Name  * @Max: 1
102*5113495bSYour Name  * @Default: 0
103*5113495bSYour Name  *
104*5113495bSYour Name  * This ini controls driver to disable wake IRQ or not.
105*5113495bSYour Name  * Disable wake IRQ for one MSI mode.
106*5113495bSYour Name  * If you want to support wake IRQ. Please allocate at least
107*5113495bSYour Name  * 2 MSI vector. The first is for wake IRQ while the others
108*5113495bSYour Name  * share the second vector.
109*5113495bSYour Name  *
110*5113495bSYour Name  * Related: None.
111*5113495bSYour Name  *
112*5113495bSYour Name  * Supported Feature: wake IRQ
113*5113495bSYour Name  *
114*5113495bSYour Name  * Usage: Internal/External
115*5113495bSYour Name  *
116*5113495bSYour Name  * </ini>
117*5113495bSYour Name  */
118*5113495bSYour Name #define CFG_DISABLE_WAKE_IRQ CFG_INI_BOOL( \
119*5113495bSYour Name 	"gDisableWakeIrq", \
120*5113495bSYour Name 	0, \
121*5113495bSYour Name 	"Disable wake IRQ")
122*5113495bSYour Name 
123*5113495bSYour Name /*
124*5113495bSYour Name  * <ini>
125*5113495bSYour Name  * irq_affine_audio_use_case - IRQ affinity for audio use case supported
126*5113495bSYour Name  * @Min: 0
127*5113495bSYour Name  * @Max: 1
128*5113495bSYour Name  * @Default: 0
129*5113495bSYour Name  *
130*5113495bSYour Name  * This ini controls driver to enable IRQ affinity for Pro audio use case.
131*5113495bSYour Name  *
132*5113495bSYour Name  * Related: None.
133*5113495bSYour Name  *
134*5113495bSYour Name  * Supported Feature: IRQ Affinity
135*5113495bSYour Name  *
136*5113495bSYour Name  * Usage: External
137*5113495bSYour Name  *
138*5113495bSYour Name  * </ini>
139*5113495bSYour Name  */
140*5113495bSYour Name #define CFG_IRQ_AFFINE_AUDIO_USE_CASE CFG_INI_BOOL( \
141*5113495bSYour Name 	"irq_affine_audio_use_case", \
142*5113495bSYour Name 	0, \
143*5113495bSYour Name 	"Enable IRQ affinity for audio use case")
144*5113495bSYour Name 
145*5113495bSYour Name #define CFG_HIF \
146*5113495bSYour Name 	CFG_RING_TIMER_THRESHOLD \
147*5113495bSYour Name 	CFG_BATCH_COUNT_THRESHOLD \
148*5113495bSYour Name 	CFG(CFG_DISABLE_WAKE_IRQ) \
149*5113495bSYour Name 	CFG(CFG_IRQ_AFFINE_AUDIO_USE_CASE)
150*5113495bSYour Name 
151*5113495bSYour Name #endif /* _CFG_HIF_H_ */
152