iPXE
ath9k_ani.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5 * Original from Linux kernel 3.0.1
6 *
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20FILE_SECBOOT ( FORBIDDEN );
21
22#include "hw.h"
23#include "hw-ops.h"
24
30
31/* values here are relative to the INI */
32
33/*
34 * Legend:
35 *
36 * SI: Spur immunity
37 * FS: FIR Step
38 * WS: OFDM / CCK Weak Signal detection
39 * MRC-CCK: Maximal Ratio Combining for CCK
40 */
41
42static const struct ani_ofdm_level_entry ofdm_level_table[] = {
43 /* SI FS WS */
44 { 0, 0, 1 }, /* lvl 0 */
45 { 1, 1, 1 }, /* lvl 1 */
46 { 2, 2, 1 }, /* lvl 2 */
47 { 3, 2, 1 }, /* lvl 3 (default) */
48 { 4, 3, 1 }, /* lvl 4 */
49 { 5, 4, 1 }, /* lvl 5 */
50 { 6, 5, 1 }, /* lvl 6 */
51 { 7, 6, 1 }, /* lvl 7 */
52 { 7, 7, 1 }, /* lvl 8 */
53 { 7, 8, 0 } /* lvl 9 */
54};
55#define ATH9K_ANI_OFDM_NUM_LEVEL \
56 ARRAY_SIZE(ofdm_level_table)
57#define ATH9K_ANI_OFDM_MAX_LEVEL \
58 (ATH9K_ANI_OFDM_NUM_LEVEL-1)
59#define ATH9K_ANI_OFDM_DEF_LEVEL \
60 3 /* default level - matches the INI settings */
61
62/*
63 * MRC (Maximal Ratio Combining) has always been used with multi-antenna ofdm.
64 * With OFDM for single stream you just add up all antenna inputs, you're
65 * only interested in what you get after FFT. Signal aligment is also not
66 * required for OFDM because any phase difference adds up in the frequency
67 * domain.
68 *
69 * MRC requires extra work for use with CCK. You need to align the antenna
70 * signals from the different antenna before you can add the signals together.
71 * You need aligment of signals as CCK is in time domain, so addition can cancel
72 * your signal completely if phase is 180 degrees (think of adding sine waves).
73 * You also need to remove noise before the addition and this is where ANI
74 * MRC CCK comes into play. One of the antenna inputs may be stronger but
75 * lower SNR, so just adding after alignment can be dangerous.
76 *
77 * Regardless of alignment in time, the antenna signals add constructively after
78 * FFT and improve your reception. For more information:
79 *
80 * http://en.wikipedia.org/wiki/Maximal-ratio_combining
81 */
82
87
88static const struct ani_cck_level_entry cck_level_table[] = {
89 /* FS MRC-CCK */
90 { 0, 1 }, /* lvl 0 */
91 { 1, 1 }, /* lvl 1 */
92 { 2, 1 }, /* lvl 2 (default) */
93 { 3, 1 }, /* lvl 3 */
94 { 4, 0 }, /* lvl 4 */
95 { 5, 0 }, /* lvl 5 */
96 { 6, 0 }, /* lvl 6 */
97 { 7, 0 }, /* lvl 7 (only for high rssi) */
98 { 8, 0 } /* lvl 8 (only for high rssi) */
99};
100
101#define ATH9K_ANI_CCK_NUM_LEVEL \
102 ARRAY_SIZE(cck_level_table)
103#define ATH9K_ANI_CCK_MAX_LEVEL \
104 (ATH9K_ANI_CCK_NUM_LEVEL-1)
105#define ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI \
106 (ATH9K_ANI_CCK_NUM_LEVEL-3)
107#define ATH9K_ANI_CCK_DEF_LEVEL \
108 2 /* default level - matches the INI settings */
109
110static int use_new_ani(struct ath_hw *ah)
111{
113}
114
116 struct ath9k_mib_stats *stats)
117{
118 stats->ackrcv_bad += REG_READ(ah, AR_ACK_FAIL);
119 stats->rts_bad += REG_READ(ah, AR_RTS_FAIL);
120 stats->fcs_bad += REG_READ(ah, AR_FCS_FAIL);
121 stats->rts_good += REG_READ(ah, AR_RTS_OK);
122 stats->beacons += REG_READ(ah, AR_BEACON_CNT);
123}
124
125static void ath9k_ani_restart(struct ath_hw *ah)
126{
127 struct ar5416AniState *aniState;
128 u32 ofdm_base = 0, cck_base = 0;
129
130 if (!DO_ANI(ah))
131 return;
132
133 aniState = &ah->curchan->ani;
134 aniState->listenTime = 0;
135
136 if (!use_new_ani(ah)) {
137 ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high;
138 cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high;
139 }
140
141 DBG2("ath9k: "
142 "Writing ofdmbase=%d cckbase=%d\n", ofdm_base, cck_base);
143
145
146 REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base);
147 REG_WRITE(ah, AR_PHY_ERR_2, cck_base);
150
152
153 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
154
155 aniState->ofdmPhyErrCount = 0;
156 aniState->cckPhyErrCount = 0;
157}
158
160{
161 struct ar5416AniState *aniState;
162 int32_t rssi;
163
164 aniState = &ah->curchan->ani;
165
168 aniState->noiseImmunityLevel + 1)) {
169 return;
170 }
171 }
172
173 if (aniState->spurImmunityLevel < HAL_SPUR_IMMUNE_MAX) {
175 aniState->spurImmunityLevel + 1)) {
176 return;
177 }
178 }
179
180 rssi = BEACON_RSSI(ah);
181 if (rssi > aniState->rssiThrHigh) {
182 if (aniState->ofdmWeakSigDetect) {
185 0)) {
188 return;
189 }
190 }
191 if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) {
193 aniState->firstepLevel + 1);
194 return;
195 }
196 } else if (rssi > aniState->rssiThrLow) {
197 if (!aniState->ofdmWeakSigDetect)
200 1);
201 if (aniState->firstepLevel < HAL_FIRST_STEP_MAX)
203 aniState->firstepLevel + 1);
204 return;
205 } else {
206 if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) {
207 if (aniState->ofdmWeakSigDetect)
210 0);
211 if (aniState->firstepLevel > 0)
214 return;
215 }
216 }
217}
218
220{
221 struct ar5416AniState *aniState;
222 int32_t rssi;
223
224 aniState = &ah->curchan->ani;
227 aniState->noiseImmunityLevel + 1)) {
228 return;
229 }
230 }
231 rssi = BEACON_RSSI(ah);
232 if (rssi > aniState->rssiThrLow) {
233 if (aniState->firstepLevel < HAL_FIRST_STEP_MAX)
235 aniState->firstepLevel + 1);
236 } else {
237 if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ) {
238 if (aniState->firstepLevel > 0)
241 }
242 }
243}
244
245/* Adjust the OFDM Noise Immunity Level */
246static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
247{
248 struct ar5416AniState *aniState = &ah->curchan->ani;
249 const struct ani_ofdm_level_entry *entry_ofdm;
250 const struct ani_cck_level_entry *entry_cck;
251
252 aniState->noiseFloor = BEACON_RSSI(ah);
253
254 DBG2("ath9k: "
255 "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
256 aniState->ofdmNoiseImmunityLevel,
257 immunityLevel, aniState->noiseFloor,
258 aniState->rssiThrLow, aniState->rssiThrHigh);
259
260 aniState->ofdmNoiseImmunityLevel = immunityLevel;
261
262 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel];
263 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel];
264
265 if (aniState->spurImmunityLevel != entry_ofdm->spur_immunity_level)
268 entry_ofdm->spur_immunity_level);
269
270 if (aniState->firstepLevel != entry_ofdm->fir_step_level &&
271 entry_ofdm->fir_step_level >= entry_cck->fir_step_level)
274 entry_ofdm->fir_step_level);
275}
276
278{
279 struct ar5416AniState *aniState;
280
281 if (!DO_ANI(ah))
282 return;
283
284 if (!use_new_ani(ah)) {
286 return;
287 }
288
289 aniState = &ah->curchan->ani;
290
293}
294
295/*
296 * Set the ANI settings to match an CCK level.
297 */
298static void ath9k_hw_set_cck_nil(struct ath_hw *ah, uint8_t immunityLevel)
299{
300 struct ar5416AniState *aniState = &ah->curchan->ani;
301 const struct ani_ofdm_level_entry *entry_ofdm;
302 const struct ani_cck_level_entry *entry_cck;
303
304 aniState->noiseFloor = BEACON_RSSI(ah);
305 DBG2("ath9k: "
306 "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
307 aniState->cckNoiseImmunityLevel, immunityLevel,
308 aniState->noiseFloor, aniState->rssiThrLow,
309 aniState->rssiThrHigh);
310
311 if (aniState->noiseFloor <= (unsigned int)aniState->rssiThrLow &&
312 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
313 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
314
315 aniState->cckNoiseImmunityLevel = immunityLevel;
316
317 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel];
318 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel];
319
320 if (aniState->firstepLevel != entry_cck->fir_step_level &&
321 entry_cck->fir_step_level >= entry_ofdm->fir_step_level)
324 entry_cck->fir_step_level);
325
326 /* Skip MRC CCK for pre AR9003 families */
328 return;
329
330 if (aniState->mrcCCKOff == entry_cck->mrc_cck_on)
333 entry_cck->mrc_cck_on);
334}
335
337{
338 struct ar5416AniState *aniState;
339
340 if (!DO_ANI(ah))
341 return;
342
343 if (!use_new_ani(ah)) {
345 return;
346 }
347
348 aniState = &ah->curchan->ani;
349
352}
353
355{
356 struct ar5416AniState *aniState;
357 int32_t rssi;
358
359 aniState = &ah->curchan->ani;
360
361 rssi = BEACON_RSSI(ah);
362 if (rssi > aniState->rssiThrHigh) {
363 /* XXX: Handle me */
364 } else if (rssi > aniState->rssiThrLow) {
365 if (!aniState->ofdmWeakSigDetect) {
368 1) == 1)
369 return;
370 }
371 if (aniState->firstepLevel > 0) {
374 aniState->firstepLevel - 1) == 1)
375 return;
376 }
377 } else {
378 if (aniState->firstepLevel > 0) {
381 aniState->firstepLevel - 1) == 1)
382 return;
383 }
384 }
385
386 if (aniState->spurImmunityLevel > 0) {
388 aniState->spurImmunityLevel - 1))
389 return;
390 }
391
392 if (aniState->noiseImmunityLevel > 0) {
394 aniState->noiseImmunityLevel - 1);
395 return;
396 }
397}
398
399/*
400 * only lower either OFDM or CCK errors per turn
401 * we lower the other one next time
402 */
404{
405 struct ar5416AniState *aniState;
406
407 aniState = &ah->curchan->ani;
408
409 if (!use_new_ani(ah)) {
411 return;
412 }
413
414 /* lower OFDM noise immunity */
415 if (aniState->ofdmNoiseImmunityLevel > 0 &&
416 (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) {
418 return;
419 }
420
421 /* lower CCK noise immunity */
422 if (aniState->cckNoiseImmunityLevel > 0)
424}
425
462
463/*
464 * Restore the ANI parameters in the HAL and reset the statistics.
465 * This routine should be called for every hardware reset and for
466 * every channel change.
467 */
468void ath9k_ani_reset(struct ath_hw *ah, int is_scanning)
469{
470 struct ar5416AniState *aniState = &ah->curchan->ani;
471 struct ath9k_channel *chan = ah->curchan;
472
473 if (!DO_ANI(ah))
474 return;
475
476 if (!use_new_ani(ah))
477 return ath9k_ani_reset_old(ah);
478
479 ah->stats.ast_ani_reset++;
480
481 /* always allow mode (on/off) to be controlled */
482 ah->ani_function |= ATH9K_ANI_MODE;
483
484 if (is_scanning) {
485 /*
486 * If we're scanning or in AP mode, the defaults (ini)
487 * should be in place. For an AP we assume the historical
488 * levels for this channel are probably outdated so start
489 * from defaults instead.
490 */
491 if (aniState->ofdmNoiseImmunityLevel !=
493 aniState->cckNoiseImmunityLevel !=
495 DBG("ath9k: "
496 "Restore defaults: chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
497 chan->channel,
498 chan->channelFlags,
499 is_scanning,
500 aniState->ofdmNoiseImmunityLevel,
501 aniState->cckNoiseImmunityLevel);
502
505 }
506 } else {
507 /*
508 * restore historical levels for this channel
509 */
510 DBG2("ath9k: "
511 "Restore history: chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
512 chan->channel,
513 chan->channelFlags,
514 is_scanning,
515 aniState->ofdmNoiseImmunityLevel,
516 aniState->cckNoiseImmunityLevel);
517
519 aniState->ofdmNoiseImmunityLevel);
521 aniState->cckNoiseImmunityLevel);
522 }
523
524 /*
525 * enable phy counters if hw supports or if not, enable phy
526 * interrupts (so we can count each one)
527 */
529
531
534
536}
537
539{
541 struct ar5416AniState *aniState = &ah->curchan->ani;
542 u32 ofdm_base = 0;
543 u32 cck_base = 0;
544 u32 ofdmPhyErrCnt, cckPhyErrCnt;
545 u32 phyCnt1, phyCnt2;
547
550
551 if (listenTime <= 0) {
552 ah->stats.ast_ani_lneg++;
554 return 0;
555 }
556
557 if (!use_new_ani(ah)) {
558 ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high;
559 cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high;
560 }
561
562 aniState->listenTime += listenTime;
563
564 phyCnt1 = REG_READ(ah, AR_PHY_ERR_1);
565 phyCnt2 = REG_READ(ah, AR_PHY_ERR_2);
566
567 if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) {
568 if (phyCnt1 < ofdm_base) {
569 DBG2("ath9k: "
570 "phyCnt1 0x%x, resetting counter value to 0x%x\n",
571 phyCnt1, ofdm_base);
572 REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base);
575 }
576 if (phyCnt2 < cck_base) {
577 DBG2("ath9k: "
578 "phyCnt2 0x%x, resetting counter value to 0x%x\n",
579 phyCnt2, cck_base);
580 REG_WRITE(ah, AR_PHY_ERR_2, cck_base);
583 }
584 return 0;
585 }
586
587 ofdmPhyErrCnt = phyCnt1 - ofdm_base;
588 ah->stats.ast_ani_ofdmerrs +=
589 ofdmPhyErrCnt - aniState->ofdmPhyErrCount;
590 aniState->ofdmPhyErrCount = ofdmPhyErrCnt;
591
592 cckPhyErrCnt = phyCnt2 - cck_base;
593 ah->stats.ast_ani_cckerrs +=
594 cckPhyErrCnt - aniState->cckPhyErrCount;
595 aniState->cckPhyErrCount = cckPhyErrCnt;
596 return 1;
597}
598
600{
601 struct ar5416AniState *aniState;
602 u32 ofdmPhyErrRate, cckPhyErrRate;
603
604 if (!DO_ANI(ah))
605 return;
606
607 aniState = &ah->curchan->ani;
608 if (!aniState)
609 return;
610
612 return;
613
614 ofdmPhyErrRate = aniState->ofdmPhyErrCount * 1000 /
615 aniState->listenTime;
616 cckPhyErrRate = aniState->cckPhyErrCount * 1000 /
617 aniState->listenTime;
618
619 DBG2("ath9k: "
620 "listenTime=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n",
621 aniState->listenTime,
622 aniState->ofdmNoiseImmunityLevel,
623 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
624 cckPhyErrRate, aniState->ofdmsTurn);
625
626 if (aniState->listenTime > 5 * ah->aniperiod) {
627 if (ofdmPhyErrRate <= ah->config.ofdm_trig_low &&
628 cckPhyErrRate <= ah->config.cck_trig_low) {
630 aniState->ofdmsTurn = !aniState->ofdmsTurn;
631 }
633 } else if (aniState->listenTime > ah->aniperiod) {
634 /* check to see if need to raise immunity */
635 if (ofdmPhyErrRate > ah->config.ofdm_trig_high &&
636 (cckPhyErrRate <= ah->config.cck_trig_high ||
637 aniState->ofdmsTurn)) {
640 aniState->ofdmsTurn = 0;
641 } else if (cckPhyErrRate > ah->config.cck_trig_high) {
644 aniState->ofdmsTurn = 1;
645 }
646 }
647}
648
650{
651 int i;
652
653 static const int totalSizeDesired[] = { -55, -55, -55, -55, -62 };
654 static const int coarseHigh[] = { -14, -14, -14, -14, -12 };
655 static const int coarseLow[] = { -64, -64, -64, -64, -70 };
656 static const int firpwr[] = { -78, -78, -78, -78, -80 };
657
658 for (i = 0; i < 5; i++) {
659 ah->totalSizeDesired[i] = totalSizeDesired[i];
660 ah->coarse_high[i] = coarseHigh[i];
661 ah->coarse_low[i] = coarseLow[i];
662 ah->firpwr[i] = firpwr[i];
663 }
664}
665
667{
668 unsigned int i;
669
670 DBG2("ath9k: Initialize ANI\n");
671
672 if (use_new_ani(ah)) {
673 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW;
674 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW;
675
676 ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW;
677 ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW;
678 } else {
679 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD;
680 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD;
681
682 ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD;
683 ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD;
684 }
685
686 for (i = 0; i < ARRAY_SIZE(ah->channels); i++) {
687 struct ath9k_channel *chan = &ah->channels[i];
688 struct ar5416AniState *ani = &chan->ani;
689
690 if (use_new_ani(ah)) {
691 ani->spurImmunityLevel =
693
695
697 ani->mrcCCKOff =
699 else
700 ani->mrcCCKOff = 1;
701
702 ani->ofdmsTurn = 1;
703 } else {
704 ani->spurImmunityLevel =
707
710 }
711
714 ani->ofdmWeakSigDetect =
717 }
718
719 /*
720 * since we expect some ongoing maintenance on the tables, let's sanity
721 * check here default level should not modify INI setting.
722 */
723 if (use_new_ani(ah)) {
724 ah->aniperiod = ATH9K_ANI_PERIOD_NEW;
725 ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW;
726 } else {
727 ah->aniperiod = ATH9K_ANI_PERIOD_OLD;
728 ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_OLD;
729 }
730
731 if (ah->config.enable_ani)
732 ah->proc_phyerr |= HAL_PROCESS_ANI;
733
735}
#define ATH9K_ANI_CCK_TRIG_LOW_OLD
Definition ani.h:45
#define ATH9K_ANI_OFDM_TRIG_LOW_NEW
Definition ani.h:38
#define DO_ANI(ah)
Definition ani.h:28
#define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD
Definition ani.h:52
#define ATH9K_ANI_RSSI_THR_LOW
Definition ani.h:59
#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD
Definition ani.h:33
#define ATH9K_ANI_ENABLE_MRC_CCK
Definition ani.h:77
#define BEACON_RSSI(ahp)
Definition ani.h:30
#define ATH9K_ANI_CCK_TRIG_HIGH_OLD
Definition ani.h:41
#define ATH9K_ANI_RSSI_THR_HIGH
Definition ani.h:58
#define ATH9K_ANI_POLLINTERVAL_NEW
Definition ani.h:66
#define ATH9K_ANI_POLLINTERVAL_OLD
Definition ani.h:65
#define HAL_FIRST_STEP_MAX
Definition ani.h:70
#define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW
Definition ani.h:53
#define HAL_SPUR_IMMUNE_MAX
Definition ani.h:69
#define ATH9K_ANI_CCK_TRIG_LOW_NEW
Definition ani.h:46
@ ATH9K_ANI_NOISE_IMMUNITY_LEVEL
Definition ani.h:83
@ ATH9K_ANI_FIRSTEP_LEVEL
Definition ani.h:86
@ ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION
Definition ani.h:84
@ ATH9K_ANI_CCK_WEAK_SIGNAL_THR
Definition ani.h:85
@ ATH9K_ANI_MODE
Definition ani.h:88
@ ATH9K_ANI_SPUR_IMMUNITY_LEVEL
Definition ani.h:87
@ ATH9K_ANI_MRC_CCK
Definition ani.h:90
#define ATH9K_ANI_USE_OFDM_WEAK_SIG
Definition ani.h:49
#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW
Definition ani.h:34
#define ATH9K_ANI_FIRSTEP_LVL_NEW
Definition ani.h:56
#define HAL_PROCESS_ANI
Definition ani.h:26
#define ATH9K_ANI_OFDM_TRIG_LOW_OLD
Definition ani.h:37
#define ATH9K_ANI_PERIOD_OLD
Definition ani.h:61
#define HAL_NOISE_IMMUNE_MAX
Definition ani.h:68
#define ATH9K_ANI_PERIOD_NEW
Definition ani.h:62
#define ATH9K_ANI_FIRSTEP_LVL_OLD
Definition ani.h:55
#define ATH9K_ANI_CCK_TRIG_HIGH_NEW
Definition ani.h:42
#define ATH9K_ANI_CCK_WEAK_SIG_THR
Definition ani.h:50
signed int int32_t
Definition stdint.h:17
unsigned char uint8_t
Definition stdint.h:10
#define AR_PHY_ERR_MASK_1
Definition reg.h:1667
#define AR_PHY_COUNTMAX
Definition reg.h:1673
#define AR_PHY_ERR_2
Definition reg.h:1669
#define AR_BEACON_CNT
Definition reg.h:1585
#define AR_PHY_ERR_CCK_TIMING
Definition reg.h:1633
#define AR_SREV_9485(_ah)
Definition reg.h:868
#define AR_PHY_ERR_1
Definition reg.h:1665
#define AR_FCS_FAIL
Definition reg.h:1584
#define AR_RTS_OK
Definition reg.h:1581
#define AR_PHY_ERR_OFDM_TIMING
Definition reg.h:1632
#define AR_PHY_ERR_MASK_2
Definition reg.h:1671
#define AR_RTS_FAIL
Definition reg.h:1582
#define AR_ACK_FAIL
Definition reg.h:1583
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition reg.h:865
#define ATH9K_ANI_CCK_DEF_LEVEL
Definition ath9k_ani.c:107
static const struct ani_ofdm_level_entry ofdm_level_table[]
Definition ath9k_ani.c:42
#define ATH9K_ANI_OFDM_MAX_LEVEL
Definition ath9k_ani.c:57
void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan __unused)
Definition ath9k_ani.c:599
#define ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI
Definition ath9k_ani.c:105
#define ATH9K_ANI_OFDM_DEF_LEVEL
Definition ath9k_ani.c:59
static void ath9k_ani_reset_old(struct ath_hw *ah)
Definition ath9k_ani.c:426
static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
Definition ath9k_ani.c:403
static int use_new_ani(struct ath_hw *ah)
Definition ath9k_ani.c:110
static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
Definition ath9k_ani.c:277
void ath9k_hw_ani_setup(struct ath_hw *ah)
Definition ath9k_ani.c:649
void ath9k_hw_ani_init(struct ath_hw *ah)
Definition ath9k_ani.c:666
static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah)
Definition ath9k_ani.c:354
static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
Definition ath9k_ani.c:246
#define ATH9K_ANI_CCK_MAX_LEVEL
Definition ath9k_ani.c:103
static const struct ani_cck_level_entry cck_level_table[]
Definition ath9k_ani.c:88
static int ath9k_hw_ani_read_counters(struct ath_hw *ah)
Definition ath9k_ani.c:538
static void ath9k_ani_restart(struct ath_hw *ah)
Definition ath9k_ani.c:125
static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
Definition ath9k_ani.c:336
void ath9k_ani_reset(struct ath_hw *ah, int is_scanning)
Definition ath9k_ani.c:468
static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah)
Definition ath9k_ani.c:159
static void ath9k_hw_set_cck_nil(struct ath_hw *ah, uint8_t immunityLevel)
Definition ath9k_ani.c:298
static void ath9k_hw_update_mibstats(struct ath_hw *ah, struct ath9k_mib_stats *stats)
Definition ath9k_ani.c:115
static void ath9k_hw_ani_cck_err_trigger_old(struct ath_hw *ah)
Definition ath9k_ani.c:219
int modparam_force_new_ani
void ath9k_hw_setrxfilter(struct ath_hw *ah, u32 bits)
Definition ath9k_hw.c:1895
u32 ath9k_hw_getrxfilter(struct ath_hw *ah)
Definition ath9k_hw.c:1882
int32_t ath_hw_get_listen_time(struct ath_common *common)
Definition ath_hw.c:174
void ath_hw_cycle_counters_update(struct ath_common *common)
ath_hw_cycle_counters_update - common function to update cycle counters
Definition ath_hw.c:139
#define ARRAY_SIZE(x)
Definition efx_common.h:43
#define __unused
Declare a variable or data structure as unused.
Definition compiler.h:573
#define DBG2(...)
Definition compiler.h:515
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
Definition net80211.h:45
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
static int ath9k_hw_ani_control(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition hw-ops.h:247
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition hw.h:96
#define REG_WRITE(_ah, _reg, _val)
Definition hw.h:78
#define REG_READ(_ah, _reg)
Definition hw.h:81
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition hw.h:90
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition hw.h:870
struct ib_cm_common common
Definition ib_mad.h:0
#define u8
Definition igbvf_osdep.h:40
@ ATH9K_RX_FILTER_PHYERR
Definition mac.h:642
uint8_t ah
Definition registers.h:1
Definition ath9k_ani.c:83
int fir_step_level
Definition ath9k_ani.c:84
int mrc_cck_on
Definition ath9k_ani.c:85
Definition ath9k_ani.c:25
int spur_immunity_level
Definition ath9k_ani.c:26
int fir_step_level
Definition ath9k_ani.c:27
int ofdm_weak_signal_on
Definition ath9k_ani.c:28
u8 cckWeakSigThreshold
Definition ani.h:130
u32 noiseFloor
Definition ani.h:134
u32 cckPhyErrCount
Definition ani.h:136
int32_t rssiThrHigh
Definition ani.h:133
u8 firstepLevel
Definition ani.h:128
u32 listenTime
Definition ani.h:131
u8 cckNoiseImmunityLevel
Definition ani.h:124
u8 noiseImmunityLevel
Definition ani.h:122
int32_t rssiThrLow
Definition ani.h:132
u8 ofdmNoiseImmunityLevel
Definition ani.h:123
int ofdmsTurn
Definition ani.h:125
u32 ofdmPhyErrCount
Definition ani.h:135
u8 spurImmunityLevel
Definition ani.h:127
u8 ofdmWeakSigDetect
Definition ani.h:129
u8 mrcCCKOff
Definition ani.h:126
struct ar5416AniState ani
Definition hw.h:349
struct net80211_channel * chan
Definition hw.h:348
u32 rts_good
Definition ani.h:97
u32 rts_bad
Definition ani.h:96
u32 beacons
Definition ani.h:99
u32 ackrcv_bad
Definition ani.h:95
u32 fcs_bad
Definition ani.h:98
Definition hw.h:657
#define u32
Definition vga.h:21