1572ff6f6SMatthew Dillon /* 2572ff6f6SMatthew Dillon * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3572ff6f6SMatthew Dillon * Copyright (c) 2002-2008 Atheros Communications, Inc. 4572ff6f6SMatthew Dillon * 5572ff6f6SMatthew Dillon * Permission to use, copy, modify, and/or distribute this software for any 6572ff6f6SMatthew Dillon * purpose with or without fee is hereby granted, provided that the above 7572ff6f6SMatthew Dillon * copyright notice and this permission notice appear in all copies. 8572ff6f6SMatthew Dillon * 9572ff6f6SMatthew Dillon * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10572ff6f6SMatthew Dillon * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11572ff6f6SMatthew Dillon * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12572ff6f6SMatthew Dillon * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13572ff6f6SMatthew Dillon * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14572ff6f6SMatthew Dillon * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15572ff6f6SMatthew Dillon * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16572ff6f6SMatthew Dillon * 17572ff6f6SMatthew Dillon * $FreeBSD$ 18572ff6f6SMatthew Dillon */ 19572ff6f6SMatthew Dillon #ifndef _ATH_AR5416_H_ 20572ff6f6SMatthew Dillon #define _ATH_AR5416_H_ 21572ff6f6SMatthew Dillon 22572ff6f6SMatthew Dillon #include "ar5212/ar5212.h" 23572ff6f6SMatthew Dillon #include "ar5416_cal.h" 24572ff6f6SMatthew Dillon #include "ah_eeprom_v14.h" /* for CAL_TARGET_POWER_* */ 25572ff6f6SMatthew Dillon 26572ff6f6SMatthew Dillon #define AR5416_MAGIC 0x20065416 27572ff6f6SMatthew Dillon 28572ff6f6SMatthew Dillon enum { 29572ff6f6SMatthew Dillon HAL_RESET_POWER_ON, 30572ff6f6SMatthew Dillon HAL_RESET_WARM, 31572ff6f6SMatthew Dillon HAL_RESET_COLD, 32572ff6f6SMatthew Dillon }; 33572ff6f6SMatthew Dillon 34572ff6f6SMatthew Dillon typedef struct { 35572ff6f6SMatthew Dillon uint16_t synth_center; 36572ff6f6SMatthew Dillon uint16_t ctl_center; 37572ff6f6SMatthew Dillon uint16_t ext_center; 38572ff6f6SMatthew Dillon } CHAN_CENTERS; 39572ff6f6SMatthew Dillon 40572ff6f6SMatthew Dillon typedef enum Ar5416_Rates { 41572ff6f6SMatthew Dillon rate6mb, rate9mb, rate12mb, rate18mb, 42572ff6f6SMatthew Dillon rate24mb, rate36mb, rate48mb, rate54mb, 43572ff6f6SMatthew Dillon rate1l, rate2l, rate2s, rate5_5l, 44572ff6f6SMatthew Dillon rate5_5s, rate11l, rate11s, rateXr, 45572ff6f6SMatthew Dillon rateHt20_0, rateHt20_1, rateHt20_2, rateHt20_3, 46572ff6f6SMatthew Dillon rateHt20_4, rateHt20_5, rateHt20_6, rateHt20_7, 47572ff6f6SMatthew Dillon rateHt40_0, rateHt40_1, rateHt40_2, rateHt40_3, 48572ff6f6SMatthew Dillon rateHt40_4, rateHt40_5, rateHt40_6, rateHt40_7, 49572ff6f6SMatthew Dillon rateDupCck, rateDupOfdm, rateExtCck, rateExtOfdm, 50572ff6f6SMatthew Dillon Ar5416RateSize 51572ff6f6SMatthew Dillon } AR5416_RATES; 52572ff6f6SMatthew Dillon 53572ff6f6SMatthew Dillon #define AR5416_DEFAULT_RXCHAINMASK 7 54572ff6f6SMatthew Dillon #define AR5416_DEFAULT_TXCHAINMASK 1 55572ff6f6SMatthew Dillon #define AR5416_MAX_RATE_POWER 63 56572ff6f6SMatthew Dillon #define AR5416_KEYTABLE_SIZE 128 57572ff6f6SMatthew Dillon 58572ff6f6SMatthew Dillon #define AR5416_CCA_MAX_GOOD_VALUE -85 59572ff6f6SMatthew Dillon #define AR5416_CCA_MAX_HIGH_VALUE -62 60572ff6f6SMatthew Dillon #define AR5416_CCA_MIN_BAD_VALUE -140 61572ff6f6SMatthew Dillon #define AR9285_CCA_MAX_GOOD_VALUE -118 62572ff6f6SMatthew Dillon 63572ff6f6SMatthew Dillon #define AR5416_SPUR_RSSI_THRESH 40 64572ff6f6SMatthew Dillon 65572ff6f6SMatthew Dillon struct ar5416NfLimits { 66572ff6f6SMatthew Dillon int16_t max; 67572ff6f6SMatthew Dillon int16_t min; 68572ff6f6SMatthew Dillon int16_t nominal; 69572ff6f6SMatthew Dillon }; 70572ff6f6SMatthew Dillon 71572ff6f6SMatthew Dillon struct ath_hal_5416 { 72572ff6f6SMatthew Dillon struct ath_hal_5212 ah_5212; 73572ff6f6SMatthew Dillon 74572ff6f6SMatthew Dillon /* NB: RF data setup at attach */ 75572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bb_rfgain; 76572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank0; 77572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank1; 78572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank2; 79572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank3; 80572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank6; 81572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_bank7; 82572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_addac; 83572ff6f6SMatthew Dillon HAL_INI_ARRAY ah_ini_pcieserdes; 84572ff6f6SMatthew Dillon 85572ff6f6SMatthew Dillon void (*ah_writeIni)(struct ath_hal *, 86572ff6f6SMatthew Dillon const struct ieee80211_channel *); 87572ff6f6SMatthew Dillon void (*ah_spurMitigate)(struct ath_hal *, 88572ff6f6SMatthew Dillon const struct ieee80211_channel *); 89572ff6f6SMatthew Dillon 90572ff6f6SMatthew Dillon /* calibration ops */ 91572ff6f6SMatthew Dillon HAL_BOOL (*ah_cal_initcal)(struct ath_hal *, 92572ff6f6SMatthew Dillon const struct ieee80211_channel *); 93572ff6f6SMatthew Dillon void (*ah_cal_pacal)(struct ath_hal *, 94572ff6f6SMatthew Dillon HAL_BOOL is_reset); 95572ff6f6SMatthew Dillon 96572ff6f6SMatthew Dillon /* optional open-loop tx power control related methods */ 97572ff6f6SMatthew Dillon void (*ah_olcInit)(struct ath_hal *); 98572ff6f6SMatthew Dillon void (*ah_olcTempCompensation)(struct ath_hal *); 99572ff6f6SMatthew Dillon 100572ff6f6SMatthew Dillon /* tx power control */ 101572ff6f6SMatthew Dillon HAL_BOOL (*ah_setPowerCalTable) (struct ath_hal *ah, 102572ff6f6SMatthew Dillon struct ar5416eeprom *pEepData, 103572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, 104572ff6f6SMatthew Dillon int16_t *pTxPowerIndexOffset); 105572ff6f6SMatthew Dillon 106572ff6f6SMatthew Dillon /* baseband operations */ 107572ff6f6SMatthew Dillon void (*ah_initPLL) (struct ath_hal *ah, 108572ff6f6SMatthew Dillon const struct ieee80211_channel *chan); 109572ff6f6SMatthew Dillon 110572ff6f6SMatthew Dillon /* bluetooth coexistence operations */ 111572ff6f6SMatthew Dillon void (*ah_btCoexSetDiversity)(struct ath_hal *ah); 112572ff6f6SMatthew Dillon 113572ff6f6SMatthew Dillon u_int ah_globaltxtimeout; /* global tx timeout */ 114572ff6f6SMatthew Dillon u_int ah_gpioMask; 115572ff6f6SMatthew Dillon int ah_hangs; /* h/w hangs state */ 116572ff6f6SMatthew Dillon uint8_t ah_keytype[AR5416_KEYTABLE_SIZE]; 117572ff6f6SMatthew Dillon /* 118572ff6f6SMatthew Dillon * Primary/Extension Channel Tx, Rx, Rx Clear State 119572ff6f6SMatthew Dillon */ 120572ff6f6SMatthew Dillon uint32_t ah_cycleCount; 121572ff6f6SMatthew Dillon uint32_t ah_ctlBusy; 122572ff6f6SMatthew Dillon uint32_t ah_extBusy; 123572ff6f6SMatthew Dillon uint32_t ah_rxBusy; 124572ff6f6SMatthew Dillon uint32_t ah_txBusy; 125572ff6f6SMatthew Dillon uint32_t ah_rx_chainmask; 126572ff6f6SMatthew Dillon uint32_t ah_tx_chainmask; 127572ff6f6SMatthew Dillon 128572ff6f6SMatthew Dillon HAL_ANI_CMD ah_ani_function; 129572ff6f6SMatthew Dillon 130572ff6f6SMatthew Dillon struct ar5416PerCal ah_cal; /* periodic calibration state */ 131572ff6f6SMatthew Dillon 132572ff6f6SMatthew Dillon struct ar5416NfLimits nf_2g; 133572ff6f6SMatthew Dillon struct ar5416NfLimits nf_5g; 134572ff6f6SMatthew Dillon 135572ff6f6SMatthew Dillon /* 136572ff6f6SMatthew Dillon * TX power configuration related structures 137572ff6f6SMatthew Dillon */ 138572ff6f6SMatthew Dillon int initPDADC; 139572ff6f6SMatthew Dillon int ah_ht40PowerIncForPdadc; 140572ff6f6SMatthew Dillon int16_t ah_ratesArray[Ar5416RateSize]; 141572ff6f6SMatthew Dillon 142572ff6f6SMatthew Dillon int ah_need_an_top2_fixup; /* merlin or later chips that may need this workaround */ 143572ff6f6SMatthew Dillon 144572ff6f6SMatthew Dillon /* 145572ff6f6SMatthew Dillon * Bluetooth coexistence static setup according to the registry 146572ff6f6SMatthew Dillon */ 147572ff6f6SMatthew Dillon HAL_BT_MODULE ah_btModule; /* Bluetooth module identifier */ 148572ff6f6SMatthew Dillon uint8_t ah_btCoexConfigType; /* BT coex configuration */ 149572ff6f6SMatthew Dillon uint8_t ah_btActiveGpioSelect; /* GPIO pin for BT_ACTIVE */ 150572ff6f6SMatthew Dillon uint8_t ah_btPriorityGpioSelect; /* GPIO pin for BT_PRIORITY */ 151572ff6f6SMatthew Dillon uint8_t ah_wlanActiveGpioSelect; /* GPIO pin for WLAN_ACTIVE */ 152572ff6f6SMatthew Dillon uint8_t ah_btActivePolarity; /* Polarity of BT_ACTIVE */ 153572ff6f6SMatthew Dillon HAL_BOOL ah_btCoexSingleAnt; /* Single or dual antenna configuration */ 154572ff6f6SMatthew Dillon uint8_t ah_btWlanIsolation; /* Isolation between BT and WLAN in dB */ 155572ff6f6SMatthew Dillon 156572ff6f6SMatthew Dillon /* 157572ff6f6SMatthew Dillon * Bluetooth coexistence runtime settings 158572ff6f6SMatthew Dillon */ 159572ff6f6SMatthew Dillon HAL_BOOL ah_btCoexEnabled; /* If Bluetooth coexistence is enabled */ 160572ff6f6SMatthew Dillon uint32_t ah_btCoexMode; /* Register setting for AR_BT_COEX_MODE */ 161572ff6f6SMatthew Dillon uint32_t ah_btCoexBTWeight; /* Register setting for AR_BT_COEX_WEIGHT */ 162572ff6f6SMatthew Dillon uint32_t ah_btCoexWLANWeight; /* Register setting for AR_BT_COEX_WEIGHT */ 163572ff6f6SMatthew Dillon uint32_t ah_btCoexMode2; /* Register setting for AR_BT_COEX_MODE2 */ 164572ff6f6SMatthew Dillon uint32_t ah_btCoexFlag; /* Special tuning flags for BT coex */ 165572ff6f6SMatthew Dillon }; 166572ff6f6SMatthew Dillon #define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) 167572ff6f6SMatthew Dillon 168572ff6f6SMatthew Dillon #define IS_5416_PCI(ah) ((AH_PRIVATE(ah)->ah_macVersion) == AR_SREV_VERSION_OWL_PCI) 169572ff6f6SMatthew Dillon #define IS_5416_PCIE(ah) ((AH_PRIVATE(ah)->ah_macVersion) == AR_SREV_VERSION_OWL_PCIE) 170572ff6f6SMatthew Dillon #undef IS_PCIE 171572ff6f6SMatthew Dillon #define IS_PCIE(ah) (IS_5416_PCIE(ah)) 172572ff6f6SMatthew Dillon 173572ff6f6SMatthew Dillon extern HAL_BOOL ar2133RfAttach(struct ath_hal *, HAL_STATUS *); 174572ff6f6SMatthew Dillon 175572ff6f6SMatthew Dillon struct ath_hal; 176572ff6f6SMatthew Dillon 177572ff6f6SMatthew Dillon extern uint32_t ar5416GetRadioRev(struct ath_hal *ah); 178572ff6f6SMatthew Dillon extern void ar5416InitState(struct ath_hal_5416 *, uint16_t devid, 179572ff6f6SMatthew Dillon HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, 180572ff6f6SMatthew Dillon HAL_STATUS *status); 181572ff6f6SMatthew Dillon extern void ar5416Detach(struct ath_hal *ah); 182572ff6f6SMatthew Dillon extern void ar5416AttachPCIE(struct ath_hal *ah); 183572ff6f6SMatthew Dillon extern HAL_BOOL ar5416FillCapabilityInfo(struct ath_hal *ah); 184572ff6f6SMatthew Dillon 185572ff6f6SMatthew Dillon extern void ar5416AniAttach(struct ath_hal *, const struct ar5212AniParams *, 186572ff6f6SMatthew Dillon const struct ar5212AniParams *, HAL_BOOL ena); 187572ff6f6SMatthew Dillon extern void ar5416AniDetach(struct ath_hal *); 188572ff6f6SMatthew Dillon extern HAL_BOOL ar5416AniControl(struct ath_hal *, HAL_ANI_CMD cmd, int param); 189572ff6f6SMatthew Dillon extern HAL_BOOL ar5416AniSetParams(struct ath_hal *, 190572ff6f6SMatthew Dillon const struct ar5212AniParams *, const struct ar5212AniParams *); 191572ff6f6SMatthew Dillon extern void ar5416ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *); 192572ff6f6SMatthew Dillon extern void ar5416RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, 193572ff6f6SMatthew Dillon const struct ieee80211_channel *); 194572ff6f6SMatthew Dillon extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *); 195572ff6f6SMatthew Dillon extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *, 196572ff6f6SMatthew Dillon HAL_OPMODE, int); 197572ff6f6SMatthew Dillon 198572ff6f6SMatthew Dillon extern void ar5416SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *); 199572ff6f6SMatthew Dillon extern void ar5416BeaconInit(struct ath_hal *ah, 200572ff6f6SMatthew Dillon uint32_t next_beacon, uint32_t beacon_period); 201572ff6f6SMatthew Dillon extern void ar5416ResetStaBeaconTimers(struct ath_hal *ah); 202572ff6f6SMatthew Dillon extern void ar5416SetStaBeaconTimers(struct ath_hal *ah, 203572ff6f6SMatthew Dillon const HAL_BEACON_STATE *); 204572ff6f6SMatthew Dillon extern uint64_t ar5416GetNextTBTT(struct ath_hal *); 205572ff6f6SMatthew Dillon 206572ff6f6SMatthew Dillon /* ar5416_btcoex.c */ 207572ff6f6SMatthew Dillon extern void ar5416SetBTCoexInfo(struct ath_hal *ah, 208572ff6f6SMatthew Dillon HAL_BT_COEX_INFO *btinfo); 209572ff6f6SMatthew Dillon extern void ar5416BTCoexConfig(struct ath_hal *ah, 210572ff6f6SMatthew Dillon HAL_BT_COEX_CONFIG *btconf); 211572ff6f6SMatthew Dillon extern void ar5416BTCoexAntennaDiversity(struct ath_hal *ah); 212572ff6f6SMatthew Dillon extern void ar5416BTCoexSetQcuThresh(struct ath_hal *ah, int qnum); 213572ff6f6SMatthew Dillon extern void ar5416BTCoexSetWeights(struct ath_hal *ah, uint32_t stompType); 214572ff6f6SMatthew Dillon extern void ar5416BTCoexSetupBmissThresh(struct ath_hal *ah, 215572ff6f6SMatthew Dillon uint32_t thresh); 216572ff6f6SMatthew Dillon extern void ar5416BTCoexSetParameter(struct ath_hal *ah, uint32_t type, 217572ff6f6SMatthew Dillon uint32_t value); 218572ff6f6SMatthew Dillon extern void ar5416BTCoexDisable(struct ath_hal *ah); 219572ff6f6SMatthew Dillon extern int ar5416BTCoexEnable(struct ath_hal *ah); 220572ff6f6SMatthew Dillon extern void ar5416InitBTCoex(struct ath_hal *ah); 221572ff6f6SMatthew Dillon 222572ff6f6SMatthew Dillon extern HAL_BOOL ar5416EepromRead(struct ath_hal *, u_int off, uint16_t *data); 223572ff6f6SMatthew Dillon extern HAL_BOOL ar5416EepromWrite(struct ath_hal *, u_int off, uint16_t data); 224572ff6f6SMatthew Dillon 225572ff6f6SMatthew Dillon extern HAL_BOOL ar5416IsInterruptPending(struct ath_hal *ah); 226572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetPendingInterrupts(struct ath_hal *, HAL_INT *masked); 227572ff6f6SMatthew Dillon extern HAL_INT ar5416SetInterrupts(struct ath_hal *ah, HAL_INT ints); 228572ff6f6SMatthew Dillon 229572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GpioCfgOutput(struct ath_hal *, uint32_t gpio, 230572ff6f6SMatthew Dillon HAL_GPIO_MUX_TYPE); 231572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GpioCfgInput(struct ath_hal *, uint32_t gpio); 232572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); 233572ff6f6SMatthew Dillon extern uint32_t ar5416GpioGet(struct ath_hal *ah, uint32_t gpio); 234572ff6f6SMatthew Dillon extern void ar5416GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel); 235572ff6f6SMatthew Dillon 236572ff6f6SMatthew Dillon extern u_int ar5416GetWirelessModes(struct ath_hal *ah); 237572ff6f6SMatthew Dillon extern void ar5416SetLedState(struct ath_hal *ah, HAL_LED_STATE state); 238572ff6f6SMatthew Dillon extern uint64_t ar5416GetTsf64(struct ath_hal *ah); 239572ff6f6SMatthew Dillon extern void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64); 240572ff6f6SMatthew Dillon extern void ar5416ResetTsf(struct ath_hal *ah); 241572ff6f6SMatthew Dillon extern uint32_t ar5416GetCurRssi(struct ath_hal *ah); 242572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); 243572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetDecompMask(struct ath_hal *, uint16_t, int); 244572ff6f6SMatthew Dillon extern void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int); 245572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetMibCycleCounts(struct ath_hal *ah, 246572ff6f6SMatthew Dillon HAL_SURVEY_SAMPLE *hsample); 247572ff6f6SMatthew Dillon extern void ar5416SetChainMasks(struct ath_hal *ah, uint32_t, uint32_t); 248572ff6f6SMatthew Dillon extern uint32_t ar5416Get11nExtBusy(struct ath_hal *ah); 249572ff6f6SMatthew Dillon extern void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode); 250572ff6f6SMatthew Dillon extern HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah); 251572ff6f6SMatthew Dillon extern void ar5416Set11nRxClear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear); 252572ff6f6SMatthew Dillon extern HAL_STATUS ar5416SetQuiet(struct ath_hal *ah, uint32_t period, 253572ff6f6SMatthew Dillon uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag); 254572ff6f6SMatthew Dillon extern HAL_STATUS ar5416GetCapability(struct ath_hal *ah, 255572ff6f6SMatthew Dillon HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result); 256572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetCapability(struct ath_hal *ah, 257572ff6f6SMatthew Dillon HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t val, 258572ff6f6SMatthew Dillon HAL_STATUS *status); 259572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request, 260572ff6f6SMatthew Dillon const void *args, uint32_t argsize, 261572ff6f6SMatthew Dillon void **result, uint32_t *resultsize); 262572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah, 263572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, HAL_BOOL enable); 264572ff6f6SMatthew Dillon 265572ff6f6SMatthew Dillon extern void ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); 266572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetDfsDefaultThresh(struct ath_hal *ah, 267572ff6f6SMatthew Dillon HAL_PHYERR_PARAM *pe); 268572ff6f6SMatthew Dillon extern void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); 269572ff6f6SMatthew Dillon extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah, 270572ff6f6SMatthew Dillon struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, 271572ff6f6SMatthew Dillon HAL_DFS_EVENT *event); 272572ff6f6SMatthew Dillon extern HAL_BOOL ar5416IsFastClockEnabled(struct ath_hal *ah); 273572ff6f6SMatthew Dillon 274572ff6f6SMatthew Dillon /* ar9280_spectral.c */ 275572ff6f6SMatthew Dillon extern void ar5416ConfigureSpectralScan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss); 276572ff6f6SMatthew Dillon extern void ar5416GetSpectralParams(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss); 277572ff6f6SMatthew Dillon extern HAL_BOOL ar5416IsSpectralActive(struct ath_hal *ah); 278572ff6f6SMatthew Dillon extern HAL_BOOL ar5416IsSpectralEnabled(struct ath_hal *ah); 279572ff6f6SMatthew Dillon extern void ar5416StartSpectralScan(struct ath_hal *ah); 280572ff6f6SMatthew Dillon extern void ar5416StopSpectralScan(struct ath_hal *ah); 281572ff6f6SMatthew Dillon extern uint32_t ar5416GetSpectralConfig(struct ath_hal *ah); 282572ff6f6SMatthew Dillon extern void ar5416RestoreSpectralConfig(struct ath_hal *ah, uint32_t restoreval); 283572ff6f6SMatthew Dillon 284572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, 285572ff6f6SMatthew Dillon int setChip); 286572ff6f6SMatthew Dillon extern HAL_POWER_MODE ar5416GetPowerMode(struct ath_hal *ah); 287572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetPowerStatus(struct ath_hal *ah); 288572ff6f6SMatthew Dillon 289572ff6f6SMatthew Dillon extern HAL_BOOL ar5416ResetKeyCacheEntry(struct ath_hal *ah, uint16_t entry); 290572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetKeyCacheEntry(struct ath_hal *ah, uint16_t entry, 291572ff6f6SMatthew Dillon const HAL_KEYVAL *k, const uint8_t *mac, int xorKey); 292572ff6f6SMatthew Dillon 293572ff6f6SMatthew Dillon extern uint32_t ar5416GetRxFilter(struct ath_hal *ah); 294572ff6f6SMatthew Dillon extern void ar5416SetRxFilter(struct ath_hal *ah, uint32_t bits); 295572ff6f6SMatthew Dillon extern HAL_BOOL ar5416StopDmaReceive(struct ath_hal *ah); 296572ff6f6SMatthew Dillon extern void ar5416StartPcuReceive(struct ath_hal *ah); 297572ff6f6SMatthew Dillon extern void ar5416StopPcuReceive(struct ath_hal *ah); 298572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetupRxDesc(struct ath_hal *, 299572ff6f6SMatthew Dillon struct ath_desc *, uint32_t size, u_int flags); 300572ff6f6SMatthew Dillon extern HAL_STATUS ar5416ProcRxDesc(struct ath_hal *ah, struct ath_desc *, 301572ff6f6SMatthew Dillon uint32_t, struct ath_desc *, uint64_t, 302572ff6f6SMatthew Dillon struct ath_rx_status *); 303572ff6f6SMatthew Dillon 304572ff6f6SMatthew Dillon extern HAL_BOOL ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode, 305572ff6f6SMatthew Dillon struct ieee80211_channel *chan, 306*b14ca477SMatthew Dillon HAL_BOOL bChannelChange, 307*b14ca477SMatthew Dillon HAL_RESET_TYPE, 308*b14ca477SMatthew Dillon HAL_STATUS *status); 309572ff6f6SMatthew Dillon extern HAL_BOOL ar5416PhyDisable(struct ath_hal *ah); 310572ff6f6SMatthew Dillon extern HAL_RFGAIN ar5416GetRfgain(struct ath_hal *ah); 311572ff6f6SMatthew Dillon extern HAL_BOOL ar5416Disable(struct ath_hal *ah); 312572ff6f6SMatthew Dillon extern HAL_BOOL ar5416ChipReset(struct ath_hal *ah, 313572ff6f6SMatthew Dillon const struct ieee80211_channel *); 314572ff6f6SMatthew Dillon extern int ar5416GetRegChainOffset(struct ath_hal *ah, int i); 315572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetBoardValues(struct ath_hal *, 316572ff6f6SMatthew Dillon const struct ieee80211_channel *); 317572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type); 318572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetTxPowerLimit(struct ath_hal *ah, uint32_t limit); 319572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetTransmitPower(struct ath_hal *, 320572ff6f6SMatthew Dillon const struct ieee80211_channel *, uint16_t *); 321572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetChipPowerLimits(struct ath_hal *ah, 322572ff6f6SMatthew Dillon struct ieee80211_channel *chan); 323572ff6f6SMatthew Dillon extern void ar5416GetChannelCenters(struct ath_hal *, 324572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, CHAN_CENTERS *centers); 325572ff6f6SMatthew Dillon extern void ar5416SetRatesArrayFromTargetPower(struct ath_hal *ah, 326572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, 327572ff6f6SMatthew Dillon int16_t *ratesArray, 328572ff6f6SMatthew Dillon const CAL_TARGET_POWER_LEG *targetPowerCck, 329572ff6f6SMatthew Dillon const CAL_TARGET_POWER_LEG *targetPowerCckExt, 330572ff6f6SMatthew Dillon const CAL_TARGET_POWER_LEG *targetPowerOfdm, 331572ff6f6SMatthew Dillon const CAL_TARGET_POWER_LEG *targetPowerOfdmExt, 332572ff6f6SMatthew Dillon const CAL_TARGET_POWER_HT *targetPowerHt20, 333572ff6f6SMatthew Dillon const CAL_TARGET_POWER_HT *targetPowerHt40); 334572ff6f6SMatthew Dillon extern void ar5416GetTargetPowers(struct ath_hal *ah, 335572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, 336572ff6f6SMatthew Dillon CAL_TARGET_POWER_HT *powInfo, 337572ff6f6SMatthew Dillon uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower, 338572ff6f6SMatthew Dillon uint16_t numRates, HAL_BOOL isHt40Target); 339572ff6f6SMatthew Dillon extern void ar5416GetTargetPowersLeg(struct ath_hal *ah, 340572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, 341572ff6f6SMatthew Dillon CAL_TARGET_POWER_LEG *powInfo, 342572ff6f6SMatthew Dillon uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, 343572ff6f6SMatthew Dillon uint16_t numRates, HAL_BOOL isExtTarget); 344572ff6f6SMatthew Dillon extern void ar5416InitChainMasks(struct ath_hal *ah); 345572ff6f6SMatthew Dillon extern void ar5416RestoreChainMask(struct ath_hal *ah); 346572ff6f6SMatthew Dillon extern void ar5416EepromSetAddac(struct ath_hal *ah, 347572ff6f6SMatthew Dillon const struct ieee80211_channel *chan); 348572ff6f6SMatthew Dillon extern uint16_t ar5416GetMaxEdgePower(uint16_t freq, 349572ff6f6SMatthew Dillon CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); 350572ff6f6SMatthew Dillon extern void ar5416InitPLL(struct ath_hal *ah, 351572ff6f6SMatthew Dillon const struct ieee80211_channel *chan); 352572ff6f6SMatthew Dillon 353572ff6f6SMatthew Dillon /* TX power setup related routines in ar5416_reset.c */ 354572ff6f6SMatthew Dillon extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, 355572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, 356572ff6f6SMatthew Dillon uint8_t * bChans, uint16_t availPiers, 357572ff6f6SMatthew Dillon uint16_t tPdGainOverlap, int16_t *pMinCalPower, 358572ff6f6SMatthew Dillon uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, 359572ff6f6SMatthew Dillon uint16_t numXpdGains); 360572ff6f6SMatthew Dillon extern void ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, 361572ff6f6SMatthew Dillon int i, uint16_t pdGainOverlap_t2, 362572ff6f6SMatthew Dillon uint16_t gainBoundaries[]); 363572ff6f6SMatthew Dillon extern uint16_t ar5416GetXpdGainValues(struct ath_hal *ah, uint16_t xpdMask, 364572ff6f6SMatthew Dillon uint16_t xpdGainValues[]); 365572ff6f6SMatthew Dillon extern void ar5416WriteDetectorGainBiases(struct ath_hal *ah, 366572ff6f6SMatthew Dillon uint16_t numXpdGain, uint16_t xpdGainValues[]); 367572ff6f6SMatthew Dillon extern void ar5416WritePdadcValues(struct ath_hal *ah, int i, 368572ff6f6SMatthew Dillon uint8_t pdadcValues[]); 369572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, 370572ff6f6SMatthew Dillon struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, 371572ff6f6SMatthew Dillon int16_t *pTxPowerIndexOffset); 372572ff6f6SMatthew Dillon extern void ar5416WriteTxPowerRateRegisters(struct ath_hal *ah, 373572ff6f6SMatthew Dillon const struct ieee80211_channel *chan, const int16_t ratesArray[]); 374572ff6f6SMatthew Dillon 375572ff6f6SMatthew Dillon extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); 376572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, 377572ff6f6SMatthew Dillon u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, 378572ff6f6SMatthew Dillon u_int txRate0, u_int txTries0, 379572ff6f6SMatthew Dillon u_int keyIx, u_int antMode, u_int flags, 380572ff6f6SMatthew Dillon u_int rtsctsRate, u_int rtsctsDuration, 381572ff6f6SMatthew Dillon u_int compicvLen, u_int compivLen, u_int comp); 382572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetupXTxDesc(struct ath_hal *, struct ath_desc *, 383572ff6f6SMatthew Dillon u_int txRate1, u_int txRetries1, 384572ff6f6SMatthew Dillon u_int txRate2, u_int txRetries2, 385572ff6f6SMatthew Dillon u_int txRate3, u_int txRetries3); 386572ff6f6SMatthew Dillon extern HAL_BOOL ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds, 387572ff6f6SMatthew Dillon HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, 388572ff6f6SMatthew Dillon u_int descId, u_int qcuId, HAL_BOOL firstSeg, HAL_BOOL lastSeg, 389572ff6f6SMatthew Dillon const struct ath_desc *ds0); 390572ff6f6SMatthew Dillon extern HAL_STATUS ar5416ProcTxDesc(struct ath_hal *ah, 391572ff6f6SMatthew Dillon struct ath_desc *, struct ath_tx_status *); 392572ff6f6SMatthew Dillon extern HAL_BOOL ar5416GetTxCompletionRates(struct ath_hal *ah, 393572ff6f6SMatthew Dillon const struct ath_desc *ds0, int *rates, int *tries); 394572ff6f6SMatthew Dillon 395572ff6f6SMatthew Dillon extern HAL_BOOL ar5416ResetTxQueue(struct ath_hal *ah, u_int q); 396572ff6f6SMatthew Dillon extern int ar5416SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type, 397572ff6f6SMatthew Dillon const HAL_TXQ_INFO *qInfo); 398572ff6f6SMatthew Dillon 399572ff6f6SMatthew Dillon extern HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds, 400572ff6f6SMatthew Dillon HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, 401572ff6f6SMatthew Dillon u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx, 402572ff6f6SMatthew Dillon HAL_CIPHER cipher, uint8_t delims, 403572ff6f6SMatthew Dillon HAL_BOOL firstSeg, HAL_BOOL lastSeg, HAL_BOOL lastAggr); 404572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds, 405572ff6f6SMatthew Dillon u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0, 406572ff6f6SMatthew Dillon u_int antMode, u_int rtsctsRate, u_int rtsctsDuration); 407572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetupLastTxDesc(struct ath_hal *ah, struct ath_desc *ds, 408572ff6f6SMatthew Dillon const struct ath_desc *ds0); 409572ff6f6SMatthew Dillon extern HAL_BOOL ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu); 410572ff6f6SMatthew Dillon extern u_int ar5416GetGlobalTxTimeout(struct ath_hal *ah); 411572ff6f6SMatthew Dillon extern void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds, 412572ff6f6SMatthew Dillon u_int durUpdateEn, u_int rtsctsRate, HAL_11N_RATE_SERIES series[], 413572ff6f6SMatthew Dillon u_int nseries, u_int flags); 414572ff6f6SMatthew Dillon 415572ff6f6SMatthew Dillon extern void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, 416572ff6f6SMatthew Dillon u_int aggrLen, u_int numDelims); 417572ff6f6SMatthew Dillon extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); 418572ff6f6SMatthew Dillon extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); 419572ff6f6SMatthew Dillon extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); 420572ff6f6SMatthew Dillon extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, 421572ff6f6SMatthew Dillon struct ath_desc *ds, u_int vmf); 422572ff6f6SMatthew Dillon 423572ff6f6SMatthew Dillon extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); 424572ff6f6SMatthew Dillon 425572ff6f6SMatthew Dillon extern const HAL_RATE_TABLE *ar5416GetRateTable(struct ath_hal *, u_int mode); 426572ff6f6SMatthew Dillon #endif /* _ATH_AR5416_H_ */ 427