blob: 2ffbe3e0601951698ccb3c4107b52109c9521d3f [file] [log] [blame]
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +03001/*
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
Shahar Levi00d20102010-11-08 11:20:10 +000024#ifndef __CONF_H__
25#define __CONF_H__
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +030026
27enum {
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};
50
51enum {
52 CONF_HW_RATE_INDEX_1MBPS = 0,
53 CONF_HW_RATE_INDEX_2MBPS = 1,
54 CONF_HW_RATE_INDEX_5_5MBPS = 2,
55 CONF_HW_RATE_INDEX_6MBPS = 3,
56 CONF_HW_RATE_INDEX_9MBPS = 4,
57 CONF_HW_RATE_INDEX_11MBPS = 5,
58 CONF_HW_RATE_INDEX_12MBPS = 6,
59 CONF_HW_RATE_INDEX_18MBPS = 7,
60 CONF_HW_RATE_INDEX_22MBPS = 8,
61 CONF_HW_RATE_INDEX_24MBPS = 9,
62 CONF_HW_RATE_INDEX_36MBPS = 10,
63 CONF_HW_RATE_INDEX_48MBPS = 11,
64 CONF_HW_RATE_INDEX_54MBPS = 12,
65 CONF_HW_RATE_INDEX_MAX = CONF_HW_RATE_INDEX_54MBPS,
66};
67
Juuso Oikarinen1b00f542010-03-18 12:26:30 +020068enum {
Juuso Oikarinenf876bb92010-03-26 12:53:11 +020069 CONF_HW_RXTX_RATE_MCS7 = 0,
70 CONF_HW_RXTX_RATE_MCS6,
71 CONF_HW_RXTX_RATE_MCS5,
72 CONF_HW_RXTX_RATE_MCS4,
73 CONF_HW_RXTX_RATE_MCS3,
74 CONF_HW_RXTX_RATE_MCS2,
75 CONF_HW_RXTX_RATE_MCS1,
76 CONF_HW_RXTX_RATE_MCS0,
77 CONF_HW_RXTX_RATE_54,
78 CONF_HW_RXTX_RATE_48,
79 CONF_HW_RXTX_RATE_36,
80 CONF_HW_RXTX_RATE_24,
81 CONF_HW_RXTX_RATE_22,
82 CONF_HW_RXTX_RATE_18,
83 CONF_HW_RXTX_RATE_12,
84 CONF_HW_RXTX_RATE_11,
85 CONF_HW_RXTX_RATE_9,
86 CONF_HW_RXTX_RATE_6,
87 CONF_HW_RXTX_RATE_5_5,
88 CONF_HW_RXTX_RATE_2,
89 CONF_HW_RXTX_RATE_1,
90 CONF_HW_RXTX_RATE_MAX,
91 CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff
92};
93
94enum {
Juuso Oikarinen1b00f542010-03-18 12:26:30 +020095 CONF_SG_DISABLE = 0,
96 CONF_SG_PROTECTIVE,
97 CONF_SG_OPPORTUNISTIC
98};
99
100enum {
101 /*
102 * PER threshold in PPM of the BT voice
103 *
104 * Range: 0 - 10000000
105 */
106 CONF_SG_BT_PER_THRESHOLD = 0,
107
108 /*
109 * Number of consequent RX_ACTIVE activities to override BT voice
110 * frames to ensure WLAN connection
111 *
112 * Range: 0 - 100
113 */
114 CONF_SG_HV3_MAX_OVERRIDE,
115
116 /*
117 * Defines the PER threshold of the BT voice
118 *
119 * Range: 0 - 65000
120 */
121 CONF_SG_BT_NFS_SAMPLE_INTERVAL,
122
123 /*
124 * Defines the load ratio of BT
125 *
126 * Range: 0 - 100 (%)
127 */
128 CONF_SG_BT_LOAD_RATIO,
129
130 /*
131 * Defines whether the SG will force WLAN host to enter/exit PSM
132 *
133 * Range: 1 - SG can force, 0 - host handles PSM
134 */
135 CONF_SG_AUTO_PS_MODE,
136
137 /*
138 * Compensation percentage of probe requests when scan initiated
139 * during BT voice/ACL link.
140 *
141 * Range: 0 - 255 (%)
142 */
143 CONF_SG_AUTO_SCAN_PROBE_REQ,
144
145 /*
146 * Compensation percentage of probe requests when active scan initiated
147 * during BT voice
148 *
149 * Range: 0 - 255 (%)
150 */
151 CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,
152
153 /*
154 * Defines antenna configuration (single/dual antenna)
155 *
156 * Range: 0 - single antenna, 1 - dual antenna
157 */
158 CONF_SG_ANTENNA_CONFIGURATION,
159
160 /*
161 * The threshold (percent) of max consequtive beacon misses before
162 * increasing priority of beacon reception.
163 *
164 * Range: 0 - 100 (%)
165 */
166 CONF_SG_BEACON_MISS_PERCENT,
167
168 /*
169 * The rate threshold below which receiving a data frame from the AP
170 * will increase the priority of the data frame above BT traffic.
171 *
172 * Range: 0,2, 5(=5.5), 6, 9, 11, 12, 18, 24, 36, 48, 54
173 */
174 CONF_SG_RATE_ADAPT_THRESH,
175
176 /*
177 * Not used currently.
178 *
179 * Range: 0
180 */
181 CONF_SG_RATE_ADAPT_SNR,
182
183 /*
184 * Configure the min and max time BT gains the antenna
185 * in WLAN PSM / BT master basic rate
186 *
187 * Range: 0 - 255 (ms)
188 */
189 CONF_SG_WLAN_PS_BT_ACL_MASTER_MIN_BR,
190 CONF_SG_WLAN_PS_BT_ACL_MASTER_MAX_BR,
191
192 /*
193 * The time after it expires no new WLAN trigger frame is trasmitted
194 * in WLAN PSM / BT master basic rate
195 *
196 * Range: 0 - 255 (ms)
197 */
198 CONF_SG_WLAN_PS_MAX_BT_ACL_MASTER_BR,
199
200 /*
201 * Configure the min and max time BT gains the antenna
202 * in WLAN PSM / BT slave basic rate
203 *
204 * Range: 0 - 255 (ms)
205 */
206 CONF_SG_WLAN_PS_BT_ACL_SLAVE_MIN_BR,
207 CONF_SG_WLAN_PS_BT_ACL_SLAVE_MAX_BR,
208
209 /*
210 * The time after it expires no new WLAN trigger frame is trasmitted
211 * in WLAN PSM / BT slave basic rate
212 *
213 * Range: 0 - 255 (ms)
214 */
215 CONF_SG_WLAN_PS_MAX_BT_ACL_SLAVE_BR,
216
217 /*
218 * Configure the min and max time BT gains the antenna
219 * in WLAN PSM / BT master EDR
220 *
221 * Range: 0 - 255 (ms)
222 */
223 CONF_SG_WLAN_PS_BT_ACL_MASTER_MIN_EDR,
224 CONF_SG_WLAN_PS_BT_ACL_MASTER_MAX_EDR,
225
226 /*
227 * The time after it expires no new WLAN trigger frame is trasmitted
228 * in WLAN PSM / BT master EDR
229 *
230 * Range: 0 - 255 (ms)
231 */
232 CONF_SG_WLAN_PS_MAX_BT_ACL_MASTER_EDR,
233
234 /*
235 * Configure the min and max time BT gains the antenna
236 * in WLAN PSM / BT slave EDR
237 *
238 * Range: 0 - 255 (ms)
239 */
240 CONF_SG_WLAN_PS_BT_ACL_SLAVE_MIN_EDR,
241 CONF_SG_WLAN_PS_BT_ACL_SLAVE_MAX_EDR,
242
243 /*
244 * The time after it expires no new WLAN trigger frame is trasmitted
245 * in WLAN PSM / BT slave EDR
246 *
247 * Range: 0 - 255 (ms)
248 */
249 CONF_SG_WLAN_PS_MAX_BT_ACL_SLAVE_EDR,
250
251 /*
252 * RX guard time before the beginning of a new BT voice frame during
253 * which no new WLAN trigger frame is transmitted.
254 *
255 * Range: 0 - 100000 (us)
256 */
257 CONF_SG_RXT,
258
259 /*
260 * TX guard time before the beginning of a new BT voice frame during
261 * which no new WLAN frame is transmitted.
262 *
263 * Range: 0 - 100000 (us)
264 */
265
266 CONF_SG_TXT,
267
268 /*
269 * Enable adaptive RXT/TXT algorithm. If disabled, the host values
270 * will be utilized.
271 *
272 * Range: 0 - disable, 1 - enable
273 */
274 CONF_SG_ADAPTIVE_RXT_TXT,
275
276 /*
277 * The used WLAN legacy service period during active BT ACL link
278 *
279 * Range: 0 - 255 (ms)
280 */
281 CONF_SG_PS_POLL_TIMEOUT,
282
283 /*
284 * The used WLAN UPSD service period during active BT ACL link
285 *
286 * Range: 0 - 255 (ms)
287 */
288 CONF_SG_UPSD_TIMEOUT,
289
290 /*
291 * Configure the min and max time BT gains the antenna
292 * in WLAN Active / BT master EDR
293 *
294 * Range: 0 - 255 (ms)
295 */
296 CONF_SG_WLAN_ACTIVE_BT_ACL_MASTER_MIN_EDR,
297 CONF_SG_WLAN_ACTIVE_BT_ACL_MASTER_MAX_EDR,
298
299 /*
300 * The maximum time WLAN can gain the antenna for
301 * in WLAN Active / BT master EDR
302 *
303 * Range: 0 - 255 (ms)
304 */
305 CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_MASTER_EDR,
306
307 /*
308 * Configure the min and max time BT gains the antenna
309 * in WLAN Active / BT slave EDR
310 *
311 * Range: 0 - 255 (ms)
312 */
313 CONF_SG_WLAN_ACTIVE_BT_ACL_SLAVE_MIN_EDR,
314 CONF_SG_WLAN_ACTIVE_BT_ACL_SLAVE_MAX_EDR,
315
316 /*
317 * The maximum time WLAN can gain the antenna for
318 * in WLAN Active / BT slave EDR
319 *
320 * Range: 0 - 255 (ms)
321 */
322 CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_SLAVE_EDR,
323
324 /*
325 * Configure the min and max time BT gains the antenna
326 * in WLAN Active / BT basic rate
327 *
328 * Range: 0 - 255 (ms)
329 */
330 CONF_SG_WLAN_ACTIVE_BT_ACL_MIN_BR,
331 CONF_SG_WLAN_ACTIVE_BT_ACL_MAX_BR,
332
333 /*
334 * The maximum time WLAN can gain the antenna for
335 * in WLAN Active / BT basic rate
336 *
337 * Range: 0 - 255 (ms)
338 */
339 CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_BR,
340
341 /*
342 * Compensation percentage of WLAN passive scan window if initiated
343 * during BT voice
344 *
345 * Range: 0 - 1000 (%)
346 */
347 CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,
348
349 /*
350 * Compensation percentage of WLAN passive scan window if initiated
351 * during BT A2DP
352 *
353 * Range: 0 - 1000 (%)
354 */
355 CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP,
356
357 /*
358 * Fixed time ensured for BT traffic to gain the antenna during WLAN
359 * passive scan.
360 *
361 * Range: 0 - 1000 ms
362 */
363 CONF_SG_PASSIVE_SCAN_A2DP_BT_TIME,
364
365 /*
366 * Fixed time ensured for WLAN traffic to gain the antenna during WLAN
367 * passive scan.
368 *
369 * Range: 0 - 1000 ms
370 */
371 CONF_SG_PASSIVE_SCAN_A2DP_WLAN_TIME,
372
373 /*
374 * Number of consequent BT voice frames not interrupted by WLAN
375 *
376 * Range: 0 - 100
377 */
378 CONF_SG_HV3_MAX_SERVED,
379
380 /*
381 * Protection time of the DHCP procedure.
382 *
383 * Range: 0 - 100000 (ms)
384 */
385 CONF_SG_DHCP_TIME,
386
387 /*
388 * Compensation percentage of WLAN active scan window if initiated
389 * during BT A2DP
390 *
391 * Range: 0 - 1000 (%)
392 */
393 CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP,
394 CONF_SG_TEMP_PARAM_1,
395 CONF_SG_TEMP_PARAM_2,
396 CONF_SG_TEMP_PARAM_3,
397 CONF_SG_TEMP_PARAM_4,
398 CONF_SG_TEMP_PARAM_5,
Arik Nemtsov801f8702011-04-18 14:15:20 +0300399
400 /*
401 * AP beacon miss
402 *
403 * Range: 0 - 255
404 */
405 CONF_SG_AP_BEACON_MISS_TX,
406
407 /*
408 * AP RX window length
409 *
410 * Range: 0 - 50
411 */
412 CONF_SG_RX_WINDOW_LENGTH,
413
414 /*
415 * AP connection protection time
416 *
417 * Range: 0 - 5000
418 */
419 CONF_SG_AP_CONNECTION_PROTECTION_TIME,
420
421 CONF_SG_TEMP_PARAM_6,
422 CONF_SG_TEMP_PARAM_7,
423 CONF_SG_TEMP_PARAM_8,
424 CONF_SG_TEMP_PARAM_9,
425 CONF_SG_TEMP_PARAM_10,
426
427 CONF_SG_STA_PARAMS_MAX = CONF_SG_TEMP_PARAM_5 + 1,
428 CONF_SG_AP_PARAMS_MAX = CONF_SG_TEMP_PARAM_10 + 1,
429
Juuso Oikarinen1b00f542010-03-18 12:26:30 +0200430 CONF_SG_PARAMS_ALL = 0xff
431};
432
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +0300433struct conf_sg_settings {
Arik Nemtsov801f8702011-04-18 14:15:20 +0300434 u32 sta_params[CONF_SG_STA_PARAMS_MAX];
435 u32 ap_params[CONF_SG_AP_PARAMS_MAX];
Juuso Oikarinen1b00f542010-03-18 12:26:30 +0200436 u8 state;
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +0300437};
438
Juuso Oikarinen8793f9b2009-10-13 12:47:40 +0300439enum conf_rx_queue_type {
440 CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */
441 CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
442};
443
444struct conf_rx_settings {
445 /*
446 * The maximum amount of time, in TU, before the
447 * firmware discards the MSDU.
448 *
449 * Range: 0 - 0xFFFFFFFF
450 */
451 u32 rx_msdu_life_time;
452
453 /*
454 * Packet detection threshold in the PHY.
455 *
456 * FIXME: details unknown.
457 */
458 u32 packet_detection_threshold;
459
460 /*
461 * The longest time the STA will wait to receive traffic from the AP
462 * after a PS-poll has been transmitted.
463 *
464 * Range: 0 - 200000
465 */
466 u16 ps_poll_timeout;
467 /*
468 * The longest time the STA will wait to receive traffic from the AP
469 * after a frame has been sent from an UPSD enabled queue.
470 *
471 * Range: 0 - 200000
472 */
473 u16 upsd_timeout;
474
475 /*
476 * The number of octets in an MPDU, below which an RTS/CTS
477 * handshake is not performed.
478 *
479 * Range: 0 - 4096
480 */
481 u16 rts_threshold;
482
483 /*
484 * The RX Clear Channel Assessment threshold in the PHY
485 * (the energy threshold).
486 *
487 * Range: ENABLE_ENERGY_D == 0x140A
488 * DISABLE_ENERGY_D == 0xFFEF
489 */
490 u16 rx_cca_threshold;
491
492 /*
493 * Occupied Rx mem-blocks number which requires interrupting the host
494 * (0 = no buffering, 0xffff = disabled).
495 *
496 * Range: u16
497 */
498 u16 irq_blk_threshold;
499
500 /*
501 * Rx packets number which requires interrupting the host
502 * (0 = no buffering).
503 *
504 * Range: u16
505 */
506 u16 irq_pkt_threshold;
507
508 /*
509 * Max time in msec the FW may delay RX-Complete interrupt.
510 *
511 * Range: 1 - 100
512 */
513 u16 irq_timeout;
514
515 /*
516 * The RX queue type.
517 *
518 * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
519 */
520 u8 queue_type;
521};
522
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300523#define CONF_TX_MAX_RATE_CLASSES 8
524
525#define CONF_TX_RATE_MASK_UNSPECIFIED 0
Juuso Oikarinena6fe2312009-12-11 15:40:58 +0200526#define CONF_TX_RATE_MASK_BASIC (CONF_HW_BIT_RATE_1MBPS | \
527 CONF_HW_BIT_RATE_2MBPS)
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300528#define CONF_TX_RATE_RETRY_LIMIT 10
529
Arik Nemtsov1e05a812010-10-16 17:44:51 +0200530/*
531 * Rates supported for data packets when operating as AP. Note the absense
532 * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
533 * one. The rate dropped is not mandatory under any operating mode.
534 */
535#define CONF_TX_AP_ENABLED_RATES (CONF_HW_BIT_RATE_1MBPS | \
536 CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
537 CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_9MBPS | \
538 CONF_HW_BIT_RATE_11MBPS | CONF_HW_BIT_RATE_12MBPS | \
539 CONF_HW_BIT_RATE_18MBPS | CONF_HW_BIT_RATE_24MBPS | \
540 CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS | \
541 CONF_HW_BIT_RATE_54MBPS)
542
543/*
544 * Default rates for management traffic when operating in AP mode. This
545 * should be configured according to the basic rate set of the AP
546 */
547#define CONF_TX_AP_DEFAULT_MGMT_RATES (CONF_HW_BIT_RATE_1MBPS | \
548 CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
549
Eliad Pellercb5ae052011-04-07 15:52:05 +0300550/*
551 * Default rates for working as IBSS. use 11b rates
552 */
553#define CONF_TX_IBSS_DEFAULT_RATES (CONF_HW_BIT_RATE_1MBPS | \
554 CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
555 CONF_HW_BIT_RATE_11MBPS);
556
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300557struct conf_tx_rate_class {
558
559 /*
560 * The rates enabled for this rate class.
561 *
562 * Range: CONF_HW_BIT_RATE_* bit mask
563 */
564 u32 enabled_rates;
565
566 /*
567 * The dot11 short retry limit used for TX retries.
568 *
569 * Range: u8
570 */
571 u8 short_retry_limit;
572
573 /*
574 * The dot11 long retry limit used for TX retries.
575 *
576 * Range: u8
577 */
578 u8 long_retry_limit;
579
580 /*
581 * Flags controlling the attributes of TX transmission.
582 *
583 * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
584 * when the total valid per-rate attempts have
585 * been exhausted; otherwise transmissions
586 * will continue at the lowest available rate
587 * until the appropriate one of the
588 * short_retry_limit, long_retry_limit,
589 * dot11_max_transmit_msdu_life_time, or
590 * max_tx_life_time, is exhausted.
591 * 1: Preamble Override - indicates if the preamble type
592 * should be used in TX.
593 * 2: Preamble Type - the type of the preamble to be used by
594 * the policy (0 - long preamble, 1 - short preamble.
595 */
596 u8 aflags;
597};
598
599#define CONF_TX_MAX_AC_COUNT 4
600
601/* Slot number setting to start transmission at PIFS interval */
602#define CONF_TX_AIFS_PIFS 1
603/* Slot number setting to start transmission at DIFS interval normal
604 * DCF access */
605#define CONF_TX_AIFS_DIFS 2
606
607
608enum conf_tx_ac {
609 CONF_TX_AC_BE = 0, /* best effort / legacy */
610 CONF_TX_AC_BK = 1, /* background */
611 CONF_TX_AC_VI = 2, /* video */
612 CONF_TX_AC_VO = 3, /* voice */
613 CONF_TX_AC_CTS2SELF = 4, /* fictious AC, follows AC_VO */
614 CONF_TX_AC_ANY_TID = 0x1f
615};
616
617struct conf_tx_ac_category {
618 /*
619 * The AC class identifier.
620 *
621 * Range: enum conf_tx_ac
622 */
623 u8 ac;
624
625 /*
626 * The contention window minimum size (in slots) for the access
627 * class.
628 *
629 * Range: u8
630 */
631 u8 cw_min;
632
633 /*
634 * The contention window maximum size (in slots) for the access
635 * class.
636 *
637 * Range: u8
638 */
639 u16 cw_max;
640
641 /*
642 * The AIF value (in slots) for the access class.
643 *
644 * Range: u8
645 */
646 u8 aifsn;
647
648 /*
649 * The TX Op Limit (in microseconds) for the access class.
650 *
651 * Range: u16
652 */
653 u16 tx_op_limit;
654};
655
Juuso Oikarinen9987a9d2010-09-01 11:31:12 +0200656#define CONF_TX_MAX_TID_COUNT 8
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300657
658enum {
659 CONF_CHANNEL_TYPE_DCF = 0, /* DC/LEGACY*/
660 CONF_CHANNEL_TYPE_EDCF = 1, /* EDCA*/
661 CONF_CHANNEL_TYPE_HCCA = 2, /* HCCA*/
662};
663
664enum {
665 CONF_PS_SCHEME_LEGACY = 0,
666 CONF_PS_SCHEME_UPSD_TRIGGER = 1,
667 CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
668 CONF_PS_SCHEME_SAPSD = 3,
669};
670
671enum {
672 CONF_ACK_POLICY_LEGACY = 0,
673 CONF_ACK_POLICY_NO_ACK = 1,
674 CONF_ACK_POLICY_BLOCK = 2,
675};
676
677
678struct conf_tx_tid {
679 u8 queue_id;
680 u8 channel_type;
681 u8 tsid;
682 u8 ps_scheme;
683 u8 ack_policy;
684 u32 apsd_conf[2];
685};
686
687struct conf_tx_settings {
688 /*
689 * The TX ED value for TELEC Enable/Disable.
690 *
691 * Range: 0, 1
692 */
693 u8 tx_energy_detection;
694
695 /*
696 * Configuration for rate classes for TX (currently only one
Arik Nemtsov1e05a812010-10-16 17:44:51 +0200697 * rate class supported). Used in non-AP mode.
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300698 */
Arik Nemtsov1e05a812010-10-16 17:44:51 +0200699 struct conf_tx_rate_class sta_rc_conf;
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300700
701 /*
702 * Configuration for access categories for TX rate control.
703 */
704 u8 ac_conf_count;
705 struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
706
707 /*
Arik Nemtsov1e05a812010-10-16 17:44:51 +0200708 * Configuration for rate classes in AP-mode. These rate classes
709 * are for the AC TX queues
710 */
711 struct conf_tx_rate_class ap_rc_conf[CONF_TX_MAX_AC_COUNT];
712
713 /*
714 * Management TX rate class for AP-mode.
715 */
716 struct conf_tx_rate_class ap_mgmt_conf;
717
718 /*
719 * Broadcast TX rate class for AP-mode.
720 */
721 struct conf_tx_rate_class ap_bcst_conf;
722
723 /*
Arik Nemtsov47684802011-04-26 23:21:51 +0300724 * Allow this number of TX retries to a connected station/AP before an
Arik Nemtsov79b223f2010-10-16 17:52:59 +0200725 * event is triggered from FW.
Arik Nemtsov47684802011-04-26 23:21:51 +0300726 * In AP-mode the hlids of unreachable stations are given in the
727 * "sta_tx_retry_exceeded" member in the event mailbox.
Arik Nemtsov79b223f2010-10-16 17:52:59 +0200728 */
Arik Nemtsov47684802011-04-26 23:21:51 +0300729 u8 max_tx_retries;
730
731 /*
732 * AP-mode - after this number of seconds a connected station is
733 * considered inactive.
734 */
735 u16 ap_aging_period;
Arik Nemtsov79b223f2010-10-16 17:52:59 +0200736
737 /*
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300738 * Configuration for TID parameters.
739 */
740 u8 tid_conf_count;
741 struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
742
743 /*
744 * The TX fragmentation threshold.
745 *
746 * Range: u16
747 */
748 u16 frag_threshold;
749
750 /*
751 * Max time in msec the FW may delay frame TX-Complete interrupt.
752 *
753 * Range: u16
754 */
755 u16 tx_compl_timeout;
756
757 /*
758 * Completed TX packet count which requires to issue the TX-Complete
759 * interrupt.
760 *
761 * Range: u16
762 */
763 u16 tx_compl_threshold;
764
Juuso Oikarinenebba60c2010-04-01 11:38:20 +0300765 /*
766 * The rate used for control messages and scanning on the 2.4GHz band
767 *
768 * Range: CONF_HW_BIT_RATE_* bit mask
769 */
770 u32 basic_rate;
771
772 /*
773 * The rate used for control messages and scanning on the 5GHz band
774 *
775 * Range: CONF_HW_BIT_RATE_* bit mask
776 */
777 u32 basic_rate_5;
Arik Nemtsov1e05a812010-10-16 17:44:51 +0200778
779 /*
780 * TX retry limits for templates
781 */
782 u8 tmpl_short_retry_limit;
783 u8 tmpl_long_retry_limit;
Juuso Oikarinen45b531a2009-10-13 12:47:41 +0300784};
785
Juuso Oikarinen51f2be22009-10-13 12:47:42 +0300786enum {
787 CONF_WAKE_UP_EVENT_BEACON = 0x01, /* Wake on every Beacon*/
788 CONF_WAKE_UP_EVENT_DTIM = 0x02, /* Wake on every DTIM*/
789 CONF_WAKE_UP_EVENT_N_DTIM = 0x04, /* Wake every Nth DTIM */
790 CONF_WAKE_UP_EVENT_N_BEACONS = 0x08, /* Wake every Nth beacon */
791 CONF_WAKE_UP_EVENT_BITS_MASK = 0x0F
792};
793
794#define CONF_MAX_BCN_FILT_IE_COUNT 32
795
796#define CONF_BCN_RULE_PASS_ON_CHANGE BIT(0)
797#define CONF_BCN_RULE_PASS_ON_APPEARANCE BIT(1)
798
799#define CONF_BCN_IE_OUI_LEN 3
800#define CONF_BCN_IE_VER_LEN 2
801
802struct conf_bcn_filt_rule {
803 /*
804 * IE number to which to associate a rule.
805 *
806 * Range: u8
807 */
808 u8 ie;
809
810 /*
811 * Rule to associate with the specific ie.
812 *
813 * Range: CONF_BCN_RULE_PASS_ON_*
814 */
815 u8 rule;
816
817 /*
818 * OUI for the vendor specifie IE (221)
819 */
820 u8 oui[CONF_BCN_IE_OUI_LEN];
821
822 /*
823 * Type for the vendor specifie IE (221)
824 */
825 u8 type;
826
827 /*
828 * Version for the vendor specifie IE (221)
829 */
830 u8 version[CONF_BCN_IE_VER_LEN];
831};
832
833#define CONF_MAX_RSSI_SNR_TRIGGERS 8
834
835enum {
836 CONF_TRIG_METRIC_RSSI_BEACON = 0,
837 CONF_TRIG_METRIC_RSSI_DATA,
838 CONF_TRIG_METRIC_SNR_BEACON,
839 CONF_TRIG_METRIC_SNR_DATA
840};
841
842enum {
843 CONF_TRIG_EVENT_TYPE_LEVEL = 0,
844 CONF_TRIG_EVENT_TYPE_EDGE
845};
846
847enum {
848 CONF_TRIG_EVENT_DIR_LOW = 0,
849 CONF_TRIG_EVENT_DIR_HIGH,
850 CONF_TRIG_EVENT_DIR_BIDIR
851};
852
Juuso Oikarinen51f2be22009-10-13 12:47:42 +0300853struct conf_sig_weights {
854
855 /*
856 * RSSI from beacons average weight.
857 *
858 * Range: u8
859 */
860 u8 rssi_bcn_avg_weight;
861
862 /*
863 * RSSI from data average weight.
864 *
865 * Range: u8
866 */
867 u8 rssi_pkt_avg_weight;
868
869 /*
870 * SNR from beacons average weight.
871 *
872 * Range: u8
873 */
874 u8 snr_bcn_avg_weight;
875
876 /*
877 * SNR from data average weight.
878 *
879 * Range: u8
880 */
881 u8 snr_pkt_avg_weight;
882};
883
884enum conf_bcn_filt_mode {
885 CONF_BCN_FILT_MODE_DISABLED = 0,
886 CONF_BCN_FILT_MODE_ENABLED = 1
887};
888
Juuso Oikarinen11f70f92009-10-13 12:47:46 +0300889enum conf_bet_mode {
890 CONF_BET_MODE_DISABLE = 0,
891 CONF_BET_MODE_ENABLE = 1,
892};
893
Juuso Oikarinen51f2be22009-10-13 12:47:42 +0300894struct conf_conn_settings {
895 /*
896 * Firmware wakeup conditions configuration. The host may set only
897 * one bit.
898 *
899 * Range: CONF_WAKE_UP_EVENT_*
900 */
901 u8 wake_up_event;
902
903 /*
904 * Listen interval for beacons or Dtims.
905 *
906 * Range: 0 for beacon and Dtim wakeup
907 * 1-10 for x Dtims
908 * 1-255 for x beacons
909 */
910 u8 listen_interval;
911
912 /*
913 * Enable or disable the beacon filtering.
914 *
915 * Range: CONF_BCN_FILT_MODE_*
916 */
917 enum conf_bcn_filt_mode bcn_filt_mode;
918
919 /*
920 * Configure Beacon filter pass-thru rules.
921 */
922 u8 bcn_filt_ie_count;
923 struct conf_bcn_filt_rule bcn_filt_ie[CONF_MAX_BCN_FILT_IE_COUNT];
924
925 /*
926 * The number of consequtive beacons to lose, before the firmware
927 * becomes out of synch.
928 *
929 * Range: u32
930 */
931 u32 synch_fail_thold;
932
933 /*
934 * After out-of-synch, the number of TU's to wait without a further
935 * received beacon (or probe response) before issuing the BSS_EVENT_LOSE
936 * event.
937 *
938 * Range: u32
939 */
940 u32 bss_lose_timeout;
941
942 /*
943 * Beacon receive timeout.
944 *
945 * Range: u32
946 */
947 u32 beacon_rx_timeout;
948
949 /*
950 * Broadcast receive timeout.
951 *
952 * Range: u32
953 */
954 u32 broadcast_timeout;
955
956 /*
957 * Enable/disable reception of broadcast packets in power save mode
958 *
959 * Range: 1 - enable, 0 - disable
960 */
961 u8 rx_broadcast_in_ps;
962
963 /*
964 * Consequtive PS Poll failures before sending event to driver
965 *
966 * Range: u8
967 */
968 u8 ps_poll_threshold;
969
970 /*
Juuso Oikarinen90494a92010-07-08 17:50:00 +0300971 * PS Poll failure recovery ACTIVE period length
972 *
973 * Range: u32 (ms)
974 */
975 u32 ps_poll_recovery_period;
976
977 /*
Juuso Oikarinen51f2be22009-10-13 12:47:42 +0300978 * Configuration of signal average weights.
979 */
980 struct conf_sig_weights sig_weights;
Juuso Oikarinen11f70f92009-10-13 12:47:46 +0300981
982 /*
983 * Specifies if beacon early termination procedure is enabled or
984 * disabled.
985 *
986 * Range: CONF_BET_MODE_*
987 */
988 u8 bet_enable;
989
990 /*
991 * Specifies the maximum number of consecutive beacons that may be
992 * early terminated. After this number is reached at least one full
993 * beacon must be correctly received in FW before beacon ET
994 * resumes.
995 *
996 * Range 0 - 255
997 */
998 u8 bet_max_consecutive;
Juuso Oikarinen19ad0712009-11-02 20:22:11 +0200999
1000 /*
1001 * Specifies the maximum number of times to try PSM entry if it fails
1002 * (if sending the appropriate null-func message fails.)
1003 *
1004 * Range 0 - 255
1005 */
1006 u8 psm_entry_retries;
Juuso Oikarinenc1899552010-03-26 12:53:32 +02001007
1008 /*
Eliad Pelleree608332011-02-02 09:59:34 +02001009 * Specifies the maximum number of times to try PSM exit if it fails
1010 * (if sending the appropriate null-func message fails.)
1011 *
1012 * Range 0 - 255
1013 */
1014 u8 psm_exit_retries;
1015
1016 /*
Juuso Oikarinen8eab7b42010-09-24 03:10:11 +02001017 * Specifies the maximum number of times to try transmit the PSM entry
1018 * null-func frame for each PSM entry attempt
1019 *
1020 * Range 0 - 255
1021 */
1022 u8 psm_entry_nullfunc_retries;
1023
1024 /*
1025 * Specifies the time to linger in active mode after successfully
1026 * transmitting the PSM entry null-func frame.
1027 *
1028 * Range 0 - 255 TU's
1029 */
1030 u8 psm_entry_hangover_period;
1031
1032 /*
Juuso Oikarinenc1899552010-03-26 12:53:32 +02001033 *
1034 * Specifies the interval of the connection keep-alive null-func
1035 * frame in ms.
1036 *
1037 * Range: 1000 - 3600000
1038 */
1039 u32 keep_alive_interval;
Juuso Oikarinen50c500a2010-04-01 11:38:22 +03001040
1041 /*
1042 * Maximum listen interval supported by the driver in units of beacons.
1043 *
1044 * Range: u16
1045 */
1046 u8 max_listen_interval;
Juuso Oikarinen51f2be22009-10-13 12:47:42 +03001047};
1048
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +03001049enum {
1050 CONF_REF_CLK_19_2_E,
1051 CONF_REF_CLK_26_E,
1052 CONF_REF_CLK_38_4_E,
Shahar Levi5aa42342011-03-06 16:32:07 +02001053 CONF_REF_CLK_52_E,
1054 CONF_REF_CLK_38_4_M_XTAL,
1055 CONF_REF_CLK_26_M_XTAL,
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +03001056};
1057
Teemu Paasikivi1ebec3d2009-10-13 12:47:48 +03001058enum single_dual_band_enum {
1059 CONF_SINGLE_BAND,
1060 CONF_DUAL_BAND
1061};
1062
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +03001063#define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
1064#define CONF_NUMBER_OF_SUB_BANDS_5 7
1065#define CONF_NUMBER_OF_RATE_GROUPS 6
1066#define CONF_NUMBER_OF_CHANNELS_2_4 14
1067#define CONF_NUMBER_OF_CHANNELS_5 35
1068
Luciano Coelho6e92b412009-12-11 15:40:50 +02001069struct conf_itrim_settings {
1070 /* enable dco itrim */
1071 u8 enable;
1072
1073 /* moderation timeout in microsecs from the last TX */
1074 u32 timeout;
1075};
1076
Juuso Oikarinen38ad2d82009-12-11 15:41:08 +02001077struct conf_pm_config_settings {
1078 /*
1079 * Host clock settling time
1080 *
1081 * Range: 0 - 30000 us
1082 */
1083 u32 host_clk_settling_time;
1084
1085 /*
1086 * Host fast wakeup support
1087 *
1088 * Range: true, false
1089 */
1090 bool host_fast_wakeup_support;
1091};
1092
Juuso Oikarinen00236aed2010-04-09 11:07:30 +03001093struct conf_roam_trigger_settings {
1094 /*
1095 * The minimum interval between two trigger events.
1096 *
1097 * Range: 0 - 60000 ms
1098 */
1099 u16 trigger_pacing;
1100
1101 /*
1102 * The weight for rssi/beacon average calculation
1103 *
1104 * Range: 0 - 255
1105 */
1106 u8 avg_weight_rssi_beacon;
1107
1108 /*
1109 * The weight for rssi/data frame average calculation
1110 *
1111 * Range: 0 - 255
1112 */
1113 u8 avg_weight_rssi_data;
1114
1115 /*
1116 * The weight for snr/beacon average calculation
1117 *
1118 * Range: 0 - 255
1119 */
1120 u8 avg_weight_snr_beacon;
1121
1122 /*
1123 * The weight for snr/data frame average calculation
1124 *
1125 * Range: 0 - 255
1126 */
1127 u8 avg_weight_snr_data;
1128};
1129
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001130struct conf_scan_settings {
1131 /*
1132 * The minimum time to wait on each channel for active scans
1133 *
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001134 * Range: u32 tu/1000
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001135 */
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001136 u32 min_dwell_time_active;
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001137
1138 /*
1139 * The maximum time to wait on each channel for active scans
1140 *
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001141 * Range: u32 tu/1000
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001142 */
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001143 u32 max_dwell_time_active;
1144
1145 /*
1146 * The minimum time to wait on each channel for passive scans
1147 *
1148 * Range: u32 tu/1000
1149 */
1150 u32 min_dwell_time_passive;
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001151
1152 /*
1153 * The maximum time to wait on each channel for passive scans
1154 *
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001155 * Range: u32 tu/1000
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001156 */
Juuso Oikarinenea45b2c2011-01-24 07:01:54 +01001157 u32 max_dwell_time_passive;
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001158
1159 /*
1160 * Number of probe requests to transmit on each active scan channel
1161 *
1162 * Range: u8
1163 */
1164 u16 num_probe_reqs;
1165
1166};
1167
Juuso Oikarinen644a4862010-10-05 13:11:56 +02001168/* these are number of channels on the band divided by two, rounded up */
1169#define CONF_TX_PWR_COMPENSATION_LEN_2 7
1170#define CONF_TX_PWR_COMPENSATION_LEN_5 18
1171
1172struct conf_rf_settings {
1173 /*
1174 * Per channel power compensation for 2.4GHz
1175 *
1176 * Range: s8
1177 */
1178 u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
1179
1180 /*
1181 * Per channel power compensation for 5GHz
1182 *
1183 * Range: s8
1184 */
1185 u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
1186};
1187
Levi, Shahar4b7fac72011-01-23 07:27:22 +01001188struct conf_ht_setting {
1189 u16 tx_ba_win_size;
1190 u16 inactivity_timeout;
1191};
1192
Eliad Pellerc8bde242011-02-02 09:59:35 +02001193struct conf_memory_settings {
Eliad Pellerfe5ef092011-02-02 09:59:36 +02001194 /* Number of stations supported in IBSS mode */
1195 u8 num_stations;
1196
1197 /* Number of ssid profiles used in IBSS mode */
1198 u8 ssid_profiles;
1199
1200 /* Number of memory buffers allocated to rx pool */
1201 u8 rx_block_num;
1202
1203 /* Minimum number of blocks allocated to tx pool */
1204 u8 tx_min_block_num;
1205
Eliad Pellerc8bde242011-02-02 09:59:35 +02001206 /* Disable/Enable dynamic memory */
1207 u8 dynamic_memory;
1208
1209 /*
1210 * Minimum required free tx memory blocks in order to assure optimum
1211 * performence
1212 *
1213 * Range: 0-120
1214 */
1215 u8 min_req_tx_blocks;
1216
1217 /*
1218 * Minimum required free rx memory blocks in order to assure optimum
1219 * performence
1220 *
1221 * Range: 0-120
1222 */
1223 u8 min_req_rx_blocks;
1224
1225 /*
1226 * Minimum number of mem blocks (free+used) guaranteed for TX
1227 *
1228 * Range: 0-120
1229 */
1230 u8 tx_min;
1231};
1232
Shahar Leviff868432011-04-11 15:41:46 +03001233struct conf_fm_coex {
1234 u8 enable;
1235 u8 swallow_period;
1236 u8 n_divider_fref_set_1;
1237 u8 n_divider_fref_set_2;
1238 u16 m_divider_fref_set_1;
1239 u16 m_divider_fref_set_2;
1240 u32 coex_pll_stabilization_time;
1241 u16 ldo_stabilization_time;
1242 u8 fm_disturbed_band_margin;
1243 u8 swallow_clk_diff;
1244};
1245
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +03001246struct conf_drv_settings {
1247 struct conf_sg_settings sg;
Juuso Oikarinen8793f9b2009-10-13 12:47:40 +03001248 struct conf_rx_settings rx;
Juuso Oikarinen45b531a2009-10-13 12:47:41 +03001249 struct conf_tx_settings tx;
Juuso Oikarinen51f2be22009-10-13 12:47:42 +03001250 struct conf_conn_settings conn;
Luciano Coelho6e92b412009-12-11 15:40:50 +02001251 struct conf_itrim_settings itrim;
Juuso Oikarinen38ad2d82009-12-11 15:41:08 +02001252 struct conf_pm_config_settings pm_config;
Juuso Oikarinen00236aed2010-04-09 11:07:30 +03001253 struct conf_roam_trigger_settings roam_trigger;
Juuso Oikarinenbea39d62010-09-21 08:14:31 +02001254 struct conf_scan_settings scan;
Juuso Oikarinen644a4862010-10-05 13:11:56 +02001255 struct conf_rf_settings rf;
Levi, Shahar4b7fac72011-01-23 07:27:22 +01001256 struct conf_ht_setting ht;
Shahar Levi13b107d2011-03-06 16:32:12 +02001257 struct conf_memory_settings mem_wl127x;
1258 struct conf_memory_settings mem_wl128x;
Shahar Leviff868432011-04-11 15:41:46 +03001259 struct conf_fm_coex fm_coex;
Luciano Coelhoafb7d3c2011-04-01 20:48:02 +03001260 u8 hci_io_ds;
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +03001261};
1262
1263#endif