FreeBSD kernel ATH device code
ar5212_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-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$
20 */
21#include "opt_ah.h"
22
23#include "ah.h"
24#include "ah_internal.h"
25#include "ah_desc.h"
26
27#include "ar5212/ar5212.h"
28#include "ar5212/ar5212reg.h"
29#include "ar5212/ar5212desc.h"
30#include "ar5212/ar5212phy.h"
31#ifdef AH_SUPPORT_5311
32#include "ar5212/ar5311reg.h"
33#endif
34
35#ifdef AH_NEED_DESC_SWAP
36static void ar5212SwapTxDesc(struct ath_desc *ds);
37#endif
38
39/*
40 * Update Tx FIFO trigger level.
41 *
42 * Set bIncTrigLevel to TRUE to increase the trigger level.
43 * Set bIncTrigLevel to FALSE to decrease the trigger level.
44 *
45 * Returns TRUE if the trigger level was updated
46 */
48ar5212UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
49{
50 struct ath_hal_5212 *ahp = AH5212(ah);
51 uint32_t txcfg, curLevel, newLevel;
52 HAL_INT omask;
53
54 if (ahp->ah_txTrigLev >= ahp->ah_maxTxTrigLev)
55 return AH_FALSE;
56
57 /*
58 * Disable interrupts while futzing with the fifo level.
59 */
61
62 txcfg = OS_REG_READ(ah, AR_TXCFG);
63 curLevel = MS(txcfg, AR_FTRIG);
64 newLevel = curLevel;
65 if (bIncTrigLevel) { /* increase the trigger level */
66 if (curLevel < ahp->ah_maxTxTrigLev)
67 newLevel++;
68 } else if (curLevel > MIN_TX_FIFO_THRESHOLD)
69 newLevel--;
70 if (newLevel != curLevel)
71 /* Update the trigger level */
73 (txcfg &~ AR_FTRIG) | SM(newLevel, AR_FTRIG));
74
75 ahp->ah_txTrigLev = newLevel;
76
77 /* re-enable chip interrupts */
78 ath_hal_setInterrupts(ah, omask);
79
80 return (newLevel != curLevel);
81}
82
83/*
84 * Set the properties of the tx queue with the parameters
85 * from qInfo.
86 */
88ar5212SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
89{
90 struct ath_hal_5212 *ahp = AH5212(ah);
91 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
92
93 if (q >= pCap->halTotalQueues) {
94 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
95 __func__, q);
96 return AH_FALSE;
97 }
98 return ath_hal_setTxQProps(ah, &ahp->ah_txq[q], qInfo);
99}
100
101/*
102 * Return the properties for the specified tx queue.
103 */
106{
107 struct ath_hal_5212 *ahp = AH5212(ah);
108 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
109
110 if (q >= pCap->halTotalQueues) {
111 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
112 __func__, q);
113 return AH_FALSE;
114 }
115 return ath_hal_getTxQProps(ah, qInfo, &ahp->ah_txq[q]);
116}
117
118/*
119 * Allocate and initialize a tx DCU/QCU combination.
120 */
121int
123 const HAL_TXQ_INFO *qInfo)
124{
125 struct ath_hal_5212 *ahp = AH5212(ah);
127 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
128 int q, defqflags;
129
130 /* by default enable OK+ERR+DESC+URN interrupts */
131 defqflags = HAL_TXQ_TXOKINT_ENABLE
135 /* XXX move queue assignment to driver */
136 switch (type) {
138 q = pCap->halTotalQueues-1; /* highest priority */
139 defqflags |= HAL_TXQ_DBA_GATED
143 break;
144 case HAL_TX_QUEUE_CAB:
145 q = pCap->halTotalQueues-2; /* next highest priority */
146 defqflags |= HAL_TXQ_DBA_GATED
151 break;
153 q = pCap->halTotalQueues-3; /* nextest highest priority */
154 if (ahp->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE) {
156 "%s: no available UAPSD tx queue\n", __func__);
157 return -1;
158 }
159 break;
161 for (q = 0; q < pCap->halTotalQueues; q++)
163 break;
164 if (q == pCap->halTotalQueues) {
166 "%s: no available tx queue\n", __func__);
167 return -1;
168 }
169 break;
170 default:
172 "%s: bad tx queue type %u\n", __func__, type);
173 return -1;
174 }
175
176 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: queue %u\n", __func__, q);
177
178 qi = &ahp->ah_txq[q];
179 if (qi->tqi_type != HAL_TX_QUEUE_INACTIVE) {
180 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: tx queue %u already active\n",
181 __func__, q);
182 return -1;
183 }
184 OS_MEMZERO(qi, sizeof(HAL_TX_QUEUE_INFO));
185 qi->tqi_type = type;
186 if (qInfo == AH_NULL) {
187 qi->tqi_qflags = defqflags;
188 qi->tqi_aifs = INIT_AIFS;
189 qi->tqi_cwmin = HAL_TXQ_USEDEFAULT; /* NB: do at reset */
190 qi->tqi_cwmax = INIT_CWMAX;
193 qi->tqi_physCompBuf = 0;
194 } else {
195 qi->tqi_physCompBuf = qInfo->tqi_compBuf;
196 (void) ar5212SetTxQueueProps(ah, q, qInfo);
197 }
198 /* NB: must be followed by ar5212ResetTxQueue */
199 return q;
200}
201
202/*
203 * Update the h/w interrupt registers to reflect a tx q's configuration.
204 */
205static void
207{
208 struct ath_hal_5212 *ahp = AH5212(ah);
209
211 "%s: tx ok 0x%x err 0x%x desc 0x%x eol 0x%x urn 0x%x\n", __func__,
215
219 );
223 );
226}
227
228/*
229 * Free a tx DCU/QCU combination.
230 */
232ar5212ReleaseTxQueue(struct ath_hal *ah, u_int q)
233{
234 struct ath_hal_5212 *ahp = AH5212(ah);
235 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
237
238 if (q >= pCap->halTotalQueues) {
239 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
240 __func__, q);
241 return AH_FALSE;
242 }
243 qi = &ahp->ah_txq[q];
244 if (qi->tqi_type == HAL_TX_QUEUE_INACTIVE) {
245 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: inactive queue %u\n",
246 __func__, q);
247 return AH_FALSE;
248 }
249
250 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: release queue %u\n", __func__, q);
251
253 ahp->ah_txOkInterruptMask &= ~(1 << q);
254 ahp->ah_txErrInterruptMask &= ~(1 << q);
255 ahp->ah_txDescInterruptMask &= ~(1 << q);
256 ahp->ah_txEolInterruptMask &= ~(1 << q);
257 ahp->ah_txUrnInterruptMask &= ~(1 << q);
258 setTxQInterrupts(ah, qi);
259
260 return AH_TRUE;
261}
262
263/*
264 * Set the retry, aifs, cwmin/max, readyTime regs for specified queue
265 * Assumes:
266 * phwChannel has been set to point to the current channel
267 */
268#define TU_TO_USEC(_tu) ((_tu) << 10)
270ar5212ResetTxQueue(struct ath_hal *ah, u_int q)
271{
272 struct ath_hal_5212 *ahp = AH5212(ah);
273 HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
274 const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan;
276 uint32_t cwMin, chanCwMin, qmisc, dmisc;
277
278 if (q >= pCap->halTotalQueues) {
279 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid queue num %u\n",
280 __func__, q);
281 return AH_FALSE;
282 }
283 qi = &ahp->ah_txq[q];
284 if (qi->tqi_type == HAL_TX_QUEUE_INACTIVE) {
285 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: inactive queue %u\n",
286 __func__, q);
287 return AH_TRUE; /* XXX??? */
288 }
289
290 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: reset queue %u\n", __func__, q);
291
292 if (qi->tqi_cwmin == HAL_TXQ_USEDEFAULT) {
293 /*
294 * Select cwmin according to channel type.
295 * NB: chan can be NULL during attach
296 */
297 if (chan && IEEE80211_IS_CHAN_B(chan))
298 chanCwMin = INIT_CWMIN_11B;
299 else
300 chanCwMin = INIT_CWMIN;
301 /* make sure that the CWmin is of the form (2^n - 1) */
302 for (cwMin = 1; cwMin < chanCwMin; cwMin = (cwMin << 1) | 1)
303 ;
304 } else
305 cwMin = qi->tqi_cwmin;
306
307 /* set cwMin/Max and AIFS values */
309 SM(cwMin, AR_D_LCL_IFS_CWMIN)
312
313 /* Set retry limit values */
319 );
320
321 /* NB: always enable early termination on the QCU */
324
325 /* NB: always enable DCU to wait for next fragment from QCU */
327
328#ifdef AH_SUPPORT_5311
329 if (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_OAHU) {
330 /* Configure DCU to use the global sequence count */
332 }
333#endif
334 /* multiqueue support */
335 if (qi->tqi_cbrPeriod) {
336 OS_REG_WRITE(ah, AR_QCBRCFG(q),
339 qmisc = (qmisc &~ AR_Q_MISC_FSP) | AR_Q_MISC_FSP_CBR;
340 if (qi->tqi_cbrOverflowLimit)
342 }
343 if (qi->tqi_readyTime) {
347 }
348
351 | (qi->tqi_burstTime ? AR_D_CHNTIME_EN : 0));
352
353 if (qi->tqi_readyTime &&
357 qmisc = (qmisc &~ AR_Q_MISC_FSP) | AR_Q_MISC_FSP_DBA_GATED;
358 if (MS(qmisc, AR_Q_MISC_FSP) != AR_Q_MISC_FSP_ASAP) {
359 /*
360 * These are meangingful only when not scheduled asap.
361 */
364 else
365 qmisc &= ~AR_Q_MISC_CBR_INCR_DIS0;
368 else
369 qmisc &= ~AR_Q_MISC_CBR_INCR_DIS1;
370 }
371
387
388 /*
389 * Fillin type-dependent bits. Most of this can be
390 * removed by specifying the queue parameters in the
391 * driver; it's here for backwards compatibility.
392 */
393 switch (qi->tqi_type) {
394 case HAL_TX_QUEUE_BEACON: /* beacon frames */
398
403 break;
404 case HAL_TX_QUEUE_CAB: /* CAB frames */
405 /*
406 * No longer Enable AR_Q_MISC_RDYTIME_EXP_POLICY,
407 * There is an issue with the CAB Queue
408 * not properly refreshing the Tx descriptor if
409 * the TXE clear setting is used.
410 */
414
415 if (qi->tqi_readyTime) {
417 "%s: using tqi_readyTime\n", __func__);
421 } else {
422 int value;
423 /*
424 * NB: don't set default ready time if driver
425 * has explicitly specified something. This is
426 * here solely for backwards compatibility.
427 */
428 /*
429 * XXX for now, hard-code a CAB interval of 70%
430 * XXX of the total beacon interval.
431 */
432
433 value = (ahp->ah_beaconInterval * 70 / 100)
437 /*
438 * XXX Ensure it isn't too low - nothing lower
439 * XXX than 10 TU
440 */
441 if (value < 10)
442 value = 10;
444 "%s: defaulting to rdytime = %d uS\n",
445 __func__, value);
449 }
452 break;
453 default: /* NB: silence compiler */
454 break;
455 }
456
457 OS_REG_WRITE(ah, AR_QMISC(q), qmisc);
458 OS_REG_WRITE(ah, AR_DMISC(q), dmisc);
459
460 /* Setup compression scratchpad buffer */
461 /*
462 * XXX: calling this asynchronously to queue operation can
463 * cause unexpected behavior!!!
464 */
465 if (qi->tqi_physCompBuf) {
468 OS_REG_WRITE(ah, AR_Q_CBBS, (80 + 2*q));
471 OS_REG_WRITE(ah, AR_Q0_MISC + 4*q,
472 OS_REG_READ(ah, AR_Q0_MISC + 4*q)
474 }
475
476 /*
477 * Always update the secondary interrupt mask registers - this
478 * could be a new queue getting enabled in a running system or
479 * hw getting re-initialized during a reset!
480 *
481 * Since we don't differentiate between tx interrupts corresponding
482 * to individual queues - secondary tx mask regs are always unmasked;
483 * tx interrupts are enabled/disabled for all queues collectively
484 * using the primary mask reg
485 */
487 ahp->ah_txOkInterruptMask |= 1 << q;
488 else
489 ahp->ah_txOkInterruptMask &= ~(1 << q);
491 ahp->ah_txErrInterruptMask |= 1 << q;
492 else
493 ahp->ah_txErrInterruptMask &= ~(1 << q);
495 ahp->ah_txDescInterruptMask |= 1 << q;
496 else
497 ahp->ah_txDescInterruptMask &= ~(1 << q);
499 ahp->ah_txEolInterruptMask |= 1 << q;
500 else
501 ahp->ah_txEolInterruptMask &= ~(1 << q);
503 ahp->ah_txUrnInterruptMask |= 1 << q;
504 else
505 ahp->ah_txUrnInterruptMask &= ~(1 << q);
506 setTxQInterrupts(ah, qi);
507
508 return AH_TRUE;
509}
510#undef TU_TO_USEC
511
512/*
513 * Get the TXDP for the specified queue
514 */
515uint32_t
516ar5212GetTxDP(struct ath_hal *ah, u_int q)
517{
518 HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues);
519 return OS_REG_READ(ah, AR_QTXDP(q));
520}
521
522/*
523 * Set the TxDP for the specified queue
524 */
526ar5212SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
527{
528 HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues);
529 HALASSERT(AH5212(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
530
531 /*
532 * Make sure that TXE is deasserted before setting the TXDP. If TXE
533 * is still asserted, setting TXDP will have no effect.
534 */
535 HALASSERT((OS_REG_READ(ah, AR_Q_TXE) & (1 << q)) == 0);
536
537 OS_REG_WRITE(ah, AR_QTXDP(q), txdp);
538
539 return AH_TRUE;
540}
541
542/*
543 * Set Transmit Enable bits for the specified queue
544 */
546ar5212StartTxDma(struct ath_hal *ah, u_int q)
547{
548 HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues);
549
550 HALASSERT(AH5212(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
551
552 HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: queue %u\n", __func__, q);
553
554 /* Check to be sure we're not enabling a q that has its TXD bit set. */
555 HALASSERT((OS_REG_READ(ah, AR_Q_TXD) & (1 << q)) == 0);
556
557 OS_REG_WRITE(ah, AR_Q_TXE, 1 << q);
558 return AH_TRUE;
559}
560
561/*
562 * Return the number of pending frames or 0 if the specified
563 * queue is stopped.
564 */
565uint32_t
566ar5212NumTxPending(struct ath_hal *ah, u_int q)
567{
568 uint32_t npend;
569
570 HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues);
571 HALASSERT(AH5212(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
572
573 npend = OS_REG_READ(ah, AR_QSTS(q)) & AR_Q_STS_PEND_FR_CNT;
574 if (npend == 0) {
575 /*
576 * Pending frame count (PFC) can momentarily go to zero
577 * while TXE remains asserted. In other words a PFC of
578 * zero is not sufficient to say that the queue has stopped.
579 */
580 if (OS_REG_READ(ah, AR_Q_TXE) & (1 << q))
581 npend = 1; /* arbitrarily return 1 */
582 }
583 return npend;
584}
585
586/*
587 * Stop transmit on the specified queue
588 */
590ar5212StopTxDma(struct ath_hal *ah, u_int q)
591{
592 u_int i;
593 u_int wait;
594
595 HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues);
596
597 HALASSERT(AH5212(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE);
598
599 OS_REG_WRITE(ah, AR_Q_TXD, 1 << q);
600 for (i = 1000; i != 0; i--) {
601 if (ar5212NumTxPending(ah, q) == 0)
602 break;
603 OS_DELAY(100); /* XXX get actual value */
604 }
605#ifdef AH_DEBUG
606 if (i == 0) {
608 "%s: queue %u DMA did not stop in 100 msec\n", __func__, q);
610 "%s: QSTS 0x%x Q_TXE 0x%x Q_TXD 0x%x Q_CBR 0x%x\n", __func__,
614 "%s: Q_MISC 0x%x Q_RDYTIMECFG 0x%x Q_RDYTIMESHDN 0x%x\n",
615 __func__, OS_REG_READ(ah, AR_QMISC(q)),
618 }
619#endif /* AH_DEBUG */
620
621 /* 2413+ and up can kill packets at the PCU level */
622 if (ar5212NumTxPending(ah, q) &&
623 (IS_2413(ah) || IS_5413(ah) || IS_2425(ah) || IS_2417(ah))) {
624 uint32_t tsfLow, j;
625
627 "%s: Num of pending TX Frames %d on Q %d\n",
628 __func__, ar5212NumTxPending(ah, q), q);
629
630 /* Kill last PCU Tx Frame */
631 /* TODO - save off and restore current values of Q1/Q2? */
632 for (j = 0; j < 2; j++) {
633 tsfLow = OS_REG_READ(ah, AR_TSF_L32);
637 SM(tsfLow >> 10, AR_QUIET1_NEXT_QUIET));
638 if ((OS_REG_READ(ah, AR_TSF_L32) >> 10) == (tsfLow >> 10)) {
639 break;
640 }
642 "%s: TSF moved while trying to set quiet time "
643 "TSF: 0x%08x\n", __func__, tsfLow);
644 HALASSERT(j < 1); /* TSF shouldn't count twice or reg access is taking forever */
645 }
646
648
649 /* Allow the quiet mechanism to do its work */
650 OS_DELAY(200);
652
653 /* Give at least 1 millisec more to wait */
654 wait = 100;
655
656 /* Verify all transmit is dead */
657 while (ar5212NumTxPending(ah, q)) {
658 if ((--wait) == 0) {
660 "%s: Failed to stop Tx DMA in %d msec after killing last frame\n",
661 __func__, wait);
662 break;
663 }
664 OS_DELAY(10);
665 }
666
668 }
669
670 OS_REG_WRITE(ah, AR_Q_TXD, 0);
671 return (i != 0);
672}
673
674/*
675 * Descriptor Access Functions
676 */
677
678#define VALID_PKT_TYPES \
679 ((1<<HAL_PKT_TYPE_NORMAL)|(1<<HAL_PKT_TYPE_ATIM)|\
680 (1<<HAL_PKT_TYPE_PSPOLL)|(1<<HAL_PKT_TYPE_PROBE_RESP)|\
681 (1<<HAL_PKT_TYPE_BEACON))
682#define isValidPktType(_t) ((1<<(_t)) & VALID_PKT_TYPES)
683#define VALID_TX_RATES \
684 ((1<<0x0b)|(1<<0x0f)|(1<<0x0a)|(1<<0x0e)|(1<<0x09)|(1<<0x0d)|\
685 (1<<0x08)|(1<<0x0c)|(1<<0x1b)|(1<<0x1a)|(1<<0x1e)|(1<<0x19)|\
686 (1<<0x1d)|(1<<0x18)|(1<<0x1c))
687#define isValidTxRate(_r) ((1<<(_r)) & VALID_TX_RATES)
688
690ar5212SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds,
691 u_int pktLen,
692 u_int hdrLen,
693 HAL_PKT_TYPE type,
694 u_int txPower,
695 u_int txRate0, u_int txTries0,
696 u_int keyIx,
697 u_int antMode,
698 u_int flags,
699 u_int rtsctsRate,
700 u_int rtsctsDuration,
701 u_int compicvLen,
702 u_int compivLen,
703 u_int comp)
704{
705#define RTSCTS (HAL_TXDESC_RTSENA|HAL_TXDESC_CTSENA)
706 struct ar5212_desc *ads = AR5212DESC(ds);
707 struct ath_hal_5212 *ahp = AH5212(ah);
708
709 (void) hdrLen;
710
711 HALASSERT(txTries0 != 0);
713 HALASSERT(isValidTxRate(txRate0));
714 HALASSERT((flags & RTSCTS) != RTSCTS);
715 /* XXX validate antMode */
716
717 txPower = (txPower + ahp->ah_txPowerIndexOffset );
718 if(txPower > 63) txPower=63;
719
720 ads->ds_ctl0 = (pktLen & AR_FrameLen)
721 | (txPower << AR_XmitPower_S)
722 | (flags & HAL_TXDESC_VEOL ? AR_VEOL : 0)
723 | (flags & HAL_TXDESC_CLRDMASK ? AR_ClearDestMask : 0)
724 | SM(antMode, AR_AntModeXmit)
725 | (flags & HAL_TXDESC_INTREQ ? AR_TxInterReq : 0)
726 ;
727 ads->ds_ctl1 = (type << AR_FrmType_S)
728 | (flags & HAL_TXDESC_NOACK ? AR_NoAck : 0)
729 | (comp << AR_CompProc_S)
730 | (compicvLen << AR_CompICVLen_S)
731 | (compivLen << AR_CompIVLen_S)
732 ;
733 ads->ds_ctl2 = SM(txTries0, AR_XmitDataTries0)
734 | (flags & HAL_TXDESC_DURENA ? AR_DurUpdateEna : 0)
735 ;
736 ads->ds_ctl3 = (txRate0 << AR_XmitRate0_S)
737 ;
738 if (keyIx != HAL_TXKEYIX_INVALID) {
739 /* XXX validate key index */
740 ads->ds_ctl1 |= SM(keyIx, AR_DestIdx);
741 ads->ds_ctl0 |= AR_DestIdxValid;
742 }
743 if (flags & RTSCTS) {
744 if (!isValidTxRate(rtsctsRate)) {
746 "%s: invalid rts/cts rate 0x%x\n",
747 __func__, rtsctsRate);
748 return AH_FALSE;
749 }
750 /* XXX validate rtsctsDuration */
751 ads->ds_ctl0 |= (flags & HAL_TXDESC_CTSENA ? AR_CTSEnable : 0)
752 | (flags & HAL_TXDESC_RTSENA ? AR_RTSCTSEnable : 0)
753 ;
754 ads->ds_ctl2 |= SM(rtsctsDuration, AR_RTSCTSDuration);
755 ads->ds_ctl3 |= (rtsctsRate << AR_RTSCTSRate_S);
756 }
757 return AH_TRUE;
758#undef RTSCTS
759}
760
762ar5212SetupXTxDesc(struct ath_hal *ah, struct ath_desc *ds,
763 u_int txRate1, u_int txTries1,
764 u_int txRate2, u_int txTries2,
765 u_int txRate3, u_int txTries3)
766{
767 struct ar5212_desc *ads = AR5212DESC(ds);
768
769 if (txTries1) {
770 HALASSERT(isValidTxRate(txRate1));
771 ads->ds_ctl2 |= SM(txTries1, AR_XmitDataTries1)
773 ;
774 ads->ds_ctl3 |= (txRate1 << AR_XmitRate1_S);
775 }
776 if (txTries2) {
777 HALASSERT(isValidTxRate(txRate2));
778 ads->ds_ctl2 |= SM(txTries2, AR_XmitDataTries2)
780 ;
781 ads->ds_ctl3 |= (txRate2 << AR_XmitRate2_S);
782 }
783 if (txTries3) {
784 HALASSERT(isValidTxRate(txRate3));
785 ads->ds_ctl2 |= SM(txTries3, AR_XmitDataTries3)
787 ;
788 ads->ds_ctl3 |= (txRate3 << AR_XmitRate3_S);
789 }
790 return AH_TRUE;
791}
792
793void
794ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *ds)
795{
796 struct ar5212_desc *ads = AR5212DESC(ds);
797
798#ifdef AH_NEED_DESC_SWAP
799 ads->ds_ctl0 |= __bswap32(AR_TxInterReq);
800#else
801 ads->ds_ctl0 |= AR_TxInterReq;
802#endif
803}
804
806ar5212FillTxDesc(struct ath_hal *ah, struct ath_desc *ds,
807 HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int qcuId,
808 u_int descId, HAL_BOOL firstSeg, HAL_BOOL lastSeg,
809 const struct ath_desc *ds0)
810{
811 struct ar5212_desc *ads = AR5212DESC(ds);
812 uint32_t segLen = segLenList[0];
813
814 HALASSERT((segLen &~ AR_BufLen) == 0);
815
816 ds->ds_data = bufAddrList[0];
817
818 if (firstSeg) {
819 /*
820 * First descriptor, don't clobber xmit control data
821 * setup by ar5212SetupTxDesc.
822 */
823 ads->ds_ctl1 |= segLen | (lastSeg ? 0 : AR_More);
824 } else if (lastSeg) { /* !firstSeg && lastSeg */
825 /*
826 * Last descriptor in a multi-descriptor frame,
827 * copy the multi-rate transmit parameters from
828 * the first frame for processing on completion.
829 */
830 ads->ds_ctl1 = segLen;
831#ifdef AH_NEED_DESC_SWAP
832 ads->ds_ctl0 = __bswap32(AR5212DESC_CONST(ds0)->ds_ctl0)
834 ads->ds_ctl2 = __bswap32(AR5212DESC_CONST(ds0)->ds_ctl2);
835 ads->ds_ctl3 = __bswap32(AR5212DESC_CONST(ds0)->ds_ctl3);
836#else
837 ads->ds_ctl0 = AR5212DESC_CONST(ds0)->ds_ctl0 & AR_TxInterReq;
838 ads->ds_ctl2 = AR5212DESC_CONST(ds0)->ds_ctl2;
839 ads->ds_ctl3 = AR5212DESC_CONST(ds0)->ds_ctl3;
840#endif
841 } else { /* !firstSeg && !lastSeg */
842 /*
843 * Intermediate descriptor in a multi-descriptor frame.
844 */
845#ifdef AH_NEED_DESC_SWAP
846 ads->ds_ctl0 = __bswap32(AR5212DESC_CONST(ds0)->ds_ctl0)
848#else
849 ads->ds_ctl0 = AR5212DESC_CONST(ds0)->ds_ctl0 & AR_TxInterReq;
850#endif
851 ads->ds_ctl1 = segLen | AR_More;
852 ads->ds_ctl2 = 0;
853 ads->ds_ctl3 = 0;
854 }
855 ads->ds_txstatus0 = ads->ds_txstatus1 = 0;
856 return AH_TRUE;
857}
858
859#ifdef AH_NEED_DESC_SWAP
860/* Swap transmit descriptor */
861static __inline void
862ar5212SwapTxDesc(struct ath_desc *ds)
863{
864 ds->ds_data = __bswap32(ds->ds_data);
865 ds->ds_ctl0 = __bswap32(ds->ds_ctl0);
866 ds->ds_ctl1 = __bswap32(ds->ds_ctl1);
867 ds->ds_hw[0] = __bswap32(ds->ds_hw[0]);
868 ds->ds_hw[1] = __bswap32(ds->ds_hw[1]);
869 ds->ds_hw[2] = __bswap32(ds->ds_hw[2]);
870 ds->ds_hw[3] = __bswap32(ds->ds_hw[3]);
871}
872#endif
873
874/*
875 * Processing of HW TX descriptor.
876 */
879 struct ath_desc *ds, struct ath_tx_status *ts)
880{
881 struct ar5212_desc *ads = AR5212DESC(ds);
882
883#ifdef AH_NEED_DESC_SWAP
884 if ((ads->ds_txstatus1 & __bswap32(AR_Done)) == 0)
885 return HAL_EINPROGRESS;
886
887 ar5212SwapTxDesc(ds);
888#else
889 if ((ads->ds_txstatus1 & AR_Done) == 0)
890 return HAL_EINPROGRESS;
891#endif
892
893 /* Update software copies of the HW status */
894 ts->ts_seqnum = MS(ads->ds_txstatus1, AR_SeqNum);
895 ts->ts_tstamp = MS(ads->ds_txstatus0, AR_SendTimestamp);
896 ts->ts_status = 0;
897 if ((ads->ds_txstatus0 & AR_FrmXmitOK) == 0) {
898 if (ads->ds_txstatus0 & AR_ExcessiveRetries)
900 if (ads->ds_txstatus0 & AR_Filtered)
902 if (ads->ds_txstatus0 & AR_FIFOUnderrun)
904 }
905 /*
906 * Extract the transmit rate used and mark the rate as
907 * ``alternate'' if it wasn't the series 0 rate.
908 */
909 ts->ts_finaltsi = MS(ads->ds_txstatus1, AR_FinalTSIndex);
910 switch (ts->ts_finaltsi) {
911 case 0:
912 ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate0);
913 break;
914 case 1:
915 ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate1);
916 break;
917 case 2:
918 ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate2);
919 break;
920 case 3:
921 ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate3);
922 break;
923 }
924 ts->ts_rssi = MS(ads->ds_txstatus1, AR_AckSigStrength);
925 ts->ts_shortretry = MS(ads->ds_txstatus0, AR_RTSFailCnt);
926 ts->ts_longretry = MS(ads->ds_txstatus0, AR_DataFailCnt);
927 /*
928 * The retry count has the number of un-acked tries for the
929 * final series used. When doing multi-rate retry we must
930 * fixup the retry count by adding in the try counts for
931 * each series that was fully-processed. Beware that this
932 * takes values from the try counts in the final descriptor.
933 * These are not required by the hardware. We assume they
934 * are placed there by the driver as otherwise we have no
935 * access and the driver can't do the calculation because it
936 * doesn't know the descriptor format.
937 */
938 switch (ts->ts_finaltsi) {
939 case 3: ts->ts_longretry += MS(ads->ds_ctl2, AR_XmitDataTries2);
940 case 2: ts->ts_longretry += MS(ads->ds_ctl2, AR_XmitDataTries1);
941 case 1: ts->ts_longretry += MS(ads->ds_ctl2, AR_XmitDataTries0);
942 }
943 ts->ts_virtcol = MS(ads->ds_txstatus0, AR_VirtCollCnt);
944 ts->ts_antenna = (ads->ds_txstatus1 & AR_XmitAtenna ? 2 : 1);
945
946 return HAL_OK;
947}
948
949/*
950 * Determine which tx queues need interrupt servicing.
951 */
952void
953ar5212GetTxIntrQueue(struct ath_hal *ah, uint32_t *txqs)
954{
955 struct ath_hal_5212 *ahp = AH5212(ah);
956 *txqs &= ahp->ah_intrTxqs;
957 ahp->ah_intrTxqs &= ~(*txqs);
958}
959
960/*
961 * Retrieve the rate table from the given TX completion descriptor
962 */
964ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries)
965{
966 const struct ar5212_desc *ads = AR5212DESC_CONST(ds0);
967
968 rates[0] = MS(ads->ds_ctl3, AR_XmitRate0);
969 rates[1] = MS(ads->ds_ctl3, AR_XmitRate1);
970 rates[2] = MS(ads->ds_ctl3, AR_XmitRate2);
971 rates[3] = MS(ads->ds_ctl3, AR_XmitRate3);
972
973 tries[0] = MS(ads->ds_ctl2, AR_XmitDataTries0);
974 tries[1] = MS(ads->ds_ctl2, AR_XmitDataTries1);
975 tries[2] = MS(ads->ds_ctl2, AR_XmitDataTries2);
976 tries[3] = MS(ads->ds_ctl2, AR_XmitDataTries3);
977
978 return AH_TRUE;
979}
980
981void
982ar5212SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
983{
984 struct ar5212_desc *ads = AR5212DESC(ds);
985
986 ads->ds_link = link;
987}
988
989void
990ar5212GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
991{
992 struct ar5212_desc *ads = AR5212DESC(ds);
993
994 *link = ads->ds_link;
995}
996
997void
998ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
999{
1000 struct ar5212_desc *ads = AR5212DESC(ds);
1001
1002 *linkptr = &ads->ds_link;
1003}
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_COMP_BUF_MAX_SIZE
Definition: ah.h:387
#define HAL_INT_GLOBAL
Definition: ah.h:506
@ HAL_TXQ_TXDESCINT_ENABLE
Definition: ah.h:293
@ HAL_TXQ_IGNORE_VIRTCOL
Definition: ah.h:360
@ HAL_TXQ_ARB_LOCKOUT_GLOBAL
Definition: ah.h:358
@ HAL_TXQ_DBA_GATED
Definition: ah.h:314
@ 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_CBR_DIS_QEMPTY
Definition: ah.h:328
@ HAL_TXQ_CBR_DIS_BEMPTY
Definition: ah.h:329
@ HAL_TXQ_TXEOLINT_ENABLE
Definition: ah.h:294
@ HAL_TXQ_ARB_LOCKOUT_INTRA
Definition: ah.h:357
@ HAL_TXQ_SEQNUM_INC_DIS
Definition: ah.h:361
@ 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_UAPSD
Definition: ah.h:245
@ 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_DURENA
Definition: ah_desc.h:267
#define HAL_TXDESC_INTREQ
Definition: ah_desc.h:264
#define HAL_TXKEYIX_INVALID
Definition: ah_desc.h:215
#define HAL_TXDESC_CTSENA
Definition: ah_desc.h:263
#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 OS_REG_SET_BIT(_a, _r, _f)
Definition: ah_internal.h:594
#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 OS_REG_CLR_BIT(_a, _r, _f)
Definition: ah_internal.h:596
#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 ath_hal_setInterrupts(_ah, _mask)
Definition: ah_internal.h:472
#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 AR_ExcessiveRetries
Definition: ar5210desc.h:83
#define AR_TxInterReq
Definition: ar5210desc.h:66
#define AR_FrmType_S
Definition: ar5210desc.h:60
#define AR_AntModeXmit
Definition: ar5210desc.h:58
#define AR_AckSigStrength
Definition: ar5210desc.h:106
#define AR_FrameLen
Definition: ar5210desc.h:42
#define AR_Done
Definition: ar5210desc.h:104
#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_FIFOUnderrun
Definition: ar5210desc.h:84
#define AR_Filtered
Definition: ar5210desc.h:85
#define AR_SeqNum
Definition: ar5210desc.h:105
#define AR_TXCFG
Definition: ar5210reg.h:46
#define AR_TSF_L32
Definition: ar5210reg.h:96
#define AR_DIAG_SW
Definition: ar5210reg.h:95
#define AR_VirtCollCnt
Definition: ar5211desc.h:86
#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_MISC_ARB_LOCKOUT_CNTRL
Definition: ar5211reg.h:579
#define AR_D_LCL_IFS_CWMIN
Definition: ar5211reg.h:546
#define AR_Q_CBRCFG_CBR_INTERVAL
Definition: ar5211reg.h:490
#define AR_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR
Definition: ar5211reg.h:582
#define AR_Q_RDYTIMECFG_INT
Definition: ar5211reg.h:495
#define AR_Q_RDYTIMESHDN
Definition: ar5211reg.h:137
#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_D_MISC_SEQ_NUM_INCR_DIS
Definition: ar5211reg.h:585
#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_D_MISC_VIR_COL_HANDLING_IGNORE
Definition: ar5211reg.h:577
#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_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_D_LCL_IFS_CWMAX
Definition: ar5211reg.h:548
#define AR_IMR_S0_QCU_TXOK
Definition: ar5211reg.h:447
#define AR_QSTS(i)
Definition: ar5211reg.h:135
#define AR_D_CHNTIME_EN
Definition: ar5211reg.h:564
#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_Q_MISC_FSP_ASAP
Definition: ar5211reg.h:508
#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 AR_Q0_MISC
Definition: ar5211reg.h:113
#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_QMISC(i)
Definition: ar5211reg.h:123
#define AR_IMR_S2_QCU_TXURN
Definition: ar5211reg.h:457
#define AR_Q_TXD
Definition: ar5211reg.h:84
#define IS_2425(ah)
Definition: ar5212.h:376
#define IS_5413(ah)
Definition: ar5212.h:374
#define IS_2417(ah)
Definition: ar5212.h:378
#define AH5212(_ah)
Definition: ar5212.h:354
#define IS_2413(ah)
Definition: ar5212.h:368
HAL_BOOL ar5212GetTxQueueProps(struct ath_hal *ah, int q, HAL_TXQ_INFO *qInfo)
Definition: ar5212_xmit.c:105
void ar5212SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link)
Definition: ar5212_xmit.c:982
HAL_BOOL ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries)
Definition: ar5212_xmit.c:964
HAL_BOOL ar5212FillTxDesc(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: ar5212_xmit.c:806
void ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr)
Definition: ar5212_xmit.c:998
int ar5212SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO *qInfo)
Definition: ar5212_xmit.c:122
HAL_BOOL ar5212SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, u_int txRate0, u_int txTries0, u_int keyIx, u_int antMode, u_int flags, u_int rtsctsRate, u_int rtsctsDuration, u_int compicvLen, u_int compivLen, u_int comp)
Definition: ar5212_xmit.c:690
HAL_BOOL ar5212StopTxDma(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:590
HAL_BOOL ar5212ReleaseTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:232
HAL_BOOL ar5212SetTxQueueProps(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qInfo)
Definition: ar5212_xmit.c:88
static void setTxQInterrupts(struct ath_hal *ah, HAL_TX_QUEUE_INFO *qi)
Definition: ar5212_xmit.c:206
#define RTSCTS
HAL_STATUS ar5212ProcTxDesc(struct ath_hal *ah, struct ath_desc *ds, struct ath_tx_status *ts)
Definition: ar5212_xmit.c:878
#define isValidPktType(_t)
Definition: ar5212_xmit.c:682
void ar5212GetTxIntrQueue(struct ath_hal *ah, uint32_t *txqs)
Definition: ar5212_xmit.c:953
uint32_t ar5212NumTxPending(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:566
uint32_t ar5212GetTxDP(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:516
HAL_BOOL ar5212SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
Definition: ar5212_xmit.c:526
HAL_BOOL ar5212StartTxDma(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:546
HAL_BOOL ar5212ResetTxQueue(struct ath_hal *ah, u_int q)
Definition: ar5212_xmit.c:270
void ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *ds)
Definition: ar5212_xmit.c:794
#define isValidTxRate(_r)
Definition: ar5212_xmit.c:687
HAL_BOOL ar5212UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel)
Definition: ar5212_xmit.c:48
void ar5212GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link)
Definition: ar5212_xmit.c:990
HAL_BOOL ar5212SetupXTxDesc(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: ar5212_xmit.c:762
#define TU_TO_USEC(_tu)
Definition: ar5212_xmit.c:268
#define AR_CompProc_S
Definition: ar5212desc.h:82
#define AR_XmitRate2_S
Definition: ar5212desc.h:108
#define AR_DataFailCnt
Definition: ar5212desc.h:128
#define AR_XmitRate3
Definition: ar5212desc.h:109
#define AR5212DESC(_ds)
Definition: ar5212desc.h:49
#define AR_XmitDataTries2
Definition: ar5212desc.h:97
#define AR_RTSFailCnt
Definition: ar5212desc.h:126
#define AR_XmitRate1
Definition: ar5212desc.h:105
#define AR_XmitDataTries1
Definition: ar5212desc.h:95
#define AR_DurUpdateEna
Definition: ar5212desc.h:92
#define AR_XmitRate0_S
Definition: ar5212desc.h:104
#define AR_XmitRate3_S
Definition: ar5212desc.h:110
#define AR_CompICVLen_S
Definition: ar5212desc.h:86
#define ds_ctl3
Definition: ar5212desc.h:53
#define AR5212DESC_CONST(_ds)
Definition: ar5212desc.h:50
#define AR_DestIdxValid
Definition: ar5212desc.h:70
#define AR_CTSEnable
Definition: ar5212desc.h:71
#define AR_XmitPower_S
Definition: ar5212desc.h:63
#define AR_RTSCTSRate_S
Definition: ar5212desc.h:112
#define AR_FinalTSIndex
Definition: ar5212desc.h:153
#define AR_XmitAtenna
Definition: ar5212desc.h:156
#define AR_DestIdx
Definition: ar5212desc.h:76
#define AR_CompIVLen_S
Definition: ar5212desc.h:84
#define AR_XmitRate1_S
Definition: ar5212desc.h:106
#define ds_ctl2
Definition: ar5212desc.h:52
#define AR_XmitDataTries3
Definition: ar5212desc.h:99
#define AR_XmitRate2
Definition: ar5212desc.h:107
#define AR_RTSCTSDuration
Definition: ar5212desc.h:90
#define AR_XmitRate0
Definition: ar5212desc.h:103
#define AR_XmitDataTries0
Definition: ar5212desc.h:93
#define AR_Q_MISC_QCU_COMP_EN
Definition: ar5212reg.h:593
#define AR_QUIET1_QUIET_ENABLE
Definition: ar5212reg.h:305
#define AR_Q_CBBA
Definition: ar5212reg.h:156
#define AR_QUIET2
Definition: ar5212reg.h:309
#define AR_QUIET1_NEXT_QUIET
Definition: ar5212reg.h:304
#define AR_QUIET1
Definition: ar5212reg.h:302
#define AR_Q_RDYTIMECFG_ENA
Definition: ar5212reg.h:575
#define AR_QUIET2_QUIET_DUR
Definition: ar5212reg.h:313
#define AR_D_MISC_VIR_COL_HANDLING
Definition: ar5212reg.h:654
#define AR_Q_CBC
Definition: ar5212reg.h:157
#define AR_Q_CBBS
Definition: ar5212reg.h:155
#define AR_DIAG_CHAN_IDLE
Definition: ar5212reg.h:919
#define AR_D_MISC_FRAG_WAIT_EN
Definition: ar5212reg.h:649
#define AR_Q_MISC_FSP
Definition: ar5212reg.h:578
#define AR_QUIET2_QUIET_PER
Definition: ar5212reg.h:311
#define AR_Q_STS_PEND_FR_CNT
Definition: ar5212reg.h:596
#define AR_FTRIG
Definition: ar5212reg.h:369
uint16_t halTotalQueues
Definition: ah_internal.h:296
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
uint32_t tqi_compBuf
Definition: ah.h:378
HAL_TX_QUEUE tqi_type
Definition: ah_internal.h:526
uint32_t tqi_readyTime
Definition: ah_internal.h:538
uint32_t tqi_physCompBuf
Definition: ah_internal.h:539
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: ar5212desc.h:32
uint32_t ds_ctl1
Definition: ar5212desc.h:35
uint32_t ds_ctl0
Definition: ar5212desc.h:34
uint32_t ds_ctl0
Definition: ah_desc.h:237
uint32_t ds_ctl1
Definition: ah_desc.h:238
uint32_t ds_data
Definition: ah_desc.h:236
uint32_t ds_hw[HAL_DESC_HW_SIZE]
Definition: ah_desc.h:239
uint32_t ah_txUrnInterruptMask
Definition: ar5212.h:272
uint32_t ah_txEolInterruptMask
Definition: ar5212.h:271
int16_t ah_txPowerIndexOffset
Definition: ar5212.h:301
uint32_t ah_txDescInterruptMask
Definition: ar5212.h:270
uint32_t ah_maskReg
Definition: ar5212.h:264
uint32_t ah_txOkInterruptMask
Definition: ar5212.h:268
uint32_t ah_txErrInterruptMask
Definition: ar5212.h:269
uint8_t ah_txTrigLev
Definition: ar5212.h:338
HAL_TX_QUEUE_INFO ah_txq[HAL_NUM_TX_QUEUES]
Definition: ar5212.h:273
uint32_t ah_beaconInterval
Definition: ar5212.h:294
uint8_t ah_maxTxTrigLev
Definition: ar5212.h:339
uint32_t ah_intrTxqs
Definition: ar5212.h:274
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