Deleted Added
full compact
ar9280.c (203682) ar9280.c (203882)
1/*
2 * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2008 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) 2008-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2008 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/ar5416/ar9280.c 203682 2010-02-08 20:12:01Z rpaulo $
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar9280.c 203882 2010-02-14 16:26:32Z rpaulo $
18 */
19#include "opt_ah.h"
20
21/*
22 * NB: Merlin and later have a simpler RF backend.
23 */
24#include "ah.h"
25#include "ah_internal.h"

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

272
273 nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR);
274 if (nf & 0x100)
275 nf = 0 - ((nf ^ 0x1ff) + 1);
276 HALDEBUG(ah, HAL_DEBUG_NFCAL,
277 "NF calibrated [ctl] [chain 0] is %d\n", nf);
278 nfarray[0] = nf;
279
18 */
19#include "opt_ah.h"
20
21/*
22 * NB: Merlin and later have a simpler RF backend.
23 */
24#include "ah.h"
25#include "ah_internal.h"

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

272
273 nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR);
274 if (nf & 0x100)
275 nf = 0 - ((nf ^ 0x1ff) + 1);
276 HALDEBUG(ah, HAL_DEBUG_NFCAL,
277 "NF calibrated [ctl] [chain 0] is %d\n", nf);
278 nfarray[0] = nf;
279
280 if (!AR_SREV_KITE(ah)) {
281 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA),
282 AR9280_PHY_CH1_MINCCA_PWR);
283 if (nf & 0x100)
284 nf = 0 - ((nf ^ 0x1ff) + 1);
285 HALDEBUG(ah, HAL_DEBUG_NFCAL,
286 "NF calibrated [ctl] [chain 1] is %d\n", nf);
287 nfarray[1] = nf;
288 }
280 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR);
281 if (nf & 0x100)
282 nf = 0 - ((nf ^ 0x1ff) + 1);
283 HALDEBUG(ah, HAL_DEBUG_NFCAL,
284 "NF calibrated [ctl] [chain 1] is %d\n", nf);
285 nfarray[1] = nf;
289
290 nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR);
291 if (nf & 0x100)
292 nf = 0 - ((nf ^ 0x1ff) + 1);
293 HALDEBUG(ah, HAL_DEBUG_NFCAL,
294 "NF calibrated [ext] [chain 0] is %d\n", nf);
295 nfarray[3] = nf;
296
286
287 nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR);
288 if (nf & 0x100)
289 nf = 0 - ((nf ^ 0x1ff) + 1);
290 HALDEBUG(ah, HAL_DEBUG_NFCAL,
291 "NF calibrated [ext] [chain 0] is %d\n", nf);
292 nfarray[3] = nf;
293
297 if (AR_SREV_KITE(ah)) {
298 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA),
299 AR9280_PHY_CH1_EXT_MINCCA_PWR);
300 if (nf & 0x100)
294 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR);
295 if (nf & 0x100)
301 nf = 0 - ((nf ^ 0x1ff) + 1);
296 nf = 0 - ((nf ^ 0x1ff) + 1);
302 HALDEBUG(ah, HAL_DEBUG_NFCAL,
303 "NF calibrated [ext] [chain 1] is %d\n", nf);
304 nfarray[4] = nf;
305 }
297 HALDEBUG(ah, HAL_DEBUG_NFCAL,
298 "NF calibrated [ext] [chain 1] is %d\n", nf);
299 nfarray[4] = nf;
306}
307
308/*
309 * Adjust NF based on statistical values for 5GHz frequencies.
310 * Stubbed:Not used by Fowl
311 */
312int16_t
313ar9280GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)

--- 54 unchanged lines hidden ---
300}
301
302/*
303 * Adjust NF based on statistical values for 5GHz frequencies.
304 * Stubbed:Not used by Fowl
305 */
306int16_t
307ar9280GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)

--- 54 unchanged lines hidden ---