Deleted Added
full compact
ar5211_reset.c (201758) ar5211_reset.c (208644)
1/*
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2006 Atheros Communications, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
1/*
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2006 Atheros Communications, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c 201758 2010-01-07 21:01:37Z mbr $
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c 208644 2010-05-29 16:14:02Z rpaulo $
18 */
19#include "opt_ah.h"
20
21/*
22 * Chips specific device attachment and device info collection
23 * Connects Init Reg Vectors, EEPROM Data, and device Functions.
24 */
25#include "ah.h"

--- 15 unchanged lines hidden (view full) ---

41 */
42typedef struct {
43 uint32_t refClkSel; /* reference clock, 1 for 16 MHz */
44 uint32_t channelSelect; /* P[7:4]S[3:0] bits */
45 uint16_t channel5111; /* 11a channel for 5111 */
46} CHAN_INFO_2GHZ;
47
48#define CI_2GHZ_INDEX_CORRECTION 19
18 */
19#include "opt_ah.h"
20
21/*
22 * Chips specific device attachment and device info collection
23 * Connects Init Reg Vectors, EEPROM Data, and device Functions.
24 */
25#include "ah.h"

--- 15 unchanged lines hidden (view full) ---

41 */
42typedef struct {
43 uint32_t refClkSel; /* reference clock, 1 for 16 MHz */
44 uint32_t channelSelect; /* P[7:4]S[3:0] bits */
45 uint16_t channel5111; /* 11a channel for 5111 */
46} CHAN_INFO_2GHZ;
47
48#define CI_2GHZ_INDEX_CORRECTION 19
49const static CHAN_INFO_2GHZ chan2GHzData[] = {
49static const CHAN_INFO_2GHZ chan2GHzData[] = {
50 { 1, 0x46, 96 }, /* 2312 -19 */
51 { 1, 0x46, 97 }, /* 2317 -18 */
52 { 1, 0x46, 98 }, /* 2322 -17 */
53 { 1, 0x46, 99 }, /* 2327 -16 */
54 { 1, 0x46, 100 }, /* 2332 -15 */
55 { 1, 0x46, 101 }, /* 2337 -14 */
56 { 1, 0x46, 102 }, /* 2342 -13 */
57 { 1, 0x46, 103 }, /* 2347 -12 */

--- 863 unchanged lines hidden (view full) ---

921static HAL_BOOL
922ar5211IsNfGood(struct ath_hal *ah, struct ieee80211_channel *chan)
923{
924 HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
925 int16_t nf, nfThresh;
926
927 if (!getNoiseFloorThresh(ah, chan, &nfThresh))
928 return AH_FALSE;
50 { 1, 0x46, 96 }, /* 2312 -19 */
51 { 1, 0x46, 97 }, /* 2317 -18 */
52 { 1, 0x46, 98 }, /* 2322 -17 */
53 { 1, 0x46, 99 }, /* 2327 -16 */
54 { 1, 0x46, 100 }, /* 2332 -15 */
55 { 1, 0x46, 101 }, /* 2337 -14 */
56 { 1, 0x46, 102 }, /* 2342 -13 */
57 { 1, 0x46, 103 }, /* 2347 -12 */

--- 863 unchanged lines hidden (view full) ---

921static HAL_BOOL
922ar5211IsNfGood(struct ath_hal *ah, struct ieee80211_channel *chan)
923{
924 HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
925 int16_t nf, nfThresh;
926
927 if (!getNoiseFloorThresh(ah, chan, &nfThresh))
928 return AH_FALSE;
929 if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF)
929 if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
930 HALDEBUG(ah, HAL_DEBUG_ANY,
931 "%s: NF did not complete in calibration window\n", __func__);
930 HALDEBUG(ah, HAL_DEBUG_ANY,
931 "%s: NF did not complete in calibration window\n", __func__);
932 }
932 nf = ar5211GetNoiseFloor(ah);
933 if (nf > nfThresh) {
934 HALDEBUG(ah, HAL_DEBUG_ANY,
935 "%s: noise floor failed; detected %u, threshold %u\n",
936 __func__, nf, nfThresh);
937 /*
938 * NB: Don't discriminate 2.4 vs 5Ghz, if this
939 * happens it indicates a problem regardless

--- 1181 unchanged lines hidden ---
933 nf = ar5211GetNoiseFloor(ah);
934 if (nf > nfThresh) {
935 HALDEBUG(ah, HAL_DEBUG_ANY,
936 "%s: noise floor failed; detected %u, threshold %u\n",
937 __func__, nf, nfThresh);
938 /*
939 * NB: Don't discriminate 2.4 vs 5Ghz, if this
940 * happens it indicates a problem regardless

--- 1181 unchanged lines hidden ---