xref: /freebsd/sys/dev/ath/ath_hal/ar5416/ar5416.h (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
1 /*-
2  * SPDX-License-Identifier: ISC
3  *
4  * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5  * Copyright (c) 2002-2008 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 #ifndef _ATH_AR5416_H_
20 #define _ATH_AR5416_H_
21 
22 #include "ar5212/ar5212.h"
23 #include "ar5416_cal.h"
24 #include "ah_eeprom_v14.h"	/* for CAL_TARGET_POWER_* */
25 
26 #define	AR5416_MAGIC	0x20065416
27 
28 typedef struct {
29 	uint16_t	synth_center;
30 	uint16_t	ctl_center;
31 	uint16_t	ext_center;
32 } CHAN_CENTERS;
33 
34 typedef enum Ar5416_Rates {
35         rate6mb,  rate9mb,  rate12mb, rate18mb,
36         rate24mb, rate36mb, rate48mb, rate54mb,
37         rate1l,   rate2l,   rate2s,   rate5_5l,
38         rate5_5s, rate11l,  rate11s,  rateXr,
39         rateHt20_0, rateHt20_1, rateHt20_2, rateHt20_3,
40         rateHt20_4, rateHt20_5, rateHt20_6, rateHt20_7,
41         rateHt40_0, rateHt40_1, rateHt40_2, rateHt40_3,
42         rateHt40_4, rateHt40_5, rateHt40_6, rateHt40_7,
43         rateDupCck, rateDupOfdm, rateExtCck, rateExtOfdm,
44         Ar5416RateSize
45 } AR5416_RATES;
46 
47 #define	AR5416_DEFAULT_RXCHAINMASK	7
48 #define	AR5416_DEFAULT_TXCHAINMASK	1
49 #define	AR5416_MAX_RATE_POWER		63
50 #define	AR5416_KEYTABLE_SIZE		128
51 
52 #define	AR5416_CCA_MAX_GOOD_VALUE	-85
53 #define	AR5416_CCA_MAX_HIGH_VALUE	-62
54 #define	AR5416_CCA_MIN_BAD_VALUE	-140
55 #define	AR9285_CCA_MAX_GOOD_VALUE	-118
56 
57 #define AR5416_SPUR_RSSI_THRESH		40
58 
59 struct ar5416NfLimits {
60 	int16_t max;
61 	int16_t min;
62 	int16_t nominal;
63 };
64 
65 struct ath_hal_5416 {
66 	struct ath_hal_5212 ah_5212;
67 
68 	/* NB: RF data setup at attach */
69 	HAL_INI_ARRAY	ah_ini_bb_rfgain;
70 	HAL_INI_ARRAY	ah_ini_bank0;
71 	HAL_INI_ARRAY	ah_ini_bank1;
72 	HAL_INI_ARRAY	ah_ini_bank2;
73 	HAL_INI_ARRAY	ah_ini_bank3;
74 	HAL_INI_ARRAY	ah_ini_bank6;
75 	HAL_INI_ARRAY	ah_ini_bank7;
76 	HAL_INI_ARRAY	ah_ini_addac;
77 	HAL_INI_ARRAY	ah_ini_pcieserdes;
78 
79 	void		(*ah_writeIni)(struct ath_hal *,
80 			    const struct ieee80211_channel *);
81 	void		(*ah_spurMitigate)(struct ath_hal *,
82 			    const struct ieee80211_channel *);
83 
84 	/* calibration ops */
85 	HAL_BOOL	(*ah_cal_initcal)(struct ath_hal *,
86 			    const struct ieee80211_channel *);
87 	void		(*ah_cal_pacal)(struct ath_hal *,
88 			    HAL_BOOL is_reset);
89 
90 	/* optional open-loop tx power control related methods */
91 	void		(*ah_olcInit)(struct ath_hal *);
92 	void		(*ah_olcTempCompensation)(struct ath_hal *);
93 
94 	/* tx power control */
95 	HAL_BOOL	(*ah_setPowerCalTable) (struct ath_hal *ah,
96 			    struct ar5416eeprom *pEepData,
97 			    const struct ieee80211_channel *chan,
98         		    int16_t *pTxPowerIndexOffset);
99 
100 	/* baseband operations */
101 	void		(*ah_initPLL) (struct ath_hal *ah,
102 			    const struct ieee80211_channel *chan);
103 
104 	/* bluetooth coexistence operations */
105 	void		(*ah_btCoexSetDiversity)(struct ath_hal *ah);
106 
107 	u_int       	ah_globaltxtimeout;	/* global tx timeout */
108 	u_int		ah_gpioMask;
109 	int		ah_hangs;		/* h/w hangs state */
110 	uint8_t		ah_keytype[AR5416_KEYTABLE_SIZE];
111 	/*
112 	 * Primary/Extension Channel Tx, Rx, Rx Clear State
113 	 */
114 	uint32_t	ah_cycleCount;
115 	uint32_t	ah_ctlBusy;
116 	uint32_t	ah_extBusy;
117 	uint32_t	ah_rxBusy;
118 	uint32_t	ah_txBusy;
119 	uint32_t	ah_rx_chainmask;
120 	uint32_t	ah_tx_chainmask;
121 
122 	HAL_ANI_CMD	ah_ani_function;
123 
124 	struct ar5416PerCal ah_cal;		/* periodic calibration state */
125 
126 	struct ar5416NfLimits nf_2g;
127 	struct ar5416NfLimits nf_5g;
128 
129 	/*
130 	 * TX power configuration related structures
131 	 */
132 	int		initPDADC;
133 	int		ah_ht40PowerIncForPdadc;
134 	int16_t		ah_ratesArray[Ar5416RateSize];
135 
136 	int		ah_need_an_top2_fixup;	/* merlin or later chips that may need this workaround */
137 
138 	/*
139 	 * Bluetooth coexistence static setup according to the registry
140 	 */
141 	HAL_BT_MODULE ah_btModule;            /* Bluetooth module identifier */
142 	uint8_t		ah_btCoexConfigType;  /* BT coex configuration */
143 	uint8_t		ah_btActiveGpioSelect;  /* GPIO pin for BT_ACTIVE */
144 	uint8_t		ah_btPriorityGpioSelect; /* GPIO pin for BT_PRIORITY */
145 	uint8_t		ah_wlanActiveGpioSelect; /* GPIO pin for WLAN_ACTIVE */
146 	uint8_t		ah_btActivePolarity;  /* Polarity of BT_ACTIVE */
147 	HAL_BOOL	ah_btCoexSingleAnt;   /* Single or dual antenna configuration */
148 	uint8_t		ah_btWlanIsolation;   /* Isolation between BT and WLAN in dB */
149 
150 	/*
151 	 * Bluetooth coexistence runtime settings
152 	 */
153 	HAL_BOOL	ah_btCoexEnabled;     /* If Bluetooth coexistence is enabled */
154 	uint32_t	ah_btCoexMode;        /* Register setting for AR_BT_COEX_MODE */
155 	uint32_t	ah_btCoexBTWeight;    /* Register setting for AR_BT_COEX_WEIGHT */
156 	uint32_t	ah_btCoexWLANWeight;  /* Register setting for AR_BT_COEX_WEIGHT */
157 	uint32_t	ah_btCoexMode2;       /* Register setting for AR_BT_COEX_MODE2 */
158 	uint32_t	ah_btCoexFlag;        /* Special tuning flags for BT coex */
159 };
160 #define	AH5416(_ah)	((struct ath_hal_5416 *)(_ah))
161 
162 #define IS_5416_PCI(ah) ((AH_PRIVATE(ah)->ah_macVersion) == AR_SREV_VERSION_OWL_PCI)
163 #define IS_5416_PCIE(ah) ((AH_PRIVATE(ah)->ah_macVersion) == AR_SREV_VERSION_OWL_PCIE)
164 #undef IS_PCIE
165 #define IS_PCIE(ah) (IS_5416_PCIE(ah))
166 
167 extern	HAL_BOOL ar2133RfAttach(struct ath_hal *, HAL_STATUS *);
168 
169 struct ath_hal;
170 
171 extern	uint32_t ar5416GetRadioRev(struct ath_hal *ah);
172 extern	void ar5416InitState(struct ath_hal_5416 *, uint16_t devid,
173 		HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh,
174 		HAL_STATUS *status);
175 extern	void ar5416Detach(struct ath_hal *ah);
176 extern	void ar5416AttachPCIE(struct ath_hal *ah);
177 extern	HAL_BOOL ar5416FillCapabilityInfo(struct ath_hal *ah);
178 
179 extern	void ar5416AniAttach(struct ath_hal *, const struct ar5212AniParams *,
180 		const struct ar5212AniParams *, HAL_BOOL ena);
181 extern	void ar5416AniDetach(struct ath_hal *);
182 extern	HAL_BOOL ar5416AniControl(struct ath_hal *, HAL_ANI_CMD cmd, int param);
183 extern	HAL_BOOL ar5416AniSetParams(struct ath_hal *,
184 		const struct ar5212AniParams *, const struct ar5212AniParams *);
185 extern	void ar5416ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *);
186 extern	void ar5416RxMonitor(struct ath_hal *, const HAL_NODE_STATS *,
187 			     const struct ieee80211_channel *);
188 extern	void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *);
189 extern	void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *,
190 		HAL_OPMODE, int);
191 
192 extern	void ar5416SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *);
193 extern	void ar5416BeaconInit(struct ath_hal *ah,
194 		uint32_t next_beacon, uint32_t beacon_period);
195 extern	void ar5416ResetStaBeaconTimers(struct ath_hal *ah);
196 extern	void ar5416SetStaBeaconTimers(struct ath_hal *ah,
197 		const HAL_BEACON_STATE *);
198 extern	uint64_t ar5416GetNextTBTT(struct ath_hal *);
199 
200 /* ar5416_btcoex.c */
201 extern	void ar5416SetBTCoexInfo(struct ath_hal *ah,
202 		HAL_BT_COEX_INFO *btinfo);
203 extern	void ar5416BTCoexConfig(struct ath_hal *ah,
204 		HAL_BT_COEX_CONFIG *btconf);
205 extern	void ar5416BTCoexAntennaDiversity(struct ath_hal *ah);
206 extern	void ar5416BTCoexSetQcuThresh(struct ath_hal *ah, int qnum);
207 extern	void ar5416BTCoexSetWeights(struct ath_hal *ah, uint32_t stompType);
208 extern	void ar5416BTCoexSetupBmissThresh(struct ath_hal *ah,
209 		uint32_t thresh);
210 extern	void ar5416BTCoexSetParameter(struct ath_hal *ah, uint32_t type,
211 		uint32_t value);
212 extern	void ar5416BTCoexDisable(struct ath_hal *ah);
213 extern	int ar5416BTCoexEnable(struct ath_hal *ah);
214 extern	void ar5416InitBTCoex(struct ath_hal *ah);
215 
216 extern	HAL_BOOL ar5416EepromRead(struct ath_hal *, u_int off, uint16_t *data);
217 extern	HAL_BOOL ar5416EepromWrite(struct ath_hal *, u_int off, uint16_t data);
218 
219 extern	HAL_BOOL ar5416IsInterruptPending(struct ath_hal *ah);
220 extern	HAL_BOOL ar5416GetPendingInterrupts(struct ath_hal *, HAL_INT *masked);
221 extern	HAL_INT ar5416SetInterrupts(struct ath_hal *ah, HAL_INT ints);
222 
223 extern	HAL_BOOL ar5416GpioCfgOutput(struct ath_hal *, uint32_t gpio,
224 		HAL_GPIO_MUX_TYPE);
225 extern	HAL_BOOL ar5416GpioCfgInput(struct ath_hal *, uint32_t gpio);
226 extern	HAL_BOOL ar5416GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val);
227 extern	uint32_t ar5416GpioGet(struct ath_hal *ah, uint32_t gpio);
228 extern	void ar5416GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel);
229 
230 extern	u_int ar5416GetWirelessModes(struct ath_hal *ah);
231 extern	void ar5416SetLedState(struct ath_hal *ah, HAL_LED_STATE state);
232 extern	uint64_t ar5416GetTsf64(struct ath_hal *ah);
233 extern	void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64);
234 extern	void ar5416ResetTsf(struct ath_hal *ah);
235 extern	uint32_t ar5416GetCurRssi(struct ath_hal *ah);
236 extern	HAL_BOOL ar5416SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
237 extern	HAL_BOOL ar5416SetDecompMask(struct ath_hal *, uint16_t, int);
238 extern	void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int);
239 extern	HAL_BOOL ar5416GetMibCycleCounts(struct ath_hal *ah,
240 	    HAL_SURVEY_SAMPLE *hsample);
241 extern	void ar5416SetChainMasks(struct ath_hal *ah, uint32_t, uint32_t);
242 extern	uint32_t ar5416Get11nExtBusy(struct ath_hal *ah);
243 extern	void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode);
244 extern	HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah);
245 extern	void ar5416Set11nRxClear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear);
246 extern	HAL_STATUS ar5416SetQuiet(struct ath_hal *ah, uint32_t period,
247 	    uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag);
248 extern	HAL_STATUS ar5416GetCapability(struct ath_hal *ah,
249 	    HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result);
250 extern	HAL_BOOL ar5416SetCapability(struct ath_hal *ah,
251 	    HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t val,
252 	    HAL_STATUS *status);
253 extern	HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request,
254 	    const void *args, uint32_t argsize,
255 	    void **result, uint32_t *resultsize);
256 extern	HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah,
257 	    const struct ieee80211_channel *chan, HAL_BOOL enable);
258 
259 extern	void ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
260 extern	HAL_BOOL ar5416GetDfsDefaultThresh(struct ath_hal *ah,
261 	    HAL_PHYERR_PARAM *pe);
262 extern	void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
263 extern	HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah,
264 	    struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,
265 	    HAL_DFS_EVENT *event);
266 extern	HAL_BOOL ar5416IsFastClockEnabled(struct ath_hal *ah);
267 
268 /* ar9280_spectral.c */
269 extern	void ar5416ConfigureSpectralScan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss);
270 extern	void ar5416GetSpectralParams(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss);
271 extern	HAL_BOOL ar5416IsSpectralActive(struct ath_hal *ah);
272 extern	HAL_BOOL ar5416IsSpectralEnabled(struct ath_hal *ah);
273 extern	void ar5416StartSpectralScan(struct ath_hal *ah);
274 extern	void ar5416StopSpectralScan(struct ath_hal *ah);
275 extern	uint32_t ar5416GetSpectralConfig(struct ath_hal *ah);
276 extern	void ar5416RestoreSpectralConfig(struct ath_hal *ah, uint32_t restoreval);
277 
278 extern	HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
279 		int setChip);
280 extern	HAL_POWER_MODE ar5416GetPowerMode(struct ath_hal *ah);
281 extern	HAL_BOOL ar5416GetPowerStatus(struct ath_hal *ah);
282 
283 extern	HAL_BOOL ar5416ResetKeyCacheEntry(struct ath_hal *ah, uint16_t entry);
284 extern	HAL_BOOL ar5416SetKeyCacheEntry(struct ath_hal *ah, uint16_t entry,
285 	       const HAL_KEYVAL *k, const uint8_t *mac, int xorKey);
286 
287 extern	uint32_t ar5416GetRxFilter(struct ath_hal *ah);
288 extern	void ar5416SetRxFilter(struct ath_hal *ah, uint32_t bits);
289 extern	HAL_BOOL ar5416StopDmaReceive(struct ath_hal *ah);
290 extern	void ar5416StartPcuReceive(struct ath_hal *ah, HAL_BOOL);
291 extern	void ar5416StopPcuReceive(struct ath_hal *ah);
292 extern	HAL_BOOL ar5416SetupRxDesc(struct ath_hal *,
293 		struct ath_desc *, uint32_t size, u_int flags);
294 extern	HAL_STATUS ar5416ProcRxDesc(struct ath_hal *ah, struct ath_desc *,
295 		uint32_t, struct ath_desc *, uint64_t,
296 		struct ath_rx_status *);
297 
298 extern	HAL_BOOL ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
299 		struct ieee80211_channel *chan,
300 		HAL_BOOL bChannelChange,
301 		HAL_RESET_TYPE,
302 		HAL_STATUS *status);
303 extern	HAL_BOOL ar5416PhyDisable(struct ath_hal *ah);
304 extern	HAL_RFGAIN ar5416GetRfgain(struct ath_hal *ah);
305 extern	HAL_BOOL ar5416Disable(struct ath_hal *ah);
306 extern	HAL_BOOL ar5416ChipReset(struct ath_hal *ah,
307 		const struct ieee80211_channel *,
308 		HAL_RESET_TYPE);
309 extern	int ar5416GetRegChainOffset(struct ath_hal *ah, int i);
310 extern	HAL_BOOL ar5416SetBoardValues(struct ath_hal *,
311 		const struct ieee80211_channel *);
312 extern	HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type);
313 extern	HAL_BOOL ar5416SetTxPowerLimit(struct ath_hal *ah, uint32_t limit);
314 extern	HAL_BOOL ar5416SetTransmitPower(struct ath_hal *,
315     		const struct ieee80211_channel *, uint16_t *);
316 extern	HAL_BOOL ar5416GetChipPowerLimits(struct ath_hal *ah,
317 		struct ieee80211_channel *chan);
318 extern	void ar5416GetChannelCenters(struct ath_hal *,
319 		const struct ieee80211_channel *chan, CHAN_CENTERS *centers);
320 extern	void ar5416SetRatesArrayFromTargetPower(struct ath_hal *ah,
321 		const struct ieee80211_channel *chan,
322 		int16_t *ratesArray,
323 		const CAL_TARGET_POWER_LEG *targetPowerCck,
324 		const CAL_TARGET_POWER_LEG *targetPowerCckExt,
325 		const CAL_TARGET_POWER_LEG *targetPowerOfdm,
326 		const CAL_TARGET_POWER_LEG *targetPowerOfdmExt,
327 		const CAL_TARGET_POWER_HT *targetPowerHt20,
328 		const CAL_TARGET_POWER_HT *targetPowerHt40);
329 extern	void ar5416GetTargetPowers(struct ath_hal *ah,
330 		const struct ieee80211_channel *chan,
331 		CAL_TARGET_POWER_HT *powInfo,
332 		uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower,
333 		uint16_t numRates, HAL_BOOL isHt40Target);
334 extern	void ar5416GetTargetPowersLeg(struct ath_hal *ah,
335 		const struct ieee80211_channel *chan,
336 		CAL_TARGET_POWER_LEG *powInfo,
337 		uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower,
338 		uint16_t numRates, HAL_BOOL isExtTarget);
339 extern	void ar5416InitChainMasks(struct ath_hal *ah);
340 extern	void ar5416RestoreChainMask(struct ath_hal *ah);
341 extern	void ar5416EepromSetAddac(struct ath_hal *ah,
342 		const struct ieee80211_channel *chan);
343 extern	uint16_t ar5416GetMaxEdgePower(uint16_t freq,
344 		CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz);
345 extern	void ar5416InitPLL(struct ath_hal *ah,
346 		const struct ieee80211_channel *chan);
347 
348 /* TX power setup related routines in ar5416_reset.c */
349 extern	void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah,
350 	const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet,
351 	uint8_t * bChans, uint16_t availPiers,
352 	uint16_t tPdGainOverlap, int16_t *pMinCalPower,
353 	uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues,
354 	uint16_t numXpdGains);
355 extern	void ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah,
356 	int i, uint16_t pdGainOverlap_t2,
357 	uint16_t gainBoundaries[]);
358 extern	uint16_t ar5416GetXpdGainValues(struct ath_hal *ah, uint16_t xpdMask,
359 	uint16_t xpdGainValues[]);
360 extern	void ar5416WriteDetectorGainBiases(struct ath_hal *ah,
361 	uint16_t numXpdGain, uint16_t xpdGainValues[]);
362 extern	void ar5416WritePdadcValues(struct ath_hal *ah, int i,
363 	uint8_t pdadcValues[]);
364 extern	HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah,
365 	struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan,
366 	int16_t *pTxPowerIndexOffset);
367 extern	void ar5416WriteTxPowerRateRegisters(struct ath_hal *ah,
368 	const struct ieee80211_channel *chan, const int16_t ratesArray[]);
369 
370 extern	HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q);
371 extern	HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds,
372 		u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower,
373 		u_int txRate0, u_int txTries0,
374 		u_int keyIx, u_int antMode, u_int flags,
375 		u_int rtsctsRate, u_int rtsctsDuration,
376 		u_int compicvLen, u_int compivLen, u_int comp);
377 extern	HAL_BOOL ar5416SetupXTxDesc(struct ath_hal *, struct ath_desc *,
378 		u_int txRate1, u_int txRetries1,
379 		u_int txRate2, u_int txRetries2,
380 		u_int txRate3, u_int txRetries3);
381 extern	HAL_BOOL ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds,
382 		HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList,
383 		u_int descId, u_int qcuId, HAL_BOOL firstSeg, HAL_BOOL lastSeg,
384 		const struct ath_desc *ds0);
385 extern	HAL_STATUS ar5416ProcTxDesc(struct ath_hal *ah,
386 		struct ath_desc *, struct ath_tx_status *);
387 extern	HAL_BOOL ar5416GetTxCompletionRates(struct ath_hal *ah,
388 		const struct ath_desc *ds0, int *rates, int *tries);
389 
390 extern	HAL_BOOL ar5416ResetTxQueue(struct ath_hal *ah, u_int q);
391 extern	int ar5416SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type,
392 	        const HAL_TXQ_INFO *qInfo);
393 
394 extern	HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
395 		HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList,
396 		u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx,
397 		HAL_CIPHER cipher, uint8_t delims,
398 		HAL_BOOL firstSeg, HAL_BOOL lastSeg, HAL_BOOL lastAggr);
399 extern	HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds,
400 		u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0,
401 		u_int antMode, u_int rtsctsRate, u_int rtsctsDuration);
402 extern	HAL_BOOL ar5416SetupLastTxDesc(struct ath_hal *ah, struct ath_desc *ds,
403 		const struct ath_desc *ds0);
404 extern	HAL_BOOL ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu);
405 extern	u_int ar5416GetGlobalTxTimeout(struct ath_hal *ah);
406 extern	void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds,
407 		u_int durUpdateEn, u_int rtsctsRate, HAL_11N_RATE_SERIES series[],
408 		u_int nseries, u_int flags);
409 
410 extern void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds,
411 		u_int aggrLen, u_int numDelims);
412 extern	void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims);
413 extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds);
414 extern	void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds);
415 extern	void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah,
416 		struct ath_desc *ds, u_int vmf);
417 
418 extern	void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration);
419 
420 extern	const HAL_RATE_TABLE *ar5416GetRateTable(struct ath_hal *, u_int mode);
421 #endif	/* _ATH_AR5416_H_ */
422