iPXE
ath5k_dma.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2004-2008 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2008 Nick Kossifidis <mickflemm@gmail.com>
4 *
5 * Lightly modified for iPXE, July 2009, by Joshua Oreman <oremanj@rwcr.net>.
6 *
7 * Permission to use, copy, modify, and 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 */
20
22FILE_SECBOOT ( FORBIDDEN );
23
24/*************************************\
25* DMA and interrupt masking functions *
26\*************************************/
27
28/*
29 * dma.c - DMA and interrupt masking functions
30 *
31 * Here we setup descriptor pointers (rxdp/txdp) start/stop dma engine and
32 * handle queue setup for 5210 chipset (rest are handled on qcu.c).
33 * Also we setup interrupt mask register (IMR) and read the various iterrupt
34 * status registers (ISR).
35 *
36 * TODO: Handle SISR on 5211+ and introduce a function to return the queue
37 * number that resulted the interrupt.
38 */
39
40#include <unistd.h>
41
42#include "ath5k.h"
43#include "reg.h"
44#include "base.h"
45
46/*********\
47* Receive *
48\*********/
49
50/**
51 * ath5k_hw_start_rx_dma - Start DMA receive
52 *
53 * @ah: The &struct ath5k_hw
54 */
60
61/**
62 * ath5k_hw_stop_rx_dma - Stop DMA receive
63 *
64 * @ah: The &struct ath5k_hw
65 */
67{
68 unsigned int i;
69
71
72 /*
73 * It may take some time to disable the DMA receive unit
74 */
75 for (i = 1000; i > 0 &&
77 i--)
78 udelay(10);
79
80 return i ? 0 : -EBUSY;
81}
82
83/**
84 * ath5k_hw_get_rxdp - Get RX Descriptor's address
85 *
86 * @ah: The &struct ath5k_hw
87 *
88 * XXX: Is RXDP read and clear ?
89 */
94
95/**
96 * ath5k_hw_set_rxdp - Set RX Descriptor's address
97 *
98 * @ah: The &struct ath5k_hw
99 * @phys_addr: RX descriptor address
100 *
101 * XXX: Should we check if rx is enabled before setting rxdp ?
102 */
103void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
104{
105 ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP);
106}
107
108
109/**********\
110* Transmit *
111\**********/
112
113/**
114 * ath5k_hw_start_tx_dma - Start DMA transmit for a specific queue
115 *
116 * @ah: The &struct ath5k_hw
117 * @queue: The hw queue number
118 *
119 * Start DMA transmit for a specific queue and since 5210 doesn't have
120 * QCU/DCU, set up queue parameters for 5210 here based on queue type (one
121 * queue for normal data and one queue for beacons). For queue setup
122 * on newer chips check out qcu.c. Returns -EINVAL if queue number is out
123 * of range or if queue is already disabled.
124 *
125 * NOTE: Must be called after setting up tx control descriptor for that
126 * queue (see below).
127 */
128int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue)
129{
130 u32 tx_queue;
131
132 /* Return if queue is declared inactive */
133 if (ah->ah_txq.tqi_type == AR5K_TX_QUEUE_INACTIVE)
134 return -EIO;
135
136 if (ah->ah_version == AR5K_AR5210) {
137 tx_queue = ath5k_hw_reg_read(ah, AR5K_CR);
138
139 /* Assume always a data queue */
140 tx_queue |= AR5K_CR_TXE0 & ~AR5K_CR_TXD0;
141
142 /* Start queue */
143 ath5k_hw_reg_write(ah, tx_queue, AR5K_CR);
145 } else {
146 /* Return if queue is disabled */
148 return -EIO;
149
150 /* Start queue */
152 }
153
154 return 0;
155}
156
157/**
158 * ath5k_hw_stop_tx_dma - Stop DMA transmit on a specific queue
159 *
160 * @ah: The &struct ath5k_hw
161 * @queue: The hw queue number
162 *
163 * Stop DMA transmit on a specific hw queue and drain queue so we don't
164 * have any pending frames. Returns -EBUSY if we still have pending frames,
165 * -EINVAL if queue number is out of range.
166 *
167 */
168int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
169{
170 unsigned int i = 40;
171 u32 tx_queue, pending;
172
173 /* Return if queue is declared inactive */
174 if (ah->ah_txq.tqi_type == AR5K_TX_QUEUE_INACTIVE)
175 return -EIO;
176
177 if (ah->ah_version == AR5K_AR5210) {
178 tx_queue = ath5k_hw_reg_read(ah, AR5K_CR);
179
180 /* Assume a data queue */
181 tx_queue |= AR5K_CR_TXD0 & ~AR5K_CR_TXE0;
182
183 /* Stop queue */
184 ath5k_hw_reg_write(ah, tx_queue, AR5K_CR);
186 } else {
187 /*
188 * Schedule TX disable and wait until queue is empty
189 */
191
192 /*Check for pending frames*/
193 do {
197 udelay(100);
198 } while (--i && pending);
199
200 /* For 2413+ order PCU to drop packets using
201 * QUIET mechanism */
202 if (ah->ah_mac_version >= (AR5K_SREV_AR2414 >> 4) && pending) {
203 /* Set periodicity and duration */
208
209 /* Enable quiet period for current TSF */
213 AR5K_TSF_L32_5211) >> 10,
216
217 /* Force channel idle high */
220
221 /* Wait a while and disable mechanism */
222 udelay(200);
225
226 /* Re-check for pending frames */
227 i = 40;
228 do {
232 udelay(100);
233 } while (--i && pending);
234
237 }
238
239 /* Clear register */
241 if (pending)
242 return -EBUSY;
243 }
244
245 /* TODO: Check for success on 5210 else return error */
246 return 0;
247}
248
249/**
250 * ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue
251 *
252 * @ah: The &struct ath5k_hw
253 * @queue: The hw queue number
254 *
255 * Get TX descriptor's address for a specific queue. For 5210 we ignore
256 * the queue number and use tx queue type since we only have 2 queues.
257 * We use TXDP0 for normal data queue and TXDP1 for beacon queue.
258 * For newer chips with QCU/DCU we just read the corresponding TXDP register.
259 *
260 * XXX: Is TXDP read and clear ?
261 */
262u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue)
263{
264 u16 tx_reg;
265
266 /*
267 * Get the transmit queue descriptor pointer from the selected queue
268 */
269 /*5210 doesn't have QCU*/
270 if (ah->ah_version == AR5K_AR5210) {
271 /* Assume a data queue */
272 tx_reg = AR5K_NOQCU_TXDP0;
273 } else {
274 tx_reg = AR5K_QUEUE_TXDP(queue);
275 }
276
277 return ath5k_hw_reg_read(ah, tx_reg);
278}
279
280/**
281 * ath5k_hw_set_txdp - Set TX Descriptor's address for a specific queue
282 *
283 * @ah: The &struct ath5k_hw
284 * @queue: The hw queue number
285 *
286 * Set TX descriptor's address for a specific queue. For 5210 we ignore
287 * the queue number and we use tx queue type since we only have 2 queues
288 * so as above we use TXDP0 for normal data queue and TXDP1 for beacon queue.
289 * For newer chips with QCU/DCU we just set the corresponding TXDP register.
290 * Returns -EINVAL if queue type is invalid for 5210 and -EIO if queue is still
291 * active.
292 */
293int ath5k_hw_set_txdp(struct ath5k_hw *ah, unsigned int queue, u32 phys_addr)
294{
295 u16 tx_reg;
296
297 /*
298 * Set the transmit queue descriptor pointer register by type
299 * on 5210
300 */
301 if (ah->ah_version == AR5K_AR5210) {
302 /* Assume a data queue */
303 tx_reg = AR5K_NOQCU_TXDP0;
304 } else {
305 /*
306 * Set the transmit queue descriptor pointer for
307 * the selected queue on QCU for 5211+
308 * (this won't work if the queue is still active)
309 */
311 return -EIO;
312
313 tx_reg = AR5K_QUEUE_TXDP(queue);
314 }
315
316 /* Set descriptor pointer */
317 ath5k_hw_reg_write(ah, phys_addr, tx_reg);
318
319 return 0;
320}
321
322/**
323 * ath5k_hw_update_tx_triglevel - Update tx trigger level
324 *
325 * @ah: The &struct ath5k_hw
326 * @increase: Flag to force increase of trigger level
327 *
328 * This function increases/decreases the tx trigger level for the tx fifo
329 * buffer (aka FIFO threshold) that is used to indicate when PCU flushes
330 * the buffer and transmits it's data. Lowering this results sending small
331 * frames more quickly but can lead to tx underruns, raising it a lot can
332 * result other problems (i think bmiss is related). Right now we start with
333 * the lowest possible (64Bytes) and if we get tx underrun we increase it using
334 * the increase flag. Returns -EIO if we have have reached maximum/minimum.
335 *
336 * XXX: Link this with tx DMA size ?
337 * XXX: Use it to save interrupts ?
338 * TODO: Needs testing, i think it's related to bmiss...
339 */
340int ath5k_hw_update_tx_triglevel(struct ath5k_hw *ah, int increase)
341{
342 u32 trigger_level, imr;
343 int ret = -EIO;
344
345 /*
346 * Disable interrupts by setting the mask
347 */
349
350 trigger_level = AR5K_REG_MS(ath5k_hw_reg_read(ah, AR5K_TXCFG),
352
353 if (!increase) {
354 if (--trigger_level < AR5K_TUNE_MIN_TX_FIFO_THRES)
355 goto done;
356 } else
357 trigger_level +=
358 ((AR5K_TUNE_MAX_TX_FIFO_THRES - trigger_level) / 2);
359
360 /*
361 * Update trigger level on success
362 */
363 if (ah->ah_version == AR5K_AR5210)
364 ath5k_hw_reg_write(ah, trigger_level, AR5K_TRIG_LVL);
365 else
367 AR5K_TXCFG_TXFULL, trigger_level);
368
369 ret = 0;
370
371done:
372 /*
373 * Restore interrupt mask
374 */
376
377 return ret;
378}
379
380/*******************\
381* Interrupt masking *
382\*******************/
383
384/**
385 * ath5k_hw_is_intr_pending - Check if we have pending interrupts
386 *
387 * @ah: The &struct ath5k_hw
388 *
389 * Check if we have pending interrupts to process. Returns 1 if we
390 * have pending interrupts and 0 if we haven't.
391 */
393{
394 return ath5k_hw_reg_read(ah, AR5K_INTPEND) == 1 ? 1 : 0;
395}
396
397/**
398 * ath5k_hw_get_isr - Get interrupt status
399 *
400 * @ah: The @struct ath5k_hw
401 * @interrupt_mask: Driver's interrupt mask used to filter out
402 * interrupts in sw.
403 *
404 * This function is used inside our interrupt handler to determine the reason
405 * for the interrupt by reading Primary Interrupt Status Register. Returns an
406 * abstract interrupt status mask which is mostly ISR with some uncommon bits
407 * being mapped on some standard non hw-specific positions
408 * (check out &ath5k_int).
409 *
410 * NOTE: We use read-and-clear register, so after this function is called ISR
411 * is zeroed.
412 */
413int ath5k_hw_get_isr(struct ath5k_hw *ah, enum ath5k_int *interrupt_mask)
414{
415 u32 data;
416
417 /*
418 * Read interrupt status from the Interrupt Status register
419 * on 5210
420 */
421 if (ah->ah_version == AR5K_AR5210) {
423 if (data == AR5K_INT_NOCARD) {
424 *interrupt_mask = data;
425 return -ENODEV;
426 }
427 } else {
428 /*
429 * Read interrupt status from Interrupt
430 * Status Register shadow copy (Read And Clear)
431 *
432 * Note: PISR/SISR Not available on 5210
433 */
435 if (data == AR5K_INT_NOCARD) {
436 *interrupt_mask = data;
437 return -ENODEV;
438 }
439 }
440
441 /*
442 * Get abstract interrupt mask (driver-compatible)
443 */
444 *interrupt_mask = (data & AR5K_INT_COMMON) & ah->ah_imr;
445
446 if (ah->ah_version != AR5K_AR5210) {
448
449 /*HIU = Host Interface Unit (PCI etc)*/
450 if (data & (AR5K_ISR_HIUERR))
451 *interrupt_mask |= AR5K_INT_FATAL;
452
453 /*Beacon Not Ready*/
454 if (data & (AR5K_ISR_BNR))
455 *interrupt_mask |= AR5K_INT_BNR;
456
457 if (sisr2 & (AR5K_SISR2_SSERR | AR5K_SISR2_DPERR |
459 *interrupt_mask |= AR5K_INT_FATAL;
460
461 if (data & AR5K_ISR_TIM)
462 *interrupt_mask |= AR5K_INT_TIM;
463
464 if (data & AR5K_ISR_BCNMISC) {
465 if (sisr2 & AR5K_SISR2_TIM)
466 *interrupt_mask |= AR5K_INT_TIM;
467 if (sisr2 & AR5K_SISR2_DTIM)
468 *interrupt_mask |= AR5K_INT_DTIM;
469 if (sisr2 & AR5K_SISR2_DTIM_SYNC)
470 *interrupt_mask |= AR5K_INT_DTIM_SYNC;
471 if (sisr2 & AR5K_SISR2_BCN_TIMEOUT)
472 *interrupt_mask |= AR5K_INT_BCN_TIMEOUT;
473 if (sisr2 & AR5K_SISR2_CAB_TIMEOUT)
474 *interrupt_mask |= AR5K_INT_CAB_TIMEOUT;
475 }
476
478 *interrupt_mask |= AR5K_INT_RX_DOPPLER;
479 if (data & AR5K_ISR_QCBRORN) {
480 *interrupt_mask |= AR5K_INT_QCBRORN;
481 ah->ah_txq_isr |= AR5K_REG_MS(
484 }
485 if (data & AR5K_ISR_QCBRURN) {
486 *interrupt_mask |= AR5K_INT_QCBRURN;
487 ah->ah_txq_isr |= AR5K_REG_MS(
490 }
491 if (data & AR5K_ISR_QTRIG) {
492 *interrupt_mask |= AR5K_INT_QTRIG;
493 ah->ah_txq_isr |= AR5K_REG_MS(
496 }
497
498 if (data & AR5K_ISR_TXOK)
499 ah->ah_txq_isr |= AR5K_REG_MS(
502
503 if (data & AR5K_ISR_TXDESC)
504 ah->ah_txq_isr |= AR5K_REG_MS(
507
508 if (data & AR5K_ISR_TXERR)
509 ah->ah_txq_isr |= AR5K_REG_MS(
512
513 if (data & AR5K_ISR_TXEOL)
514 ah->ah_txq_isr |= AR5K_REG_MS(
517
518 if (data & AR5K_ISR_TXURN)
519 ah->ah_txq_isr |= AR5K_REG_MS(
522 } else {
525 *interrupt_mask |= AR5K_INT_FATAL;
526
527 /*
528 * XXX: BMISS interrupts may occur after association.
529 * I found this on 5210 code but it needs testing. If this is
530 * true we should disable them before assoc and re-enable them
531 * after a successful assoc + some jiffies.
532 interrupt_mask &= ~AR5K_INT_BMISS;
533 */
534 }
535
536 return 0;
537}
538
539/**
540 * ath5k_hw_set_imr - Set interrupt mask
541 *
542 * @ah: The &struct ath5k_hw
543 * @new_mask: The new interrupt mask to be set
544 *
545 * Set the interrupt mask in hw to save interrupts. We do that by mapping
546 * ath5k_int bits to hw-specific bits to remove abstraction and writing
547 * Interrupt Mask Register.
548 */
549enum ath5k_int ath5k_hw_set_imr(struct ath5k_hw *ah, enum ath5k_int new_mask)
550{
551 enum ath5k_int old_mask, int_mask;
552
553 old_mask = ah->ah_imr;
554
555 /*
556 * Disable card interrupts to prevent any race conditions
557 * (they will be re-enabled afterwards if AR5K_INT GLOBAL
558 * is set again on the new mask).
559 */
560 if (old_mask & AR5K_INT_GLOBAL) {
563 }
564
565 /*
566 * Add additional, chipset-dependent interrupt mask flags
567 * and write them to the IMR (interrupt mask register).
568 */
569 int_mask = new_mask & AR5K_INT_COMMON;
570
571 if (ah->ah_version != AR5K_AR5210) {
572 /* Preserve per queue TXURN interrupt mask */
575
576 if (new_mask & AR5K_INT_FATAL) {
577 int_mask |= AR5K_IMR_HIUERR;
580 }
581
582 /*Beacon Not Ready*/
583 if (new_mask & AR5K_INT_BNR)
584 int_mask |= AR5K_INT_BNR;
585
586 if (new_mask & AR5K_INT_TIM)
587 int_mask |= AR5K_IMR_TIM;
588
589 if (new_mask & AR5K_INT_TIM)
590 simr2 |= AR5K_SISR2_TIM;
591 if (new_mask & AR5K_INT_DTIM)
592 simr2 |= AR5K_SISR2_DTIM;
593 if (new_mask & AR5K_INT_DTIM_SYNC)
594 simr2 |= AR5K_SISR2_DTIM_SYNC;
595 if (new_mask & AR5K_INT_BCN_TIMEOUT)
596 simr2 |= AR5K_SISR2_BCN_TIMEOUT;
597 if (new_mask & AR5K_INT_CAB_TIMEOUT)
598 simr2 |= AR5K_SISR2_CAB_TIMEOUT;
599
600 if (new_mask & AR5K_INT_RX_DOPPLER)
601 int_mask |= AR5K_IMR_RXDOPPLER;
602
603 /* Note: Per queue interrupt masks
604 * are set via reset_tx_queue (qcu.c) */
605 ath5k_hw_reg_write(ah, int_mask, AR5K_PIMR);
607
608 } else {
609 if (new_mask & AR5K_INT_FATAL)
610 int_mask |= (AR5K_IMR_SSERR | AR5K_IMR_MCABT
612
613 ath5k_hw_reg_write(ah, int_mask, AR5K_IMR);
614 }
615
616 /* If RXNOFRM interrupt is masked disable it
617 * by setting AR5K_RXNOFRM to zero */
618 if (!(new_mask & AR5K_INT_RXNOFRM))
620
621 /* Store new interrupt mask */
622 ah->ah_imr = new_mask;
623
624 /* ..re-enable interrupts if AR5K_INT_GLOBAL is set */
625 if (new_mask & AR5K_INT_GLOBAL) {
626 ath5k_hw_reg_write(ah, ah->ah_ier, AR5K_IER);
628 }
629
630 return old_mask;
631}
632
#define AR5K_ISR_TXEOL
Definition reg.h:299
#define AR5K_NOQCU_TXDP0
Definition reg.h:49
#define AR5K_ISR_TXOK
Definition reg.h:295
#define AR5K_QUIET_CTL2
Definition reg.h:1681
#define AR5K_ISR_RXDOPPLER
Definition reg.h:314
#define AR5K_RAC_PISR
Definition reg.h:367
#define AR5K_IMR_DPERR
Definition reg.h:406
#define AR5K_IMR_SSERR
Definition reg.h:405
#define AR5K_QUEUE_STATUS(_q)
Definition reg.h:629
#define AR5K_IMR
Definition reg.h:380
#define AR5K_QCU_TXD
Definition reg.h:566
#define AR5K_TSF_L32_5211
Definition reg.h:1435
#define AR5K_SISR4_QTRIG
Definition reg.h:361
#define AR5K_SISR2_DTIM
Definition reg.h:351
#define AR5K_SISR2_DPERR
Definition reg.h:345
#define AR5K_ISR_BNR
Definition reg.h:309
#define AR5K_IER_DISABLE
Definition reg.h:93
#define AR5K_SIMR2_QCU_TXURN
Definition reg.h:431
#define AR5K_ISR_DPERR
Definition reg.h:313
#define AR5K_SIMR2_DPERR
Definition reg.h:435
#define AR5K_QUIET_CTL1
Definition reg.h:1675
#define AR5K_ISR_TXDESC
Definition reg.h:296
#define AR5K_ISR_BCNMISC
Definition reg.h:316
#define AR5K_DIAG_SW_CHANEL_IDLE_HIGH
Definition reg.h:1428
#define AR5K_CR_TXD0
Definition reg.h:59
#define AR5K_ISR_TXURN
Definition reg.h:300
#define AR5K_INTPEND
Definition reg.h:864
#define AR5K_SISR1_QCU_TXERR
Definition reg.h:335
#define AR5K_RAC_SISR2
Definition reg.h:370
#define AR5K_RXDP
Definition reg.h:67
#define AR5K_CR
Definition reg.h:55
#define AR5K_SISR1_QCU_TXEOL
Definition reg.h:337
#define AR5K_SIMR2_SSERR
Definition reg.h:434
#define AR5K_ISR_MCABT
Definition reg.h:310
#define AR5K_RAC_SISR4
Definition reg.h:372
#define AR5K_SISR2_QCU_TXURN
Definition reg.h:341
#define AR5K_SISR2_TIM
Definition reg.h:346
#define AR5K_ISR_TIM
Definition reg.h:315
#define AR5K_SISR0_QCU_TXDESC
Definition reg.h:331
#define AR5K_ISR_HIUERR
Definition reg.h:308
#define AR5K_ISR_TXERR
Definition reg.h:297
#define AR5K_SISR3_QCBRORN
Definition reg.h:355
#define AR5K_ISR_QCBRURN
Definition reg.h:319
#define AR5K_ISR_QCBRORN
Definition reg.h:318
#define AR5K_RAC_SISR1
Definition reg.h:369
#define AR5K_SISR3_QCBRURN
Definition reg.h:357
#define AR5K_TXCFG
Definition reg.h:171
#define AR5K_TRIG_LVL
Definition reg.h:1376
#define AR5K_RXNOFRM
Definition reg.h:231
#define AR5K_DIAG_SW_5211
Definition reg.h:1386
#define AR5K_ISR_SSERR
Definition reg.h:312
#define AR5K_QUIET_CTL2_QT_PER
Definition reg.h:1682
#define AR5K_SISR2_DTIM_SYNC
Definition reg.h:348
#define AR5K_IMR_RXDOPPLER
Definition reg.h:407
#define AR5K_SISR0_QCU_TXOK
Definition reg.h:329
#define AR5K_QUIET_CTL1_QT_EN
Definition reg.h:1678
#define AR5K_SISR2_MCABT
Definition reg.h:343
#define AR5K_SISR2_SSERR
Definition reg.h:344
#define AR5K_QUIET_CTL1_NEXT_QT_TSF
Definition reg.h:1676
#define AR5K_SIMR2
Definition reg.h:430
#define AR5K_TXCFG_TXFULL
Definition reg.h:176
#define AR5K_SISR2_BCN_TIMEOUT
Definition reg.h:349
#define AR5K_QCU_TXE
Definition reg.h:559
#define AR5K_CR_RXE
Definition reg.h:58
#define AR5K_IMR_TIM
Definition reg.h:408
#define AR5K_CR_RXD
Definition reg.h:61
#define AR5K_QUIET_CTL2_QT_DUR
Definition reg.h:1684
#define AR5K_IMR_MCABT
Definition reg.h:403
#define AR5K_IER
Definition reg.h:92
#define AR5K_PIMR
Definition reg.h:381
#define AR5K_QUEUE_TXDP(_q)
Definition reg.h:554
#define AR5K_IMR_HIUERR
Definition reg.h:401
#define AR5K_ISR
Definition reg.h:287
#define AR5K_SIMR2_MCABT
Definition reg.h:433
#define AR5K_ISR_QTRIG
Definition reg.h:320
#define AR5K_RAC_SISR3
Definition reg.h:371
#define AR5K_QCU_STS_FRMPENDCNT
Definition reg.h:627
#define AR5K_SISR2_CAB_TIMEOUT
Definition reg.h:350
#define AR5K_RAC_SISR0
Definition reg.h:368
#define AR5K_CR_TXE0
Definition reg.h:56
#define AR5K_TUNE_MAX_TX_FIFO_THRES
Definition ath5k.h:170
#define AR5K_SREV_AR2414
Definition ath5k.h:299
#define AR5K_REG_SM(_val, _flags)
Definition ath5k.h:86
#define AR5K_REG_WRITE_Q(ah, _reg, _queue)
Definition ath5k.h:123
#define AR5K_REG_ENABLE_BITS(ah, _reg, _flags)
Definition ath5k.h:106
#define AR5K_REG_MS(_val, _flags)
Definition ath5k.h:90
#define AR5K_TUNE_MIN_TX_FIFO_THRES
Definition ath5k.h:169
static u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
Definition ath5k.h:1216
#define AR5K_REG_WRITE_BITS(ah, _reg, _flags, _val)
Definition ath5k.h:98
@ AR5K_TX_QUEUE_INACTIVE
Definition ath5k.h:447
@ AR5K_AR5210
Definition ath5k.h:256
#define AR5K_REG_READ_Q(ah, _reg, _queue)
Definition ath5k.h:120
ath5k_int
enum ath5k_int - Hardware interrupt masks helpers
Definition ath5k.h:806
@ AR5K_INT_RXNOFRM
Definition ath5k.h:810
@ AR5K_INT_CAB_TIMEOUT
Definition ath5k.h:833
@ AR5K_INT_TIM
Definition ath5k.h:828
@ AR5K_INT_BCN_TIMEOUT
Definition ath5k.h:832
@ AR5K_INT_FATAL
Definition ath5k.h:826
@ AR5K_INT_QCBRORN
Definition ath5k.h:835
@ AR5K_INT_GLOBAL
Definition ath5k.h:838
@ AR5K_INT_BNR
Definition ath5k.h:827
@ AR5K_INT_QTRIG
Definition ath5k.h:837
@ AR5K_INT_RX_DOPPLER
Definition ath5k.h:834
@ AR5K_INT_DTIM_SYNC
Definition ath5k.h:830
@ AR5K_INT_NOCARD
Definition ath5k.h:862
@ AR5K_INT_COMMON
Definition ath5k.h:840
@ AR5K_INT_DTIM
Definition ath5k.h:829
@ AR5K_INT_QCBRURN
Definition ath5k.h:836
static void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
Definition ath5k.h:1224
#define AR5K_REG_DISABLE_BITS(ah, _reg, _flags)
Definition ath5k.h:109
int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah)
ath5k_hw_stop_rx_dma - Stop DMA receive
Definition ath5k_dma.c:66
int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue)
ath5k_hw_start_tx_dma - Start DMA transmit for a specific queue
Definition ath5k_dma.c:128
int ath5k_hw_update_tx_triglevel(struct ath5k_hw *ah, int increase)
ath5k_hw_update_tx_triglevel - Update tx trigger level
Definition ath5k_dma.c:340
u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah)
ath5k_hw_get_rxdp - Get RX Descriptor's address
Definition ath5k_dma.c:90
void ath5k_hw_start_rx_dma(struct ath5k_hw *ah)
ath5k_hw_start_rx_dma - Start DMA receive
Definition ath5k_dma.c:55
int ath5k_hw_get_isr(struct ath5k_hw *ah, enum ath5k_int *interrupt_mask)
Definition ath5k_dma.c:413
enum ath5k_int ath5k_hw_set_imr(struct ath5k_hw *ah, enum ath5k_int new_mask)
ath5k_hw_set_imr - Set interrupt mask
Definition ath5k_dma.c:549
u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue)
ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue
Definition ath5k_dma.c:262
int ath5k_hw_set_txdp(struct ath5k_hw *ah, unsigned int queue, u32 phys_addr)
ath5k_hw_set_txdp - Set TX Descriptor's address for a specific queue
Definition ath5k_dma.c:293
int ath5k_hw_is_intr_pending(struct ath5k_hw *ah)
ath5k_hw_is_intr_pending - Check if we have pending interrupts
Definition ath5k_dma.c:392
int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
ath5k_hw_stop_tx_dma - Stop DMA transmit on a specific queue
Definition ath5k_dma.c:168
void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
ath5k_hw_set_rxdp - Set RX Descriptor's address
Definition ath5k_dma.c:103
struct bofm_section_header done
Definition bofm_test.c:46
uint8_t data[48]
Additional event data.
Definition ena.h:11
uint16_t queue
Queue ID.
Definition ena.h:11
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define EIO
Input/output error.
Definition errno.h:434
#define EBUSY
Device or resource busy.
Definition errno.h:339
#define ENODEV
No such device.
Definition errno.h:510
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
uint32_t pending
Pending events.
Definition hyperv.h:1
uint8_t ah
Definition registers.h:1
@ imr
Definition sis900.h:27
ath5k_hw_get_isr - Get interrupt status
Definition ath5k.h:955
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21