xref: /wlan-driver/qcacld-3.0/core/mac/inc/wlan_tgt_def_config.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2011, 2014-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  *
6  * Permission to use, copy, modify, and/or distribute this software for
7  * any purpose with or without fee is hereby granted, provided that the
8  * above copyright notice and this permission notice appear in all
9  * copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
12  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
14  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
17  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18  * PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #ifndef __WLAN_TGT_DEF_CONFIG_H__
22 #define __WLAN_TGT_DEF_CONFIG_H__
23 
24 /*
25  * set of default target config , that can be over written by platform
26  */
27 
28 /*
29  * default limit of 8 VAPs per device.
30  */
31 /* Rome PRD support 4 vdevs */
32 #define CFG_TGT_NUM_VDEV                4
33 
34 /*
35  * We would need 1 AST entry per peer. Scale it by a
36  * factor of 2 to minimize hash collisions.
37  * TODO: This scaling factor would be taken care inside the WAL in the future.
38  */
39 #define CFG_TGT_NUM_PEER_AST            2
40 
41 /* # of WDS entries to support.
42  */
43 #define CFG_TGT_WDS_ENTRIES             0
44 
45 /* MAC DMA burst size. 0: 128B - default, 1: 256B, 2: 64B
46  */
47 #define CFG_TGT_DEFAULT_DMA_BURST_SIZE   0
48 
49 /* Fixed delimiters to be inserted after every MPDU
50  */
51 #define CFG_TGT_DEFAULT_MAC_AGGR_DELIM   0
52 
53 /*
54  * This value may need to be fine tuned, but a constant value will
55  * probably always be appropriate; it is probably not necessary to
56  * determine this value dynamically.
57  */
58 #define CFG_TGT_AST_SKID_LIMIT          16
59 
60 /*
61  * total number of peers per device.
62  */
63 #define CFG_TGT_NUM_PEERS               14
64 
65 /*
66  * In offload mode target supports features like WOW, chatter and other
67  * protocol offloads. In order to support them some functionalities like
68  * reorder buffering, PN checking need to be done in target. This determines
69  * maximum number of peers supported by target in offload mode
70  */
71 
72 /*
73  * The current firmware implementation requires the number of offload peers
74  * should be (number of vdevs + 1).
75 
76  * The reason for this is the firmware clubbed the self peer and offload peer
77  * in the same pool. So if the firmware wanted to support n vdevs then the
78  * number of offload peer must be n+1 of which n buffers will be used for
79  * self peer and the remaining 1 is used for offload peer to support chatter
80  * mode for single STA.
81 
82  * Technically the macro should be 1 however the current firmware requires n+1.
83 
84  * TODO: This MACRO need to be modified in the future, if the firmware modified
85  * to allocate buffers for self peer and offload peer independently.
86  */
87 
88 #define CFG_TGT_NUM_OFFLOAD_PEERS       (CFG_TGT_NUM_VDEV + 1)
89 
90 /*
91  * Number of reorder buffers used in offload mode
92  */
93 #define CFG_TGT_NUM_OFFLOAD_REORDER_BUFFS   4
94 
95 /*
96  * keys per peer node
97  */
98 #define CFG_TGT_NUM_PEER_KEYS           2
99 /*
100  * total number of data TX and RX TIDs
101  */
102 #define CFG_TGT_NUM_TIDS       (2 * (CFG_TGT_NUM_PEERS + CFG_TGT_NUM_VDEV + 2))
103 /*
104  * set this to 0x7 (Peregrine = 3 chains).
105  * need to be set dynamically based on the HW capability.
106  */
107 #define CFG_TGT_DEFAULT_TX_CHAIN_MASK   0x7
108 /*
109  * set this to 0x7 (Peregrine = 3 chains).
110  * need to be set dynamically based on the HW capability.
111  */
112 #define CFG_TGT_DEFAULT_RX_CHAIN_MASK   0x7
113 /* 100 ms for video, best-effort, and background */
114 #define CFG_TGT_RX_TIMEOUT_LO_PRI       100
115 /* 40 ms for voice*/
116 #define CFG_TGT_RX_TIMEOUT_HI_PRI       40
117 
118 /* AR9888 unified is default in ethernet mode */
119 #define CFG_TGT_RX_DECAP_MODE (0x2)
120 /* Decap to native Wifi header */
121 #define CFG_TGT_RX_DECAP_MODE_NWIFI (0x1)
122 /* Decap to raw mode header */
123 #define CFG_TGT_RX_DECAP_MODE_RAW   (0x0)
124 
125 /* maximum number of pending scan requests */
126 #define CFG_TGT_DEFAULT_SCAN_MAX_REQS   0x4
127 
128 /* maximum number of VDEV that could use BMISS offload */
129 #ifndef CFG_TGT_DEFAULT_BMISS_OFFLOAD_MAX_VDEV
130 #define CFG_TGT_DEFAULT_BMISS_OFFLOAD_MAX_VDEV   0x3
131 #endif
132 
133 /* maximum number of VDEV offload Roaming to support */
134 #ifndef CFG_TGT_DEFAULT_ROAM_OFFLOAD_MAX_VDEV
135 #define CFG_TGT_DEFAULT_ROAM_OFFLOAD_MAX_VDEV   0x3
136 #endif
137 
138 /* maximum number of STA VDEVs */
139 #ifndef CFG_TGT_DEFAULT_MAX_STA_VDEVS
140 #define CFG_TGT_DEFAULT_MAX_STA_VDEVS 0
141 #endif
142 
143 /* maximum number of AP profiles pushed to offload Roaming */
144 #define CFG_TGT_DEFAULT_ROAM_OFFLOAD_MAX_PROFILES   0x8
145 
146 /* maximum number of VDEV offload GTK to support */
147 #ifndef CFG_TGT_DEFAULT_GTK_OFFLOAD_MAX_VDEV
148 #define CFG_TGT_DEFAULT_GTK_OFFLOAD_MAX_VDEV   0x3
149 #endif
150 
151 /* default: mcast->ucast disabled if ATH_SUPPORT_MCAST2UCAST not defined */
152 #ifndef ATH_SUPPORT_MCAST2UCAST
153 #define CFG_TGT_DEFAULT_NUM_MCAST_GROUPS 0
154 #define CFG_TGT_DEFAULT_NUM_MCAST_TABLE_ELEMS 0
155 #define CFG_TGT_DEFAULT_MCAST2UCAST_MODE 0      /* disabled */
156 #else
157 /* (for testing) small multicast group membership table enabled */
158 #define CFG_TGT_DEFAULT_NUM_MCAST_GROUPS 4
159 #define CFG_TGT_DEFAULT_NUM_MCAST_TABLE_ELEMS 16
160 #define CFG_TGT_DEFAULT_MCAST2UCAST_MODE 2
161 #endif
162 
163 #define CFG_TGT_MAX_MULTICAST_FILTER_ENTRIES 32
164 /*
165  * Specify how much memory the target should allocate for a debug log of
166  * tx PPDU meta-information (how large the PPDU was, when it was sent,
167  * whether it was successful, etc.)
168  * The size of the log records is configurable, from a minimum of 28 bytes
169  * to a maximum of about 300 bytes.  A typical configuration would result
170  * in each log record being about 124 bytes.
171  * Thus, 1KB of log space can hold about 30 small records, 3 large records,
172  * or about 8 typical-sized records.
173  */
174 #define CFG_TGT_DEFAULT_TX_DBG_LOG_SIZE 1024    /* bytes */
175 
176 /* target based fragment timeout and MPDU duplicate detection */
177 #define CFG_TGT_DEFAULT_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 0
178 
179 /*  Default VoW configuration
180  */
181 #define CFG_TGT_DEFAULT_VOW_CONFIG   0
182 
183 /*
184  * total number of descriptors to use in the target
185  */
186 #ifndef CFG_TGT_NUM_MSDU_DESC
187 #define CFG_TGT_NUM_MSDU_DESC    (1024 + 32)
188 #endif
189 
190 /*
191  * Maximum number of frag table entries
192  */
193 #define CFG_TGT_MAX_FRAG_TABLE_ENTRIES 10
194 
195 /*
196  * Maximum number of VDEV that beacon tx offload will support
197  */
198 #ifndef CFG_TGT_DEFAULT_BEACON_TX_OFFLOAD_MAX_VDEV
199 #define CFG_TGT_DEFAULT_BEACON_TX_OFFLOAD_MAX_VDEV 3
200 #endif
201 
202 /*
203  * number of vdevs that can support tdls
204  */
205 #define CFG_TGT_NUM_TDLS_VDEVS    1
206 
207 /*
208  * number of peers that each Tdls vdev can track
209  */
210 #ifndef CFG_TGT_NUM_TDLS_CONN_TABLE_ENTRIES
211 #define CFG_TGT_NUM_TDLS_CONN_TABLE_ENTRIES   8
212 #endif
213 
214 /*
215  * number of TDLS concurrent sleep STAs
216  */
217 #define CFG_TGT_NUM_TDLS_CONC_SLEEP_STAS    1
218 
219 /*
220  * number of TDLS concurrent buffer STAs
221  */
222 #define CFG_TGT_NUM_TDLS_CONC_BUFFER_STAS    1
223 
224 /*
225  * ht enable highest MCS by default
226  */
227 #define CFG_TGT_DEFAULT_GTX_HT_MASK             0x8080
228 /*
229  * vht enable highest MCS by default
230  */
231 #define CFG_TGT_DEFAULT_GTX_VHT_MASK            0x80200
232 /*
233  * threshold to enable GTX
234  */
235 #define CFG_TGT_DEFAULT_GTX_PER_THRESHOLD       3
236 /*
237  * margin to move back when per > margin + threshold
238  */
239 #define CFG_TGT_DEFAULT_GTX_PER_MARGIN          2
240 /*
241  * step for every move
242  */
243 #define CFG_TGT_DEFAULT_GTX_TPC_STEP            1
244 /*
245  * lowest TPC
246  */
247 #define CFG_TGT_DEFAULT_GTX_TPC_MIN             0
248 /*
249  * enable all BW 20/40/80/160
250  */
251 #define CFG_TGT_DEFAULT_GTX_BW_MASK             0xf
252 
253 /*
254  * number of vdevs that can support OCB
255  */
256 #define CFG_TGT_NUM_OCB_VDEVS			1
257 
258 /*
259  * maximum number of channels that can do OCB
260  */
261 #define CFG_TGT_NUM_OCB_CHANNELS		2
262 
263 /*
264  * maximum number of channels in an OCB schedule
265  */
266 #define CFG_TGT_NUM_OCB_SCHEDULES		2
267 
268 /*
269  * Default TWT AP STA Count
270  */
271 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_SAP_STA_COUNT)
272 #define CFG_TGT_DEFAULT_TWT_AP_STA_COUNT	WLAN_TWT_SAP_STA_COUNT
273 #else
274 #define CFG_TGT_DEFAULT_TWT_AP_STA_COUNT	0
275 #endif /* WLAN_SUPPORT_TWT && WLAN_TWT_SAP_STA_COUNT */
276 
277 #endif /*__WLAN_TGT_DEF_CONFIG_H__ */
278