Deleted Added
full compact
ar9280.c (218416) ar9280.c (219605)
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/ar9002/ar9280.c 218416 2011-02-07 21:30:56Z adrian $
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar9002/ar9280.c 219605 2011-03-13 13:00:45Z adrian $
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"

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

260 return(AH_FALSE);
261 }
262#else
263 *maxPow = *minPow = 0;
264 return AH_FALSE;
265#endif
266}
267
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"

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

260 return(AH_FALSE);
261 }
262#else
263 *maxPow = *minPow = 0;
264 return AH_FALSE;
265#endif
266}
267
268/*
269 * The ordering of nfarray is thus:
270 *
271 * nfarray[0]: Chain 0 ctl
272 * nfarray[1]: Chain 1 ctl
273 * nfarray[2]: Chain 2 ctl
274 * nfarray[3]: Chain 0 ext
275 * nfarray[4]: Chain 1 ext
276 * nfarray[5]: Chain 2 ext
277 */
268static void
269ar9280GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
270{
271 int16_t nf;
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);

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

292 nfarray[3] = nf;
293
294 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR);
295 if (nf & 0x100)
296 nf = 0 - ((nf ^ 0x1ff) + 1);
297 HALDEBUG(ah, HAL_DEBUG_NFCAL,
298 "NF calibrated [ext] [chain 1] is %d\n", nf);
299 nfarray[4] = nf;
278static void
279ar9280GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
280{
281 int16_t nf;
282
283 nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR);
284 if (nf & 0x100)
285 nf = 0 - ((nf ^ 0x1ff) + 1);

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

302 nfarray[3] = nf;
303
304 nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR);
305 if (nf & 0x100)
306 nf = 0 - ((nf ^ 0x1ff) + 1);
307 HALDEBUG(ah, HAL_DEBUG_NFCAL,
308 "NF calibrated [ext] [chain 1] is %d\n", nf);
309 nfarray[4] = nf;
310
311 /* Chain 2 - invalid */
312 nfarray[2] = 0;
313 nfarray[5] = 0;
314
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 ---
315}
316
317/*
318 * Adjust NF based on statistical values for 5GHz frequencies.
319 * Stubbed:Not used by Fowl
320 */
321int16_t
322ar9280GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)

--- 54 unchanged lines hidden ---