FreeBSD kernel ATH device code
ar5211_xmit.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: ISC
3 *
4 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5 * Copyright (c) 2002-2006 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$
20 */
21#include "opt_ah.h"
22
23#include "ah.h"
24#include "ah_internal.h"
25#include "ah_desc.h"
26
27#include "ar5211/ar5211.h"
28#include "ar5211/ar5211reg.h"
29#include "ar5211/ar5211desc.h"
30
31/*
32 * Update Tx FIFO trigger level.
33 *
34 * Set bIncTrigLevel to TRUE to increase the trigger level.
35 * Set bIncTrigLevel to FALSE to decrease the trigger level.
36 *
37 * Returns TRUE if the trigger level was updated
38 */
40ar5211UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
41{
42 uint32_t curTrigLevel, txcfg;
44
45 /*
46 * Disable chip interrupts. This is because halUpdateTxTrigLevel
47 * is called from both ISR and non-ISR contexts.
48 */
50 txcfg = OS_REG_READ(ah, AR_TXCFG);
51 curTrigLevel = (txcfg & AR_TXCFG_FTRIG_M) >> AR_TXCFG_FTRIG_S;
52 if (bIncTrigLevel){
53 /* increase the trigger level */
54 curTrigLevel = curTrigLevel +
55 ((MAX_TX_FIFO_THRESHOLD - curTrigLevel) / 2);
56 } else {
57 /* decrease the trigger level if not already at the minimum */
58 if (curTrigLevel > MIN_TX_FIFO_THRESHOLD) {
59 /* decrease the trigger level */
60 curTrigLevel--;
61 } else {
62 /* no update to the trigger level */
63 /* re-enable chip interrupts */
64 ar5211SetInterrupts(ah, ints);
65 return AH_FALSE;
66 }
67 }
68 /* Update the trigger level */
69 OS_REG_WRITE(ah, AR_TXCFG, (txcfg &~ AR_TXCFG_FTRIG_M) |
70 ((curTrigLevel << AR_TXCFG_FTRIG_S) & AR_TXCFG_FTRIG_M));
71 /* re-enable chip interrupts */
72 ar5211SetInterrupts(ah, ints);
73 return AH_TRUE;
74}
75
76/*
77 * Set the properties of the tx queue with the parameters
78 * from qInfo. The queue must previously have been setup
79 * with a call to ar5211SetupTxQueue.
80 */
82ar5211SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
83{
84 struct ath_hal_5211 *ahp = AH5211(ah);
85
86 if (q >= HAL_NUM_TX_QUEUES) {
87 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
88 __func__, q);
89 return AH_FALSE;
90 }
91 return ath_hal_setTxQProps(ah, &ahp->ah_txq[q], qInfo);
92}
93
94/*
95 * Return the properties for the specified tx queue.
96 */
98ar5211GetTxQueueProps(struct ath_hal *ah, int q, HAL_TXQ_INFO *qInfo)
99{
100 struct ath_hal_5211 *ahp = AH5211(ah);
101
102 if (q >= HAL_NUM_TX_QUEUES) {
103 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
104 __func__, q);
105 return AH_FALSE;
106 }
107 return ath_hal_getTxQProps(ah, qInfo, &ahp->ah_txq[q]);
108}
109
110/*
111 * Allocate and initialize a tx DCU/QCU combination.
112 */
113int
115 const HAL_TXQ_INFO *qInfo)
116{
117 struct ath_hal_5211 *ahp = AH5211(ah);
119 int q;
120
121 switch (type) {
123 q = 9;
124 break;
125 case HAL_TX_QUEUE_CAB:
126 q = 8;
127 break;
129 q = 0;
131 return q;
132 break;
133 default:
134 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad tx queue type %u\n",
135 __func__, type);
136 return -1;
137 }
138
139 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: queue %u\n", __func__, q);
140
141 qi = &ahp->ah_txq[q];
142 if (qi->tqi_type != HAL_TX_QUEUE_INACTIVE) {
143 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: tx queue %u already active\n",
144 __func__, q);
145 return -1;
146 }
147 OS_MEMZERO(qi, sizeof(HAL_TX_QUEUE_INFO));
148 qi->tqi_type = type;
149 if (qInfo == AH_NULL) {
150 /* by default enable OK+ERR+DESC+URN interrupts */
151 qi->tqi_qflags =
156 ;
157 qi->tqi_aifs = INIT_AIFS;
158 qi->tqi_cwmin = HAL_TXQ_USEDEFAULT; /* NB: do at reset */
159 qi->tqi_cwmax = INIT_CWMAX;
162 } else
163 (void) ar5211SetTxQueueProps(ah, q, qInfo);
164 return q;
165}
166
167/*
168 * Update the h/w interrupt registers to reflect a tx q's configuration.
169 */
170static void
172{
173 struct ath_hal_5211 *ahp = AH5211(ah);
174
176 "%s: tx ok 0x%x err 0x%x desc 0x%x eol 0x%x urn 0x%x\n", __func__
182 );
183
187 );
191 );
194}
195
196/*
197 * Free a tx DCU/QCU combination.
198 */
200ar5211ReleaseTxQueue(struct ath_hal *ah, u_int q)
201{
202 struct ath_hal_5211 *ahp = AH5211(ah);
204
205 if (q >= HAL_NUM_TX_QUEUES) {
206 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
207 __func__, q);
208 return AH_FALSE;
209 }
210 qi = &ahp->ah_txq[q];
211 if (qi->tqi_type == HAL_TX_QUEUE_INACTIVE) {
212 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: inactive queue %u\n",
213 __func__, q);
214 return AH_FALSE;
215 }
216
217 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: release queue %u\n", __func__, q);
218
220 ahp->ah_txOkInterruptMask &= ~(1 << q);
221 ahp->ah_txErrInterruptMask &= ~(1 << q);
222 ahp->ah_txDescInterruptMask &= ~(1 << q);
223 ahp->ah_txEolInterruptMask &= ~(1 << q);
224 ahp->ah_txUrnInterruptMask &= ~(1 << q);
225 setTxQInterrupts(ah, qi);
226
227 return AH_TRUE;
228}
229
230/*
231 * Set the retry, aifs, cwmin/max, readyTime regs for specified queue
232 */
234ar5211ResetTxQueue(struct ath_hal *ah, u_int q)
235{
236 struct ath_hal_5211 *ahp = AH5211(ah);
237 const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan;
239 uint32_t cwMin, chanCwMin, value;
240
241 if (q >= HAL_NUM_TX_QUEUES) {
242 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
243 __func__, q);
244 return AH_FALSE;
245 }
246 qi = &ahp->ah_txq[q];
247 if (qi->tqi_type == HAL_TX_QUEUE_INACTIVE) {
248 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: inactive queue %u\n",
249 __func__, q);
250 return AH_TRUE; /* XXX??? */
251 }
252
253 if (qi->tqi_cwmin == HAL_TXQ_USEDEFAULT) {
254 /*
255 * Select cwmin according to channel type.
256 * NB: chan can be NULL during attach
257 */
258 if (chan && IEEE80211_IS_CHAN_B(chan))
259 chanCwMin = INIT_CWMIN_11B;
260 else
261 chanCwMin = INIT_CWMIN;
262 /* make sure that the CWmin is of the form (2^n - 1) */
263 for (cwMin = 1; cwMin < chanCwMin; cwMin = (cwMin << 1) | 1)
264 ;
265 } else
266 cwMin = qi->tqi_cwmin;
267
268 /* set cwMin/Max and AIFS values */
270 SM(cwMin, AR_D_LCL_IFS_CWMIN)
273
274 /* Set retry limit values */
280 );
281
282 /* enable early termination on the QCU */
284
285 if (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_OAHU) {
286 /* Configure DCU to use the global sequence count */
288 }
289 /* multiqueue support */
290 if (qi->tqi_cbrPeriod) {
291 OS_REG_WRITE(ah, AR_QCBRCFG(q),
294 OS_REG_WRITE(ah, AR_QMISC(q),
295 OS_REG_READ(ah, AR_QMISC(q)) |
299 }
300 if (qi->tqi_readyTime) {
304 }
305 if (qi->tqi_burstTime) {
310 OS_REG_WRITE(ah, AR_QMISC(q),
311 OS_REG_READ(ah, AR_QMISC(q)) |
313 }
314 }
315
317 OS_REG_WRITE(ah, AR_DMISC(q),
318 OS_REG_READ(ah, AR_DMISC(q)) |
320 }
322 OS_REG_WRITE(ah, AR_DMISC(q),
323 OS_REG_READ(ah, AR_DMISC(q)) |
325 }
326 switch (qi->tqi_type) {
328 /* Configure QCU for beacons */
329 OS_REG_WRITE(ah, AR_QMISC(q),
330 OS_REG_READ(ah, AR_QMISC(q))
334 /* Configure DCU for beacons */
337 if (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_OAHU)
339 OS_REG_WRITE(ah, AR_DMISC(q), value);
340 break;
341 case HAL_TX_QUEUE_CAB:
342 /* Configure QCU for CAB (Crap After Beacon) frames */
343 OS_REG_WRITE(ah, AR_QMISC(q),
344 OS_REG_READ(ah, AR_QMISC(q))
347
348 value = (ahp->ah_beaconInterval
353
354 /* Configure DCU for CAB */
356 if (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_OAHU)
358 OS_REG_WRITE(ah, AR_QMISC(q), value);
359 break;
360 default:
361 /* NB: silence compiler */
362 break;
363 }
364
365 /*
366 * Always update the secondary interrupt mask registers - this
367 * could be a new queue getting enabled in a running system or
368 * hw getting re-initialized during a reset!
369 *
370 * Since we don't differentiate between tx interrupts corresponding
371 * to individual queues - secondary tx mask regs are always unmasked;
372 * tx interrupts are enabled/disabled for all queues collectively
373 * using the primary mask reg
374 */
376 ahp->ah_txOkInterruptMask |= 1 << q;
377 else
378 ahp->ah_txOkInterruptMask &= ~(1 << q);
380 ahp->ah_txErrInterruptMask |= 1 << q;
381 else
382 ahp->ah_txErrInterruptMask &= ~(1 << q);
384 ahp->ah_txDescInterruptMask |= 1 << q;
385 else
386 ahp->ah_txDescInterruptMask &= ~(1 << q);
388 ahp->ah_txEolInterruptMask |= 1 << q;
389 else
390 ahp->ah_txEolInterruptMask &= ~(1 << q);
392 ahp->ah_txUrnInterruptMask |= 1 << q;
393 else
394 ahp->ah_txUrnInterruptMask &= ~(1 << q);
395 setTxQInterrupts(ah, qi);
396
397 return AH_TRUE;
398}
399
400/*
401 * Get the TXDP for the specified data queue.
402 */
403uint32_t
404ar5211GetTxDP(struct ath_hal *ah, u_int q)
405{
407 return OS_REG_READ(ah, AR_QTXDP(q));
408}
409
410/*
411 * Set the TxDP for the specified tx queue.
412 */
414ar5211SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
415{
417 HALASSERT(AH5211(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
418
419 /*
420 * Make sure that TXE is deasserted before setting the TXDP. If TXE
421 * is still asserted, setting TXDP will have no effect.
422 */
423 HALASSERT((OS_REG_READ(ah, AR_Q_TXE) & (1 << q)) == 0);
424
425 OS_REG_WRITE(ah, AR_QTXDP(q), txdp);
426
427 return AH_TRUE;
428}
429
430/*
431 * Set Transmit Enable bits for the specified queues.
432 */
434ar5211StartTxDma(struct ath_hal *ah, u_int q)
435{
437 HALASSERT(AH5211(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
438
439 /* Check that queue is not already active */
440 HALASSERT((OS_REG_READ(ah, AR_Q_TXD) & (1<<q)) == 0);
441
442 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: queue %u\n", __func__, q);
443
444 /* Check to be sure we're not enabling a q that has its TXD bit set. */
445 HALASSERT((OS_REG_READ(ah, AR_Q_TXD) & (1 << q)) == 0);
446
447 OS_REG_WRITE(ah, AR_Q_TXE, 1 << q);
448 return AH_TRUE;
449}
450
451/*
452 * Return the number of frames pending on the specified queue.
453 */
454uint32_t
455ar5211NumTxPending(struct ath_hal *ah, u_int q)
456{
457 uint32_t n;
458
460 HALASSERT(AH5211(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
461
463 /*
464 * Pending frame count (PFC) can momentarily go to zero
465 * while TXE remains asserted. In other words a PFC of
466 * zero is not sufficient to say that the queue has stopped.
467 */
468 if (n == 0 && (OS_REG_READ(ah, AR_Q_TXE) & (1<<q)))
469 n = 1; /* arbitrarily pick 1 */
470 return n;
471}
472
473/*
474 * Stop transmit on the specified queue
475 */
477ar5211StopTxDma(struct ath_hal *ah, u_int q)
478{
479 int i;
480
482 HALASSERT(AH5211(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
483
484 OS_REG_WRITE(ah, AR_Q_TXD, 1<<q);
485 for (i = 0; i < 10000; i++) {
486 if (ar5211NumTxPending(ah, q) == 0)
487 break;
488 OS_DELAY(10);
489 }
490 OS_REG_WRITE(ah, AR_Q_TXD, 0);
491
492 return (i < 10000);
493}
494
495/*
496 * Descriptor Access Functions
497 */
498
499#define VALID_PKT_TYPES \
500 ((1<<HAL_PKT_TYPE_NORMAL)|(1<<HAL_PKT_TYPE_ATIM)|\
501 (1<<HAL_PKT_TYPE_PSPOLL)|(1<<HAL_PKT_TYPE_PROBE_RESP)|\
502 (1<<HAL_PKT_TYPE_BEACON))
503#define isValidPktType(_t) ((1<<(_t)) & VALID_PKT_TYPES)
504#define VALID_TX_RATES \
505 ((1<<0x0b)|(1<<0x0f)|(1<<0x0a)|(1<<0x0e)|(1<<0x09)|(1<<0x0d)|\
506 (1<<0x08)|(1<<0x0c)|(1<<0x1b)|(1<<0x1a)|(1<<0x1e)|(1<<0x19)|\
507 (1<<0x1d)|(1<<0x18)|(1<<0x1c))
508#define isValidTxRate(_r) ((1<<(_r)) & VALID_TX_RATES)
509
511ar5211SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds,
512 u_int pktLen,
513 u_int hdrLen,
514 HAL_PKT_TYPE type,
515 u_int txPower,
516 u_int txRate0, u_int txTries0,
517 u_int keyIx,
518 u_int antMode,
519 u_int flags,
520 u_int rtsctsRate,
521 u_int rtsctsDuration,
522 u_int compicvLen,
523 u_int compivLen,
524 u_int comp)
525{
526 struct ar5211_desc *ads = AR5211DESC(ds);
527
528 (void) hdrLen;
529 (void) txPower;
530 (void) rtsctsRate; (void) rtsctsDuration;
531
532 HALASSERT(txTries0 != 0);
534 HALASSERT(isValidTxRate(txRate0));
535 /* XXX validate antMode */
536
537 ads->ds_ctl0 = (pktLen & AR_FrameLen)
538 | (txRate0 << AR_XmitRate_S)
539 | (antMode << AR_AntModeXmit_S)
540 | (flags & HAL_TXDESC_CLRDMASK ? AR_ClearDestMask : 0)
541 | (flags & HAL_TXDESC_INTREQ ? AR_TxInterReq : 0)
542 | (flags & HAL_TXDESC_RTSENA ? AR_RTSCTSEnable : 0)
543 | (flags & HAL_TXDESC_VEOL ? AR_VEOL : 0)
544 ;
545 ads->ds_ctl1 = (type << 26)
546 | (flags & HAL_TXDESC_NOACK ? AR_NoAck : 0)
547 ;
548
549 if (keyIx != HAL_TXKEYIX_INVALID) {
550 ads->ds_ctl1 |=
553 }
554 return AH_TRUE;
555#undef RATE
556}
557
559ar5211SetupXTxDesc(struct ath_hal *ah, struct ath_desc *ds,
560 u_int txRate1, u_int txTries1,
561 u_int txRate2, u_int txTries2,
562 u_int txRate3, u_int txTries3)
563{
564 (void) ah; (void) ds;
565 (void) txRate1; (void) txTries1;
566 (void) txRate2; (void) txTries2;
567 (void) txRate3; (void) txTries3;
568 return AH_FALSE;
569}
570
571void
572ar5211IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *ds)
573{
574 struct ar5211_desc *ads = AR5211DESC(ds);
575
576 ads->ds_ctl0 |= AR_TxInterReq;
577}
578
580ar5211FillTxDesc(struct ath_hal *ah, struct ath_desc *ds,
581 HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int qcuId,
582 u_int descId, HAL_BOOL firstSeg, HAL_BOOL lastSeg,
583 const struct ath_desc *ds0)
584{
585 struct ar5211_desc *ads = AR5211DESC(ds);
586 uint32_t segLen = segLenList[0];
587
588 ds->ds_data = bufAddrList[0];
589
590 HALASSERT((segLen &~ AR_BufLen) == 0);
591
592 if (firstSeg) {
593 /*
594 * First descriptor, don't clobber xmit control data
595 * setup by ar5211SetupTxDesc.
596 */
597 ads->ds_ctl1 |= segLen | (lastSeg ? 0 : AR_More);
598 } else if (lastSeg) { /* !firstSeg && lastSeg */
599 /*
600 * Last descriptor in a multi-descriptor frame,
601 * copy the transmit parameters from the first
602 * frame for processing on completion.
603 */
604 ads->ds_ctl0 = AR5211DESC_CONST(ds0)->ds_ctl0;
605 ads->ds_ctl1 = segLen;
606 } else { /* !firstSeg && !lastSeg */
607 /*
608 * Intermediate descriptor in a multi-descriptor frame.
609 */
610 ads->ds_ctl0 = 0;
611 ads->ds_ctl1 = segLen | AR_More;
612 }
613 ads->ds_status0 = ads->ds_status1 = 0;
614 return AH_TRUE;
615}
616
617/*
618 * Processing of HW TX descriptor.
619 */
622 struct ath_desc *ds, struct ath_tx_status *ts)
623{
624 struct ar5211_desc *ads = AR5211DESC(ds);
625
626 if ((ads->ds_status1 & AR_Done) == 0)
627 return HAL_EINPROGRESS;
628
629 /* Update software copies of the HW status */
630 ts->ts_seqnum = MS(ads->ds_status1, AR_SeqNum);
632 ts->ts_status = 0;
633 if ((ads->ds_status0 & AR_FrmXmitOK) == 0) {
636 if (ads->ds_status0 & AR_Filtered)
638 if (ads->ds_status0 & AR_FIFOUnderrun)
640 }
641 ts->ts_rate = MS(ads->ds_ctl0, AR_XmitRate);
646 ts->ts_antenna = 0; /* NB: don't know */
647 ts->ts_finaltsi = 0;
648 /*
649 * NB: the number of retries is one less than it should be.
650 * Also, 0 retries and 1 retry are both reported as 0 retries.
651 */
652 if (ts->ts_shortretry > 0)
653 ts->ts_shortretry++;
654 if (ts->ts_longretry > 0)
655 ts->ts_longretry++;
656
657 return HAL_OK;
658}
659
660/*
661 * Determine which tx queues need interrupt servicing.
662 * STUB.
663 */
664void
665ar5211GetTxIntrQueue(struct ath_hal *ah, uint32_t *txqs)
666{
667 return;
668}
669
670/*
671 * Retrieve the rate table from the given TX completion descriptor
672 */
674ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries)
675{
676 return AH_FALSE;
677}
678
679void
680ar5211SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
681{
682 struct ar5211_desc *ads = AR5211DESC(ds);
683
684 ads->ds_link = link;
685}
686
687void
688ar5211GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
689{
690 struct ar5211_desc *ads = AR5211DESC(ds);
691
692 *link = ads->ds_link;
693}
694
695void
696ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
697{
698 struct ar5211_desc *ads = AR5211DESC(ds);
699
700 *linkptr = &ads->ds_link;
701}
HAL_BOOL ath_hal_getTxQProps(struct ath_hal *ah, HAL_TXQ_INFO *qInfo, const HAL_TX_QUEUE_INFO *qi)
Definition: ah.c:1120
HAL_BOOL ath_hal_setTxQProps(struct ath_hal *ah, HAL_TX_QUEUE_INFO *qi, const HAL_TXQ_INFO *qInfo)
Definition: ah.c:1059
HAL_STATUS
Definition: ah.h:71
@ HAL_OK
Definition: ah.h:72
@ HAL_EINPROGRESS
Definition: ah.h:87
HAL_PKT_TYPE
Definition: ah.h:398
#define HAL_INT_GLOBAL
Definition: ah.h:506
#define HAL_NUM_TX_QUEUES
Definition: ah.h:251
@ HAL_TXQ_TXDESCINT_ENABLE
Definition: ah.h:293
@ HAL_TXQ_TXERRINT_ENABLE
Definition: ah.h:292
@ HAL_TXQ_RDYTIME_EXP_POLICY_ENABLE
Definition: ah.h:308
@ HAL_TXQ_TXURNINT_ENABLE
Definition: ah.h:295
@ HAL_TXQ_FRAG_BURST_BACKOFF_ENABLE
Definition: ah.h:340
@ HAL_TXQ_TXEOLINT_ENABLE
Definition: ah.h:294
@ HAL_TXQ_BACKOFF_DISABLE
Definition: ah.h:344
@ HAL_TXQ_TXOKINT_ENABLE
Definition: ah.h:291
HAL_TX_QUEUE
Definition: ah.h:240
@ HAL_TX_QUEUE_DATA
Definition: ah.h:242
@ HAL_TX_QUEUE_INACTIVE
Definition: ah.h:241
@ HAL_TX_QUEUE_BEACON
Definition: ah.h:243
@ HAL_TX_QUEUE_CAB
Definition: ah.h:244
#define HAL_TXQ_USEDEFAULT
Definition: ah.h:384
HAL_INT
Definition: ah.h:472
HAL_BOOL
Definition: ah.h:93
@ AH_FALSE
Definition: ah.h:94
@ AH_TRUE
Definition: ah.h:95
@ HAL_DEBUG_TXQUEUE
Definition: ah_debug.h:38
@ HAL_DEBUG_ANY
Definition: ah_debug.h:62
#define HAL_TXERR_FILT
Definition: ah_desc.h:64
#define HAL_TXDESC_VEOL
Definition: ah_desc.h:265
#define HAL_TXDESC_INTREQ
Definition: ah_desc.h:264
#define HAL_TXKEYIX_INVALID
Definition: ah_desc.h:215
#define HAL_TXDESC_NOACK
Definition: ah_desc.h:261
#define HAL_TXDESC_CLRDMASK
Definition: ah_desc.h:260
#define HAL_TXERR_XRETRY
Definition: ah_desc.h:63
#define HAL_TXERR_FIFO
Definition: ah_desc.h:65
#define HAL_TXDESC_RTSENA
Definition: ah_desc.h:262
#define SM(_v, _f)
Definition: ah_internal.h:587
#define MS(_v, _f)
Definition: ah_internal.h:588
#define INIT_CWMIN_11B
Definition: ah_internal.h:517
#define INIT_SH_RETRY
Definition: ah_internal.h:519
#define INIT_AIFS
Definition: ah_internal.h:515
#define AH_PRIVATE(_ah)
Definition: ah_internal.h:442
#define INIT_LG_RETRY
Definition: ah_internal.h:520
#define INIT_SSH_RETRY
Definition: ah_internal.h:521
#define INIT_CWMIN
Definition: ah_internal.h:516
#define OS_REG_RMW_FIELD(_a, _r, _f, _v)
Definition: ah_internal.h:591
#define AH_NULL
Definition: ah_internal.h:28
#define HALASSERT(_x)
Definition: ah_internal.h:683
#define HALDEBUG(_ah, __m,...)
Definition: ah_internal.h:658
#define INIT_CWMAX
Definition: ah_internal.h:518
#define INIT_SLG_RETRY
Definition: ah_internal.h:522
#define OS_DELAY(_n)
Definition: ah_osdep.h:69
#define OS_MEMZERO(_a, _n)
Definition: ah_osdep.h:72
#define OS_REG_WRITE(_ah, _reg, _val)
Definition: ah_osdep.h:139
uint32_t HAL_DMA_ADDR
Definition: ah_osdep.h:57
#define OS_REG_READ(_ah, _reg)
Definition: ah_osdep.h:140
#define MIN_TX_FIFO_THRESHOLD
Definition: ar5210.h:73
#define MAX_TX_FIFO_THRESHOLD
Definition: ar5210.h:74
#define AR_ExcessiveRetries
Definition: ar5210desc.h:83
#define AR_XmitRate_S
Definition: ar5210desc.h:46
#define AR_XmitRate
Definition: ar5210desc.h:45
#define AR_TxInterReq
Definition: ar5210desc.h:66
#define AR_LongRetryCnt
Definition: ar5210desc.h:87
#define AR_AckSigStrength
Definition: ar5210desc.h:106
#define AR_EncryptKeyIdx
Definition: ar5210desc.h:72
#define AR_FrameLen
Definition: ar5210desc.h:42
#define AR_Done
Definition: ar5210desc.h:104
#define AR_EncryptKeyValid
Definition: ar5210desc.h:67
#define AR_More
Definition: ar5210desc.h:71
#define AR_RTSCTSEnable
Definition: ar5210desc.h:55
#define AR_SendTimestamp
Definition: ar5210desc.h:91
#define AR_ClearDestMask
Definition: ar5210desc.h:57
#define AR_FrmXmitOK
Definition: ar5210desc.h:82
#define AR_BufLen
Definition: ar5210desc.h:70
#define AR_ShortRetryCnt
Definition: ar5210desc.h:89
#define AR_FIFOUnderrun
Definition: ar5210desc.h:84
#define AR_Filtered
Definition: ar5210desc.h:85
#define AR_EncryptKeyIdx_S
Definition: ar5210desc.h:73
#define AR_SeqNum
Definition: ar5210desc.h:105
#define AR_TXCFG
Definition: ar5210reg.h:46
HAL_INT ar5211GetInterrupts(struct ath_hal *)
#define AH5211(ah)
Definition: ar5211.h:144
HAL_INT ar5211SetInterrupts(struct ath_hal *, HAL_INT ints)
HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries)
Definition: ar5211_xmit.c:674
HAL_BOOL ar5211ResetTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:234
HAL_BOOL ar5211SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
Definition: ar5211_xmit.c:414
HAL_BOOL ar5211ReleaseTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:200
static void setTxQInterrupts(struct ath_hal *ah, HAL_TX_QUEUE_INFO *qi)
Definition: ar5211_xmit.c:171
void ar5211GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
Definition: ar5211_xmit.c:688
#define isValidPktType(_t)
Definition: ar5211_xmit.c:503
HAL_BOOL ar5211SetupXTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int txRate1, u_int txTries1, u_int txRate2, u_int txTries2, u_int txRate3, u_int txTries3)
Definition: ar5211_xmit.c:559
HAL_BOOL ar5211FillTxDesc(struct ath_hal *ah, struct ath_desc *ds, HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int qcuId, u_int descId, HAL_BOOL firstSeg, HAL_BOOL lastSeg, const struct ath_desc *ds0)
Definition: ar5211_xmit.c:580
HAL_BOOL ar5211StopTxDma(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:477
uint32_t ar5211NumTxPending(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:455
void ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
Definition: ar5211_xmit.c:696
int ar5211SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO *qInfo)
Definition: ar5211_xmit.c:114
void ar5211IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *ds)
Definition: ar5211_xmit.c:572
#define isValidTxRate(_r)
Definition: ar5211_xmit.c:508
HAL_BOOL ar5211SetupTxDesc(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)
Definition: ar5211_xmit.c:511
HAL_BOOL ar5211UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
Definition: ar5211_xmit.c:40
HAL_STATUS ar5211ProcTxDesc(struct ath_hal *ah, struct ath_desc *ds, struct ath_tx_status *ts)
Definition: ar5211_xmit.c:621
HAL_BOOL ar5211StartTxDma(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:434
HAL_BOOL ar5211SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
Definition: ar5211_xmit.c:82
HAL_BOOL ar5211GetTxQueueProps(struct ath_hal *ah, int q, HAL_TXQ_INFO *qInfo)
Definition: ar5211_xmit.c:98
void ar5211SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
Definition: ar5211_xmit.c:680
void ar5211GetTxIntrQueue(struct ath_hal *ah, uint32_t *txqs)
Definition: ar5211_xmit.c:665
uint32_t ar5211GetTxDP(struct ath_hal *ah, u_int q)
Definition: ar5211_xmit.c:404
#define AR_AntModeXmit_S
Definition: ar5211desc.h:50
#define AR_VirtCollCnt
Definition: ar5211desc.h:86
#define AR5211DESC(_ds)
Definition: ar5211desc.h:38
#define AR5211DESC_CONST(_ds)
Definition: ar5211desc.h:39
#define AR_VEOL
Definition: ar5211desc.h:47
#define AR_NoAck
Definition: ar5211desc.h:67
#define AR_D_CHNTIME_DUR
Definition: ar5211reg.h:566
#define AR_D_LCL_IFS_CWMIN
Definition: ar5211reg.h:546
#define AR_Q_CBRCFG_CBR_INTERVAL
Definition: ar5211reg.h:490
#define AR_Q_RDYTIMECFG_INT
Definition: ar5211reg.h:495
#define AR_Q_MISC_CBR_EXP_CNTR_LIMIT
Definition: ar5211reg.h:517
#define AR_D_MISC_FRAG_BKOFF_EN
Definition: ar5211reg.h:570
#define AR_Q_MISC_FSP_CBR
Definition: ar5211reg.h:509
#define AR_Q_MISC_FSP_DBA_GATED
Definition: ar5211reg.h:510
#define AR_DCHNTIME(i)
Definition: ar5211reg.h:184
#define AR_D_MISC_BEACON_USE
Definition: ar5211reg.h:578
#define AR_IMR_S1_QCU_TXEOL
Definition: ar5211reg.h:454
#define AR_QCBRCFG(i)
Definition: ar5211reg.h:96
#define AR_QRDYTIMECFG(i)
Definition: ar5211reg.h:108
#define AR_D_RETRY_LIMIT_FR_LG
Definition: ar5211reg.h:556
#define AR_Q_MISC_CBR_INCR_DIS1
Definition: ar5211reg.h:514
#define AR_Q_CBRCFG_CBR_OVF_THRESH
Definition: ar5211reg.h:492
#define AR_IMR_S2
Definition: ar5211reg.h:60
#define AR_DLCL_IFS(i)
Definition: ar5211reg.h:160
#define AR_TXCFG_FTRIG_S
Definition: ar5211reg.h:326
#define AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL
Definition: ar5211reg.h:583
#define AR_IMR_S1
Definition: ar5211reg.h:59
#define AR_IMR_S0_QCU_TXDESC
Definition: ar5211reg.h:449
#define AR_DMISC(i)
Definition: ar5211reg.h:196
#define AR_Q_STS_PEND_FR_CNT_M
Definition: ar5211reg.h:523
#define AR_D_LCL_IFS_CWMAX
Definition: ar5211reg.h:548
#define AR_IMR_S0_QCU_TXOK
Definition: ar5211reg.h:447
#define AR_TXCFG_FTRIG_M
Definition: ar5211reg.h:325
#define AR_QSTS(i)
Definition: ar5211reg.h:135
#define AR_D_CHNTIME_EN
Definition: ar5211reg.h:564
#define AR_D_MISC_ARB_LOCKOUT_CNTRL_S
Definition: ar5211reg.h:580
#define AR_Q_MISC_RDYTIME_EXP_POLICY
Definition: ar5211reg.h:518
#define AR_IMR_S0
Definition: ar5211reg.h:58
#define AR_QTXDP(i)
Definition: ar5211reg.h:81
#define AR_SREV_VERSION_OAHU
Definition: ar5211reg.h:725
#define AR_DRETRY_LIMIT(i)
Definition: ar5211reg.h:172
#define AR_D_RETRY_LIMIT_FR_SH
Definition: ar5211reg.h:554
#define AR_D_LCL_IFS_AIFS
Definition: ar5211reg.h:550
#define AR_D_RETRY_LIMIT_STA_SH
Definition: ar5211reg.h:558
#define AR_Q_MISC_CBR_INCR_DIS0
Definition: ar5211reg.h:515
#define AR_D_RETRY_LIMIT_STA_LG
Definition: ar5211reg.h:560
#define AR_Q_MISC_DCU_EARLY_TERM_REQ
Definition: ar5211reg.h:520
#define AR5311_D_MISC_SEQ_NUM_CONTROL
Definition: ar5211reg.h:589
#define AR_D_MISC_POST_FR_BKOFF_DIS
Definition: ar5211reg.h:586
#define AR_IMR_S1_QCU_TXERR
Definition: ar5211reg.h:452
#define AR_Q_MISC_BEACON_USE
Definition: ar5211reg.h:516
#define AR_Q_TXE
Definition: ar5211reg.h:83
#define AR_Q_RDYTIMECFG_EN
Definition: ar5211reg.h:498
#define AR_QMISC(i)
Definition: ar5211reg.h:123
#define AR_IMR_S2_QCU_TXURN
Definition: ar5211reg.h:457
#define AR_Q_TXD
Definition: ar5211reg.h:84
int ah_additional_swba_backoff
Definition: ah.h:1161
int ah_dma_beacon_response_time
Definition: ah.h:1159
int ah_sw_beacon_response_time
Definition: ah.h:1160
HAL_TX_QUEUE tqi_type
Definition: ah_internal.h:526
uint32_t tqi_readyTime
Definition: ah_internal.h:538
uint16_t tqi_lgretry
Definition: ah_internal.h:534
uint16_t tqi_shretry
Definition: ah_internal.h:533
uint32_t tqi_burstTime
Definition: ah_internal.h:537
HAL_TX_QUEUE_FLAGS tqi_qflags
Definition: ah_internal.h:528
uint32_t tqi_cbrOverflowLimit
Definition: ah_internal.h:536
uint32_t tqi_cwmin
Definition: ah_internal.h:531
uint32_t tqi_cbrPeriod
Definition: ah_internal.h:535
uint32_t tqi_cwmax
Definition: ah_internal.h:532
uint32_t ds_link
Definition: ar5211desc.h:31
uint32_t ds_ctl1
Definition: ar5211desc.h:34
uint32_t ds_ctl0
Definition: ar5211desc.h:33
uint32_t ds_status0
Definition: ar5211desc.h:35
uint32_t ds_status1
Definition: ar5211desc.h:36
uint32_t ds_data
Definition: ah_desc.h:236
uint32_t ah_beaconInterval
Definition: ar5211.h:130
uint32_t ah_txDescInterruptMask
Definition: ar5211.h:120
HAL_TX_QUEUE_INFO ah_txq[HAL_NUM_TX_QUEUES]
Definition: ar5211.h:123
uint32_t ah_txEolInterruptMask
Definition: ar5211.h:121
uint32_t ah_txUrnInterruptMask
Definition: ar5211.h:122
uint32_t ah_txErrInterruptMask
Definition: ar5211.h:119
uint32_t ah_txOkInterruptMask
Definition: ar5211.h:118
Definition: ah.h:1219
HAL_OPS_CONFIG ah_config
Definition: ah.h:1243
uint8_t ts_status
Definition: ah_desc.h:38
int8_t ts_rssi
Definition: ah_desc.h:40
uint32_t ts_tstamp
Definition: ah_desc.h:37
uint8_t ts_finaltsi
Definition: ah_desc.h:45
uint8_t ts_longretry
Definition: ah_desc.h:42
uint8_t ts_antenna
Definition: ah_desc.h:44
uint16_t ts_seqnum
Definition: ah_desc.h:35
uint8_t ts_virtcol
Definition: ah_desc.h:43
uint8_t ts_rate
Definition: ah_desc.h:39
uint8_t ts_shortretry
Definition: ah_desc.h:41