FreeBSD kernel ATH device code
ar5211_misc.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-2006 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
26#include "ar5211/ar5211.h"
27#include "ar5211/ar5211reg.h"
28#include "ar5211/ar5211phy.h"
29
30#include "ah_eeprom_v3.h"
31
32#define AR_NUM_GPIO 6 /* 6 GPIO bits */
33#define AR_GPIOD_MASK 0x2f /* 6-bit mask */
34
35void
36ar5211GetMacAddress(struct ath_hal *ah, uint8_t *mac)
37{
38 struct ath_hal_5211 *ahp = AH5211(ah);
39
41}
42
44ar5211SetMacAddress(struct ath_hal *ah, const uint8_t *mac)
45{
46 struct ath_hal_5211 *ahp = AH5211(ah);
47
49 return AH_TRUE;
50}
51
52void
53ar5211GetBssIdMask(struct ath_hal *ah, uint8_t *mask)
54{
55 static const uint8_t ones[IEEE80211_ADDR_LEN] =
56 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
57 OS_MEMCPY(mask, ones, IEEE80211_ADDR_LEN);
58}
59
61ar5211SetBssIdMask(struct ath_hal *ah, const uint8_t *mask)
62{
63 return AH_FALSE;
64}
65
66/*
67 * Read 16 bits of data from the specified EEPROM offset.
68 */
70ar5211EepromRead(struct ath_hal *ah, u_int off, uint16_t *data)
71{
74
79 "%s: read failed for entry 0x%x\n", __func__, off);
80 return AH_FALSE;
81 }
82 *data = OS_REG_READ(ah, AR_EEPROM_DATA) & 0xffff;
83 return AH_TRUE;
84}
85
86#ifdef AH_SUPPORT_WRITE_EEPROM
87/*
88 * Write 16 bits of data to the specified EEPROM offset.
89 */
91ar5211EepromWrite(struct ath_hal *ah, u_int off, uint16_t data)
92{
93 return AH_FALSE;
94}
95#endif /* AH_SUPPORT_WRITE_EEPROM */
96
97/*
98 * Attempt to change the cards operating regulatory domain to the given value
99 */
102 uint16_t regDomain, HAL_STATUS *status)
103{
104 HAL_STATUS ecode;
105
106 if (AH_PRIVATE(ah)->ah_currentRD == regDomain) {
107 ecode = HAL_EINVAL;
108 goto bad;
109 }
110 /*
111 * Check if EEPROM is configured to allow this; must
112 * be a proper version and the protection bits must
113 * permit re-writing that segment of the EEPROM.
114 */
116 ecode = HAL_EEWRITE;
117 goto bad;
118 }
119#ifdef AH_SUPPORT_WRITE_REGDOMAIN
122 "%s: set regulatory domain to %u (0x%x)\n",
123 __func__, regDomain, regDomain);
124 AH_PRIVATE(ah)->ah_currentRD = regDomain;
125 return AH_TRUE;
126 }
127#endif
128 ecode = HAL_EIO;
129bad:
130 if (status)
131 *status = ecode;
132 return AH_FALSE;
133}
134
135/*
136 * Return the wireless modes (a,b,g,t) supported by hardware.
137 *
138 * This value is what is actually supported by the hardware
139 * and is unaffected by regulatory/country code settings.
140 *
141 */
142u_int
144{
145 u_int mode = 0;
146
148 mode = HAL_MODE_11A;
151 }
153 mode |= HAL_MODE_11B;
154 return mode;
155}
156
157#if 0
159ar5211GetTurboDisable(struct ath_hal *ah)
160{
161 return (AH5211(ah)->ah_turboDisable != 0);
162}
163#endif
164
165/*
166 * Called if RfKill is supported (according to EEPROM). Set the interrupt and
167 * GPIO values so the ISR and can disable RF on a switch signal
168 */
169void
171{
172 uint16_t rfsilent = AH_PRIVATE(ah)->ah_rfsilent;
173 int select = MS(rfsilent, AR_EEPROM_RFSILENT_GPIO_SEL);
174 int polarity = MS(rfsilent, AR_EEPROM_RFSILENT_POLARITY);
175
176 /*
177 * Configure the desired GPIO port for input
178 * and enable baseband rf silence.
179 */
180 ar5211GpioCfgInput(ah, select);
181 OS_REG_SET_BIT(ah, AR_PHY_BASE, 0x00002000);
182 /*
183 * If radio disable switch connection to GPIO bit x is enabled
184 * program GPIO interrupt.
185 * If rfkill bit on eeprom is 1, setupeeprommap routine has already
186 * verified that it is a later version of eeprom, it has a place for
187 * rfkill bit and it is set to 1, indicating that GPIO bit x hardware
188 * connection is present.
189 */
190 ar5211GpioSetIntr(ah, select, (ar5211GpioGet(ah, select) != polarity));
191}
192
193/*
194 * Configure GPIO Output lines
195 */
197ar5211GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type)
198{
199 uint32_t reg;
200
201 HALASSERT(gpio < AR_NUM_GPIO);
202
203 reg = OS_REG_READ(ah, AR_GPIOCR);
204 reg &= ~(AR_GPIOCR_0_CR_A << (gpio * AR_GPIOCR_CR_SHIFT));
205 reg |= AR_GPIOCR_0_CR_A << (gpio * AR_GPIOCR_CR_SHIFT);
206
207 OS_REG_WRITE(ah, AR_GPIOCR, reg);
208 return AH_TRUE;
209}
210
211/*
212 * Configure GPIO Input lines
213 */
215ar5211GpioCfgInput(struct ath_hal *ah, uint32_t gpio)
216{
217 uint32_t reg;
218
219 HALASSERT(gpio < AR_NUM_GPIO);
220
221 reg = OS_REG_READ(ah, AR_GPIOCR);
222 reg &= ~(AR_GPIOCR_0_CR_A << (gpio * AR_GPIOCR_CR_SHIFT));
223 reg |= AR_GPIOCR_0_CR_N << (gpio * AR_GPIOCR_CR_SHIFT);
224
225 OS_REG_WRITE(ah, AR_GPIOCR, reg);
226 return AH_TRUE;
227}
228
229/*
230 * Once configured for I/O - set output lines
231 */
233ar5211GpioSet(struct ath_hal *ah, uint32_t gpio, uint32_t val)
234{
235 uint32_t reg;
236
237 HALASSERT(gpio < AR_NUM_GPIO);
238
239 reg = OS_REG_READ(ah, AR_GPIODO);
240 reg &= ~(1 << gpio);
241 reg |= (val&1) << gpio;
242
243 OS_REG_WRITE(ah, AR_GPIODO, reg);
244 return AH_TRUE;
245}
246
247/*
248 * Once configured for I/O - get input lines
249 */
250uint32_t
251ar5211GpioGet(struct ath_hal *ah, uint32_t gpio)
252{
253 if (gpio < AR_NUM_GPIO) {
254 uint32_t val = OS_REG_READ(ah, AR_GPIODI);
255 val = ((val & AR_GPIOD_MASK) >> gpio) & 0x1;
256 return val;
257 } else {
258 return 0xffffffff;
259 }
260}
261
262/*
263 * Set the GPIO 0 Interrupt (gpio is ignored)
264 */
265void
266ar5211GpioSetIntr(struct ath_hal *ah, u_int gpio, uint32_t ilevel)
267{
268 uint32_t val = OS_REG_READ(ah, AR_GPIOCR);
269
270 /* Clear the bits that we will modify. */
273
275 if (ilevel)
276 val |= AR_GPIOCR_INT_SELH;
277
278 /* Don't need to change anything for low level interrupt. */
279 OS_REG_WRITE(ah, AR_GPIOCR, val);
280
281 /* Change the interrupt mask. */
283}
284
285/*
286 * Change the LED blinking pattern to correspond to the connectivity
287 */
288void
290{
291 static const uint32_t ledbits[8] = {
300 };
302 (OS_REG_READ(ah, AR_PCICFG) &~
304 | ledbits[state & 0x7]
305 );
306}
307
308/*
309 * Change association related fields programmed into the hardware.
310 * Writing a valid BSSID to the hardware effectively enables the hardware
311 * to synchronize its TSF to the correct beacons and receive frames coming
312 * from that BSSID. It is called by the SME JOIN operation.
313 */
314void
315ar5211WriteAssocid(struct ath_hal *ah, const uint8_t *bssid, uint16_t assocId)
316{
317 struct ath_hal_5211 *ahp = AH5211(ah);
318
319 /* XXX save bssid for possible re-use on reset */
323 ((assocId & 0x3fff)<<AR_BSS_ID1_AID_S));
324}
325
326/*
327 * Get the current hardware tsf for stamlme.
328 */
329uint64_t
331{
332 uint32_t low1, low2, u32;
333
334 /* sync multi-word read */
335 low1 = OS_REG_READ(ah, AR_TSF_L32);
336 u32 = OS_REG_READ(ah, AR_TSF_U32);
337 low2 = OS_REG_READ(ah, AR_TSF_L32);
338 if (low2 < low1) { /* roll over */
339 /*
340 * If we are not preempted this will work. If we are
341 * then we re-reading AR_TSF_U32 does no good as the
342 * low bits will be meaningless. Likewise reading
343 * L32, U32, U32, then comparing the last two reads
344 * to check for rollover doesn't help if preempted--so
345 * we take this approach as it costs one less PCI
346 * read which can be noticeable when doing things
347 * like timestamping packets in monitor mode.
348 */
349 u32++;
350 }
351 return (((uint64_t) u32) << 32) | ((uint64_t) low2);
352}
353
354/*
355 * Get the current hardware tsf for stamlme.
356 */
357uint32_t
359{
360 return OS_REG_READ(ah, AR_TSF_L32);
361}
362
363/*
364 * Reset the current hardware tsf for stamlme
365 */
366void
368{
369 uint32_t val = OS_REG_READ(ah, AR_BEACON);
370
372}
373
374/*
375 * Grab a semi-random value from hardware registers - may not
376 * change often
377 */
378uint32_t
380{
381 uint32_t nf;
382
383 nf = (OS_REG_READ(ah, AR_PHY(25)) >> 19) & 0x1ff;
384 if (nf & 0x100)
385 nf = 0 - ((nf ^ 0x1ff) + 1);
386 return (OS_REG_READ(ah, AR_TSF_U32) ^
387 OS_REG_READ(ah, AR_TSF_L32) ^ nf);
388}
389
390/*
391 * Detect if our card is present
392 */
395{
396 uint16_t macVersion, macRev;
397 uint32_t v;
398
399 /*
400 * Read the Silicon Revision register and compare that
401 * to what we read at attach time. If the same, we say
402 * a card/device is present.
403 */
405 macVersion = v >> AR_SREV_ID_S;
406 macRev = v & AR_SREV_REVISION_M;
407 return (AH_PRIVATE(ah)->ah_macVersion == macVersion &&
408 AH_PRIVATE(ah)->ah_macRev == macRev);
409}
410
411/*
412 * Update MIB Counters
413 */
414void
416{
417 stats->ackrcv_bad += OS_REG_READ(ah, AR_ACK_FAIL);
418 stats->rts_bad += OS_REG_READ(ah, AR_RTS_FAIL);
419 stats->fcs_bad += OS_REG_READ(ah, AR_FCS_FAIL);
420 stats->rts_good += OS_REG_READ(ah, AR_RTS_OK);
421 stats->beacons += OS_REG_READ(ah, AR_BEACON_CNT);
422}
423
425ar5211SetSifsTime(struct ath_hal *ah, u_int us)
426{
427 struct ath_hal_5211 *ahp = AH5211(ah);
428
429 if (us > ath_hal_mac_usec(ah, 0xffff)) {
430 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad SIFS time %u\n",
431 __func__, us);
432 ahp->ah_sifstime = (u_int) -1; /* restore default handling */
433 return AH_FALSE;
434 } else {
435 /* convert to system clocks */
437 ahp->ah_slottime = us;
438 return AH_TRUE;
439 }
440}
441
442u_int
444{
445 u_int clks = OS_REG_READ(ah, AR_D_GBL_IFS_SIFS) & 0xffff;
446 return ath_hal_mac_usec(ah, clks); /* convert from system clocks */
447}
448
450ar5211SetSlotTime(struct ath_hal *ah, u_int us)
451{
452 struct ath_hal_5211 *ahp = AH5211(ah);
453
454 if (us < HAL_SLOT_TIME_9 || us > ath_hal_mac_usec(ah, 0xffff)) {
455 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad slot time %u\n",
456 __func__, us);
457 ahp->ah_slottime = us; /* restore default handling */
458 return AH_FALSE;
459 } else {
460 /* convert to system clocks */
462 ahp->ah_slottime = us;
463 return AH_TRUE;
464 }
465}
466
467u_int
469{
470 u_int clks = OS_REG_READ(ah, AR_D_GBL_IFS_SLOT) & 0xffff;
471 return ath_hal_mac_usec(ah, clks); /* convert from system clocks */
472}
473
475ar5211SetAckTimeout(struct ath_hal *ah, u_int us)
476{
477 struct ath_hal_5211 *ahp = AH5211(ah);
478
479 if (us > ath_hal_mac_usec(ah, MS(0xffffffff, AR_TIME_OUT_ACK))) {
480 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad ack timeout %u\n",
481 __func__, us);
482 ahp->ah_acktimeout = (u_int) -1; /* restore default handling */
483 return AH_FALSE;
484 } else {
485 /* convert to system clocks */
488 ahp->ah_acktimeout = us;
489 return AH_TRUE;
490 }
491}
492
493u_int
495{
496 u_int clks = MS(OS_REG_READ(ah, AR_TIME_OUT), AR_TIME_OUT_ACK);
497 return ath_hal_mac_usec(ah, clks); /* convert from system clocks */
498}
499
500u_int
502{
503 return ((AH5211(ah)->ah_staId1Defaults & AR_STA_ID1_ACKCTS_6MB) == 0);
504}
505
507ar5211SetAckCTSRate(struct ath_hal *ah, u_int high)
508{
509 struct ath_hal_5211 *ahp = AH5211(ah);
510
511 if (high) {
513 ahp->ah_staId1Defaults &= ~AR_STA_ID1_ACKCTS_6MB;
514 } else {
517 }
518 return AH_TRUE;
519}
520
522ar5211SetCTSTimeout(struct ath_hal *ah, u_int us)
523{
524 struct ath_hal_5211 *ahp = AH5211(ah);
525
526 if (us > ath_hal_mac_usec(ah, MS(0xffffffff, AR_TIME_OUT_CTS))) {
527 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad cts timeout %u\n",
528 __func__, us);
529 ahp->ah_ctstimeout = (u_int) -1; /* restore default handling */
530 return AH_FALSE;
531 } else {
532 /* convert to system clocks */
535 ahp->ah_ctstimeout = us;
536 return AH_TRUE;
537 }
538}
539
540u_int
542{
543 u_int clks = MS(OS_REG_READ(ah, AR_TIME_OUT), AR_TIME_OUT_CTS);
544 return ath_hal_mac_usec(ah, clks); /* convert from system clocks */
545}
546
548ar5211SetDecompMask(struct ath_hal *ah, uint16_t keyidx, int en)
549{
550 /* nothing to do */
551 return AH_TRUE;
552}
553
554void
555ar5211SetCoverageClass(struct ath_hal *ah, uint8_t coverageclass, int now)
556{
557}
558
560ar5211SetQuiet(struct ath_hal *ah, uint32_t period, uint32_t duration,
561 uint32_t next_start, HAL_QUIET_FLAG flags)
562{
563 return HAL_OK;
564}
565
566/*
567 * Control Adaptive Noise Immunity Parameters
568 */
570ar5211AniControl(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
571{
572 return AH_FALSE;
573}
574
575void
576ar5211AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
577{
578}
579
580void
581ar5211RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats,
582 const struct ieee80211_channel *chan)
583{
584}
585
586void
587ar5211MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats)
588{
589}
590
591/*
592 * Get the rssi of frame curently being received.
593 */
594uint32_t
596{
597 return (OS_REG_READ(ah, AR_PHY_CURRENT_RSSI) & 0xff);
598}
599
600u_int
602{
603 return (OS_REG_READ(ah, AR_DEF_ANTENNA) & 0x7);
604}
605
606void
607ar5211SetDefAntenna(struct ath_hal *ah, u_int antenna)
608{
609 OS_REG_WRITE(ah, AR_DEF_ANTENNA, (antenna & 0x7));
610}
611
614{
615 return AH5211(ah)->ah_diversityControl;
616}
617
620{
621 const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan;
622
623 if (chan == AH_NULL) {
624 AH5211(ah)->ah_diversityControl = settings;
625 return AH_TRUE;
626 }
627 return ar5211SetAntennaSwitchInternal(ah, settings, chan);
628}
629
632 uint32_t capability, uint32_t *result)
633{
634
635 switch (type) {
636 case HAL_CAP_CIPHER: /* cipher handled in hardware */
637 switch (capability) {
639 case HAL_CIPHER_WEP:
640 case HAL_CIPHER_CLR:
641 return HAL_OK;
642 default:
643 return HAL_ENOTSUPP;
644 }
645 default:
646 return ath_hal_getcapability(ah, type, capability, result);
647 }
648}
649
652 uint32_t capability, uint32_t setting, HAL_STATUS *status)
653{
654 switch (type) {
655 case HAL_CAP_DIAG: /* hardware diagnostic support */
656 /*
657 * NB: could split this up into virtual capabilities,
658 * (e.g. 1 => ACK, 2 => CTS, etc.) but it hardly
659 * seems worth the additional complexity.
660 */
661#ifdef AH_DEBUG
662 AH_PRIVATE(ah)->ah_diagreg = setting;
663#else
664 AH_PRIVATE(ah)->ah_diagreg = setting & 0x6; /* ACK+CTS */
665#endif
666 OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg);
667 return AH_TRUE;
668 default:
669 return ath_hal_setcapability(ah, type, capability,
670 setting, status);
671 }
672}
673
675ar5211GetDiagState(struct ath_hal *ah, int request,
676 const void *args, uint32_t argsize,
677 void **result, uint32_t *resultsize)
678{
679 struct ath_hal_5211 *ahp = AH5211(ah);
680
681 (void) ahp;
682 if (ath_hal_getdiagstate(ah, request, args, argsize, result, resultsize))
683 return AH_TRUE;
684 switch (request) {
685 case HAL_DIAG_EEPROM:
686 return ath_hal_eepromDiag(ah, request,
687 args, argsize, result, resultsize);
688 case HAL_DIAG_RFGAIN:
689 *result = &ahp->ah_gainValues;
690 *resultsize = sizeof(GAIN_VALUES);
691 return AH_TRUE;
693 *result = __DECONST(void *, ahp->ah_gainValues.currStep);
694 *resultsize = (*result == AH_NULL) ?
695 0 : sizeof(GAIN_OPTIMIZATION_STEP);
696 return AH_TRUE;
697 }
698 return AH_FALSE;
699}
700
701/*
702 * Return what percentage of the extension channel is busy.
703 * This is always disabled for AR5211 series NICs.
704 */
705uint32_t
707{
708 return (0);
709}
710
711/*
712 * There's no channel survey support for the AR5211.
713 */
716{
717
718 return (AH_FALSE);
719}
720
721void
722ar5211SetChainMasks(struct ath_hal *ah, uint32_t txchainmask,
723 uint32_t rxchainmask)
724{
725}
726
727void
729{
730}
731
732void
734{
735}
736
737/*
738 * Get the current NAV value from the hardware.
739 */
740u_int
742{
743 uint32_t reg;
744
745 reg = OS_REG_READ(ah, AR_NAV);
746 return (reg);
747}
748
749/*
750 * Set the current NAV value to the hardware.
751 */
752void
753ar5211SetNav(struct ath_hal *ah, u_int val)
754{
755
756 OS_REG_WRITE(ah, AR_NAV, val);
757}
758
u_int ath_hal_mac_clks(struct ath_hal *ah, u_int usecs)
Definition: ah.c:597
u_int ath_hal_mac_usec(struct ath_hal *ah, u_int clks)
Definition: ah.c:625
HAL_BOOL ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val)
Definition: ah.c:305
HAL_STATUS
Definition: ah.h:71
@ HAL_EIO
Definition: ah.h:75
@ HAL_ENOTSUPP
Definition: ah.h:85
@ HAL_EEWRITE
Definition: ah.h:83
@ HAL_OK
Definition: ah.h:72
@ HAL_EINVAL
Definition: ah.h:84
@ HAL_MODE_TURBO
Definition: ah.h:658
@ HAL_MODE_108A
Definition: ah.h:667
@ HAL_MODE_11A
Definition: ah.h:657
@ HAL_MODE_11B
Definition: ah.h:659
HAL_CAPABILITY_TYPE
Definition: ah.h:98
@ HAL_CAP_CIPHER
Definition: ah.h:100
@ HAL_CAP_DIAG
Definition: ah.h:109
@ HAL_CIPHER_CLR
Definition: ah.h:810
@ HAL_CIPHER_WEP
Definition: ah.h:805
@ HAL_CIPHER_AES_OCB
Definition: ah.h:806
HAL_ANT_SETTING
Definition: ah.h:758
HAL_GPIO_MUX_TYPE
Definition: ah.h:582
HAL_ANI_CMD
Definition: ah.h:970
HAL_QUIET_FLAG
Definition: ah.h:1090
@ HAL_INT_GPIO
Definition: ah.h:497
HAL_BOOL
Definition: ah.h:93
@ AH_FALSE
Definition: ah.h:94
@ AH_TRUE
Definition: ah.h:95
HAL_LED_STATE
Definition: ah.h:227
@ HAL_DEBUG_ANY
Definition: ah_debug.h:62
@ HAL_DIAG_EEPROM
Definition: ah_diagcodes.h:41
@ HAL_DIAG_RFGAIN
Definition: ah_diagcodes.h:49
@ HAL_DIAG_RFGAIN_CURSTEP
Definition: ah_diagcodes.h:50
@ AR_EEP_BMODE
Definition: ah_eeprom.h:71
@ AR_EEP_WRITEPROTECT
Definition: ah_eeprom.h:104
@ AR_EEP_TURBO5DISABLE
Definition: ah_eeprom.h:73
@ AR_EEP_AMODE
Definition: ah_eeprom.h:70
#define AR_EEPROM_REG_DOMAIN
Definition: ah_eeprom_v1.h:48
#define AR_EEPROM_RFSILENT_GPIO_SEL
Definition: ah_eeprom_v1.h:64
#define AR_EEPROM_RFSILENT_POLARITY
Definition: ah_eeprom_v1.h:66
#define LE_READ_4(p)
Definition: ah_internal.h:577
#define OS_REG_SET_BIT(_a, _r, _f)
Definition: ah_internal.h:594
#define LE_READ_2(p)
Definition: ah_internal.h:574
#define MS(_v, _f)
Definition: ah_internal.h:588
#define IEEE80211_ADDR_LEN
Definition: ah_internal.h:501
#define OS_REG_CLR_BIT(_a, _r, _f)
Definition: ah_internal.h:596
#define AH_PRIVATE(_ah)
Definition: ah_internal.h:442
#define OS_REG_RMW_FIELD(_a, _r, _f, _v)
Definition: ah_internal.h:591
#define AH_NULL
Definition: ah_internal.h:28
#define ath_hal_eepromDiag(_ah, _request, _a, _asize, _r, _rsize)
Definition: ah_internal.h:494
#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 OS_REG_WRITE(_ah, _reg, _val)
Definition: ah_osdep.h:139
#define OS_MEMCPY(_d, _s, _n)
Definition: ah_osdep.h:73
#define OS_REG_READ(_ah, _reg)
Definition: ah_osdep.h:140
#define AR_PHY_BASE
Definition: ar5210phy.h:29
#define AR_PHY(_n)
Definition: ar5210phy.h:30
#define AR_TIME_OUT
Definition: ar5210reg.h:75
#define AR_BEACON
Definition: ar5210reg.h:79
#define AR_STA_ID1_ACKCTS_6MB
Definition: ar5210reg.h:312
#define AR_TIME_OUT_CTS
Definition: ar5210reg.h:322
#define AR_BEACON_CNT
Definition: ar5210reg.h:106
#define AR_NAV
Definition: ar5210reg.h:101
#define AR_STA_ID1
Definition: ar5210reg.h:71
#define AR_SREV
Definition: ar5210reg.h:63
#define AR_GPIODI
Definition: ar5210reg.h:62
#define AR_TSF_U32
Definition: ar5210reg.h:97
#define AR_BSS_ID0
Definition: ar5210reg.h:72
#define AR_GPIOCR_INT_ENA
Definition: ar5210reg.h:289
#define AR_PCICFG
Definition: ar5210reg.h:59
#define AR_GPIODO
Definition: ar5210reg.h:61
#define AR_GPIOCR_INT_SELH
Definition: ar5210reg.h:291
#define AR_FCS_FAIL
Definition: ar5210reg.h:105
#define AR_RTS_OK
Definition: ar5210reg.h:102
#define AR_BEACON_RESET_TSF
Definition: ar5210reg.h:353
#define AR_GPIOCR
Definition: ar5210reg.h:60
#define AR_BSS_ID1
Definition: ar5210reg.h:73
#define AR_TSF_L32
Definition: ar5210reg.h:96
#define AR_TIME_OUT_ACK
Definition: ar5210reg.h:320
#define AR_RTS_FAIL
Definition: ar5210reg.h:103
#define AR_ACK_FAIL
Definition: ar5210reg.h:104
#define AR_BSS_ID1_AID_S
Definition: ar5210reg.h:318
#define AR_DIAG_SW
Definition: ar5210reg.h:95
HAL_BOOL ar5211EepromWrite(struct ath_hal *, u_int off, uint16_t data)
HAL_BOOL ar5211SetAntennaSwitchInternal(struct ath_hal *, HAL_ANT_SETTING, const struct ieee80211_channel *)
#define AH5211(ah)
Definition: ar5211.h:144
HAL_INT ar5211SetInterrupts(struct ath_hal *, HAL_INT ints)
void ar5211GetMacAddress(struct ath_hal *ah, uint8_t *mac)
Definition: ar5211_misc.c:36
HAL_BOOL ar5211SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t setting, HAL_STATUS *status)
Definition: ar5211_misc.c:651
HAL_BOOL ar5211GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type)
Definition: ar5211_misc.c:197
HAL_BOOL ar5211SetSlotTime(struct ath_hal *ah, u_int us)
Definition: ar5211_misc.c:450
HAL_BOOL ar5211SetSifsTime(struct ath_hal *ah, u_int us)
Definition: ar5211_misc.c:425
HAL_BOOL ar5211SetBssIdMask(struct ath_hal *ah, const uint8_t *mask)
Definition: ar5211_misc.c:61
u_int ar5211GetNav(struct ath_hal *ah)
Definition: ar5211_misc.c:741
u_int ar5211GetSlotTime(struct ath_hal *ah)
Definition: ar5211_misc.c:468
void ar5211WriteAssocid(struct ath_hal *ah, const uint8_t *bssid, uint16_t assocId)
Definition: ar5211_misc.c:315
uint64_t ar5211GetTsf64(struct ath_hal *ah)
Definition: ar5211_misc.c:330
HAL_BOOL ar5211EepromRead(struct ath_hal *ah, u_int off, uint16_t *data)
Definition: ar5211_misc.c:70
u_int ar5211GetCTSTimeout(struct ath_hal *ah)
Definition: ar5211_misc.c:541
void ar5211SetNav(struct ath_hal *ah, u_int val)
Definition: ar5211_misc.c:753
u_int ar5211GetDefAntenna(struct ath_hal *ah)
Definition: ar5211_misc.c:601
u_int ar5211GetSifsTime(struct ath_hal *ah)
Definition: ar5211_misc.c:443
#define AR_GPIOD_MASK
Definition: ar5211_misc.c:33
u_int ar5211GetWirelessModes(struct ath_hal *ah)
Definition: ar5211_misc.c:143
HAL_BOOL ar5211SetAckCTSRate(struct ath_hal *ah, u_int high)
Definition: ar5211_misc.c:507
HAL_BOOL ar5211GpioCfgInput(struct ath_hal *ah, uint32_t gpio)
Definition: ar5211_misc.c:215
void ar5211GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
Definition: ar5211_misc.c:733
u_int ar5211GetAckCTSRate(struct ath_hal *ah)
Definition: ar5211_misc.c:501
HAL_BOOL ar5211SetDecompMask(struct ath_hal *ah, uint16_t keyidx, int en)
Definition: ar5211_misc.c:548
HAL_ANT_SETTING ar5211GetAntennaSwitch(struct ath_hal *ah)
Definition: ar5211_misc.c:613
#define AR_NUM_GPIO
Definition: ar5211_misc.c:32
void ar5211ResetTsf(struct ath_hal *ah)
Definition: ar5211_misc.c:367
HAL_BOOL ar5211GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
Definition: ar5211_misc.c:715
HAL_BOOL ar5211SetAckTimeout(struct ath_hal *ah, u_int us)
Definition: ar5211_misc.c:475
HAL_STATUS ar5211SetQuiet(struct ath_hal *ah, uint32_t period, uint32_t duration, uint32_t next_start, HAL_QUIET_FLAG flags)
Definition: ar5211_misc.c:560
void ar5211RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan)
Definition: ar5211_misc.c:581
uint32_t ar5211GetTsf32(struct ath_hal *ah)
Definition: ar5211_misc.c:358
HAL_BOOL ar5211AniControl(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
Definition: ar5211_misc.c:570
void ar5211EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
Definition: ar5211_misc.c:728
HAL_BOOL ar5211GpioSet(struct ath_hal *ah, uint32_t gpio, uint32_t val)
Definition: ar5211_misc.c:233
void ar5211SetLedState(struct ath_hal *ah, HAL_LED_STATE state)
Definition: ar5211_misc.c:289
void ar5211AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
Definition: ar5211_misc.c:576
void ar5211EnableRfKill(struct ath_hal *ah)
Definition: ar5211_misc.c:170
HAL_BOOL ar5211SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings)
Definition: ar5211_misc.c:619
uint32_t ar5211GetRandomSeed(struct ath_hal *ah)
Definition: ar5211_misc.c:379
void ar5211UpdateMibCounters(struct ath_hal *ah, HAL_MIB_STATS *stats)
Definition: ar5211_misc.c:415
HAL_BOOL ar5211GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
Definition: ar5211_misc.c:675
void ar5211GpioSetIntr(struct ath_hal *ah, u_int gpio, uint32_t ilevel)
Definition: ar5211_misc.c:266
u_int ar5211GetAckTimeout(struct ath_hal *ah)
Definition: ar5211_misc.c:494
void ar5211SetChainMasks(struct ath_hal *ah, uint32_t txchainmask, uint32_t rxchainmask)
Definition: ar5211_misc.c:722
HAL_BOOL ar5211SetCTSTimeout(struct ath_hal *ah, u_int us)
Definition: ar5211_misc.c:522
HAL_STATUS ar5211GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result)
Definition: ar5211_misc.c:631
void ar5211SetCoverageClass(struct ath_hal *ah, uint8_t coverageclass, int now)
Definition: ar5211_misc.c:555
void ar5211MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats)
Definition: ar5211_misc.c:587
uint32_t ar5211Get11nExtBusy(struct ath_hal *ah)
Definition: ar5211_misc.c:706
HAL_BOOL ar5211SetRegulatoryDomain(struct ath_hal *ah, uint16_t regDomain, HAL_STATUS *status)
Definition: ar5211_misc.c:101
uint32_t ar5211GetCurRssi(struct ath_hal *ah)
Definition: ar5211_misc.c:595
HAL_BOOL ar5211SetMacAddress(struct ath_hal *ah, const uint8_t *mac)
Definition: ar5211_misc.c:44
void ar5211SetDefAntenna(struct ath_hal *ah, u_int antenna)
Definition: ar5211_misc.c:607
HAL_BOOL ar5211DetectCardPresent(struct ath_hal *ah)
Definition: ar5211_misc.c:394
void ar5211GetBssIdMask(struct ath_hal *ah, uint8_t *mask)
Definition: ar5211_misc.c:53
uint32_t ar5211GpioGet(struct ath_hal *ah, uint32_t gpio)
Definition: ar5211_misc.c:251
#define AR_PHY_CURRENT_RSSI
Definition: ar5211phy.h:87
#define AR_SREV_REVISION_M
Definition: ar5211reg.h:712
#define AR_GPIOCR_0_CR_N
Definition: ar5211reg.h:673
#define AR_SREV_ID_S
Definition: ar5211reg.h:711
#define AR_PCICFG_LEDCTL_NONE
Definition: ar5211reg.h:651
#define AR_GPIOCR_CR_SHIFT
Definition: ar5211reg.h:672
#define AR_PCICFG_LEDMODE_PROP
Definition: ar5211reg.h:662
#define AR_D_GBL_IFS_SLOT
Definition: ar5211reg.h:212
#define AR_PCICFG_LEDMODE
Definition: ar5211reg.h:661
#define AR_SREV_ID_M
Definition: ar5211reg.h:709
#define AR_EEPROM_CMD
Definition: ar5211reg.h:236
#define AR_PCICFG_LEDMODE_RAND
Definition: ar5211reg.h:665
#define AR_EEPROM_DATA
Definition: ar5211reg.h:235
#define AR_PCICFG_LEDCTL
Definition: ar5211reg.h:650
#define AR_EEPROM_STS_READ_COMPLETE
Definition: ar5211reg.h:739
#define AR_GPIOCR_INT_SEL0
Definition: ar5211reg.h:699
#define AR_DEF_ANTENNA
Definition: ar5211reg.h:262
#define AR_EEPROM_ADDR
Definition: ar5211reg.h:234
#define AR_EEPROM_CMD_READ
Definition: ar5211reg.h:734
#define AR_PCICFG_LEDCTL_PEND
Definition: ar5211reg.h:652
#define AR_EEPROM_STS
Definition: ar5211reg.h:237
#define AR_GPIOCR_0_CR_A
Definition: ar5211reg.h:676
#define AR_D_GBL_IFS_SIFS
Definition: ar5211reg.h:211
#define AR_EEPROM_STS_READ_ERROR
Definition: ar5211reg.h:738
#define AR_PCICFG_LEDCTL_ASSOC
Definition: ar5211reg.h:653
#define ath_hal_setcapability(_ah, _cap, _param, _v, _status)
Definition: if_athvar.h:1210
#define ath_hal_getcapability(_ah, _cap, _param, _result)
Definition: if_athvar.h:1208
#define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize)
Definition: if_athvar.h:1165
const GAIN_OPTIMIZATION_STEP * currStep
Definition: ar5211.h:92
uint32_t ackrcv_bad
Definition: ah.h:637
uint32_t beacons
Definition: ah.h:641
uint32_t fcs_bad
Definition: ah.h:640
uint32_t rts_bad
Definition: ah.h:638
uint32_t rts_good
Definition: ah.h:639
u_int ah_slottime
Definition: ar5211.h:134
u_int ah_sifstime
Definition: ar5211.h:133
uint32_t ah_maskReg
Definition: ar5211.h:117
u_int ah_acktimeout
Definition: ar5211.h:135
GAIN_VALUES ah_gainValues
Definition: ar5211.h:109
u_int ah_ctstimeout
Definition: ar5211.h:136
uint8_t ah_bssid[IEEE80211_ADDR_LEN]
Definition: ar5211.h:112
uint8_t ah_macaddr[IEEE80211_ADDR_LEN]
Definition: ar5211.h:111
uint32_t ah_staId1Defaults
Definition: ar5211.h:129
Definition: ah.h:1219