32#include "ar5212/ar5212.ini"
178#ifdef AH_SUPPORT_WRITE_EEPROM
192 for (i = 0; i < 8; i++)
195 val = ((val & 0xf0) >> 4) | ((val & 0x0f) << 4);
204 .totalSizeDesired = { -55, -55, -55, -55, -62 },
205 .coarseHigh = { -14, -14, -14, -14, -12 },
206 .coarseLow = { -64, -64, -64, -64, -70 },
207 .firpwr = { -78, -78, -78, -78, -80 },
208 .maxSpurImmunityLevel = 2,
209 .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 },
210 .maxFirstepLevel = 2,
211 .firstep = { 0, 4, 8 },
239#define N(a) (sizeof(a)/sizeof(a[0]))
241 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
290#define N(a) (sizeof(a)/sizeof(a[0]))
291 static const struct {
293 uint8_t revMin, revMax;
310 for (i = 0; i <
N(macs); i++)
311 if (macs[i].version == macVersion &&
312 macs[i].revMin <= macRev && macRev <= macs[i].revMax)
326#define AH_EEPROM_PROTECT(ah) \
327 (AH_PRIVATE(ah)->ah_ispcie)? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT)
336 __func__, sc, (
void*) st, (
void*) sh);
342 "%s: cannot allocate memory for state block\n", __func__);
363 "%s: Mac Chip Rev 0x%02x.%x not supported\n" ,
455 "%s: 5G Radio Chip Rev 0x%02X is not supported by "
464 "%s: 5112 Rev 1 is not supported by this "
465 "driver (analog5GhzRev 0x%x)\n", __func__,
476 "%s: unsupported EEPROM size %u (0x%x) found\n",
485 "%s: unsupported EEPROM size %u (0x%x) found\n",
491 "%s: EEPROM size = %d. Must be %d (16k).\n",
520 "%s: 2G Radio Chip Rev 0x%02X is not "
521 "supported by this driver\n", __func__,
531 "%s: cannot read regulatory domain from EEPROM\n",
543 "%s: failed ar5212FillCapabilityInfo\n", __func__);
548 if (!rf->
attach(ah, &ecode)) {
565 "%s: error getting mac address from EEPROM\n", __func__);
585#undef AH_EEPROM_PROTECT
610 uint32_t patternData[4] =
611 { 0x55555555, 0xaaaaaaaa, 0x66666666, 0x99999999 };
615 for (i = 0; i < 2; i++) {
616 uint32_t addr = regAddr[i];
617 uint32_t wrData, rdData;
620 for (j = 0; j < 0x100; j++) {
621 wrData = (j << 16) | j;
624 if (rdData != wrData) {
626"%s: address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
627 __func__, addr, wrData, rdData);
631 for (j = 0; j < 4; j++) {
632 wrData = patternData[j];
635 if (wrData != rdData) {
637"%s: address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
638 __func__, addr, wrData, rdData);
653 uint16_t flags, uint16_t *low, uint16_t *high)
655 if (flags & IEEE80211_CHAN_5GHZ) {
660 if ((flags & IEEE80211_CHAN_2GHZ) &&
714#define AR_KEYTABLE_SIZE 128
715#define IS_GRIFFIN_LITE(ah) \
716 (AH_PRIVATE(ah)->ah_macVersion == AR_SREV_VERSION_GRIFFIN && \
717 AH_PRIVATE(ah)->ah_macRev == AR_SREV_GRIFFIN_LITE)
718#define IS_COBRA(ah) \
719 (AH_PRIVATE(ah)->ah_macVersion == AR_SREV_VERSION_COBRA)
721 ((AH_PRIVATE(ah)->ah_analog5GhzRev & 0xF0) == AR_RAD2112_SREV_MAJOR)
725 uint16_t capField, val;
730 "%s: unable to read caps from eeprom\n", __func__);
744 "%s: override caps for griffin-lite, now 0x%x (+!turbo)\n",
763 "%s: enable Bmode and disable turbo for Swan/Nala\n",
935 return "Atheros 5212 (FPGA)";
939 return "Atheros 5212";
941 return "Atheros 2413";
943 return "Atheros 2417";
945 return "Atheros 5413";
947 return "Atheros 5424/2424";
uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n)
struct ath_hal_rf * ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode)
int16_t ath_hal_getChanNoise(struct ath_hal *ah, const struct ieee80211_channel *chan)
#define HAL_NUM_TX_QUEUES
#define AR_SUBVENDOR_ID_NOG
#define ATHEROS_3COM_VENDOR_ID
#define AR_SUBVENDOR_ID_NEW_A
#define ATHEROS_3COM2_VENDOR_ID
#define ATHEROS_VENDOR_ID
HAL_STATUS ath_hal_legacyEepromAttach(struct ath_hal *ah)
#define OS_REG_SET_BIT(_a, _r, _f)
#define ath_hal_eepromSet(_ah, _param, _val)
#define HAL_INI_INIT(_ia, _data, _cols)
#define IEEE80211_ADDR_LEN
#define ath_hal_configPCIE(_ah, _reset, _poweroff)
#define ath_hal_eepromGet(_ah, _param, _val)
void * ath_hal_malloc(size_t)
#define HALDEBUG(_ah, __m,...)
#define ath_hal_eepromGetFlag(_ah, _param)
#define ath_hal_eepromDetach(_ah)
void ath_hal_free(void *p)
bus_space_tag_t HAL_BUS_TAG
#define OS_REG_WRITE(_ah, _reg, _val)
bus_space_handle_t HAL_BUS_HANDLE
#define OS_MEMCPY(_d, _s, _n)
#define OS_REG_READ(_ah, _reg)
#define MAX_TX_FIFO_THRESHOLD
#define INIT_TX_FIFO_THRESHOLD
#define AR_PCICFG_EEPROM_SIZE_16K
#define AR_PCICFG_EEPROM_SIZE_FAILED
#define AR_SREV_VERSION_OAHU
HAL_BOOL ar5212GetTxQueueProps(struct ath_hal *ah, int q, HAL_TXQ_INFO *qInfo)
HAL_BOOL ar5212EepromRead(struct ath_hal *, u_int off, uint16_t *data)
void ar5212AniDetach(struct ath_hal *)
void ar5212GetTxIntrQueue(struct ath_hal *ah, uint32_t *)
HAL_BOOL ar5212SetCTSTimeout(struct ath_hal *, u_int)
HAL_BOOL ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, HAL_RESET_TYPE, HAL_STATUS *status)
HAL_RFGAIN ar5212GetRfgain(struct ath_hal *ah)
HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *)
void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
HAL_STATUS ar5212SetQuiet(struct ath_hal *ah, uint32_t period, uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag)
HAL_BOOL ar5212SetTxPowerLimit(struct ath_hal *ah, uint32_t limit)
HAL_BOOL ar5212FillTxDesc(struct ath_hal *ah, struct ath_desc *ds, HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int descId, u_int qcuId, HAL_BOOL firstSeg, HAL_BOOL lastSeg, const struct ath_desc *ds0)
uint32_t ar5212GetTsf32(struct ath_hal *ah)
void ar5212SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
void ar5212SetNav(struct ath_hal *, u_int)
void ar5212SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1)
HAL_BOOL ar5212SetKeyCacheEntry(struct ath_hal *ah, uint16_t entry, const HAL_KEYVAL *k, const uint8_t *mac, int xorKey)
HAL_BOOL ar5212SetSlotTime(struct ath_hal *, u_int)
void ar5212StopPcuReceive(struct ath_hal *ah)
HAL_BOOL ar5212PerCalibration(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_BOOL *isIQdone)
HAL_BOOL ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries)
u_int ar5212GetCTSTimeout(struct ath_hal *)
uint32_t ar5212GpioGet(struct ath_hal *ah, uint32_t gpio)
HAL_ANT_SETTING ar5212GetAntennaSwitch(struct ath_hal *)
void ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
HAL_BOOL ar5212SetMacAddress(struct ath_hal *ah, const uint8_t *)
HAL_BOOL ar5212SetMulticastFilterIndex(struct ath_hal *, uint32_t ix)
uint64_t ar5212GetNextTBTT(struct ath_hal *)
int ar5212SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO *qInfo)
void ar5212EnableReceive(struct ath_hal *ah)
HAL_BOOL ar5212SetBssIdMask(struct ath_hal *, const uint8_t *)
HAL_STATUS ar5212ProcRxDesc(struct ath_hal *ah, struct ath_desc *, uint32_t, struct ath_desc *, uint64_t, struct ath_rx_status *)
u_int ar5212GetNav(struct ath_hal *)
void ar5212SetBeaconTimers(struct ath_hal *ah, const HAL_BEACON_TIMERS *)
#define AH_RADIO_MAJOR(ah)
HAL_BOOL ar5212SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, u_int txRate0, u_int txTries0, u_int keyIx, u_int antMode, u_int flags, u_int rtsctsRate, u_int rtsctsDuration, u_int compicvLen, u_int compivLen, u_int comp)
HAL_BOOL ar5212StopTxDma(struct ath_hal *ah, u_int q)
HAL_BOOL ar5212ReleaseTxQueue(struct ath_hal *ah, u_int q)
HAL_BOOL ar5212SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
void ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits)
HAL_BOOL ar5212IsFastClockEnabled(struct ath_hal *ah)
void ar5212AniAttach(struct ath_hal *, const struct ar5212AniParams *, const struct ar5212AniParams *, HAL_BOOL ena)
void ar5212ResetStaBeaconTimers(struct ath_hal *ah)
u_int ar5212GetAckTimeout(struct ath_hal *)
u_int ar5212GetSifsTime(struct ath_hal *)
void ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *)
u_int ar5212GetSlotTime(struct ath_hal *)
void ar5212SetStaBeaconTimers(struct ath_hal *ah, const HAL_BEACON_STATE *)
void ar5212ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *)
HAL_BOOL ar5212SetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE, uint32_t, uint32_t, HAL_STATUS *)
HAL_BOOL ar5212StopDmaReceive(struct ath_hal *ah)
HAL_BOOL ar5212UpdateTxTrigLevel(struct ath_hal *, HAL_BOOL IncTrigLevel)
void ar5212UpdateMibCounters(struct ath_hal *ah, HAL_MIB_STATS *stats)
HAL_BOOL ar5212ClrMulticastFilterIndex(struct ath_hal *, uint32_t ix)
void ar5212SetTsf64(struct ath_hal *ah, uint64_t tsf64)
uint32_t ar5212NumTxPending(struct ath_hal *ah, u_int q)
uint32_t ar5212GetTxDP(struct ath_hal *ah, u_int q)
void ar5212SetChainMasks(struct ath_hal *, uint32_t, uint32_t)
void ar5212InitializeGainValues(struct ath_hal *)
HAL_BOOL ar5212SetupXTxDesc(struct ath_hal *, struct ath_desc *, u_int txRate1, u_int txRetries1, u_int txRate2, u_int txRetries2, u_int txRate3, u_int txRetries3)
#define ar5212RfDetach(ah)
HAL_BOOL ar5212EepromWrite(struct ath_hal *, u_int off, uint16_t data)
HAL_BOOL ar5212GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan)
uint32_t ar5212Get11nExtBusy(struct ath_hal *ah)
void ar5212GetBssIdMask(struct ath_hal *ah, uint8_t *mac)
HAL_BOOL ar5212SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
HAL_BOOL ar5212SetAckTimeout(struct ath_hal *, u_int)
HAL_BOOL ar5212IsKeyCacheEntryValid(struct ath_hal *, uint16_t entry)
HAL_BOOL ar5212GpioCfgOutput(struct ath_hal *, uint32_t gpio, HAL_GPIO_MUX_TYPE)
HAL_BOOL ar5212StartTxDma(struct ath_hal *ah, u_int q)
HAL_BOOL ar5212SetSifsTime(struct ath_hal *, u_int)
HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip)
HAL_BOOL ar5212Disable(struct ath_hal *ah)
HAL_BOOL ar5212GetPendingInterrupts(struct ath_hal *ah, HAL_INT *)
HAL_INT ar5212SetInterrupts(struct ath_hal *ah, HAL_INT ints)
HAL_BOOL ar5212ResetTxQueue(struct ath_hal *ah, u_int q)
void ar5212SetLedState(struct ath_hal *ah, HAL_LED_STATE state)
HAL_BOOL ar5212GpioCfgInput(struct ath_hal *, uint32_t gpio)
uint32_t ar5212GetRxDP(struct ath_hal *ath, HAL_RX_QUEUE)
void ar5212StartPcuReceive(struct ath_hal *ah, HAL_BOOL)
HAL_BOOL ar5212PerCalibrationN(struct ath_hal *ah, struct ieee80211_channel *chan, u_int chainMask, HAL_BOOL longCal, HAL_BOOL *isCalDone)
u_int ar5212GetDefAntenna(struct ath_hal *ah)
void ar5212SetDefAntenna(struct ath_hal *ah, u_int antenna)
HAL_POWER_MODE ar5212GetPowerMode(struct ath_hal *ah)
void ar5212SetPCUConfig(struct ath_hal *)
#define IS_RAD5112_ANY(ah)
void ar5212AniPoll(struct ath_hal *, const struct ieee80211_channel *)
const HAL_RATE_TABLE * ar5212GetRateTable(struct ath_hal *, u_int mode)
void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
#define IS_RAD5112_REV1(ah)
u_int ar5212GetAckCTSRate(struct ath_hal *)
HAL_STATUS ar5212ProcTxDesc(struct ath_hal *ah, struct ath_desc *, struct ath_tx_status *)
void ar5212SetCoverageClass(struct ath_hal *, uint8_t, int)
u_int ar5212GetWirelessModes(struct ath_hal *ah)
HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event)
HAL_BOOL ar5212ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *)
HAL_BOOL ar5212AniControl(struct ath_hal *, HAL_ANI_CMD cmd, int param)
void ar5212GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel)
void ar5212GetMacAddress(struct ath_hal *ah, uint8_t *mac)
uint32_t ar5212GetKeyCacheSize(struct ath_hal *)
void ar5212GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
uint64_t ar5212GetTsf64(struct ath_hal *ah)
HAL_BOOL ar5212SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING)
void ar5212InitNfCalHistBuffer(struct ath_hal *)
HAL_BOOL ar5212SetAckCTSRate(struct ath_hal *, u_int)
HAL_BOOL ar5212SetDecompMask(struct ath_hal *, uint16_t, int)
void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE)
void ar5212ResetTsf(struct ath_hal *ah)
HAL_BOOL ar5212PhyDisable(struct ath_hal *ah)
HAL_BOOL ar5212GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val)
HAL_INT ar5212GetInterrupts(struct ath_hal *ah)
HAL_STATUS ar5212GetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE, uint32_t, uint32_t *)
HAL_BOOL ar5212DetectCardPresent(struct ath_hal *ah)
HAL_BOOL ar5212SetRegulatoryDomain(struct ath_hal *ah, uint16_t regDomain, HAL_STATUS *stats)
uint32_t ar5212GetRxFilter(struct ath_hal *ah)
HAL_BOOL ar5212GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
HAL_BOOL ar5212ChipReset(struct ath_hal *ah, const struct ieee80211_channel *)
HAL_BOOL ar5212SetupRxDesc(struct ath_hal *, struct ath_desc *, uint32_t size, u_int flags)
HAL_BOOL ar5212ResetKeyCacheEntry(struct ath_hal *ah, uint16_t entry)
void ar5212BeaconInit(struct ath_hal *ah, uint32_t next_beacon, uint32_t beacon_period)
HAL_BOOL ar5212IsInterruptPending(struct ath_hal *ah)
void ar5212WriteAssocid(struct ath_hal *ah, const uint8_t *bssid, uint16_t assocId)
void ar5212RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *)
HAL_BOOL ar5212SetKeyCacheEntryMac(struct ath_hal *, uint16_t entry, const uint8_t *mac)
static void ar5212DisablePCIE(struct ath_hal *ah)
AH_CHIP(AR5212, ar5212Probe, ar5212Attach)
void ar5212Detach(struct ath_hal *ah)
static void ar5212AniSetup(struct ath_hal *ah)
HAL_BOOL ar5212FillCapabilityInfo(struct ath_hal *ah)
static const char * ar5212Probe(uint16_t vendorid, uint16_t devid)
HAL_BOOL ar5212ChipTest(struct ath_hal *ah)
HAL_BOOL ar5212GetChannelEdges(struct ath_hal *ah, uint16_t flags, uint16_t *low, uint16_t *high)
static struct ath_hal * ar5212Attach(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)
static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
static const struct ath_hal_private ar5212hal
static HAL_BOOL ar5212IsMacSupported(uint8_t macVersion, uint8_t macRev)
uint32_t ar5212GetRadioRev(struct ath_hal *ah)
#define IS_GRIFFIN_LITE(ah)
void ar5212InitState(struct ath_hal_5212 *ahp, uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status)
#define AR_RAD5111_SREV_MAJOR
#define AR_PCICFG_EEPROM_SIZE
#define AR_STA_ID1_CRPT_MIC_ENABLE
#define AR_SREV_REVISION_MAX
#define AR_PCICFG_RETRYFIXEN
#define AR_RAD2112_SREV_MAJOR
#define AR_SREV_VERSION_GRIFFIN
#define AR_RAD5112_SREV_MAJOR
#define AR_RAD5424_SREV_MAJOR
#define AR_RAD2111_SREV_MAJOR
#define AR_SREV_VERSION_VENICE
#define AR_SREV_REVISION_MIN
#define AR_RAD5413_SREV_MAJOR
#define AR_ANALOG5REV_HAINAN
#define AR_RADIO_SREV_MAJOR
#define AR_RAD2413_SREV_MAJOR
uint32_t halChanSpreadSupport
uint32_t halRfSilentSupport
uint32_t halBssidMatchSupport
uint32_t halTurboPrimeSupport
uint32_t halHwPhyCounterSupport
uint32_t halMicCkipSupport
uint32_t halFastFramesSupport
uint32_t halUseCombinedRadarRssi
uint32_t halMicAesCcmSupport
uint32_t halBssIdMaskSupport
uint32_t halCipherAesCcmSupport
uint32_t halTurboGSupport
uint32_t halCipherTkipSupport
uint32_t halCipherCkipSupport
uint32_t halCompressSupport
uint32_t halMcastKeySrchSupport
uint32_t halTsfAddSupport
uint32_t halWirelessModes
uint32_t halTkipMicTxRxKeySupport
uint32_t halMicTkipSupport
uint32_t halHasRxSelfLinkedTail
uint32_t halChapTuningSupport
uint32_t halChanQuarterRate
uint32_t hal4kbSplitTransSupport
uint32_t halSleepAfterBeaconBroken
int16_t(* getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL *)
int maxNoiseImmunityLevel
HAL_ANT_SETTING ah_antControl
HAL_INI_ARRAY ah_ini_common
enum ath_hal_5212::@23 ah_enable32kHzClock
uint8_t ah_bssidmask[IEEE80211_ADDR_LEN]
enum ath_hal_5212::@22 ah_bIQCalibration
uint32_t ah_staId1Defaults
uint8_t ah_macaddr[IEEE80211_ADDR_LEN]
uint32_t ah_beaconInterval
struct ath_hal_private ah_priv
HAL_INI_ARRAY ah_ini_modes
HAL_REG_DOMAIN ah_currentRD
HAL_BOOL ah_rfkillEnabled
HAL_BOOL(* attach)(struct ath_hal *ah, HAL_STATUS *ecode)