Deleted Added
full compact
ar9285_attach.c (219450) ar9285_attach.c (219481)
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/ar9285_attach.c 219450 2011-03-10 11:23:43Z adrian $
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c 219481 2011-03-11 11:58:54Z adrian $
18 */
19#include "opt_ah.h"
20
21#include "ah.h"
22#include "ah_internal.h"
23#include "ah_devid.h"
24
25#include "ah_eeprom_v4k.h" /* XXX for tx/rx gain */
26
27#include "ar9002/ar9280.h"
28#include "ar9002/ar9285.h"
29#include "ar5416/ar5416reg.h"
30#include "ar5416/ar5416phy.h"
31
32#include "ar9002/ar9285.ini"
33#include "ar9002/ar9285v2.ini"
34#include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */
35
18 */
19#include "opt_ah.h"
20
21#include "ah.h"
22#include "ah_internal.h"
23#include "ah_devid.h"
24
25#include "ah_eeprom_v4k.h" /* XXX for tx/rx gain */
26
27#include "ar9002/ar9280.h"
28#include "ar9002/ar9285.h"
29#include "ar5416/ar5416reg.h"
30#include "ar5416/ar5416phy.h"
31
32#include "ar9002/ar9285.ini"
33#include "ar9002/ar9285v2.ini"
34#include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */
35
36#include "ar9002/ar9285_cal.h"
37
36static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */
37 .calName = "IQ", .calType = IQ_MISMATCH_CAL,
38 .calNumSamples = MIN_CAL_SAMPLES,
39 .calCountMax = PER_MAX_LOG_COUNT,
40 .calCollect = ar5416IQCalCollect,
41 .calPostProc = ar5416IQCalibration
42};
43static const HAL_PERCAL_DATA ar9280_adc_gain_cal = { /* single sample */

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

113 ah->ah_setBoardValues = ar9285SetBoardValues;
114
115 AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal;
116 AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal;
117 AH5416(ah)->ah_cal.adcDcCalData.calData = &ar9280_adc_dc_cal;
118 AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal;
119 AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL;
120
38static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */
39 .calName = "IQ", .calType = IQ_MISMATCH_CAL,
40 .calNumSamples = MIN_CAL_SAMPLES,
41 .calCountMax = PER_MAX_LOG_COUNT,
42 .calCollect = ar5416IQCalCollect,
43 .calPostProc = ar5416IQCalibration
44};
45static const HAL_PERCAL_DATA ar9280_adc_gain_cal = { /* single sample */

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

115 ah->ah_setBoardValues = ar9285SetBoardValues;
116
117 AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal;
118 AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal;
119 AH5416(ah)->ah_cal.adcDcCalData.calData = &ar9280_adc_dc_cal;
120 AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal;
121 AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL;
122
123 if (AR_SREV_KITE_12_OR_LATER(ah))
124 AH5416(ah)->ah_cal_initcal = ar9285InitCalHardware;
125 AH5416(ah)->ah_cal_pacal = ar9002_hw_pa_cal;
126
121 AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate;
122 AH5416(ah)->ah_writeIni = ar9285WriteIni;
123 AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK;
124 AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK;
125
126 ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1;
127
128 if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {

--- 297 unchanged lines hidden ---
127 AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate;
128 AH5416(ah)->ah_writeIni = ar9285WriteIni;
129 AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK;
130 AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK;
131
132 ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1;
133
134 if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {

--- 297 unchanged lines hidden ---