FreeBSD kernel ATH device code
ar9287_attach.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: ISC
3 *
4 * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
5 * Copyright (c) 2008 Atheros Communications, Inc.
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 * $FreeBSD$
20 */
21#include "opt_ah.h"
22
23#include "ah.h"
24#include "ah_internal.h"
25#include "ah_devid.h"
26
27#include "ah_eeprom_v14.h" /* XXX for tx/rx gain */
28#include "ah_eeprom_9287.h"
29
30#include "ar9002/ar9280.h"
31#include "ar9002/ar9287.h"
32#include "ar5416/ar5416reg.h"
33#include "ar5416/ar5416phy.h"
34
35#include "ar9002/ar9287_cal.h"
36#include "ar9002/ar9287_reset.h"
37#include "ar9002/ar9287_olc.h"
38
39#include "ar9002/ar9287.ini"
40
41static const HAL_PERCAL_DATA ar9287_iq_cal = { /* single sample */
42 .calName = "IQ", .calType = IQ_MISMATCH_CAL,
43 .calNumSamples = MIN_CAL_SAMPLES,
44 .calCountMax = PER_MAX_LOG_COUNT,
45 .calCollect = ar5416IQCalCollect,
46 .calPostProc = ar5416IQCalibration
47};
48static const HAL_PERCAL_DATA ar9287_adc_gain_cal = { /* single sample */
49 .calName = "ADC Gain", .calType = ADC_GAIN_CAL,
50 .calNumSamples = MIN_CAL_SAMPLES,
51 .calCountMax = PER_MIN_LOG_COUNT,
52 .calCollect = ar5416AdcGainCalCollect,
53 .calPostProc = ar5416AdcGainCalibration
54};
55static const HAL_PERCAL_DATA ar9287_adc_dc_cal = { /* single sample */
56 .calName = "ADC DC", .calType = ADC_DC_CAL,
57 .calNumSamples = MIN_CAL_SAMPLES,
58 .calCountMax = PER_MIN_LOG_COUNT,
59 .calCollect = ar5416AdcDcCalCollect,
60 .calPostProc = ar5416AdcDcCalibration
61};
63 .calName = "ADC Init DC", .calType = ADC_DC_INIT_CAL,
64 .calNumSamples = MIN_CAL_SAMPLES,
65 .calCountMax = INIT_LOG_COUNT,
66 .calCollect = ar5416AdcDcCalCollect,
67 .calPostProc = ar5416AdcDcCalibration
68};
69
70static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore,
71 HAL_BOOL power_off);
72static void ar9287DisablePCIE(struct ath_hal *ah);
74static void ar9287WriteIni(struct ath_hal *ah,
75 const struct ieee80211_channel *chan);
76
77static void
79{
80 /*
81 * These are the parameters from the AR5416 ANI code;
82 * they likely need quite a bit of adjustment for the
83 * AR9287.
84 */
85 static const struct ar5212AniParams aniparams = {
86 .maxNoiseImmunityLevel = 4, /* levels 0..4 */
87 .totalSizeDesired = { -55, -55, -55, -55, -62 },
88 .coarseHigh = { -14, -14, -14, -14, -12 },
89 .coarseLow = { -64, -64, -64, -64, -70 },
90 .firpwr = { -78, -78, -78, -78, -80 },
91 .maxSpurImmunityLevel = 7,
92 .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 },
93 .maxFirstepLevel = 2, /* levels 0..2 */
94 .firstep = { 0, 4, 8 },
95 .ofdmTrigHigh = 500,
96 .ofdmTrigLow = 200,
97 .cckTrigHigh = 200,
98 .cckTrigLow = 100,
99 .rssiThrHigh = 40,
100 .rssiThrLow = 7,
101 .period = 100,
102 };
103 /* NB: disable ANI noise immmunity for reliable RIFS rx */
104 AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
105
106 /* NB: ANI is not enabled yet */
107 ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
108}
109
110/*
111 * Attach for an AR9287 part.
112 */
113static struct ath_hal *
114ar9287Attach(uint16_t devid, HAL_SOFTC sc,
115 HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
117 HAL_STATUS *status)
118{
119 struct ath_hal_9287 *ahp9287;
120 struct ath_hal_5212 *ahp;
121 struct ath_hal *ah;
122 uint32_t val;
123 HAL_STATUS ecode;
124 HAL_BOOL rfStatus;
125 int8_t pwr_table_offset;
126
127 HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n",
128 __func__, sc, (void*) st, (void*) sh);
129
130 /* NB: memory is returned zero'd */
131 ahp9287 = ath_hal_malloc(sizeof (struct ath_hal_9287));
132 if (ahp9287 == AH_NULL) {
134 "%s: cannot allocate memory for state block\n", __func__);
135 *status = HAL_ENOMEM;
136 return AH_NULL;
137 }
138 ahp = AH5212(ahp9287);
139 ah = &ahp->ah_priv.h;
140
141 ar5416InitState(AH5416(ah), devid, sc, st, sh, status);
142
143 if (eepromdata != AH_NULL) {
144 AH_PRIVATE(ah)->ah_eepromRead = ath_hal_EepromDataRead;
145 AH_PRIVATE(ah)->ah_eepromWrite = NULL;
146 ah->ah_eepromdata = eepromdata;
147 }
148
149 /* XXX override with 9280 specific state */
150 /* override 5416 methods for our needs */
151 AH5416(ah)->ah_initPLL = ar9280InitPLL;
152
156
157 AH5416(ah)->ah_cal.iqCalData.calData = &ar9287_iq_cal;
158 AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9287_adc_gain_cal;
159 AH5416(ah)->ah_cal.adcDcCalData.calData = &ar9287_adc_dc_cal;
160 AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9287_adc_init_dc_cal;
161 /* Better performance without ADC Gain Calibration */
162 AH5416(ah)->ah_cal.suppCals = ADC_DC_CAL | IQ_MISMATCH_CAL;
163
164 AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate;
165 AH5416(ah)->ah_writeIni = ar9287WriteIni;
166
169
170 AH5416(ah)->ah_olcInit = ar9287olcInit;
171 AH5416(ah)->ah_olcTempCompensation = ar9287olcTemperatureCompensation;
172 //AH5416(ah)->ah_setPowerCalTable = ar9287SetPowerCalTable;
173 AH5416(ah)->ah_cal_initcal = ar9287InitCalHardware;
174 AH5416(ah)->ah_cal_pacal = ar9287PACal;
175
176 /* XXX NF calibration */
177 /* XXX Ini override? (IFS vars - since the kiwi mac clock is faster?) */
178 /* XXX what else is kiwi-specific in the radio/calibration pathway? */
179
180 AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK;
181 AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK;
182
184 /* reset chip */
185 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n",
186 __func__);
187 ecode = HAL_EIO;
188 goto bad;
189 }
190
192 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
193 __func__);
194 ecode = HAL_EIO;
195 goto bad;
196 }
197 /* Read Revisions from Chips before taking out of reset */
198 val = OS_REG_READ(ah, AR_SREV);
200 "%s: ID 0x%x VERSION 0x%x TYPE 0x%x REVISION 0x%x\n",
201 __func__, MS(val, AR_XSREV_ID), MS(val, AR_XSREV_VERSION),
202 MS(val, AR_XSREV_TYPE), MS(val, AR_XSREV_REVISION));
203 /* NB: include chip type to differentiate from pre-Sowl versions */
204 AH_PRIVATE(ah)->ah_macVersion =
206 AH_PRIVATE(ah)->ah_macRev = MS(val, AR_XSREV_REVISION);
207 AH_PRIVATE(ah)->ah_ispcie = (val & AR_XSREV_TYPE_HOST_MODE) == 0;
208
209 /* Don't support Kiwi < 1.2; those are pre-release chips */
210 if (! AR_SREV_KIWI_12_OR_LATER(ah)) {
211 ath_hal_printf(ah, "[ath]: Kiwi < 1.2 is not supported\n");
212 ecode = HAL_EIO;
213 goto bad;
214 }
215
216 /* setup common ini data; rf backends handle remainder */
217 HAL_INI_INIT(&ahp->ah_ini_modes, ar9287Modes_9287_1_1, 6);
218 HAL_INI_INIT(&ahp->ah_ini_common, ar9287Common_9287_1_1, 2);
219
220 /* If pcie_clock_req */
221 HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes,
222 ar9287PciePhy_clkreq_always_on_L1_9287_1_1, 2);
223
224 /* XXX WoW ini values */
225
226 /* Else */
227#if 0
228 HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes,
229 ar9287PciePhy_clkreq_off_L1_9287_1_1, 2);
230#endif
231
232 /* Initialise Japan arrays */
234 ar9287Common_normal_cck_fir_coeff_9287_1_1, 2);
236 ar9287Common_japan_2484_cck_fir_coeff_9287_1_1, 2);
237
239
240 ecode = ath_hal_9287EepromAttach(ah);
241 if (ecode != HAL_OK)
242 goto bad;
243
244 if (!ar5416ChipReset(ah, AH_NULL, HAL_RESET_NORMAL)) { /* reset chip */
245 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__);
246 ecode = HAL_EIO;
247 goto bad;
248 }
249
250 AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID);
251
252 if (!ar5212ChipTest(ah)) {
253 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: hardware self-test failed\n",
254 __func__);
255 ecode = HAL_ESELFTEST;
256 goto bad;
257 }
258
259 /*
260 * Set correct Baseband to analog shift
261 * setting to access analog chips.
262 */
263 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
264
265 /* Read Radio Chip Rev Extract */
266 AH_PRIVATE(ah)->ah_analog5GhzRev = ar5416GetRadioRev(ah);
268 case AR_RAD2133_SREV_MAJOR: /* Sowl: 2G/3x3 */
269 case AR_RAD5133_SREV_MAJOR: /* Sowl: 2+5G/3x3 */
270 break;
271 default:
272 if (AH_PRIVATE(ah)->ah_analog5GhzRev == 0) {
273 AH_PRIVATE(ah)->ah_analog5GhzRev =
275 break;
276 }
277#ifdef AH_DEBUG
279 "%s: 5G Radio Chip Rev 0x%02X is not supported by "
280 "this driver\n", __func__,
282 ecode = HAL_ENOTSUPP;
283 goto bad;
284#endif
285 }
286 rfStatus = ar9287RfAttach(ah, &ecode);
287 if (!rfStatus) {
288 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n",
289 __func__, ecode);
290 goto bad;
291 }
292
293 /*
294 * We only implement open-loop TX power control
295 * for the AR9287 in this codebase.
296 */
298 ath_hal_printf(ah, "[ath] AR9287 w/ closed-loop TX power control"
299 " isn't supported.\n");
300 ecode = HAL_ENOTSUPP;
301 goto bad;
302 }
303
304 /*
305 * Check whether the power table offset isn't the default.
306 * This can occur with eeprom minor V21 or greater on Merlin.
307 */
308 (void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, &pwr_table_offset);
309 if (pwr_table_offset != AR5416_PWR_TABLE_OFFSET_DB)
310 ath_hal_printf(ah, "[ath]: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm; curves will be adjusted.\n",
311 AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset);
312
313 /* setup rxgain table */
314 HAL_INI_INIT(&ahp9287->ah_ini_rxgain, ar9287Modes_rx_gain_9287_1_1, 6);
315
316 /* setup txgain table */
317 HAL_INI_INIT(&ahp9287->ah_ini_txgain, ar9287Modes_tx_gain_9287_1_1, 6);
318
319 /*
320 * Got everything we need now to setup the capabilities.
321 */
322 if (!ar9287FillCapabilityInfo(ah)) {
323 ecode = HAL_EEREAD;
324 goto bad;
325 }
326
328 if (ecode != HAL_OK) {
330 "%s: error getting mac address from EEPROM\n", __func__);
331 goto bad;
332 }
333 /* XXX How about the serial number ? */
334 /* Read Reg Domain */
335 AH_PRIVATE(ah)->ah_currentRD =
337 AH_PRIVATE(ah)->ah_currentRDext = AR9287_RDEXT_DEFAULT;
338
339 /*
340 * ah_miscMode is populated by ar5416FillCapabilityInfo()
341 * starting from griffin. Set here to make sure that
342 * AR_MISC_MODE_MIC_NEW_LOC_ENABLE is set before a GTK is
343 * placed into hardware.
344 */
345 if (ahp->ah_miscMode != 0)
347
348 ar9287AniSetup(ah); /* Anti Noise Immunity */
349
350 /* Setup noise floor min/max/nominal values */
353 AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9287_2GHZ;
356 AH5416(ah)->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_9287_5GHZ;
357
358 ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist);
359
360 HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__);
361
362 return ah;
363bad:
364 if (ah != AH_NULL)
365 ah->ah_detach(ah);
366 if (status)
367 *status = ecode;
368 return AH_NULL;
369}
370
371static void
372ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
373{
374 if (AH_PRIVATE(ah)->ah_ispcie && !restore) {
375 ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0);
376 OS_DELAY(1000);
378 /* Yes, Kiwi uses the Kite PCIe PHY WA */
380 }
381}
382
383static void
385{
386 /* XXX TODO */
387}
388
389static void
390ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
391{
392 u_int modesIndex, freqIndex;
393 int regWrites = 0;
394
395 /* Setup the indices for the next set of register array writes */
396 /* XXX Ignore 11n dynamic mode on the AR5416 for the moment */
397 if (IEEE80211_IS_CHAN_2GHZ(chan)) {
398 freqIndex = 2;
399 if (IEEE80211_IS_CHAN_HT40(chan))
400 modesIndex = 3;
401 else if (IEEE80211_IS_CHAN_108G(chan))
402 modesIndex = 5;
403 else
404 modesIndex = 4;
405 } else {
406 freqIndex = 1;
407 if (IEEE80211_IS_CHAN_HT40(chan) ||
408 IEEE80211_IS_CHAN_TURBO(chan))
409 modesIndex = 2;
410 else
411 modesIndex = 1;
412 }
413
414 /* Set correct Baseband to analog shift setting to access analog chips. */
415 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
417
418 regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_modes, modesIndex, regWrites);
419 regWrites = ath_hal_ini_write(ah, &AH9287(ah)->ah_ini_rxgain, modesIndex, regWrites);
420 regWrites = ath_hal_ini_write(ah, &AH9287(ah)->ah_ini_txgain, modesIndex, regWrites);
421 regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, 1, regWrites);
422}
423
424/*
425 * Fill all software cached or static hardware state information.
426 * Return failure if capabilities are to come from EEPROM and
427 * cannot be read.
428 */
429static HAL_BOOL
431{
432 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
433
435 return AH_FALSE;
436 pCap->halNumGpioPins = 10;
437 pCap->halWowSupport = AH_TRUE;
439#if 0
440 pCap->halWowMatchPatternDword = AH_TRUE;
441#endif
442
443 pCap->halCSTSupport = AH_TRUE;
446 pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
449#if 0
450 /* XXX bluetooth */
452#endif
453 pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
455 /* Disable this so Block-ACK works correctly */
459
460 /* Hardware supports (at least) single-stream STBC TX/RX */
461 pCap->halRxStbcSupport = 1;
462 pCap->halTxStbcSupport = 1;
463
464 /* Hardware supports short-GI w/ 20MHz */
465 pCap->halHTSGI20Support = 1;
466
468
469 return AH_TRUE;
470}
471
472/*
473 * This has been disabled - having the HAL flip chainmasks on/off
474 * when attempting to implement 11n disrupts things. For now, just
475 * leave this flipped off and worry about implementing TX diversity
476 * for legacy and MCS0-15 when 11n is fully functioning.
477 */
480{
481 return AH_TRUE;
482}
483
484static const char*
485ar9287Probe(uint16_t vendorid, uint16_t devid)
486{
487 if (vendorid == ATHEROS_VENDOR_ID) {
488 if (devid == AR9287_DEVID_PCI)
489 return "Atheros 9227";
490 if (devid == AR9287_DEVID_PCIE)
491 return "Atheros 9287";
492 }
493 return AH_NULL;
494}
HAL_BOOL ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data)
Definition: ah.c:1527
int ath_hal_ini_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia, int col, int regWr)
Definition: ah.c:1312
HAL_STATUS
Definition: ah.h:71
@ HAL_EIO
Definition: ah.h:75
@ HAL_ESELFTEST
Definition: ah.h:86
@ HAL_EEREAD
Definition: ah.h:80
@ HAL_ENOTSUPP
Definition: ah.h:85
@ HAL_OK
Definition: ah.h:72
@ HAL_ENOMEM
Definition: ah.h:74
@ HAL_PM_AWAKE
Definition: ah.h:440
@ HAL_RESET_NORMAL
Definition: ah.h:772
HAL_ANT_SETTING
Definition: ah.h:758
@ HAL_RESET_POWER_ON
Definition: ah.h:778
HAL_BOOL
Definition: ah.h:93
@ AH_FALSE
Definition: ah.h:94
@ AH_TRUE
Definition: ah.h:95
@ HAL_DEBUG_ANY
Definition: ah_debug.h:62
@ HAL_DEBUG_ATTACH
Definition: ah_debug.h:30
#define AR9287_DEVID_PCI
Definition: ah_devid.h:85
#define ATHEROS_VENDOR_ID
Definition: ah_devid.h:25
#define AR9287_DEVID_PCIE
Definition: ah_devid.h:86
HAL_STATUS ath_hal_9287EepromAttach(struct ath_hal *ah)
@ AR_EEP_MACADDR
Definition: ah_eeprom.h:77
@ AR_EEP_PWR_TABLE_OFFSET
Definition: ah_eeprom.h:105
@ AR_EEP_REGDMN_0
Definition: ah_eeprom.h:86
@ AR_EEP_OL_PWRCTRL
Definition: ah_eeprom.h:100
#define AR9287_RDEXT_DEFAULT
#define AR5416_PWR_TABLE_OFFSET_DB
Definition: ah_eeprom_v14.h:85
#define OS_REG_SET_BIT(_a, _r, _f)
Definition: ah_internal.h:594
#define HAL_INI_INIT(_ia, _data, _cols)
Definition: ah_internal.h:910
#define MS(_v, _f)
Definition: ah_internal.h:588
#define ath_hal_eepromGet(_ah, _param, _val)
Definition: ah_internal.h:486
#define AH_PRIVATE(_ah)
Definition: ah_internal.h:442
void * ath_hal_malloc(size_t)
#define AH_NULL
Definition: ah_internal.h:28
#define HALDEBUG(_ah, __m,...)
Definition: ah_internal.h:658
#define ath_hal_eepromGetFlag(_ah, _param)
Definition: ah_internal.h:490
void ath_hal_printf(struct ath_hal *, const char *,...)
Definition: ah_osdep.c:80
#define OS_DELAY(_n)
Definition: ah_osdep.h:69
bus_space_tag_t HAL_BUS_TAG
Definition: ah_osdep.h:50
#define OS_REG_WRITE(_ah, _reg, _val)
Definition: ah_osdep.h:139
void * HAL_SOFTC
Definition: ah_osdep.h:49
bus_space_handle_t HAL_BUS_HANDLE
Definition: ah_osdep.h:51
#define OS_REG_READ(_ah, _reg)
Definition: ah_osdep.h:140
#define AR_PHY(_n)
Definition: ar5210phy.h:30
#define AR_SREV
Definition: ar5210reg.h:63
#define AR_PHY_CHIP_ID
Definition: ar5211phy.h:36
HAL_BOOL ar5212ChipTest(struct ath_hal *ah)
#define AH5212(_ah)
Definition: ar5212.h:354
#define AR_MISC_MODE
Definition: ar5212reg.h:321
#define AR_RADIO_SREV_MAJOR
Definition: ar5212reg.h:796
#define AH5416(_ah)
Definition: ar5416.h:162
void ar5416InitState(struct ath_hal_5416 *, uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status)
Definition: ar5416_attach.c:86
HAL_BOOL ar5416ChipReset(struct ath_hal *ah, const struct ieee80211_channel *, HAL_RESET_TYPE)
Definition: ar5416_reset.c:779
HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip)
Definition: ar5416_power.c:127
void ar5416AttachPCIE(struct ath_hal *ah)
HAL_BOOL ar5416FillCapabilityInfo(struct ath_hal *ah)
void ar5416AniAttach(struct ath_hal *, const struct ar5212AniParams *, const struct ar5212AniParams *, HAL_BOOL ena)
Definition: ar5416_ani.c:133
HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type)
uint32_t ar5416GetRadioRev(struct ath_hal *ah)
void ar5416InitNfHistBuff(struct ar5212NfCalHist *h)
Definition: ar5416_cal.c:696
#define INIT_LOG_COUNT
Definition: ar5416_cal.h:46
#define PER_MAX_LOG_COUNT
Definition: ar5416_cal.h:48
void ar5416AdcDcCalCollect(struct ath_hal *ah)
@ ADC_DC_CAL
Definition: ar5416_cal.h:27
@ ADC_DC_INIT_CAL
Definition: ar5416_cal.h:25
@ IQ_MISMATCH_CAL
Definition: ar5416_cal.h:28
@ ADC_GAIN_CAL
Definition: ar5416_cal.h:26
#define MIN_CAL_SAMPLES
Definition: ar5416_cal.h:44
void ar5416AdcDcCalibration(struct ath_hal *ah, uint8_t numChains)
void ar5416AdcGainCalibration(struct ath_hal *ah, uint8_t numChains)
void ar5416AdcGainCalCollect(struct ath_hal *ah)
void ar5416IQCalCollect(struct ath_hal *ah)
Definition: ar5416_cal_iq.c:40
#define PER_MIN_LOG_COUNT
Definition: ar5416_cal.h:47
void ar5416IQCalibration(struct ath_hal *ah, uint8_t numChains)
Definition: ar5416_cal_iq.c:66
#define AR_PHY_SEL_INTERNAL_ADDAC
Definition: ar5416phy.h:164
#define AR_PHY_ADC_SERIAL_CTL
Definition: ar5416phy.h:163
#define AR_RAD5133_SREV_MAJOR
Definition: ar5416reg.h:642
#define AR_XSREV_VERSION
Definition: ar5416reg.h:659
#define AR_XSREV_TYPE
Definition: ar5416reg.h:661
#define AR_PCIE_PM_CTRL_ENA
Definition: ar5416reg.h:279
#define AR9285_WA_DEFAULT
Definition: ar5416reg.h:277
#define AR_RAD2133_SREV_MAJOR
Definition: ar5416reg.h:643
#define AR_PCIE_PM_CTRL
Definition: ar5416reg.h:37
#define AR_XSREV_ID
Definition: ar5416reg.h:657
#define AR_XSREV_TYPE_HOST_MODE
Definition: ar5416reg.h:664
#define AR_WA
Definition: ar5416reg.h:36
#define AR_XSREV_TYPE_S
Definition: ar5416reg.h:662
#define AR_XSREV_REVISION
Definition: ar5416reg.h:665
#define AR_SREV_KIWI_12_OR_LATER(_ah)
Definition: ar5416reg.h:801
void ar9280InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
void ar9280SpurMitigate(struct ath_hal *, const struct ieee80211_channel *)
HAL_BOOL ar9287RfAttach(struct ath_hal *ah, HAL_STATUS *status)
Definition: ar9287.c:359
#define AR9287(ah)
Definition: ar9287.c:41
#define AR9287_DEFAULT_RXCHAINMASK
Definition: ar9287.h:49
#define AR_PHY_CCA_MAX_GOOD_VAL_9287_5GHZ
Definition: ar9287.h:57
#define AR_PHY_CCA_NOM_VAL_9287_5GHZ
Definition: ar9287.h:53
#define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ
Definition: ar9287.h:56
#define AR9287_DEFAULT_TXCHAINMASK
Definition: ar9287.h:50
#define AR_PHY_CCA_MIN_GOOD_VAL_9287_5GHZ
Definition: ar9287.h:55
#define AR_PHY_CCA_NOM_VAL_9287_2GHZ
Definition: ar9287.h:52
#define AH9287(_ah)
Definition: ar9287.h:47
#define AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ
Definition: ar9287.h:54
static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah)
static void ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
static void ar9287DisablePCIE(struct ath_hal *ah)
static void ar9287AniSetup(struct ath_hal *ah)
Definition: ar9287_attach.c:78
static const HAL_PERCAL_DATA ar9287_iq_cal
Definition: ar9287_attach.c:41
static const HAL_PERCAL_DATA ar9287_adc_dc_cal
Definition: ar9287_attach.c:55
static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
static const HAL_PERCAL_DATA ar9287_adc_gain_cal
Definition: ar9287_attach.c:48
static const char * ar9287Probe(uint16_t vendorid, uint16_t devid)
static const HAL_PERCAL_DATA ar9287_adc_init_dc_cal
Definition: ar9287_attach.c:62
AH_CHIP(AR9287, ar9287Probe, ar9287Attach)
static struct ath_hal * ar9287Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
HAL_BOOL ar9287SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings)
HAL_BOOL ar9287InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan)
Definition: ar9287_cal.c:54
void ar9287PACal(struct ath_hal *ah, HAL_BOOL is_reset)
Definition: ar9287_cal.c:45
void ar9287olcTemperatureCompensation(struct ath_hal *ah)
Definition: ar9287_olc.c:67
void ar9287olcInit(struct ath_hal *ah)
Definition: ar9287_olc.c:47
HAL_BOOL ar9287SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan)
Definition: ar9287_reset.c:453
HAL_BOOL ar9287SetTransmitPower(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
Definition: ar9287_reset.c:329
uint32_t halWowMatchPatternExact
Definition: ah_internal.h:250
uint32_t halAutoSleepSupport
Definition: ah_internal.h:251
uint32_t halTxStbcSupport
Definition: ah_internal.h:255
uint8_t halNumGpioPins
Definition: ah_internal.h:305
uint32_t halRifsTxSupport
Definition: ah_internal.h:259
uint32_t halUseCombinedRadarRssi
Definition: ah_internal.h:262
uint32_t halRxStbcSupport
Definition: ah_internal.h:254
uint32_t halCSTSupport
Definition: ah_internal.h:257
uint32_t halBtCoexSupport
Definition: ah_internal.h:253
uint32_t halExtChanDfsSupport
Definition: ah_internal.h:261
uint32_t halWowSupport
Definition: ah_internal.h:249
uint32_t halSpectralScanSupport
Definition: ah_internal.h:290
uint32_t halHasRxSelfLinkedTail
Definition: ah_internal.h:269
uint32_t halRifsRxSupport
Definition: ah_internal.h:258
uint32_t halHTSGI20Support
Definition: ah_internal.h:246
uint32_t halPSPollBroken
Definition: ah_internal.h:238
uint32_t hal4kbSplitTransSupport
Definition: ah_internal.h:268
uint32_t halEnhancedDfsSupport
Definition: ah_internal.h:265
int maxNoiseImmunityLevel
Definition: ar5212.h:154
uint32_t ah_miscMode
Definition: ar5212.h:287
HAL_INI_ARRAY ah_ini_common
Definition: ar5212.h:252
uint8_t ah_macaddr[IEEE80211_ADDR_LEN]
Definition: ar5212.h:256
struct ath_hal_private ah_priv
Definition: ar5212.h:245
HAL_INI_ARRAY ah_ini_modes
Definition: ar5212.h:251
HAL_INI_ARRAY ah_ini_txgain
Definition: ar9287.h:38
HAL_INI_ARRAY ah_ini_cckFirNormal
Definition: ar9287.h:40
HAL_INI_ARRAY ah_ini_rxgain
Definition: ar9287.h:37
HAL_INI_ARRAY ah_ini_cckFirJapan2484
Definition: ar9287.h:41
struct ath_hal h
Definition: ah_internal.h:358
Definition: ah.h:1219
HAL_BOOL __ahdecl(* ah_setTxPower)(struct ath_hal *, const struct ieee80211_channel *, uint16_t *)
Definition: ah.h:1267
HAL_BOOL __ahdecl(* ah_setAntennaSwitch)(struct ath_hal *, HAL_ANT_SETTING)
Definition: ah.h:1388
HAL_OPS_CONFIG ah_config
Definition: ah.h:1243
uint16_t ah_analog5GhzRev
Definition: ah.h:1232
void __ahdecl(* ah_detach)(struct ath_hal *)
Definition: ah.h:1246
void __ahdecl(* ah_disablePCIE)(struct ath_hal *)
Definition: ah.h:1258
uint16_t * ah_eepromdata
Definition: ah.h:1235
void __ahdecl(* ah_configPCIE)(struct ath_hal *, HAL_BOOL restore, HAL_BOOL power_off)
Definition: ah.h:1256
HAL_BOOL __ahdecl(* ah_setBoardValues)(struct ath_hal *, const struct ieee80211_channel *)
Definition: ah.h:1270
const char * calName
Definition: ar5416_cal.h:52