xref: /openbmc/linux/drivers/net/wireless/ti/wlcore/conf.h (revision 95e9fd10)
1 /*
2  * This file is part of wl1271
3  *
4  * Copyright (C) 2009 Nokia Corporation
5  *
6  * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * version 2 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  */
23 
24 #ifndef __CONF_H__
25 #define __CONF_H__
26 
27 enum {
28 	CONF_HW_BIT_RATE_1MBPS   = BIT(0),
29 	CONF_HW_BIT_RATE_2MBPS   = BIT(1),
30 	CONF_HW_BIT_RATE_5_5MBPS = BIT(2),
31 	CONF_HW_BIT_RATE_6MBPS   = BIT(3),
32 	CONF_HW_BIT_RATE_9MBPS   = BIT(4),
33 	CONF_HW_BIT_RATE_11MBPS  = BIT(5),
34 	CONF_HW_BIT_RATE_12MBPS  = BIT(6),
35 	CONF_HW_BIT_RATE_18MBPS  = BIT(7),
36 	CONF_HW_BIT_RATE_22MBPS  = BIT(8),
37 	CONF_HW_BIT_RATE_24MBPS  = BIT(9),
38 	CONF_HW_BIT_RATE_36MBPS  = BIT(10),
39 	CONF_HW_BIT_RATE_48MBPS  = BIT(11),
40 	CONF_HW_BIT_RATE_54MBPS  = BIT(12),
41 	CONF_HW_BIT_RATE_MCS_0   = BIT(13),
42 	CONF_HW_BIT_RATE_MCS_1   = BIT(14),
43 	CONF_HW_BIT_RATE_MCS_2   = BIT(15),
44 	CONF_HW_BIT_RATE_MCS_3   = BIT(16),
45 	CONF_HW_BIT_RATE_MCS_4   = BIT(17),
46 	CONF_HW_BIT_RATE_MCS_5   = BIT(18),
47 	CONF_HW_BIT_RATE_MCS_6   = BIT(19),
48 	CONF_HW_BIT_RATE_MCS_7   = BIT(20),
49 	CONF_HW_BIT_RATE_MCS_8   = BIT(21),
50 	CONF_HW_BIT_RATE_MCS_9   = BIT(22),
51 	CONF_HW_BIT_RATE_MCS_10  = BIT(23),
52 	CONF_HW_BIT_RATE_MCS_11  = BIT(24),
53 	CONF_HW_BIT_RATE_MCS_12  = BIT(25),
54 	CONF_HW_BIT_RATE_MCS_13  = BIT(26),
55 	CONF_HW_BIT_RATE_MCS_14  = BIT(27),
56 	CONF_HW_BIT_RATE_MCS_15  = BIT(28),
57 };
58 
59 enum {
60 	CONF_HW_RATE_INDEX_1MBPS   = 0,
61 	CONF_HW_RATE_INDEX_2MBPS   = 1,
62 	CONF_HW_RATE_INDEX_5_5MBPS = 2,
63 	CONF_HW_RATE_INDEX_6MBPS   = 3,
64 	CONF_HW_RATE_INDEX_9MBPS   = 4,
65 	CONF_HW_RATE_INDEX_11MBPS  = 5,
66 	CONF_HW_RATE_INDEX_12MBPS  = 6,
67 	CONF_HW_RATE_INDEX_18MBPS  = 7,
68 	CONF_HW_RATE_INDEX_22MBPS  = 8,
69 	CONF_HW_RATE_INDEX_24MBPS  = 9,
70 	CONF_HW_RATE_INDEX_36MBPS  = 10,
71 	CONF_HW_RATE_INDEX_48MBPS  = 11,
72 	CONF_HW_RATE_INDEX_54MBPS  = 12,
73 	CONF_HW_RATE_INDEX_MAX     = CONF_HW_RATE_INDEX_54MBPS,
74 };
75 
76 #define CONF_HW_RXTX_RATE_UNSUPPORTED 0xff
77 
78 enum {
79 	CONF_SG_DISABLE = 0,
80 	CONF_SG_PROTECTIVE,
81 	CONF_SG_OPPORTUNISTIC
82 };
83 
84 enum {
85 	/*
86 	 * Configure the min and max time BT gains the antenna
87 	 * in WLAN / BT master basic rate
88 	 *
89 	 * Range: 0 - 255 (ms)
90 	 */
91 	CONF_SG_ACL_BT_MASTER_MIN_BR = 0,
92 	CONF_SG_ACL_BT_MASTER_MAX_BR,
93 
94 	/*
95 	 * Configure the min and max time BT gains the antenna
96 	 * in WLAN / BT slave basic rate
97 	 *
98 	 * Range: 0 - 255 (ms)
99 	 */
100 	CONF_SG_ACL_BT_SLAVE_MIN_BR,
101 	CONF_SG_ACL_BT_SLAVE_MAX_BR,
102 
103 	/*
104 	 * Configure the min and max time BT gains the antenna
105 	 * in WLAN / BT master EDR
106 	 *
107 	 * Range: 0 - 255 (ms)
108 	 */
109 	CONF_SG_ACL_BT_MASTER_MIN_EDR,
110 	CONF_SG_ACL_BT_MASTER_MAX_EDR,
111 
112 	/*
113 	 * Configure the min and max time BT gains the antenna
114 	 * in WLAN / BT slave EDR
115 	 *
116 	 * Range: 0 - 255 (ms)
117 	 */
118 	CONF_SG_ACL_BT_SLAVE_MIN_EDR,
119 	CONF_SG_ACL_BT_SLAVE_MAX_EDR,
120 
121 	/*
122 	 * The maximum time WLAN can gain the antenna
123 	 * in WLAN PSM / BT master/slave BR
124 	 *
125 	 * Range: 0 - 255 (ms)
126 	 */
127 	CONF_SG_ACL_WLAN_PS_MASTER_BR,
128 	CONF_SG_ACL_WLAN_PS_SLAVE_BR,
129 
130 	/*
131 	 * The maximum time WLAN can gain the antenna
132 	 * in WLAN PSM / BT master/slave EDR
133 	 *
134 	 * Range: 0 - 255 (ms)
135 	 */
136 	CONF_SG_ACL_WLAN_PS_MASTER_EDR,
137 	CONF_SG_ACL_WLAN_PS_SLAVE_EDR,
138 
139 	/* TODO: explain these values */
140 	CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR,
141 	CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR,
142 	CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR,
143 	CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR,
144 	CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR,
145 	CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR,
146 	CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR,
147 	CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR,
148 
149 	CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR,
150 	CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR,
151 	CONF_SG_ACL_PASSIVE_SCAN_BT_BR,
152 	CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR,
153 	CONF_SG_ACL_PASSIVE_SCAN_BT_EDR,
154 	CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR,
155 
156 	/*
157 	 * Compensation percentage of probe requests when scan initiated
158 	 * during BT voice/ACL link.
159 	 *
160 	 * Range: 0 - 255 (%)
161 	 */
162 	CONF_SG_AUTO_SCAN_PROBE_REQ,
163 
164 	/*
165 	 * Compensation percentage of probe requests when active scan initiated
166 	 * during BT voice
167 	 *
168 	 * Range: 0 - 255 (%)
169 	 */
170 	CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,
171 
172 	/*
173 	 * Compensation percentage of WLAN active scan window if initiated
174 	 * during BT A2DP
175 	 *
176 	 * Range: 0 - 1000 (%)
177 	 */
178 	CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP,
179 
180 	/*
181 	 * Compensation percentage of WLAN passive scan window if initiated
182 	 * during BT A2DP BR
183 	 *
184 	 * Range: 0 - 1000 (%)
185 	 */
186 	CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR,
187 
188 	/*
189 	 * Compensation percentage of WLAN passive scan window if initiated
190 	 * during BT A2DP EDR
191 	 *
192 	 * Range: 0 - 1000 (%)
193 	 */
194 	CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR,
195 
196 	/*
197 	 * Compensation percentage of WLAN passive scan window if initiated
198 	 * during BT voice
199 	 *
200 	 * Range: 0 - 1000 (%)
201 	 */
202 	CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,
203 
204 	/* TODO: explain these values */
205 	CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN,
206 	CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN,
207 	CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN,
208 
209 	/*
210 	 * Defines whether the SG will force WLAN host to enter/exit PSM
211 	 *
212 	 * Range: 1 - SG can force, 0 - host handles PSM
213 	 */
214 	CONF_SG_STA_FORCE_PS_IN_BT_SCO,
215 
216 	/*
217 	 * Defines antenna configuration (single/dual antenna)
218 	 *
219 	 * Range: 0 - single antenna, 1 - dual antenna
220 	 */
221 	CONF_SG_ANTENNA_CONFIGURATION,
222 
223 	/*
224 	 * The threshold (percent) of max consecutive beacon misses before
225 	 * increasing priority of beacon reception.
226 	 *
227 	 * Range: 0 - 100 (%)
228 	 */
229 	CONF_SG_BEACON_MISS_PERCENT,
230 
231 	/*
232 	 * Protection time of the DHCP procedure.
233 	 *
234 	 * Range: 0 - 100000 (ms)
235 	 */
236 	CONF_SG_DHCP_TIME,
237 
238 	/*
239 	 * RX guard time before the beginning of a new BT voice frame during
240 	 * which no new WLAN trigger frame is transmitted.
241 	 *
242 	 * Range: 0 - 100000 (us)
243 	 */
244 	CONF_SG_RXT,
245 
246 	/*
247 	 * TX guard time before the beginning of a new BT voice frame during
248 	 * which no new WLAN frame is transmitted.
249 	 *
250 	 * Range: 0 - 100000 (us)
251 	 */
252 
253 	CONF_SG_TXT,
254 
255 	/*
256 	 * Enable adaptive RXT/TXT algorithm. If disabled, the host values
257 	 * will be utilized.
258 	 *
259 	 * Range: 0 - disable, 1 - enable
260 	 */
261 	CONF_SG_ADAPTIVE_RXT_TXT,
262 
263 	/* TODO: explain this value */
264 	CONF_SG_GENERAL_USAGE_BIT_MAP,
265 
266 	/*
267 	 * Number of consecutive BT voice frames not interrupted by WLAN
268 	 *
269 	 * Range: 0 - 100
270 	 */
271 	CONF_SG_HV3_MAX_SERVED,
272 
273 	/*
274 	 * The used WLAN legacy service period during active BT ACL link
275 	 *
276 	 * Range: 0 - 255 (ms)
277 	 */
278 	CONF_SG_PS_POLL_TIMEOUT,
279 
280 	/*
281 	 * The used WLAN UPSD service period during active BT ACL link
282 	 *
283 	 * Range: 0 - 255 (ms)
284 	 */
285 	CONF_SG_UPSD_TIMEOUT,
286 
287 	CONF_SG_CONSECUTIVE_CTS_THRESHOLD,
288 	CONF_SG_STA_RX_WINDOW_AFTER_DTIM,
289 	CONF_SG_STA_CONNECTION_PROTECTION_TIME,
290 
291 	/* AP params */
292 	CONF_AP_BEACON_MISS_TX,
293 	CONF_AP_RX_WINDOW_AFTER_BEACON,
294 	CONF_AP_BEACON_WINDOW_INTERVAL,
295 	CONF_AP_CONNECTION_PROTECTION_TIME,
296 	CONF_AP_BT_ACL_VAL_BT_SERVE_TIME,
297 	CONF_AP_BT_ACL_VAL_WL_SERVE_TIME,
298 
299 	/* CTS Diluting params */
300 	CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH,
301 	CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER,
302 
303 	CONF_SG_TEMP_PARAM_1,
304 	CONF_SG_TEMP_PARAM_2,
305 	CONF_SG_TEMP_PARAM_3,
306 	CONF_SG_TEMP_PARAM_4,
307 	CONF_SG_TEMP_PARAM_5,
308 	CONF_SG_TEMP_PARAM_6,
309 	CONF_SG_TEMP_PARAM_7,
310 	CONF_SG_TEMP_PARAM_8,
311 	CONF_SG_TEMP_PARAM_9,
312 	CONF_SG_TEMP_PARAM_10,
313 
314 	CONF_SG_PARAMS_MAX,
315 	CONF_SG_PARAMS_ALL = 0xff
316 };
317 
318 struct conf_sg_settings {
319 	u32 params[CONF_SG_PARAMS_MAX];
320 	u8 state;
321 } __packed;
322 
323 enum conf_rx_queue_type {
324 	CONF_RX_QUEUE_TYPE_LOW_PRIORITY,  /* All except the high priority */
325 	CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
326 };
327 
328 struct conf_rx_settings {
329 	/*
330 	 * The maximum amount of time, in TU, before the
331 	 * firmware discards the MSDU.
332 	 *
333 	 * Range: 0 - 0xFFFFFFFF
334 	 */
335 	u32 rx_msdu_life_time;
336 
337 	/*
338 	 * Packet detection threshold in the PHY.
339 	 *
340 	 * FIXME: details unknown.
341 	 */
342 	u32 packet_detection_threshold;
343 
344 	/*
345 	 * The longest time the STA will wait to receive traffic from the AP
346 	 * after a PS-poll has been transmitted.
347 	 *
348 	 * Range: 0 - 200000
349 	 */
350 	u16 ps_poll_timeout;
351 	/*
352 	 * The longest time the STA will wait to receive traffic from the AP
353 	 * after a frame has been sent from an UPSD enabled queue.
354 	 *
355 	 * Range: 0 - 200000
356 	 */
357 	u16 upsd_timeout;
358 
359 	/*
360 	 * The number of octets in an MPDU, below which an RTS/CTS
361 	 * handshake is not performed.
362 	 *
363 	 * Range: 0 - 4096
364 	 */
365 	u16 rts_threshold;
366 
367 	/*
368 	 * The RX Clear Channel Assessment threshold in the PHY
369 	 * (the energy threshold).
370 	 *
371 	 * Range: ENABLE_ENERGY_D  == 0x140A
372 	 *        DISABLE_ENERGY_D == 0xFFEF
373 	 */
374 	u16 rx_cca_threshold;
375 
376 	/*
377 	 * Occupied Rx mem-blocks number which requires interrupting the host
378 	 * (0 = no buffering, 0xffff = disabled).
379 	 *
380 	 * Range: u16
381 	 */
382 	u16 irq_blk_threshold;
383 
384 	/*
385 	 * Rx packets number which requires interrupting the host
386 	 * (0 = no buffering).
387 	 *
388 	 * Range: u16
389 	 */
390 	u16 irq_pkt_threshold;
391 
392 	/*
393 	 * Max time in msec the FW may delay RX-Complete interrupt.
394 	 *
395 	 * Range: 1 - 100
396 	 */
397 	u16 irq_timeout;
398 
399 	/*
400 	 * The RX queue type.
401 	 *
402 	 * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
403 	 */
404 	u8 queue_type;
405 } __packed;
406 
407 #define CONF_TX_MAX_RATE_CLASSES       10
408 
409 #define CONF_TX_RATE_MASK_UNSPECIFIED  0
410 #define CONF_TX_RATE_MASK_BASIC        (CONF_HW_BIT_RATE_1MBPS | \
411 					CONF_HW_BIT_RATE_2MBPS)
412 #define CONF_TX_RATE_RETRY_LIMIT       10
413 
414 /* basic rates for p2p operations (probe req/resp, etc.) */
415 #define CONF_TX_RATE_MASK_BASIC_P2P    (CONF_HW_BIT_RATE_6MBPS | \
416 	CONF_HW_BIT_RATE_12MBPS | CONF_HW_BIT_RATE_24MBPS)
417 
418 /*
419  * Rates supported for data packets when operating as AP. Note the absence
420  * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
421  * one. The rate dropped is not mandatory under any operating mode.
422  */
423 #define CONF_TX_AP_ENABLED_RATES       (CONF_HW_BIT_RATE_1MBPS | \
424 	CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS |      \
425 	CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_9MBPS |        \
426 	CONF_HW_BIT_RATE_11MBPS | CONF_HW_BIT_RATE_12MBPS |      \
427 	CONF_HW_BIT_RATE_18MBPS | CONF_HW_BIT_RATE_24MBPS |      \
428 	CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS |      \
429 	CONF_HW_BIT_RATE_54MBPS)
430 
431 #define CONF_TX_CCK_RATES  (CONF_HW_BIT_RATE_1MBPS |		\
432 	CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS |	\
433 	CONF_HW_BIT_RATE_11MBPS)
434 
435 #define CONF_TX_OFDM_RATES (CONF_HW_BIT_RATE_6MBPS |             \
436 	CONF_HW_BIT_RATE_12MBPS | CONF_HW_BIT_RATE_24MBPS |      \
437 	CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS |      \
438 	CONF_HW_BIT_RATE_54MBPS)
439 
440 #define CONF_TX_MCS_RATES (CONF_HW_BIT_RATE_MCS_0 |              \
441 	CONF_HW_BIT_RATE_MCS_1 | CONF_HW_BIT_RATE_MCS_2 |        \
442 	CONF_HW_BIT_RATE_MCS_3 | CONF_HW_BIT_RATE_MCS_4 |        \
443 	CONF_HW_BIT_RATE_MCS_5 | CONF_HW_BIT_RATE_MCS_6 |        \
444 	CONF_HW_BIT_RATE_MCS_7)
445 
446 #define CONF_TX_MIMO_RATES (CONF_HW_BIT_RATE_MCS_8 |             \
447 	CONF_HW_BIT_RATE_MCS_9 | CONF_HW_BIT_RATE_MCS_10 |       \
448 	CONF_HW_BIT_RATE_MCS_11 | CONF_HW_BIT_RATE_MCS_12 |      \
449 	CONF_HW_BIT_RATE_MCS_13 | CONF_HW_BIT_RATE_MCS_14 |      \
450 	CONF_HW_BIT_RATE_MCS_15)
451 
452 /*
453  * Default rates for management traffic when operating in AP mode. This
454  * should be configured according to the basic rate set of the AP
455  */
456 #define CONF_TX_AP_DEFAULT_MGMT_RATES  (CONF_HW_BIT_RATE_1MBPS | \
457 	CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
458 
459 /* default rates for working as IBSS (11b and OFDM) */
460 #define CONF_TX_IBSS_DEFAULT_RATES  (CONF_HW_BIT_RATE_1MBPS |       \
461 		CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
462 		CONF_HW_BIT_RATE_11MBPS | CONF_TX_OFDM_RATES);
463 
464 struct conf_tx_rate_class {
465 
466 	/*
467 	 * The rates enabled for this rate class.
468 	 *
469 	 * Range: CONF_HW_BIT_RATE_* bit mask
470 	 */
471 	u32 enabled_rates;
472 
473 	/*
474 	 * The dot11 short retry limit used for TX retries.
475 	 *
476 	 * Range: u8
477 	 */
478 	u8 short_retry_limit;
479 
480 	/*
481 	 * The dot11 long retry limit used for TX retries.
482 	 *
483 	 * Range: u8
484 	 */
485 	u8 long_retry_limit;
486 
487 	/*
488 	 * Flags controlling the attributes of TX transmission.
489 	 *
490 	 * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
491 	 *               when the total valid per-rate attempts have
492 	 *               been exhausted; otherwise transmissions
493 	 *               will continue at the lowest available rate
494 	 *               until the appropriate one of the
495 	 *               short_retry_limit, long_retry_limit,
496 	 *               dot11_max_transmit_msdu_life_time, or
497 	 *               max_tx_life_time, is exhausted.
498 	 *            1: Preamble Override - indicates if the preamble type
499 	 *               should be used in TX.
500 	 *            2: Preamble Type - the type of the preamble to be used by
501 	 *               the policy (0 - long preamble, 1 - short preamble.
502 	 */
503 	u8 aflags;
504 } __packed;
505 
506 #define CONF_TX_MAX_AC_COUNT 4
507 
508 /* Slot number setting to start transmission at PIFS interval */
509 #define CONF_TX_AIFS_PIFS 1
510 /* Slot number setting to start transmission at DIFS interval normal
511  * DCF access */
512 #define CONF_TX_AIFS_DIFS 2
513 
514 
515 enum conf_tx_ac {
516 	CONF_TX_AC_BE = 0,         /* best effort / legacy */
517 	CONF_TX_AC_BK = 1,         /* background */
518 	CONF_TX_AC_VI = 2,         /* video */
519 	CONF_TX_AC_VO = 3,         /* voice */
520 	CONF_TX_AC_CTS2SELF = 4,   /* fictitious AC, follows AC_VO */
521 	CONF_TX_AC_ANY_TID = 0xff
522 };
523 
524 struct conf_tx_ac_category {
525 	/*
526 	 * The AC class identifier.
527 	 *
528 	 * Range: enum conf_tx_ac
529 	 */
530 	u8 ac;
531 
532 	/*
533 	 * The contention window minimum size (in slots) for the access
534 	 * class.
535 	 *
536 	 * Range: u8
537 	 */
538 	u8 cw_min;
539 
540 	/*
541 	 * The contention window maximum size (in slots) for the access
542 	 * class.
543 	 *
544 	 * Range: u8
545 	 */
546 	u16 cw_max;
547 
548 	/*
549 	 * The AIF value (in slots) for the access class.
550 	 *
551 	 * Range: u8
552 	 */
553 	u8 aifsn;
554 
555 	/*
556 	 * The TX Op Limit (in microseconds) for the access class.
557 	 *
558 	 * Range: u16
559 	 */
560 	u16 tx_op_limit;
561 } __packed;
562 
563 #define CONF_TX_MAX_TID_COUNT 8
564 
565 /* Allow TX BA on all TIDs but 6,7. These are currently reserved in the FW */
566 #define CONF_TX_BA_ENABLED_TID_BITMAP 0x3F
567 
568 enum {
569 	CONF_CHANNEL_TYPE_DCF = 0,   /* DC/LEGACY*/
570 	CONF_CHANNEL_TYPE_EDCF = 1,  /* EDCA*/
571 	CONF_CHANNEL_TYPE_HCCA = 2,  /* HCCA*/
572 };
573 
574 enum {
575 	CONF_PS_SCHEME_LEGACY = 0,
576 	CONF_PS_SCHEME_UPSD_TRIGGER = 1,
577 	CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
578 	CONF_PS_SCHEME_SAPSD = 3,
579 };
580 
581 enum {
582 	CONF_ACK_POLICY_LEGACY = 0,
583 	CONF_ACK_POLICY_NO_ACK = 1,
584 	CONF_ACK_POLICY_BLOCK = 2,
585 };
586 
587 
588 struct conf_tx_tid {
589 	u8 queue_id;
590 	u8 channel_type;
591 	u8 tsid;
592 	u8 ps_scheme;
593 	u8 ack_policy;
594 	u32 apsd_conf[2];
595 } __packed;
596 
597 struct conf_tx_settings {
598 	/*
599 	 * The TX ED value for TELEC Enable/Disable.
600 	 *
601 	 * Range: 0, 1
602 	 */
603 	u8 tx_energy_detection;
604 
605 	/*
606 	 * Configuration for rate classes for TX (currently only one
607 	 * rate class supported). Used in non-AP mode.
608 	 */
609 	struct conf_tx_rate_class sta_rc_conf;
610 
611 	/*
612 	 * Configuration for access categories for TX rate control.
613 	 */
614 	u8 ac_conf_count;
615 	struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
616 
617 	/*
618 	 * AP-mode - allow this number of TX retries to a station before an
619 	 * event is triggered from FW.
620 	 * In AP-mode the hlids of unreachable stations are given in the
621 	 * "sta_tx_retry_exceeded" member in the event mailbox.
622 	 */
623 	u8 max_tx_retries;
624 
625 	/*
626 	 * AP-mode - after this number of seconds a connected station is
627 	 * considered inactive.
628 	 */
629 	u16 ap_aging_period;
630 
631 	/*
632 	 * Configuration for TID parameters.
633 	 */
634 	u8 tid_conf_count;
635 	struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
636 
637 	/*
638 	 * The TX fragmentation threshold.
639 	 *
640 	 * Range: u16
641 	 */
642 	u16 frag_threshold;
643 
644 	/*
645 	 * Max time in msec the FW may delay frame TX-Complete interrupt.
646 	 *
647 	 * Range: u16
648 	 */
649 	u16 tx_compl_timeout;
650 
651 	/*
652 	 * Completed TX packet count which requires to issue the TX-Complete
653 	 * interrupt.
654 	 *
655 	 * Range: u16
656 	 */
657 	u16 tx_compl_threshold;
658 
659 	/*
660 	 * The rate used for control messages and scanning on the 2.4GHz band
661 	 *
662 	 * Range: CONF_HW_BIT_RATE_* bit mask
663 	 */
664 	u32 basic_rate;
665 
666 	/*
667 	 * The rate used for control messages and scanning on the 5GHz band
668 	 *
669 	 * Range: CONF_HW_BIT_RATE_* bit mask
670 	 */
671 	u32 basic_rate_5;
672 
673 	/*
674 	 * TX retry limits for templates
675 	 */
676 	u8 tmpl_short_retry_limit;
677 	u8 tmpl_long_retry_limit;
678 
679 	/* Time in ms for Tx watchdog timer to expire */
680 	u32 tx_watchdog_timeout;
681 } __packed;
682 
683 enum {
684 	CONF_WAKE_UP_EVENT_BEACON    = 0x01, /* Wake on every Beacon*/
685 	CONF_WAKE_UP_EVENT_DTIM      = 0x02, /* Wake on every DTIM*/
686 	CONF_WAKE_UP_EVENT_N_DTIM    = 0x04, /* Wake every Nth DTIM */
687 	CONF_WAKE_UP_EVENT_N_BEACONS = 0x08, /* Wake every Nth beacon */
688 	CONF_WAKE_UP_EVENT_BITS_MASK = 0x0F
689 };
690 
691 #define CONF_MAX_BCN_FILT_IE_COUNT 32
692 
693 #define CONF_BCN_RULE_PASS_ON_CHANGE         BIT(0)
694 #define CONF_BCN_RULE_PASS_ON_APPEARANCE     BIT(1)
695 
696 #define CONF_BCN_IE_OUI_LEN    3
697 #define CONF_BCN_IE_VER_LEN    2
698 
699 struct conf_bcn_filt_rule {
700 	/*
701 	 * IE number to which to associate a rule.
702 	 *
703 	 * Range: u8
704 	 */
705 	u8 ie;
706 
707 	/*
708 	 * Rule to associate with the specific ie.
709 	 *
710 	 * Range: CONF_BCN_RULE_PASS_ON_*
711 	 */
712 	u8 rule;
713 
714 	/*
715 	 * OUI for the vendor specifie IE (221)
716 	 */
717 	u8 oui[CONF_BCN_IE_OUI_LEN];
718 
719 	/*
720 	 * Type for the vendor specifie IE (221)
721 	 */
722 	u8 type;
723 
724 	/*
725 	 * Version for the vendor specifie IE (221)
726 	 */
727 	u8 version[CONF_BCN_IE_VER_LEN];
728 } __packed;
729 
730 #define CONF_MAX_RSSI_SNR_TRIGGERS 8
731 
732 enum {
733 	CONF_TRIG_METRIC_RSSI_BEACON = 0,
734 	CONF_TRIG_METRIC_RSSI_DATA,
735 	CONF_TRIG_METRIC_SNR_BEACON,
736 	CONF_TRIG_METRIC_SNR_DATA
737 };
738 
739 enum {
740 	CONF_TRIG_EVENT_TYPE_LEVEL = 0,
741 	CONF_TRIG_EVENT_TYPE_EDGE
742 };
743 
744 enum {
745 	CONF_TRIG_EVENT_DIR_LOW = 0,
746 	CONF_TRIG_EVENT_DIR_HIGH,
747 	CONF_TRIG_EVENT_DIR_BIDIR
748 };
749 
750 struct conf_sig_weights {
751 
752 	/*
753 	 * RSSI from beacons average weight.
754 	 *
755 	 * Range: u8
756 	 */
757 	u8 rssi_bcn_avg_weight;
758 
759 	/*
760 	 * RSSI from data average weight.
761 	 *
762 	 * Range: u8
763 	 */
764 	u8 rssi_pkt_avg_weight;
765 
766 	/*
767 	 * SNR from beacons average weight.
768 	 *
769 	 * Range: u8
770 	 */
771 	u8 snr_bcn_avg_weight;
772 
773 	/*
774 	 * SNR from data average weight.
775 	 *
776 	 * Range: u8
777 	 */
778 	u8 snr_pkt_avg_weight;
779 } __packed;
780 
781 enum conf_bcn_filt_mode {
782 	CONF_BCN_FILT_MODE_DISABLED = 0,
783 	CONF_BCN_FILT_MODE_ENABLED = 1
784 };
785 
786 enum conf_bet_mode {
787 	CONF_BET_MODE_DISABLE = 0,
788 	CONF_BET_MODE_ENABLE = 1,
789 };
790 
791 struct conf_conn_settings {
792 	/*
793 	 * Firmware wakeup conditions configuration. The host may set only
794 	 * one bit.
795 	 *
796 	 * Range: CONF_WAKE_UP_EVENT_*
797 	 */
798 	u8 wake_up_event;
799 
800 	/*
801 	 * Listen interval for beacons or Dtims.
802 	 *
803 	 * Range: 0 for beacon and Dtim wakeup
804 	 *        1-10 for x Dtims
805 	 *        1-255 for x beacons
806 	 */
807 	u8 listen_interval;
808 
809 	/*
810 	 * Firmware wakeup conditions during suspend
811 	 * Range: CONF_WAKE_UP_EVENT_*
812 	 */
813 	u8 suspend_wake_up_event;
814 
815 	/*
816 	 * Listen interval during suspend.
817 	 * Currently will be in DTIMs (1-10)
818 	 *
819 	 */
820 	u8 suspend_listen_interval;
821 
822 	/*
823 	 * Enable or disable the beacon filtering.
824 	 *
825 	 * Range: CONF_BCN_FILT_MODE_*
826 	 */
827 	u8 bcn_filt_mode;
828 
829 	/*
830 	 * Configure Beacon filter pass-thru rules.
831 	 */
832 	u8 bcn_filt_ie_count;
833 	struct conf_bcn_filt_rule bcn_filt_ie[CONF_MAX_BCN_FILT_IE_COUNT];
834 
835 	/*
836 	 * The number of consecutive beacons to lose, before the firmware
837 	 * becomes out of synch.
838 	 *
839 	 * Range: u32
840 	 */
841 	u32 synch_fail_thold;
842 
843 	/*
844 	 * After out-of-synch, the number of TU's to wait without a further
845 	 * received beacon (or probe response) before issuing the BSS_EVENT_LOSE
846 	 * event.
847 	 *
848 	 * Range: u32
849 	 */
850 	u32 bss_lose_timeout;
851 
852 	/*
853 	 * Beacon receive timeout.
854 	 *
855 	 * Range: u32
856 	 */
857 	u32 beacon_rx_timeout;
858 
859 	/*
860 	 * Broadcast receive timeout.
861 	 *
862 	 * Range: u32
863 	 */
864 	u32 broadcast_timeout;
865 
866 	/*
867 	 * Enable/disable reception of broadcast packets in power save mode
868 	 *
869 	 * Range: 1 - enable, 0 - disable
870 	 */
871 	u8 rx_broadcast_in_ps;
872 
873 	/*
874 	 * Consecutive PS Poll failures before sending event to driver
875 	 *
876 	 * Range: u8
877 	 */
878 	u8 ps_poll_threshold;
879 
880 	/*
881 	 * Configuration of signal average weights.
882 	 */
883 	struct conf_sig_weights sig_weights;
884 
885 	/*
886 	 * Specifies if beacon early termination procedure is enabled or
887 	 * disabled.
888 	 *
889 	 * Range: CONF_BET_MODE_*
890 	 */
891 	u8 bet_enable;
892 
893 	/*
894 	 * Specifies the maximum number of consecutive beacons that may be
895 	 * early terminated. After this number is reached at least one full
896 	 * beacon must be correctly received in FW before beacon ET
897 	 * resumes.
898 	 *
899 	 * Range 0 - 255
900 	 */
901 	u8 bet_max_consecutive;
902 
903 	/*
904 	 * Specifies the maximum number of times to try PSM entry if it fails
905 	 * (if sending the appropriate null-func message fails.)
906 	 *
907 	 * Range 0 - 255
908 	 */
909 	u8 psm_entry_retries;
910 
911 	/*
912 	 * Specifies the maximum number of times to try PSM exit if it fails
913 	 * (if sending the appropriate null-func message fails.)
914 	 *
915 	 * Range 0 - 255
916 	 */
917 	u8 psm_exit_retries;
918 
919 	/*
920 	 * Specifies the maximum number of times to try transmit the PSM entry
921 	 * null-func frame for each PSM entry attempt
922 	 *
923 	 * Range 0 - 255
924 	 */
925 	u8 psm_entry_nullfunc_retries;
926 
927 	/*
928 	 * Specifies the dynamic PS timeout in ms that will be used
929 	 * by the FW when in AUTO_PS mode
930 	 */
931 	u16 dynamic_ps_timeout;
932 
933 	/*
934 	 * Specifies whether dynamic PS should be disabled and PSM forced.
935 	 * This is required for certain WiFi certification tests.
936 	 */
937 	u8 forced_ps;
938 
939 	/*
940 	 *
941 	 * Specifies the interval of the connection keep-alive null-func
942 	 * frame in ms.
943 	 *
944 	 * Range: 1000 - 3600000
945 	 */
946 	u32 keep_alive_interval;
947 
948 	/*
949 	 * Maximum listen interval supported by the driver in units of beacons.
950 	 *
951 	 * Range: u16
952 	 */
953 	u8 max_listen_interval;
954 
955 	/*
956 	 * Default sleep authorization for a new STA interface. This determines
957 	 * whether we can go to ELP.
958 	 */
959 	u8 sta_sleep_auth;
960 } __packed;
961 
962 enum {
963 	CONF_REF_CLK_19_2_E,
964 	CONF_REF_CLK_26_E,
965 	CONF_REF_CLK_38_4_E,
966 	CONF_REF_CLK_52_E,
967 	CONF_REF_CLK_38_4_M_XTAL,
968 	CONF_REF_CLK_26_M_XTAL,
969 };
970 
971 enum single_dual_band_enum {
972 	CONF_SINGLE_BAND,
973 	CONF_DUAL_BAND
974 };
975 
976 #define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
977 #define CONF_NUMBER_OF_SUB_BANDS_5  7
978 #define CONF_NUMBER_OF_RATE_GROUPS  6
979 #define CONF_NUMBER_OF_CHANNELS_2_4 14
980 #define CONF_NUMBER_OF_CHANNELS_5   35
981 
982 struct conf_itrim_settings {
983 	/* enable dco itrim */
984 	u8 enable;
985 
986 	/* moderation timeout in microsecs from the last TX */
987 	u32 timeout;
988 } __packed;
989 
990 enum conf_fast_wakeup {
991 	CONF_FAST_WAKEUP_ENABLE,
992 	CONF_FAST_WAKEUP_DISABLE,
993 };
994 
995 struct conf_pm_config_settings {
996 	/*
997 	 * Host clock settling time
998 	 *
999 	 * Range: 0 - 30000 us
1000 	 */
1001 	u32 host_clk_settling_time;
1002 
1003 	/*
1004 	 * Host fast wakeup support
1005 	 *
1006 	 * Range: enum conf_fast_wakeup
1007 	 */
1008 	u8 host_fast_wakeup_support;
1009 } __packed;
1010 
1011 struct conf_roam_trigger_settings {
1012 	/*
1013 	 * The minimum interval between two trigger events.
1014 	 *
1015 	 * Range: 0 - 60000 ms
1016 	 */
1017 	u16 trigger_pacing;
1018 
1019 	/*
1020 	 * The weight for rssi/beacon average calculation
1021 	 *
1022 	 * Range: 0 - 255
1023 	 */
1024 	u8 avg_weight_rssi_beacon;
1025 
1026 	/*
1027 	 * The weight for rssi/data frame average calculation
1028 	 *
1029 	 * Range: 0 - 255
1030 	 */
1031 	u8 avg_weight_rssi_data;
1032 
1033 	/*
1034 	 * The weight for snr/beacon average calculation
1035 	 *
1036 	 * Range: 0 - 255
1037 	 */
1038 	u8 avg_weight_snr_beacon;
1039 
1040 	/*
1041 	 * The weight for snr/data frame average calculation
1042 	 *
1043 	 * Range: 0 - 255
1044 	 */
1045 	u8 avg_weight_snr_data;
1046 } __packed;
1047 
1048 struct conf_scan_settings {
1049 	/*
1050 	 * The minimum time to wait on each channel for active scans
1051 	 *
1052 	 * Range: u32 tu/1000
1053 	 */
1054 	u32 min_dwell_time_active;
1055 
1056 	/*
1057 	 * The maximum time to wait on each channel for active scans
1058 	 *
1059 	 * Range: u32 tu/1000
1060 	 */
1061 	u32 max_dwell_time_active;
1062 
1063 	/*
1064 	 * The minimum time to wait on each channel for passive scans
1065 	 *
1066 	 * Range: u32 tu/1000
1067 	 */
1068 	u32 min_dwell_time_passive;
1069 
1070 	/*
1071 	 * The maximum time to wait on each channel for passive scans
1072 	 *
1073 	 * Range: u32 tu/1000
1074 	 */
1075 	u32 max_dwell_time_passive;
1076 
1077 	/*
1078 	 * Number of probe requests to transmit on each active scan channel
1079 	 *
1080 	 * Range: u8
1081 	 */
1082 	u16 num_probe_reqs;
1083 
1084 	/*
1085 	 * Scan trigger (split scan) timeout. The FW will split the scan
1086 	 * operation into slices of the given time and allow the FW to schedule
1087 	 * other tasks in between.
1088 	 *
1089 	 * Range: u32 Microsecs
1090 	 */
1091 	u32 split_scan_timeout;
1092 } __packed;
1093 
1094 struct conf_sched_scan_settings {
1095 	/*
1096 	 * The base time to wait on the channel for active scans (in TU/1000).
1097 	 * The minimum dwell time is calculated according to this:
1098 	 * min_dwell_time = base + num_of_probes_to_be_sent * delta_per_probe
1099 	 * The maximum dwell time is calculated according to this:
1100 	 * max_dwell_time = min_dwell_time + max_dwell_time_delta
1101 	 */
1102 	u32 base_dwell_time;
1103 
1104 	/* The delta between the min dwell time and max dwell time for
1105 	 * active scans (in TU/1000s). The max dwell time is used by the FW once
1106 	 * traffic is detected on the channel.
1107 	 */
1108 	u32 max_dwell_time_delta;
1109 
1110 	/* Delta added to min dwell time per each probe in 2.4 GHz (TU/1000) */
1111 	u32 dwell_time_delta_per_probe;
1112 
1113 	/* Delta added to min dwell time per each probe in 5 GHz (TU/1000) */
1114 	u32 dwell_time_delta_per_probe_5;
1115 
1116 	/* time to wait on the channel for passive scans (in TU/1000) */
1117 	u32 dwell_time_passive;
1118 
1119 	/* time to wait on the channel for DFS scans (in TU/1000) */
1120 	u32 dwell_time_dfs;
1121 
1122 	/* number of probe requests to send on each channel in active scans */
1123 	u8 num_probe_reqs;
1124 
1125 	/* RSSI threshold to be used for filtering */
1126 	s8 rssi_threshold;
1127 
1128 	/* SNR threshold to be used for filtering */
1129 	s8 snr_threshold;
1130 } __packed;
1131 
1132 struct conf_ht_setting {
1133 	u8 rx_ba_win_size;
1134 	u8 tx_ba_win_size;
1135 	u16 inactivity_timeout;
1136 
1137 	/* bitmap of enabled TIDs for TX BA sessions */
1138 	u8 tx_ba_tid_bitmap;
1139 } __packed;
1140 
1141 struct conf_memory_settings {
1142 	/* Number of stations supported in IBSS mode */
1143 	u8 num_stations;
1144 
1145 	/* Number of ssid profiles used in IBSS mode */
1146 	u8 ssid_profiles;
1147 
1148 	/* Number of memory buffers allocated to rx pool */
1149 	u8 rx_block_num;
1150 
1151 	/* Minimum number of blocks allocated to tx pool */
1152 	u8 tx_min_block_num;
1153 
1154 	/* Disable/Enable dynamic memory */
1155 	u8 dynamic_memory;
1156 
1157 	/*
1158 	 * Minimum required free tx memory blocks in order to assure optimum
1159 	 * performance
1160 	 *
1161 	 * Range: 0-120
1162 	 */
1163 	u8 min_req_tx_blocks;
1164 
1165 	/*
1166 	 * Minimum required free rx memory blocks in order to assure optimum
1167 	 * performance
1168 	 *
1169 	 * Range: 0-120
1170 	 */
1171 	u8 min_req_rx_blocks;
1172 
1173 	/*
1174 	 * Minimum number of mem blocks (free+used) guaranteed for TX
1175 	 *
1176 	 * Range: 0-120
1177 	 */
1178 	u8 tx_min;
1179 } __packed;
1180 
1181 struct conf_fm_coex {
1182 	u8 enable;
1183 	u8 swallow_period;
1184 	u8 n_divider_fref_set_1;
1185 	u8 n_divider_fref_set_2;
1186 	u16 m_divider_fref_set_1;
1187 	u16 m_divider_fref_set_2;
1188 	u32 coex_pll_stabilization_time;
1189 	u16 ldo_stabilization_time;
1190 	u8 fm_disturbed_band_margin;
1191 	u8 swallow_clk_diff;
1192 } __packed;
1193 
1194 struct conf_rx_streaming_settings {
1195 	/*
1196 	 * RX Streaming duration (in msec) from last tx/rx
1197 	 *
1198 	 * Range: u32
1199 	 */
1200 	u32 duration;
1201 
1202 	/*
1203 	 * Bitmap of tids to be polled during RX streaming.
1204 	 * (Note: it doesn't look like it really matters)
1205 	 *
1206 	 * Range: 0x1-0xff
1207 	 */
1208 	u8 queues;
1209 
1210 	/*
1211 	 * RX Streaming interval.
1212 	 * (Note:this value is also used as the rx streaming timeout)
1213 	 * Range: 0 (disabled), 10 - 100
1214 	 */
1215 	u8 interval;
1216 
1217 	/*
1218 	 * enable rx streaming also when there is no coex activity
1219 	 */
1220 	u8 always;
1221 } __packed;
1222 
1223 struct conf_fwlog {
1224 	/* Continuous or on-demand */
1225 	u8 mode;
1226 
1227 	/*
1228 	 * Number of memory blocks dedicated for the FW logger
1229 	 *
1230 	 * Range: 1-3, or 0 to disable the FW logger
1231 	 */
1232 	u8 mem_blocks;
1233 
1234 	/* Minimum log level threshold */
1235 	u8 severity;
1236 
1237 	/* Include/exclude timestamps from the log messages */
1238 	u8 timestamp;
1239 
1240 	/* See enum wl1271_fwlogger_output */
1241 	u8 output;
1242 
1243 	/* Regulates the frequency of log messages */
1244 	u8 threshold;
1245 } __packed;
1246 
1247 #define ACX_RATE_MGMT_NUM_OF_RATES 13
1248 struct conf_rate_policy_settings {
1249 	u16 rate_retry_score;
1250 	u16 per_add;
1251 	u16 per_th1;
1252 	u16 per_th2;
1253 	u16 max_per;
1254 	u8 inverse_curiosity_factor;
1255 	u8 tx_fail_low_th;
1256 	u8 tx_fail_high_th;
1257 	u8 per_alpha_shift;
1258 	u8 per_add_shift;
1259 	u8 per_beta1_shift;
1260 	u8 per_beta2_shift;
1261 	u8 rate_check_up;
1262 	u8 rate_check_down;
1263 	u8 rate_retry_policy[ACX_RATE_MGMT_NUM_OF_RATES];
1264 } __packed;
1265 
1266 struct conf_hangover_settings {
1267 	u32 recover_time;
1268 	u8 hangover_period;
1269 	u8 dynamic_mode;
1270 	u8 early_termination_mode;
1271 	u8 max_period;
1272 	u8 min_period;
1273 	u8 increase_delta;
1274 	u8 decrease_delta;
1275 	u8 quiet_time;
1276 	u8 increase_time;
1277 	u8 window_size;
1278 } __packed;
1279 
1280 /*
1281  * The conf version consists of 4 bytes.  The two MSB are the wlcore
1282  * version, the two LSB are the lower driver's private conf
1283  * version.
1284  */
1285 #define WLCORE_CONF_VERSION	(0x0002 << 16)
1286 #define WLCORE_CONF_MASK	0xffff0000
1287 #define WLCORE_CONF_SIZE	(sizeof(struct wlcore_conf_header) +	\
1288 				 sizeof(struct wlcore_conf))
1289 
1290 struct wlcore_conf_header {
1291 	__le32 magic;
1292 	__le32 version;
1293 	__le32 checksum;
1294 } __packed;
1295 
1296 struct wlcore_conf {
1297 	struct conf_sg_settings sg;
1298 	struct conf_rx_settings rx;
1299 	struct conf_tx_settings tx;
1300 	struct conf_conn_settings conn;
1301 	struct conf_itrim_settings itrim;
1302 	struct conf_pm_config_settings pm_config;
1303 	struct conf_roam_trigger_settings roam_trigger;
1304 	struct conf_scan_settings scan;
1305 	struct conf_sched_scan_settings sched_scan;
1306 	struct conf_ht_setting ht;
1307 	struct conf_memory_settings mem;
1308 	struct conf_fm_coex fm_coex;
1309 	struct conf_rx_streaming_settings rx_streaming;
1310 	struct conf_fwlog fwlog;
1311 	struct conf_rate_policy_settings rate;
1312 	struct conf_hangover_settings hangover;
1313 } __packed;
1314 
1315 struct wlcore_conf_file {
1316 	struct wlcore_conf_header header;
1317 	struct wlcore_conf core;
1318 	u8 priv[0];
1319 } __packed;
1320 
1321 #endif
1322