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