Lines Matching refs:ah

21 #include "ah.h"
33 static HAL_BOOL ar5312GetMacAddr(struct ath_hal *ah);
36 ar5312AniSetup(struct ath_hal *ah)
56 ar5212AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
67 struct ath_hal *ah;
85 ah = &ahp->ah_priv.h;
88 ah->ah_reset = ar5312Reset;
89 ah->ah_phyDisable = ar5312PhyDisable;
90 ah->ah_setLedState = ar5312SetLedState;
91 ah->ah_detectCardPresent = ar5312DetectCardPresent;
92 ah->ah_setPowerMode = ar5312SetPowerMode;
93 ah->ah_getPowerMode = ar5312GetPowerMode;
94 ah->ah_isInterruptPending = ar5312IsInterruptPending;
101 if (IS_5315(ah)) {
117 ah->ah_gpioCfgInput = ahp->ah_priv.ah_gpioCfgInput;
118 ah->ah_gpioCfgOutput = ahp->ah_priv.ah_gpioCfgOutput;
119 ah->ah_gpioGet = ahp->ah_priv.ah_gpioGet;
120 ah->ah_gpioSet = ahp->ah_priv.ah_gpioSet;
121 ah->ah_gpioSetIntr = ahp->ah_priv.ah_gpioSetIntr;
127 if (!ar5312ChipReset(ah, AH_NULL)) { /* reset chip */
128 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__);
138 val = ((OS_REG_READ(ah, (AR5315_RSTIMER_BASE -((uint32_t) sh)) + AR5315_WREV)) >> AR5315_WREV_S)
140 AH_PRIVATE(ah)->ah_macVersion = val >> AR5315_WREV_ID_S;
141 AH_PRIVATE(ah)->ah_macRev = val & AR5315_WREV_REVISION;
142 HALDEBUG(ah, HAL_DEBUG_ATTACH,
144 AH_PRIVATE(ah)->ah_macVersion, AH_PRIVATE(ah)->ah_macRev);
148 val = OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + 0x0020);
149 val = OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + 0x0080);
151 val = ((OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + AR5312_WREV)) >> AR5312_WREV_S) & AR5312_WREV_ID;
152 AH_PRIVATE(ah)->ah_macVersion = val >> AR5312_WREV_ID_S;
153 AH_PRIVATE(ah)->ah_macRev = val & AR5312_WREV_REVISION;
156 if (((AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_VENICE &&
157 AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_VENICE) ||
158 AH_PRIVATE(ah)->ah_macRev < AR_SREV_D2PLUS) &&
159 AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_COBRA) {
161 ath_hal_printf(ah, "%s: Mac Chip Rev 0x%02x.%x is not supported by "
163 AH_PRIVATE(ah)->ah_macVersion,
164 AH_PRIVATE(ah)->ah_macRev);
170 AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID);
172 if (!ar5212ChipTest(ah)) {
173 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: hardware self-test failed\n",
183 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
186 AH_PRIVATE(ah)->ah_analog5GhzRev = ar5212GetRadioRev(ah);
188 rf = ath_hal_rfprobe(ah, &ecode);
191 if (IS_RAD5112(ah) && !IS_RADX112_REV2(ah)) {
193 ath_hal_printf(ah, "%s: 5112 Rev 1 is not supported by this "
195 AH_PRIVATE(ah)->ah_analog5GhzRev);
201 ecode = ath_hal_legacyEepromAttach(ah);
209 if (ath_hal_eepromGetFlag(ah, AR_EEP_BMODE) &&
210 (AH_PRIVATE(ah)->ah_analog5GhzRev & 0xF0) == AR_RAD5111_SREV_MAJOR) {
215 OS_REG_WRITE(ah, AR_PHY(0), 0x00004007);
217 AH_PRIVATE(ah)->ah_analog2GhzRev = ar5212GetRadioRev(ah);
220 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
222 if ((AH_PRIVATE(ah)->ah_analog2GhzRev & 0xF0) != AR_RAD2111_SREV_MAJOR) {
224 ath_hal_printf(ah, "%s: 2G Radio Chip Rev 0x%02X is not "
226 AH_PRIVATE(ah)->ah_analog2GhzRev);
233 ecode = ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, &eeval);
235 HALDEBUG(ah, HAL_DEBUG_ANY,
240 AH_PRIVATE(ah)->ah_currentRD = eeval;
247 if (!ar5212FillCapabilityInfo(ah)) {
248 HALDEBUG(ah, HAL_DEBUG_ANY,
254 if (!rf->attach(ah, &ecode)) {
255 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n",
260 AH_PRIVATE(ah)->ah_getNfAdjust = ahp->ah_rfHal->getNfAdjust;
263 ar5212InitializeGainValues(ah);
266 if (!ar5312GetMacAddr(ah)) {
271 ar5312AniSetup(ah);
272 ar5212InitNfCalHistBuffer(ah);
275 return ah;
286 ar5312GetMacAddr(struct ath_hal *ah)
288 const struct ar531x_boarddata *board = AR5312_BOARDCONFIG(ah);
289 int wlanNum = AR5312_UNIT(ah);
301 ath_hal_printf(ah, "Invalid WLAN wmac index (%d)\n",
306 OS_MEMCPY(AH5212(ah)->ah_macaddr, macAddr, 6);