FreeBSD kernel ATH device code
ar5210_attach.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: ISC
3 *
4 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5 * Copyright (c) 2002-2004 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 "ar5210/ar5210.h"
28#include "ar5210/ar5210reg.h"
29#include "ar5210/ar5210phy.h"
30
31#include "ah_eeprom_v1.h"
32
34 uint16_t flags, uint16_t *low, uint16_t *high);
36 struct ieee80211_channel *chan);
37
38static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore,
39 HAL_BOOL power_on);
40static void ar5210DisablePCIE(struct ath_hal *ah);
41
42static const struct ath_hal_private ar5210hal = {{
43 .ah_magic = AR5210_MAGIC,
44
45 .ah_getRateTable = ar5210GetRateTable,
46 .ah_detach = ar5210Detach,
47
48 /* Reset Functions */
49 .ah_reset = ar5210Reset,
50 .ah_phyDisable = ar5210PhyDisable,
51 .ah_disable = ar5210Disable,
52 .ah_configPCIE = ar5210ConfigPCIE,
53 .ah_disablePCIE = ar5210DisablePCIE,
54 .ah_setPCUConfig = ar5210SetPCUConfig,
55 .ah_perCalibration = ar5210PerCalibration,
56 .ah_perCalibrationN = ar5210PerCalibrationN,
57 .ah_resetCalValid = ar5210ResetCalValid,
58 .ah_setTxPowerLimit = ar5210SetTxPowerLimit,
59 .ah_getChanNoise = ath_hal_getChanNoise,
60
61 /* Transmit functions */
62 .ah_updateTxTrigLevel = ar5210UpdateTxTrigLevel,
63 .ah_setupTxQueue = ar5210SetupTxQueue,
64 .ah_setTxQueueProps = ar5210SetTxQueueProps,
65 .ah_getTxQueueProps = ar5210GetTxQueueProps,
66 .ah_releaseTxQueue = ar5210ReleaseTxQueue,
67 .ah_resetTxQueue = ar5210ResetTxQueue,
68 .ah_getTxDP = ar5210GetTxDP,
69 .ah_setTxDP = ar5210SetTxDP,
70 .ah_numTxPending = ar5210NumTxPending,
71 .ah_startTxDma = ar5210StartTxDma,
72 .ah_stopTxDma = ar5210StopTxDma,
73 .ah_setupTxDesc = ar5210SetupTxDesc,
74 .ah_setupXTxDesc = ar5210SetupXTxDesc,
75 .ah_fillTxDesc = ar5210FillTxDesc,
76 .ah_procTxDesc = ar5210ProcTxDesc,
77 .ah_getTxIntrQueue = ar5210GetTxIntrQueue,
78 .ah_reqTxIntrDesc = ar5210IntrReqTxDesc,
79 .ah_getTxCompletionRates = ar5210GetTxCompletionRates,
80 .ah_setTxDescLink = ar5210SetTxDescLink,
81 .ah_getTxDescLink = ar5210GetTxDescLink,
82 .ah_getTxDescLinkPtr = ar5210GetTxDescLinkPtr,
83
84 /* RX Functions */
85 .ah_getRxDP = ar5210GetRxDP,
86 .ah_setRxDP = ar5210SetRxDP,
87 .ah_enableReceive = ar5210EnableReceive,
88 .ah_stopDmaReceive = ar5210StopDmaReceive,
89 .ah_startPcuReceive = ar5210StartPcuReceive,
90 .ah_stopPcuReceive = ar5210StopPcuReceive,
91 .ah_setMulticastFilter = ar5210SetMulticastFilter,
92 .ah_setMulticastFilterIndex = ar5210SetMulticastFilterIndex,
93 .ah_clrMulticastFilterIndex = ar5210ClrMulticastFilterIndex,
94 .ah_getRxFilter = ar5210GetRxFilter,
95 .ah_setRxFilter = ar5210SetRxFilter,
96 .ah_setupRxDesc = ar5210SetupRxDesc,
97 .ah_procRxDesc = ar5210ProcRxDesc,
98 .ah_rxMonitor = ar5210RxMonitor,
99 .ah_aniPoll = ar5210AniPoll,
100 .ah_procMibEvent = ar5210MibEvent,
101
102 /* Misc Functions */
103 .ah_getCapability = ar5210GetCapability,
104 .ah_setCapability = ar5210SetCapability,
105 .ah_getDiagState = ar5210GetDiagState,
106 .ah_getMacAddress = ar5210GetMacAddress,
107 .ah_setMacAddress = ar5210SetMacAddress,
108 .ah_getBssIdMask = ar5210GetBssIdMask,
109 .ah_setBssIdMask = ar5210SetBssIdMask,
110 .ah_setRegulatoryDomain = ar5210SetRegulatoryDomain,
111 .ah_setLedState = ar5210SetLedState,
112 .ah_writeAssocid = ar5210WriteAssocid,
113 .ah_gpioCfgInput = ar5210GpioCfgInput,
114 .ah_gpioCfgOutput = ar5210GpioCfgOutput,
115 .ah_gpioGet = ar5210GpioGet,
116 .ah_gpioSet = ar5210GpioSet,
117 .ah_gpioSetIntr = ar5210Gpio0SetIntr,
118 .ah_getTsf32 = ar5210GetTsf32,
119 .ah_getTsf64 = ar5210GetTsf64,
120 .ah_resetTsf = ar5210ResetTsf,
121 .ah_detectCardPresent = ar5210DetectCardPresent,
122 .ah_updateMibCounters = ar5210UpdateMibCounters,
123 .ah_getRfGain = ar5210GetRfgain,
124 .ah_getDefAntenna = ar5210GetDefAntenna,
125 .ah_setDefAntenna = ar5210SetDefAntenna,
126 .ah_getAntennaSwitch = ar5210GetAntennaSwitch,
127 .ah_setAntennaSwitch = ar5210SetAntennaSwitch,
128 .ah_setSifsTime = ar5210SetSifsTime,
129 .ah_getSifsTime = ar5210GetSifsTime,
130 .ah_setSlotTime = ar5210SetSlotTime,
131 .ah_getSlotTime = ar5210GetSlotTime,
132 .ah_setAckTimeout = ar5210SetAckTimeout,
133 .ah_getAckTimeout = ar5210GetAckTimeout,
134 .ah_setAckCTSRate = ar5210SetAckCTSRate,
135 .ah_getAckCTSRate = ar5210GetAckCTSRate,
136 .ah_setCTSTimeout = ar5210SetCTSTimeout,
137 .ah_getCTSTimeout = ar5210GetCTSTimeout,
138 .ah_setDecompMask = ar5210SetDecompMask,
139 .ah_setCoverageClass = ar5210SetCoverageClass,
140 .ah_setQuiet = ar5210SetQuiet,
141 .ah_get11nExtBusy = ar5210Get11nExtBusy,
142 .ah_getMibCycleCounts = ar5210GetMibCycleCounts,
143 .ah_setChainMasks = ar5210SetChainMasks,
144 .ah_enableDfs = ar5210EnableDfs,
145 .ah_getDfsThresh = ar5210GetDfsThresh,
146 /* XXX procRadarEvent */
147 /* XXX isFastClockEnabled */
148 .ah_getNav = ar5210GetNav,
149 .ah_setNav = ar5210SetNav,
150
151 /* Key Cache Functions */
152 .ah_getKeyCacheSize = ar5210GetKeyCacheSize,
153 .ah_resetKeyCacheEntry = ar5210ResetKeyCacheEntry,
154 .ah_isKeyCacheEntryValid = ar5210IsKeyCacheEntryValid,
155 .ah_setKeyCacheEntry = ar5210SetKeyCacheEntry,
156 .ah_setKeyCacheEntryMac = ar5210SetKeyCacheEntryMac,
157
158 /* Power Management Functions */
159 .ah_setPowerMode = ar5210SetPowerMode,
160 .ah_getPowerMode = ar5210GetPowerMode,
161
162 /* Beacon Functions */
163 .ah_setBeaconTimers = ar5210SetBeaconTimers,
164 .ah_beaconInit = ar5210BeaconInit,
165 .ah_setStationBeaconTimers = ar5210SetStaBeaconTimers,
166 .ah_resetStationBeaconTimers = ar5210ResetStaBeaconTimers,
167 .ah_getNextTBTT = ar5210GetNextTBTT,
168
169 /* Interrupt Functions */
170 .ah_isInterruptPending = ar5210IsInterruptPending,
171 .ah_getPendingInterrupts = ar5210GetPendingInterrupts,
172 .ah_getInterrupts = ar5210GetInterrupts,
173 .ah_setInterrupts = ar5210SetInterrupts },
174
175 .ah_getChannelEdges = ar5210GetChannelEdges,
176 .ah_getWirelessModes = ar5210GetWirelessModes,
177 .ah_eepromRead = ar5210EepromRead,
178#ifdef AH_SUPPORT_WRITE_EEPROM
179 .ah_eepromWrite = ar5210EepromWrite,
180#endif
181 .ah_getChipPowerLimits = ar5210GetChipPowerLimits,
182};
183
184static HAL_BOOL ar5210FillCapabilityInfo(struct ath_hal *ah);
185
186/*
187 * Attach for an AR5210 part.
188 */
189static struct ath_hal *
191 uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
192{
193#define N(a) (sizeof(a)/sizeof(a[0]))
194 struct ath_hal_5210 *ahp;
195 struct ath_hal *ah;
196 uint32_t revid, pcicfg;
197 uint16_t eeval;
198 HAL_STATUS ecode;
199 int i;
200
202 "%s: devid 0x%x sc %p st %p sh %p\n", __func__, devid,
203 sc, (void*) st, (void*) sh);
204
205 /* NB: memory is returned zero'd */
206 ahp = ath_hal_malloc(sizeof (struct ath_hal_5210));
207 if (ahp == AH_NULL) {
209 "%s: no memory for state block\n", __func__);
210 ecode = HAL_ENOMEM;
211 goto bad;
212 }
213 ah = &ahp->ah_priv.h;
214 /* set initial values */
215 OS_MEMCPY(&ahp->ah_priv, &ar5210hal, sizeof(struct ath_hal_private));
216 ah->ah_sc = sc;
217 ah->ah_st = st;
218 ah->ah_sh = sh;
219
220 ah->ah_devid = devid; /* NB: for AH_DEBUG_ALQ */
221 AH_PRIVATE(ah)->ah_devid = devid;
222 AH_PRIVATE(ah)->ah_subvendorid = 0; /* XXX */
223
224 AH_PRIVATE(ah)->ah_powerLimit = AR5210_MAX_RATE_POWER;
225 AH_PRIVATE(ah)->ah_tpScale = HAL_TP_SCALE_MAX; /* no scaling */
226
228 ahp->ah_staId1Defaults = 0;
230 ahp->ah_sifstime = (u_int) -1;
231 ahp->ah_slottime = (u_int) -1;
232 ahp->ah_acktimeout = (u_int) -1;
233 ahp->ah_ctstimeout = (u_int) -1;
234
235 if (!ar5210ChipReset(ah, AH_NULL)) { /* reset chip */
236 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n",
237 __func__);
238 ecode = HAL_EIO;
239 goto bad;
240 }
241
242 /* Read Revisions from Chips */
243 AH_PRIVATE(ah)->ah_macVersion = 1;
244 AH_PRIVATE(ah)->ah_macRev = OS_REG_READ(ah, AR_SREV) & 0xff;
245 AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIPID);
246 AH_PRIVATE(ah)->ah_analog2GhzRev = 0;
247
248 /* Read Radio Chip Rev Extract */
249 OS_REG_WRITE(ah, (AR_PHY_BASE + (0x34 << 2)), 0x00001c16);
250 for (i = 0; i < 4; i++)
251 OS_REG_WRITE(ah, (AR_PHY_BASE + (0x20 << 2)), 0x00010000);
252 revid = (OS_REG_READ(ah, AR_PHY_BASE + (256 << 2)) >> 28) & 0xf;
253
254 /* Chip labelling is 1 greater than revision register for AR5110 */
255 AH_PRIVATE(ah)->ah_analog5GhzRev = ath_hal_reverseBits(revid, 4) + 1;
256
257 /*
258 * Read all the settings from the EEPROM and stash
259 * ones we'll use later.
260 */
261 pcicfg = OS_REG_READ(ah, AR_PCICFG);
263 ecode = ath_hal_v1EepromAttach(ah);
264 if (ecode != HAL_OK) {
265 goto eebad;
266 }
267 ecode = ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, &eeval);
268 if (ecode != HAL_OK) {
270 "%s: cannot read regulatory domain from EEPROM\n",
271 __func__);
272 goto eebad;
273 }
274 AH_PRIVATE(ah)->ah_currentRD = eeval;
276 if (ecode != HAL_OK) {
278 "%s: error getting mac address from EEPROM\n", __func__);
279 goto eebad;
280 }
281 OS_REG_WRITE(ah, AR_PCICFG, pcicfg); /* disable EEPROM access */
282
283 AH_PRIVATE(ah)->ah_getNfAdjust = ar5210GetNfAdjust;
284
285 /*
286 * Got everything we need now to setup the capabilities.
287 */
288 (void) ar5210FillCapabilityInfo(ah);
289
290 HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__);
291
292 return ah;
293eebad:
294 OS_REG_WRITE(ah, AR_PCICFG, pcicfg); /* disable EEPROM access */
295bad:
296 if (ahp)
297 ath_hal_free(ahp);
298 if (status)
299 *status = ecode;
300 return AH_NULL;
301#undef N
302}
303
304void
306{
307 HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s:\n", __func__);
308
309 HALASSERT(ah != AH_NULL);
311
313 ath_hal_free(ah);
314}
315
316/*
317 * Store the channel edges for the requested operational mode
318 */
319static HAL_BOOL
321 uint16_t flags, uint16_t *low, uint16_t *high)
322{
323 if (flags & IEEE80211_CHAN_5GHZ) {
324 *low = 5120;
325 *high = 5430;
326 return AH_TRUE;
327 } else {
328 return AH_FALSE;
329 }
330}
331
332static HAL_BOOL
333ar5210GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan)
334{
335 /* XXX fill in, this is just a placeholder */
337 "%s: no min/max power for %u/0x%x\n",
338 __func__, chan->ic_freq, chan->ic_flags);
339 chan->ic_maxpower = AR5210_MAX_RATE_POWER;
340 chan->ic_minpower = 0;
341 return AH_TRUE;
342}
343
344static void
345ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
346{
347}
348
349static void
351{
352}
353
354/*
355 * Fill all software cached or static hardware state information.
356 */
357static HAL_BOOL
359{
360 struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
361 HAL_CAPABILITIES *pCap = &ahpriv->ah_caps;
362
364
365 pCap->halLow5GhzChan = 5120;
366 pCap->halHigh5GhzChan = 5430;
367
370 pCap->halNumMRRetries = 1; /* No hardware MRR support */
371 pCap->halNumTxMaps = 1; /* Single TX ptr per descr */
372
374 pCap->halKeyCacheSize = 64;
375
376 /* XXX not needed */
379
380 /*
381 * RSSI uses the combined field; some 11n NICs may use
382 * the control chain RSSI.
383 */
385
387 /*
388 * Setup initial rfsilent settings based on the EEPROM
389 * contents. Pin 0, polarity 0 is fixed; record this
390 * using the EEPROM format found in later parts.
391 */
394 ahpriv->ah_rfkillEnabled = AH_TRUE;
396 }
397
398 pCap->halTxTstampPrecision = 16;
399 pCap->halRxTstampPrecision = 15; /* NB: s/w extended from 13 */
401 | HAL_INT_RX
402 | HAL_INT_TX
404 ;
405
408
409 ahpriv->ah_rxornIsFatal = AH_TRUE;
410 return AH_TRUE;
411}
412
413static const char*
414ar5210Probe(uint16_t vendorid, uint16_t devid)
415{
416 if (vendorid == ATHEROS_VENDOR_ID &&
417 (devid == AR5210_PROD || devid == AR5210_DEFAULT))
418 return "Atheros 5210";
419 return AH_NULL;
420}
uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n)
Definition: ah.c:333
int16_t ath_hal_getChanNoise(struct ath_hal *ah, const struct ieee80211_channel *chan)
Definition: ah.c:1158
HAL_STATUS
Definition: ah.h:71
@ HAL_EIO
Definition: ah.h:75
@ HAL_OK
Definition: ah.h:72
@ HAL_ENOMEM
Definition: ah.h:74
@ HAL_MODE_11A
Definition: ah.h:657
#define HAL_NUM_TX_QUEUES
Definition: ah.h:251
@ HAL_PM_UNDEFINED
Definition: ah.h:443
@ HAL_INT_BNR
Definition: ah.h:493
@ HAL_INT_COMMON
Definition: ah.h:514
@ HAL_INT_FATAL
Definition: ah.h:505
@ HAL_INT_TX
Definition: ah.h:481
@ HAL_INT_RX
Definition: ah.h:473
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 AR5210_DEFAULT
Definition: ah_devid.h:35
#define AR5210_PROD
Definition: ah_devid.h:36
#define ATHEROS_VENDOR_ID
Definition: ah_devid.h:25
HAL_STATUS ath_hal_v1EepromAttach(struct ath_hal *ah)
Definition: ah_eeprom_v1.c:113
@ AR_EEP_MACADDR
Definition: ah_eeprom.h:77
@ AR_EEP_REGDMN_0
Definition: ah_eeprom.h:86
@ AR_EEP_RFKILL
Definition: ah_eeprom.h:69
#define AR_EEPROM_RFSILENT_GPIO_SEL
Definition: ah_eeprom_v1.h:64
#define AR_EEPROM_RFSILENT_POLARITY
Definition: ah_eeprom_v1.h:66
@ HAL_TP_SCALE_MAX
Definition: ah_internal.h:67
#define SM(_v, _f)
Definition: ah_internal.h:587
#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 HALASSERT(_x)
Definition: ah_internal.h:683
#define HALDEBUG(_ah, __m,...)
Definition: ah_internal.h:658
#define ath_hal_eepromGetFlag(_ah, _param)
Definition: ah_internal.h:490
#define ath_hal_eepromDetach(_ah)
Definition: ah_internal.h:482
void ath_hal_free(void *p)
Definition: ah_osdep.c:116
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_MEMCPY(_d, _s, _n)
Definition: ah_osdep.h:73
#define OS_REG_READ(_ah, _reg)
Definition: ah_osdep.h:140
int16_t ar5210GetNfAdjust(struct ath_hal *, const HAL_CHANNEL_INTERNAL *)
Definition: ar5210_reset.c:998
HAL_BOOL ar5210UpdateTxTrigLevel(struct ath_hal *, HAL_BOOL)
Definition: ar5210_xmit.c:331
HAL_BOOL ar5210SetSlotTime(struct ath_hal *, u_int)
Definition: ar5210_misc.c:448
void ar5210StartPcuReceive(struct ath_hal *, HAL_BOOL)
Definition: ar5210_recv.c:88
HAL_RFGAIN ar5210GetRfgain(struct ath_hal *)
void ar5210IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *)
Definition: ar5210_xmit.c:543
const HAL_RATE_TABLE * ar5210GetRateTable(struct ath_hal *, u_int mode)
Definition: ar5210_phy.c:70
HAL_BOOL ar5210GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *)
Definition: ar5210_misc.c:677
HAL_BOOL ar5210SetKeyCacheEntryMac(struct ath_hal *, uint16_t, const uint8_t *)
u_int ar5210GetAckCTSRate(struct ath_hal *)
Definition: ar5210_misc.c:499
void ar5210EnableReceive(struct ath_hal *)
Definition: ar5210_recv.c:57
void ar5210RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *)
Definition: ar5210_misc.c:574
HAL_BOOL ar5210SetKeyCacheEntry(struct ath_hal *, uint16_t entry, const HAL_KEYVAL *, const uint8_t *mac, int xorKey)
HAL_BOOL ar5210SetPowerMode(struct ath_hal *, uint32_t powerRequest, int setChip)
void ar5210GetBssIdMask(struct ath_hal *, uint8_t *)
Definition: ar5210_misc.c:53
HAL_ANT_SETTING ar5210GetAntennaSwitch(struct ath_hal *)
Definition: ar5210_misc.c:295
void ar5210SetLedState(struct ath_hal *, HAL_LED_STATE)
Definition: ar5210_misc.c:249
HAL_BOOL ar5210SetAckCTSRate(struct ath_hal *, u_int)
Definition: ar5210_misc.c:505
HAL_BOOL ar5210SetTxDP(struct ath_hal *, u_int, uint32_t txdp)
Definition: ar5210_xmit.c:284
HAL_BOOL ar5210ChipReset(struct ath_hal *, struct ieee80211_channel *)
Definition: ar5210_reset.c:392
void ar5210AniPoll(struct ath_hal *, const struct ieee80211_channel *)
Definition: ar5210_misc.c:580
uint64_t ar5210GetNextTBTT(struct ath_hal *)
Definition: ar5210_beacon.c:35
HAL_BOOL ar5210GpioSet(struct ath_hal *, uint32_t gpio, uint32_t)
Definition: ar5210_misc.c:193
HAL_BOOL ar5210SetupRxDesc(struct ath_hal *, struct ath_desc *, uint32_t, u_int flags)
Definition: ar5210_recv.c:184
HAL_POWER_MODE ar5210GetPowerMode(struct ath_hal *)
Definition: ar5210_power.c:136
HAL_BOOL ar5210Disable(struct ath_hal *)
Definition: ar5210_reset.c:368
void ar5210ResetStaBeaconTimers(struct ath_hal *)
Definition: ar5210_beacon.c:96
void ar5210StopPcuReceive(struct ath_hal *)
Definition: ar5210_recv.c:98
HAL_BOOL ar5210SetAckTimeout(struct ath_hal *, u_int)
Definition: ar5210_misc.c:473
void ar5210SetPCUConfig(struct ath_hal *)
Definition: ar5210_reset.c:347
HAL_BOOL ar5210SetMulticastFilterIndex(struct ath_hal *, uint32_t)
Definition: ar5210_recv.c:139
HAL_STATUS ar5210ProcRxDesc(struct ath_hal *, struct ath_desc *, uint32_t, struct ath_desc *, uint64_t, struct ath_rx_status *)
Definition: ar5210_recv.c:214
void ar5210GetMacAddress(struct ath_hal *, uint8_t *)
Definition: ar5210_misc.c:36
void ar5210SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *)
Definition: ar5210_beacon.c:46
void ar5210BeaconInit(struct ath_hal *, uint32_t, uint32_t)
Definition: ar5210_beacon.c:63
u_int ar5210GetKeyCacheSize(struct ath_hal *)
HAL_STATUS ar5210ProcTxDesc(struct ath_hal *, struct ath_desc *, struct ath_tx_status *)
Definition: ar5210_xmit.c:592
HAL_BOOL ar5210StopDmaReceive(struct ath_hal *)
Definition: ar5210_recv.c:66
void ar5210MibEvent(struct ath_hal *, const HAL_NODE_STATS *)
Definition: ar5210_misc.c:585
HAL_BOOL ar5210ReleaseTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5210_xmit.c:125
uint32_t ar5210Get11nExtBusy(struct ath_hal *)
Definition: ar5210_misc.c:667
#define INIT_RSSI_THR
Definition: ar5210.h:84
HAL_BOOL ar5210IsKeyCacheEntryValid(struct ath_hal *, uint16_t)
HAL_BOOL ar5210GpioCfgOutput(struct ath_hal *, uint32_t gpio, HAL_GPIO_MUX_TYPE)
Definition: ar5210_misc.c:163
void ar5210SetNav(struct ath_hal *ah, u_int val)
Definition: ar5210_misc.c:730
HAL_BOOL ar5210StartTxDma(struct ath_hal *, u_int)
Definition: ar5210_xmit.c:369
uint32_t ar5210GpioGet(struct ath_hal *, uint32_t gpio)
Definition: ar5210_misc.c:211
HAL_BOOL ar5210GetPendingInterrupts(struct ath_hal *, HAL_INT *)
HAL_BOOL ar5210GpioCfgInput(struct ath_hal *, uint32_t gpio)
Definition: ar5210_misc.c:178
void ar5210EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *)
Definition: ar5210_misc.c:690
void ar5210GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
Definition: ar5210_xmit.c:656
void ar5210GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *)
Definition: ar5210_misc.c:695
void ar5210SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
Definition: ar5210_xmit.c:645
int ar5210SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO *qInfo)
Definition: ar5210_xmit.c:70
HAL_BOOL ar5210SetMacAddress(struct ath_hal *ah, const uint8_t *)
Definition: ar5210_misc.c:44
HAL_BOOL ar5210ResetKeyCacheEntry(struct ath_hal *, uint16_t entry)
HAL_BOOL ar5210IsInterruptPending(struct ath_hal *)
HAL_BOOL ar5210GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
Definition: ar5210_misc.c:634
void ar5210SetRxFilter(struct ath_hal *, uint32_t)
Definition: ar5210_recv.c:169
HAL_BOOL ar5210DetectCardPresent(struct ath_hal *)
Definition: ar5210_misc.c:398
HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *, int *rates, int *tries)
Definition: ar5210_xmit.c:636
void ar5210SetStaBeaconTimers(struct ath_hal *, const HAL_BEACON_STATE *)
uint32_t ar5210GetTsf32(struct ath_hal *)
Definition: ar5210_misc.c:362
HAL_STATUS ar5210SetQuiet(struct ath_hal *, uint32_t, uint32_t, uint32_t, HAL_QUIET_FLAG)
Definition: ar5210_misc.c:558
HAL_BOOL ar5210Reset(struct ath_hal *, HAL_OPMODE, struct ieee80211_channel *, HAL_BOOL bChannelChange, HAL_RESET_TYPE, HAL_STATUS *)
Definition: ar5210_reset.c:72
HAL_BOOL ar5210SetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE, uint32_t, uint32_t, HAL_STATUS *)
Definition: ar5210_misc.c:607
#define AR5210_MAX_RATE_POWER
Definition: ar5210.h:95
HAL_BOOL ar5210ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *)
Definition: ar5210_reset.c:580
HAL_BOOL ar5210PhyDisable(struct ath_hal *)
Definition: ar5210_reset.c:359
u_int ar5210GetAckTimeout(struct ath_hal *)
Definition: ar5210_misc.c:492
HAL_STATUS ar5210GetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE, uint32_t, uint32_t *)
Definition: ar5210_misc.c:590
HAL_BOOL ar5210SetCTSTimeout(struct ath_hal *, u_int)
Definition: ar5210_misc.c:520
void ar5210SetDefAntenna(struct ath_hal *, u_int)
Definition: ar5210_misc.c:282
HAL_BOOL ar5210PerCalibrationN(struct ath_hal *ah, struct ieee80211_channel *chan, u_int chainMask, HAL_BOOL longCal, HAL_BOOL *isCalDone)
Definition: ar5210_reset.c:452
void ar5210SetMulticastFilter(struct ath_hal *, uint32_t filter0, uint32_t filter1)
Definition: ar5210_recv.c:109
HAL_BOOL ar5210SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
Definition: ar5210_xmit.c:38
HAL_BOOL ar5210GetTxQueueProps(struct ath_hal *ah, int q, HAL_TXQ_INFO *qInfo)
Definition: ar5210_xmit.c:54
void ar5210GetTxIntrQueue(struct ath_hal *ah, uint32_t *)
Definition: ar5210_xmit.c:627
void ar5210GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
Definition: ar5210_xmit.c:667
u_int ar5210GetCTSTimeout(struct ath_hal *)
Definition: ar5210_misc.c:539
HAL_BOOL ar5210StopTxDma(struct ath_hal *, u_int)
Definition: ar5210_xmit.c:430
HAL_INT ar5210SetInterrupts(struct ath_hal *, HAL_INT ints)
void ar5210WriteAssocid(struct ath_hal *, const uint8_t *bssid, uint16_t assocId)
Definition: ar5210_misc.c:314
u_int ar5210GetNav(struct ath_hal *ah)
Definition: ar5210_misc.c:718
void ar5210UpdateMibCounters(struct ath_hal *, HAL_MIB_STATS *)
Definition: ar5210_misc.c:412
HAL_BOOL ar5210SetRegulatoryDomain(struct ath_hal *, uint16_t, HAL_STATUS *)
Definition: ar5210_misc.c:98
HAL_BOOL ar5210SetDecompMask(struct ath_hal *, uint16_t, int)
Definition: ar5210_misc.c:546
HAL_BOOL ar5210SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING)
Definition: ar5210_misc.c:301
HAL_BOOL ar5210SetBssIdMask(struct ath_hal *, const uint8_t *)
Definition: ar5210_misc.c:61
HAL_BOOL ar5210ClrMulticastFilterIndex(struct ath_hal *, uint32_t)
Definition: ar5210_recv.c:119
HAL_BOOL ar5210SetTxPowerLimit(struct ath_hal *, uint32_t limit)
Definition: ar5210_reset.c:722
HAL_BOOL ar5210SetupTxDesc(struct ath_hal *, struct ath_desc *, u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, u_int txRate0, u_int txRetries0, u_int keyIx, u_int antMode, u_int flags, u_int rtsctsRate, u_int rtsctsDuration, u_int compicvLen, u_int compivLen, u_int comp)
Definition: ar5210_xmit.c:479
void ar5210ResetTsf(struct ath_hal *)
Definition: ar5210_misc.c:371
#define AR5210_MAGIC
Definition: ar5210.h:24
HAL_BOOL ar5210FillTxDesc(struct ath_hal *, struct ath_desc *, HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int descId, u_int qcuId, HAL_BOOL firstSeg, HAL_BOOL lastSeg, const struct ath_desc *ds0)
Definition: ar5210_xmit.c:551
HAL_BOOL ar5210EepromWrite(struct ath_hal *, u_int off, uint16_t data)
uint32_t ar5210NumTxPending(struct ath_hal *, u_int)
Definition: ar5210_xmit.c:402
u_int ar5210GetWirelessModes(struct ath_hal *ah)
Definition: ar5210_misc.c:131
uint32_t ar5210GetRxFilter(struct ath_hal *)
Definition: ar5210_recv.c:159
uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE)
Definition: ar5210_recv.c:35
void ar5210Gpio0SetIntr(struct ath_hal *, u_int, uint32_t ilevel)
Definition: ar5210_misc.c:226
u_int ar5210GetDefAntenna(struct ath_hal *)
Definition: ar5210_misc.c:275
HAL_BOOL ar5210ResetTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5210_xmit.c:156
u_int ar5210GetSlotTime(struct ath_hal *)
Definition: ar5210_misc.c:466
uint64_t ar5210GetTsf64(struct ath_hal *)
Definition: ar5210_misc.c:334
HAL_BOOL ar5210SetupXTxDesc(struct ath_hal *, struct ath_desc *, u_int txRate1, u_int txRetries1, u_int txRate2, u_int txRetries2, u_int txRate3, u_int txRetries3)
Definition: ar5210_xmit.c:530
HAL_BOOL ar5210SetSifsTime(struct ath_hal *, u_int)
Definition: ar5210_misc.c:422
void ar5210SetCoverageClass(struct ath_hal *, uint8_t, int)
Definition: ar5210_misc.c:553
HAL_INT ar5210GetInterrupts(struct ath_hal *)
HAL_BOOL ar5210EepromRead(struct ath_hal *, u_int off, uint16_t *data)
Definition: ar5210_misc.c:70
u_int ar5210GetSifsTime(struct ath_hal *)
Definition: ar5210_misc.c:441
uint32_t ar5210GetTxDP(struct ath_hal *, u_int)
Definition: ar5210_xmit.c:259
HAL_BOOL ar5210PerCalibration(struct ath_hal *, struct ieee80211_channel *, HAL_BOOL *)
Definition: ar5210_reset.c:573
void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE)
Definition: ar5210_recv.c:46
void ar5210SetChainMasks(struct ath_hal *, uint32_t, uint32_t)
Definition: ar5210_misc.c:684
static const char * ar5210Probe(uint16_t vendorid, uint16_t devid)
void ar5210Detach(struct ath_hal *ah)
static void ar5210DisablePCIE(struct ath_hal *ah)
AH_CHIP(AR5210, ar5210Probe, ar5210Attach)
static HAL_BOOL ar5210FillCapabilityInfo(struct ath_hal *ah)
static const struct ath_hal_private ar5210hal
Definition: ar5210_attach.c:42
static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_on)
static HAL_BOOL ar5210GetChannelEdges(struct ath_hal *, uint16_t flags, uint16_t *low, uint16_t *high)
static HAL_BOOL ar5210GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan)
static struct ath_hal * ar5210Attach(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)
#define AR_PHY_BASE
Definition: ar5210phy.h:29
#define AR_PHY_CHIPID
Definition: ar5210phy.h:49
#define AR_PCICFG_EEPROMSEL
Definition: ar5210reg.h:271
#define AR_SREV
Definition: ar5210reg.h:63
#define AR_PCICFG
Definition: ar5210reg.h:59
uint32_t halRfSilentSupport
Definition: ah_internal.h:247
uint16_t halLow5GhzChan
Definition: ah_internal.h:298
uint32_t halUseCombinedRadarRssi
Definition: ah_internal.h:262
uint32_t halIntrMask
Definition: ah_internal.h:308
uint16_t halHigh5GhzChan
Definition: ah_internal.h:298
uint16_t halKeyCacheSize
Definition: ah_internal.h:297
uint16_t halTotalQueues
Definition: ah_internal.h:296
uint32_t halWirelessModes
Definition: ah_internal.h:295
uint32_t halChanHalfRate
Definition: ah_internal.h:243
uint32_t halHasRxSelfLinkedTail
Definition: ah_internal.h:269
uint32_t halChanQuarterRate
Definition: ah_internal.h:244
uint32_t halPSPollBroken
Definition: ah_internal.h:238
uint32_t hal4kbSplitTransSupport
Definition: ah_internal.h:268
uint32_t halSleepAfterBeaconBroken
Definition: ah_internal.h:224
uint32_t ah_staId1Defaults
Definition: ar5210.h:118
u_int ah_slottime
Definition: ar5210.h:122
u_int ah_ctstimeout
Definition: ar5210.h:124
uint32_t ah_rssiThr
Definition: ar5210.h:119
u_int ah_sifstime
Definition: ar5210.h:121
struct ath_hal_private ah_priv
Definition: ar5210.h:101
u_int ah_acktimeout
Definition: ar5210.h:123
uint8_t ah_macaddr[IEEE80211_ADDR_LEN]
Definition: ar5210.h:103
HAL_CAPABILITIES ah_caps
Definition: ah_internal.h:402
struct ath_hal h
Definition: ah_internal.h:358
HAL_BOOL ah_rfkillEnabled
Definition: ah_internal.h:426
uint16_t ah_rfsilent
Definition: ah_internal.h:425
Definition: ah.h:1219
HAL_BUS_TAG ah_st
Definition: ah.h:1224
uint16_t ah_devid
Definition: ah.h:1221
uint32_t ah_magic
Definition: ah.h:1220
HAL_BUS_HANDLE ah_sh
Definition: ah.h:1225
HAL_OPS_CONFIG ah_config
Definition: ah.h:1243
HAL_POWER_MODE ah_powerMode
Definition: ah.h:1241
HAL_SOFTC ah_sc
Definition: ah.h:1223