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);
68 struct ath_hal *ah;
86 ah = &ahp->ah_priv.h;
89 ah->ah_reset = ar5312Reset;
90 ah->ah_phyDisable = ar5312PhyDisable;
91 ah->ah_setLedState = ar5312SetLedState;
92 ah->ah_detectCardPresent = ar5312DetectCardPresent;
93 ah->ah_setPowerMode = ar5312SetPowerMode;
94 ah->ah_getPowerMode = ar5312GetPowerMode;
95 ah->ah_isInterruptPending = ar5312IsInterruptPending;
102 if (IS_5315(ah)) {
118 ah->ah_gpioCfgInput = ahp->ah_priv.ah_gpioCfgInput;
119 ah->ah_gpioCfgOutput = ahp->ah_priv.ah_gpioCfgOutput;
120 ah->ah_gpioGet = ahp->ah_priv.ah_gpioGet;
121 ah->ah_gpioSet = ahp->ah_priv.ah_gpioSet;
122 ah->ah_gpioSetIntr = ahp->ah_priv.ah_gpioSetIntr;
128 if (!ar5312ChipReset(ah, AH_NULL)) { /* reset chip */
129 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__);
139 val = ((OS_REG_READ(ah, (AR5315_RSTIMER_BASE -((uint32_t) sh)) + AR5315_WREV)) >> AR5315_WREV_S)
141 AH_PRIVATE(ah)->ah_macVersion = val >> AR5315_WREV_ID_S;
142 AH_PRIVATE(ah)->ah_macRev = val & AR5315_WREV_REVISION;
143 HALDEBUG(ah, HAL_DEBUG_ATTACH,
145 AH_PRIVATE(ah)->ah_macVersion, AH_PRIVATE(ah)->ah_macRev);
149 val = OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + 0x0020);
150 val = OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + 0x0080);
152 val = ((OS_REG_READ(ah, (AR5312_RSTIMER_BASE - ((uint32_t) sh)) + AR5312_WREV)) >> AR5312_WREV_S) & AR5312_WREV_ID;
153 AH_PRIVATE(ah)->ah_macVersion = val >> AR5312_WREV_ID_S;
154 AH_PRIVATE(ah)->ah_macRev = val & AR5312_WREV_REVISION;
157 if (((AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_VENICE &&
158 AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_VENICE) ||
159 AH_PRIVATE(ah)->ah_macRev < AR_SREV_D2PLUS) &&
160 AH_PRIVATE(ah)->ah_macVersion != AR_SREV_VERSION_COBRA) {
162 ath_hal_printf(ah, "%s: Mac Chip Rev 0x%02x.%x is not supported by "
164 AH_PRIVATE(ah)->ah_macVersion,
165 AH_PRIVATE(ah)->ah_macRev);
171 AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID);
173 if (!ar5212ChipTest(ah)) {
174 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: hardware self-test failed\n",
184 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
187 AH_PRIVATE(ah)->ah_analog5GhzRev = ar5212GetRadioRev(ah);
189 rf = ath_hal_rfprobe(ah, &ecode);
192 if (IS_RAD5112(ah) && !IS_RADX112_REV2(ah)) {
194 ath_hal_printf(ah, "%s: 5112 Rev 1 is not supported by this "
196 AH_PRIVATE(ah)->ah_analog5GhzRev);
202 ecode = ath_hal_legacyEepromAttach(ah);
210 if (ath_hal_eepromGetFlag(ah, AR_EEP_BMODE) &&
211 (AH_PRIVATE(ah)->ah_analog5GhzRev & 0xF0) == AR_RAD5111_SREV_MAJOR) {
216 OS_REG_WRITE(ah, AR_PHY(0), 0x00004007);
218 AH_PRIVATE(ah)->ah_analog2GhzRev = ar5212GetRadioRev(ah);
221 OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
223 if ((AH_PRIVATE(ah)->ah_analog2GhzRev & 0xF0) != AR_RAD2111_SREV_MAJOR) {
225 ath_hal_printf(ah, "%s: 2G Radio Chip Rev 0x%02X is not "
227 AH_PRIVATE(ah)->ah_analog2GhzRev);
234 ecode = ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, &eeval);
236 HALDEBUG(ah, HAL_DEBUG_ANY,
241 AH_PRIVATE(ah)->ah_currentRD = eeval;
248 if (!ar5212FillCapabilityInfo(ah)) {
249 HALDEBUG(ah, HAL_DEBUG_ANY,
255 if (!rf->attach(ah, &ecode)) {
256 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n",
261 AH_PRIVATE(ah)->ah_getNfAdjust = ahp->ah_rfHal->getNfAdjust;
264 ar5212InitializeGainValues(ah);
267 if (!ar5312GetMacAddr(ah)) {
272 ar5312AniSetup(ah);
273 ar5212InitNfCalHistBuffer(ah);
276 return ah;
287 ar5312GetMacAddr(struct ath_hal *ah)
289 const struct ar531x_boarddata *board = AR5312_BOARDCONFIG(ah);
290 int wlanNum = AR5312_UNIT(ah);
302 ath_hal_printf(ah, "Invalid WLAN wmac index (%d)\n",
307 OS_MEMCPY(AH5212(ah)->ah_macaddr, macAddr, 6);