iPXE
ath9k_ar9003_mac.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2011 Atheros Communications Inc.
3 *
4 * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5 * Original from Linux kernel 3.0.1
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
20FILE_SECBOOT ( FORBIDDEN );
21
22#include <ipxe/io.h>
23
24#include "hw.h"
25#include "ar9003_mac.h"
26
27static void ar9003_hw_rx_enable(struct ath_hw *hw)
28{
29 REG_WRITE(hw, AR_CR, 0);
30}
31
33{
34 int checksum;
35
36 checksum = ads->info + ads->link
37 + ads->data0 + ads->ctl3
38 + ads->data1 + ads->ctl5
39 + ads->data2 + ads->ctl7
40 + ads->data3 + ads->ctl9;
41
42 return ((checksum & 0xffff) + (checksum >> 16)) & AR_TxPtrChkSum;
43}
44
46{
47 struct ar9003_txc *ads = ds;
48
49 ads->link = ds_link;
50 ads->ctl10 &= ~AR_TxPtrChkSum;
51 ads->ctl10 |= ar9003_calc_ptr_chksum(ads);
52}
53
55{
56 struct ar9003_txc *ads = ds;
57
58 *ds_link = &ads->link;
59}
60
61static int ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
62{
63 u32 isr = 0;
64 u32 mask2 = 0;
65 struct ath9k_hw_capabilities *pCap = &ah->caps;
66 u32 sync_cause = 0;
67
68 if (ah->ah_ier & AR_IER_ENABLE) {
73 }
74
76
77 *masked = 0;
78
79 if (!isr && !sync_cause)
80 return 0;
81 } else {
82 *masked = 0;
84 }
85
86 if (isr) {
87 if (isr & AR_ISR_BCNMISC) {
88 u32 isr2;
89 isr2 = REG_READ(ah, AR_ISR_S2);
90
91 mask2 |= ((isr2 & AR_ISR_S2_TIM) >>
93 mask2 |= ((isr2 & AR_ISR_S2_DTIM) >>
95 mask2 |= ((isr2 & AR_ISR_S2_DTIMSYNC) >>
97 mask2 |= ((isr2 & AR_ISR_S2_CABEND) >>
99 mask2 |= ((isr2 & AR_ISR_S2_GTT) <<
101 mask2 |= ((isr2 & AR_ISR_S2_CST) <<
103 mask2 |= ((isr2 & AR_ISR_S2_TSFOOR) >>
105 mask2 |= ((isr2 & AR_ISR_S2_BB_WATCHDOG) >>
107
108 if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
109 REG_WRITE(ah, AR_ISR_S2, isr2);
111 }
112 }
113
116
117 if (isr == 0xffffffff) {
118 *masked = 0;
119 return 0;
120 }
121
122 *masked = isr & ATH9K_INT_COMMON;
123
124 if (ah->config.rx_intr_mitigation)
126 *masked |= ATH9K_INT_RXLP;
127
128 if (ah->config.tx_intr_mitigation)
130 *masked |= ATH9K_INT_TX;
131
133 *masked |= ATH9K_INT_RXLP;
134
135 if (isr & AR_ISR_HP_RXOK)
136 *masked |= ATH9K_INT_RXHP;
137
139 *masked |= ATH9K_INT_TX;
140
141 if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
142 u32 s0, s1;
143 s0 = REG_READ(ah, AR_ISR_S0);
144 REG_WRITE(ah, AR_ISR_S0, s0);
145 s1 = REG_READ(ah, AR_ISR_S1);
146 REG_WRITE(ah, AR_ISR_S1, s1);
147
150 }
151 }
152
153 if (isr & AR_ISR_GENTMR) {
154 u32 s5;
155
157 s5 = REG_READ(ah, AR_ISR_S5_S);
158 else
159 s5 = REG_READ(ah, AR_ISR_S5);
160
161 ah->intr_gen_timer_trigger =
163
164 ah->intr_gen_timer_thresh =
166
167 if (ah->intr_gen_timer_trigger)
168 *masked |= ATH9K_INT_GENTIMER;
169
170 if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
171 REG_WRITE(ah, AR_ISR_S5, s5);
173 }
174
175 }
176
177 *masked |= mask2;
178
179 if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
181
182 (void) REG_READ(ah, AR_ISR);
183 }
184 }
185
186 if (sync_cause) {
187 if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) {
189 REG_WRITE(ah, AR_RC, 0);
190 *masked |= ATH9K_INT_FATAL;
191 }
192
193 if (sync_cause & AR_INTR_SYNC_LOCAL_TIMEOUT)
194 DBG("ath9k: "
195 "AR_INTR_SYNC_LOCAL_TIMEOUT\n");
196
197 REG_WRITE(ah, AR_INTR_SYNC_CAUSE_CLR, sync_cause);
199
200 }
201 return 1;
202}
203
204static void ar9003_hw_fill_txdesc(struct ath_hw *ah __unused, void *ds, u32 seglen,
205 int is_firstseg, int is_lastseg,
206 const void *ds0, u32 buf_addr,
207 unsigned int qcu)
208{
209 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
210 unsigned int descid = 0;
211
213 (1 << AR_TxRxDesc_S) |
214 (1 << AR_CtrlStat_S) |
215 (qcu << AR_TxQcuNum_S) | 0x17;
216
217 ads->data0 = buf_addr;
218 ads->data1 = 0;
219 ads->data2 = 0;
220 ads->data3 = 0;
221
222 ads->ctl3 = (seglen << AR_BufLen_S);
223 ads->ctl3 &= AR_BufLen;
224
225 /* Fill in pointer checksum and descriptor id */
226 ads->ctl10 = ar9003_calc_ptr_chksum(ads);
227 ads->ctl10 |= (descid << AR_TxDescId_S);
228
229 if (is_firstseg) {
230 ads->ctl12 |= (is_lastseg ? 0 : AR_TxMore);
231 } else if (is_lastseg) {
232 ads->ctl11 = 0;
233 ads->ctl12 = 0;
234 ads->ctl13 = AR9003TXC_CONST(ds0)->ctl13;
235 ads->ctl14 = AR9003TXC_CONST(ds0)->ctl14;
236 } else {
237 /* XXX Intermediate descriptor in a multi-descriptor frame.*/
238 ads->ctl11 = 0;
239 ads->ctl12 = AR_TxMore;
240 ads->ctl13 = 0;
241 ads->ctl14 = 0;
242 }
243}
244
245static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds __unused,
246 struct ath_tx_status *ts)
247{
248 struct ar9003_txs *ads;
249 u32 status;
250
251 ads = &ah->ts_ring[ah->ts_tail];
252
253 status = *(volatile typeof(ads->status8) *)&(ads->status8);
254 if ((status & AR_TxDone) == 0)
255 return -EINPROGRESS;
256
257 ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size;
258
259 if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) ||
260 (MS(ads->ds_info, AR_TxRxDesc) != 1)) {
261 DBG("ath9k: "
262 "Tx Descriptor error %x\n", ads->ds_info);
263 memset(ads, 0, sizeof(*ads));
264 return -EIO;
265 }
266
271 ts->tid = MS(status, AR_TxTid);
272
273 ts->qid = MS(ads->ds_info, AR_TxQcuNum);
274 ts->desc_id = MS(ads->status1, AR_TxDescId);
275 ts->ts_tstamp = ads->status4;
276 ts->ts_status = 0;
277 ts->ts_flags = 0;
278
279 status = *(volatile typeof(ads->status2) *)&(ads->status2);
283 if (status & AR_TxBaStatus) {
284 ts->ts_flags |= ATH9K_TX_BA;
285 ts->ba_low = ads->status5;
286 ts->ba_high = ads->status6;
287 }
288
289 status = *(volatile typeof(ads->status3) *)&(ads->status3);
292 if (status & AR_Filtered)
294 if (status & AR_FIFOUnderrun) {
297 }
300 if (status & AR_DescCfgErr)
305 }
309 }
313
314 status = *(volatile typeof(ads->status7) *)&(ads->status7);
319
320 memset(ads, 0, sizeof(*ads));
321
322 return 0;
323}
324
325static void ar9003_hw_set11n_txdesc(struct ath_hw *ah, void *ds,
326 u32 pktlen, enum ath9k_pkt_type type, u32 txpower,
327 u32 keyIx, enum ath9k_key_type keyType, u32 flags)
328{
329 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
330
331 if (txpower > ah->txpower_limit)
332 txpower = ah->txpower_limit;
333
334 if (txpower > 63)
335 txpower = 63;
336
337 ads->ctl11 = (pktlen & AR_FrameLen)
339 | SM(txpower, AR_XmitPower)
341 | (keyIx != ATH9K_TXKEYIX_INVALID ? AR_DestIdxValid : 0)
343
344 ads->ctl12 =
345 (keyIx != ATH9K_TXKEYIX_INVALID ? SM(keyIx, AR_DestIdx) : 0)
350
351 ads->ctl17 = SM(keyType, AR_EncrType) |
353 ads->ctl18 = 0;
354 ads->ctl19 = AR_Not_Sounding;
355
356 ads->ctl20 = 0;
357 ads->ctl21 = 0;
358 ads->ctl22 = 0;
359}
360
361static void ar9003_hw_set_clrdmask(struct ath_hw *ah __unused, void *ds, int val)
362{
363 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
364
365 if (val)
366 ads->ctl11 |= AR_ClrDestMask;
367 else
368 ads->ctl11 &= ~AR_ClrDestMask;
369}
370
372 void *lastds,
373 u32 durUpdateEn, u32 rtsctsRate,
374 u32 rtsctsDuration __unused,
375 struct ath9k_11n_rate_series series[],
376 u32 nseries __unused, u32 flags)
377{
378 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
379 struct ar9003_txc *last_ads = (struct ar9003_txc *) lastds;
381
383 ctl11 = ads->ctl11;
384
388 } else {
391 }
392
393 ads->ctl11 = ctl11;
394 } else {
395 ads->ctl11 = (ads->ctl11 & ~(AR_RTSEnable | AR_CTSEnable));
396 }
397
398 ads->ctl13 = set11nTries(series, 0)
399 | set11nTries(series, 1)
400 | set11nTries(series, 2)
401 | set11nTries(series, 3)
402 | (durUpdateEn ? AR_DurUpdateEna : 0)
403 | SM(0, AR_BurstDur);
404
405 ads->ctl14 = set11nRate(series, 0)
406 | set11nRate(series, 1)
407 | set11nRate(series, 2)
408 | set11nRate(series, 3);
409
410 ads->ctl15 = set11nPktDurRTSCTS(series, 0)
411 | set11nPktDurRTSCTS(series, 1);
412
413 ads->ctl16 = set11nPktDurRTSCTS(series, 2)
414 | set11nPktDurRTSCTS(series, 3);
415
416 ads->ctl18 = set11nRateFlags(series, 0)
417 | set11nRateFlags(series, 1)
418 | set11nRateFlags(series, 2)
419 | set11nRateFlags(series, 3)
420 | SM(rtsctsRate, AR_RTSCTSRate);
421 ads->ctl19 = AR_Not_Sounding;
422
423 last_ads->ctl13 = ads->ctl13;
424 last_ads->ctl14 = ads->ctl14;
425}
426
427static void ar9003_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
428 u32 aggrLen)
429{
430#define FIRST_DESC_NDELIMS 60
431 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
432
433 ads->ctl12 |= (AR_IsAggr | AR_MoreAggr);
434
435 if (ah->ent_mode & AR_ENT_OTP_MPSD) {
436 u32 ctl17, ndelim;
437 /*
438 * Add delimiter when using RTS/CTS with aggregation
439 * and non enterprise AR9003 card
440 */
441 ctl17 = ads->ctl17;
442 ndelim = MS(ctl17, AR_PadDelim);
443
444 if (ndelim < FIRST_DESC_NDELIMS) {
445 aggrLen += (FIRST_DESC_NDELIMS - ndelim) * 4;
446 ndelim = FIRST_DESC_NDELIMS;
447 }
448
450 ctl17 |= SM(aggrLen, AR_AggrLen);
451
453 ctl17 |= SM(ndelim, AR_PadDelim);
454
455 ads->ctl17 = ctl17;
456 } else {
457 ads->ctl17 &= ~AR_AggrLen;
458 ads->ctl17 |= SM(aggrLen, AR_AggrLen);
459 }
460}
461
463 u32 numDelims)
464{
465 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
466 unsigned int ctl17;
467
468 ads->ctl12 |= (AR_IsAggr | AR_MoreAggr);
469
470 /*
471 * We use a stack variable to manipulate ctl6 to reduce uncached
472 * read modify, modfiy, write.
473 */
474 ctl17 = ads->ctl17;
476 ctl17 |= SM(numDelims, AR_PadDelim);
477 ads->ctl17 = ctl17;
478}
479
480static void ar9003_hw_set11n_aggr_last(struct ath_hw *ah __unused, void *ds)
481{
482 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
483
484 ads->ctl12 |= AR_IsAggr;
485 ads->ctl12 &= ~AR_MoreAggr;
486 ads->ctl17 &= ~AR_PadDelim;
487}
488
489static void ar9003_hw_clr11n_aggr(struct ath_hw *ah __unused, void *ds)
490{
491 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
492
493 ads->ctl12 &= (~AR_IsAggr & ~AR_MoreAggr);
494}
495
496void ar9003_hw_set_paprd_txdesc(struct ath_hw *ah __unused, void *ds, u8 chains)
497{
498 struct ar9003_txc *ads = ds;
499
500 ads->ctl12 |= SM(chains, AR_PAPRDChainMask);
501}
502
521
522void ath9k_hw_set_rx_bufsize(struct ath_hw *ah, u16 buf_size)
523{
525}
526
528 enum ath9k_rx_qtype qtype)
529{
530 if (qtype == ATH9K_RX_QUEUE_HP)
532 else
534}
535
537 void *buf_addr)
538{
539 struct ar9003_rxs *rxsp = (struct ar9003_rxs *) buf_addr;
540 unsigned int phyerr;
541
542 /* TODO: byte swap on big endian for ar9300_10 */
543
544 if ((rxsp->status11 & AR_RxDone) == 0)
545 return -EINPROGRESS;
546
547 if (MS(rxsp->ds_info, AR_DescId) != 0x168c)
548 return -EINVAL;
549
550 if ((rxsp->ds_info & (AR_TxRxDesc | AR_CtrlStat)) != 0)
551 return -EINPROGRESS;
552
553 if (!rxs)
554 return 0;
555
556 rxs->rs_status = 0;
557 rxs->rs_flags = 0;
558
559 rxs->rs_datalen = rxsp->status2 & AR_DataLen;
560 rxs->rs_tstamp = rxsp->status3;
561
562 /* XXX: Keycache */
563 rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined);
564 rxs->rs_rssi_ctl0 = MS(rxsp->status1, AR_RxRSSIAnt00);
565 rxs->rs_rssi_ctl1 = MS(rxsp->status1, AR_RxRSSIAnt01);
566 rxs->rs_rssi_ctl2 = MS(rxsp->status1, AR_RxRSSIAnt02);
567 rxs->rs_rssi_ext0 = MS(rxsp->status5, AR_RxRSSIAnt10);
568 rxs->rs_rssi_ext1 = MS(rxsp->status5, AR_RxRSSIAnt11);
569 rxs->rs_rssi_ext2 = MS(rxsp->status5, AR_RxRSSIAnt12);
570
571 if (rxsp->status11 & AR_RxKeyIdxValid)
572 rxs->rs_keyix = MS(rxsp->status11, AR_KeyIdx);
573 else
575
576 rxs->rs_rate = MS(rxsp->status1, AR_RxRate);
577 rxs->rs_more = (rxsp->status2 & AR_RxMore) ? 1 : 0;
578
579 rxs->rs_isaggr = (rxsp->status11 & AR_RxAggr) ? 1 : 0;
580 rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0;
581 rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7);
582 rxs->rs_flags = (rxsp->status4 & AR_GI) ? ATH9K_RX_GI : 0;
583 rxs->rs_flags |= (rxsp->status4 & AR_2040) ? ATH9K_RX_2040 : 0;
584
585 rxs->evm0 = rxsp->status6;
586 rxs->evm1 = rxsp->status7;
587 rxs->evm2 = rxsp->status8;
588 rxs->evm3 = rxsp->status9;
589 rxs->evm4 = (rxsp->status10 & 0xffff);
590
591 if (rxsp->status11 & AR_PreDelimCRCErr)
593
594 if (rxsp->status11 & AR_PostDelimCRCErr)
596
597 if (rxsp->status11 & AR_DecryptBusyErr)
599
600 if ((rxsp->status11 & AR_RxFrameOK) == 0) {
601 /*
602 * AR_CRCErr will bet set to true if we're on the last
603 * subframe and the AR_PostDelimCRCErr is caught.
604 * In a way this also gives us a guarantee that when
605 * (!(AR_CRCErr) && (AR_PostDelimCRCErr)) we cannot
606 * possibly be reviewing the last subframe. AR_CRCErr
607 * is the CRC of the actual data.
608 */
609 if (rxsp->status11 & AR_CRCErr)
611 else if (rxsp->status11 & AR_PHYErr) {
612 phyerr = MS(rxsp->status11, AR_PHYErrCode);
613 /*
614 * If we reach a point here where AR_PostDelimCRCErr is
615 * true it implies we're *not* on the last subframe. In
616 * in that case that we know already that the CRC of
617 * the frame was OK, and MAC would send an ACK for that
618 * subframe, even if we did get a phy error of type
619 * ATH9K_PHYERR_OFDM_RESTART. This is only applicable
620 * to frame that are prior to the last subframe.
621 * The AR_PostDelimCRCErr is the CRC for the MPDU
622 * delimiter, which contains the 4 reserved bits,
623 * the MPDU length (12 bits), and follows the MPDU
624 * delimiter for an A-MPDU subframe (0x4E = 'N' ASCII).
625 */
626 if ((phyerr == ATH9K_PHYERR_OFDM_RESTART) &&
627 (rxsp->status11 & AR_PostDelimCRCErr)) {
628 rxs->rs_phyerr = 0;
629 } else {
631 rxs->rs_phyerr = phyerr;
632 }
633
634 } else if (rxsp->status11 & AR_DecryptCRCErr)
636 else if (rxsp->status11 & AR_MichaelErr)
638 else if (rxsp->status11 & AR_KeyMiss)
640 }
641
642 return 0;
643}
644
646{
647 ah->ts_tail = 0;
648
649 memset((void *) ah->ts_ring, 0,
650 ah->ts_size * sizeof(struct ar9003_txs));
651
652 DBG2("ath9k: "
653 "TS Start 0x%x End 0x%x Virt %p, Size %d\n",
654 ah->ts_paddr_start, ah->ts_paddr_end,
655 ah->ts_ring, ah->ts_size);
656
657 REG_WRITE(ah, AR_Q_STATUS_RING_START, ah->ts_paddr_start);
658 REG_WRITE(ah, AR_Q_STATUS_RING_END, ah->ts_paddr_end);
659}
660
661void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start,
662 u32 ts_paddr_start,
663 u8 size)
664{
665
666 ah->ts_paddr_start = ts_paddr_start;
667 ah->ts_paddr_end = ts_paddr_start + (size * sizeof(struct ar9003_txs));
668 ah->ts_size = size;
669 ah->ts_ring = (struct ar9003_txs *) ts_start;
670
672}
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48
#define AR_PAPRDChainMask
Definition ar9003_mac.h:46
#define AR_TxDescId
Definition ar9003_mac.h:37
#define AR_BufLen_S
Definition ar9003_mac.h:35
#define MAP_ISR_S2_GTT
Definition ar9003_mac.h:50
u32 ctl11
Definition ar9003_mac.h:11
#define MAP_ISR_S2_DTIM
Definition ar9003_mac.h:54
#define AR_TxQcuNum_S
Definition ar9003_mac.h:32
u32 ctl17
Definition ar9003_mac.h:17
#define MAP_ISR_S2_TSFOOR
Definition ar9003_mac.h:55
#define AR_TxDescId_S
Definition ar9003_mac.h:38
#define AR_Not_Sounding
Definition ar9003_mac.h:43
#define MAP_ISR_S2_DTIMSYNC
Definition ar9003_mac.h:53
#define MAP_ISR_S2_BB_WATCHDOG
Definition ar9003_mac.h:56
#define MAP_ISR_S2_TIM
Definition ar9003_mac.h:51
#define AR_DescId
Definition ar9003_mac.h:25
#define AR_DescId_S
Definition ar9003_mac.h:26
#define AR_LowRxChain
Definition ar9003_mac.h:41
#define AR_TxRxDesc_S
Definition ar9003_mac.h:30
#define AR_TxRxDesc
Definition ar9003_mac.h:29
#define AR_CtrlStat_S
Definition ar9003_mac.h:28
#define MAP_ISR_S2_CABEND
Definition ar9003_mac.h:52
#define AR_TxQcuNum
Definition ar9003_mac.h:31
#define AR_BufLen
Definition ar9003_mac.h:34
#define AR9003TXC_CONST(_ds)
Definition ar9003_mac.h:58
#define MAP_ISR_S2_CST
Definition ar9003_mac.h:49
#define AR_CtrlStat
Definition ar9003_mac.h:27
#define AR_TxPtrChkSum
Definition ar9003_mac.h:39
unsigned int uint32_t
Definition stdint.h:12
#define AR_ISR_S5_S
Definition reg.h:350
#define AR_RTC_STATUS_M
Definition reg.h:1203
#define AR_ISR_S2
Definition reg.h:220
#define AR_ENT_OTP_MPSD
Definition reg.h:1110
#define AR_ISR_HP_RXOK
Definition reg.h:175
#define AR_ISR_S0
Definition reg.h:208
#define AR_RC_HOSTIF
Definition reg.h:697
#define AR_Q_STATUS_RING_END
Definition reg.h:385
#define AR_ISR_TXINTM
Definition reg.h:205
#define AR_ISR_RXMINTR
Definition reg.h:204
#define AR_INTR_MAC_IRQ
Definition reg.h:916
#define AR_ISR
Definition reg.h:172
#define AR_LP_RXDP
Definition reg.h:170
#define AR_ISR_TXEOL
Definition reg.h:185
#define AR_ISR_S2_DTIMSYNC
Definition reg.h:227
#define AR_IER_ENABLE
Definition reg.h:56
#define AR_ISR_S1
Definition reg.h:214
#define AR_ISR_S5_GENTIMER_THRESH
Definition reg.h:252
#define AR_ISR_S2_TSFOOR
Definition reg.h:231
#define AR_ISR_S5_GENTIMER_TRIG
Definition reg.h:250
#define AR_ISR_S2_CABEND
Definition reg.h:226
#define AR_ISR_RXINTM
Definition reg.h:206
#define AR_ISR_TXMINTR
Definition reg.h:203
#define AR_ISR_S2_BB_WATCHDOG
Definition reg.h:222
#define AR_ISR_S2_TIM
Definition reg.h:225
#define AR_Q_STATUS_RING_START
Definition reg.h:384
#define AR_ISR_TXOK
Definition reg.h:181
#define AR_ISR_S5
Definition reg.h:242
#define AR_ISR_GENTMR
Definition reg.h:201
#define AR_ISR_TXERR
Definition reg.h:183
#define AR_DATABUF_SIZE
Definition reg.h:150
#define AR_ISR_S2_CST
Definition reg.h:223
#define AR_ISR_S2_DTIM
Definition reg.h:230
#define AR_HP_RXDP
Definition reg.h:169
#define AR_ISR_S2_GTT
Definition reg.h:224
#define AR_CR
Definition reg.h:25
#define AR_ISR_RXERR
Definition reg.h:177
#define AR_ISR_RAC
Definition reg.h:334
#define AR_INTR_ASYNC_CAUSE
Definition reg.h:976
#define AR_INTR_SYNC_CAUSE_CLR
Definition reg.h:924
#define AR_INTR_SYNC_CAUSE
Definition reg.h:923
#define AR_DATABUF_SIZE_MASK
Definition reg.h:151
#define AR_RTC_STATUS_ON
Definition reg.h:1209
#define AR_ISR_BCNMISC
Definition reg.h:196
@ AR_INTR_SYNC_RADM_CPL_TIMEOUT
Definition reg.h:944
@ AR_INTR_SYNC_LOCAL_TIMEOUT
Definition reg.h:945
@ AR_INTR_SYNC_DEFAULT
Definition reg.h:953
#define AR_RC
Definition reg.h:694
#define AR_ISR_LP_RXOK
Definition reg.h:176
#define AR_RTC_STATUS
Definition reg.h:1200
static int ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
static void ar9003_hw_get_desc_link(void *ds, u32 **ds_link)
static void ar9003_hw_set_desc_link(void *ds, u32 ds_link)
static void ar9003_hw_set11n_txdesc(struct ath_hw *ah, void *ds, u32 pktlen, enum ath9k_pkt_type type, u32 txpower, u32 keyIx, enum ath9k_key_type keyType, u32 flags)
static void ar9003_hw_rx_enable(struct ath_hw *hw)
void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start, u32 ts_paddr_start, u8 size)
void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah)
static void ar9003_hw_set11n_aggr_last(struct ath_hw *ah __unused, void *ds)
int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah __unused, struct ath_rx_status *rxs, void *buf_addr)
void ar9003_hw_set_paprd_txdesc(struct ath_hw *ah __unused, void *ds, u8 chains)
void ar9003_hw_attach_mac_ops(struct ath_hw *hw)
static void ar9003_hw_clr11n_aggr(struct ath_hw *ah __unused, void *ds)
static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads)
void ath9k_hw_addrxbuf_edma(struct ath_hw *ah, u32 rxdp, enum ath9k_rx_qtype qtype)
static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds __unused, struct ath_tx_status *ts)
#define FIRST_DESC_NDELIMS
static void ar9003_hw_set11n_aggr_middle(struct ath_hw *ah __unused, void *ds, u32 numDelims)
void ath9k_hw_set_rx_bufsize(struct ath_hw *ah, u16 buf_size)
static void ar9003_hw_set11n_ratescenario(struct ath_hw *ah __unused, void *ds, void *lastds, u32 durUpdateEn, u32 rtsctsRate, u32 rtsctsDuration __unused, struct ath9k_11n_rate_series series[], u32 nseries __unused, u32 flags)
static void ar9003_hw_set_clrdmask(struct ath_hw *ah __unused, void *ds, int val)
static void ar9003_hw_set11n_aggr_first(struct ath_hw *ah, void *ds, u32 aggrLen)
static void ar9003_hw_fill_txdesc(struct ath_hw *ah __unused, void *ds, u32 seglen, int is_firstseg, int is_lastseg, const void *ds0, u32 buf_addr, unsigned int qcu)
int ath9k_hw_updatetxtriglevel(struct ath_hw *ah, int bIncTrigLevel)
ath9k_hw_updatetxtriglevel - adjusts the frame trigger level
Definition ath9k_mac.c:103
u32 ds_link
Definition desc.h:0
uint32_t type
Operating system type.
Definition ena.h:1
uint8_t flags
Flags.
Definition ena.h:7
uint8_t status
Status.
Definition ena.h:5
#define __unused
Declare a variable or data structure as unused.
Definition compiler.h:573
#define DBG2(...)
Definition compiler.h:515
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
uint16_t size
Buffer size.
Definition dwmac.h:3
#define EINVAL
Invalid argument.
Definition errno.h:429
#define EINPROGRESS
Operation in progress.
Definition errno.h:419
#define EIO
Input/output error.
Definition errno.h:434
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
@ ATH9K_HW_CAP_RAC_SUPPORTED
Definition hw.h:188
#define REG_WRITE(_ah, _reg, _val)
Definition hw.h:78
#define SM(_v, _f)
Definition hw.h:102
#define MS(_v, _f)
Definition hw.h:103
#define REG_READ(_ah, _reg)
Definition hw.h:81
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition hw.h:885
ath9k_int
Definition hw.h:252
@ ATH9K_INT_RXLP
Definition hw.h:256
@ ATH9K_INT_GENTIMER
Definition hw.h:277
@ ATH9K_INT_COMMON
Definition hw.h:287
@ ATH9K_INT_TX
Definition hw.h:260
@ ATH9K_INT_RXHP
Definition hw.h:255
@ ATH9K_INT_FATAL
Definition hw.h:280
ath9k_rx_qtype
Definition hw.h:400
@ ATH9K_RX_QUEUE_HP
Definition hw.h:401
#define ATHEROS_VENDOR_ID
Definition hw.h:41
#define u8
Definition igbvf_osdep.h:40
iPXE I/O API
void __asmcall int val
Definition setjmp.h:12
void * memset(void *dest, int character, size_t len) __nonnull
uint32_t ds
Definition librm.h:5
#define AR_ExcessiveRetries
Definition mac.h:464
#define ATH9K_TX_BA
Definition mac.h:94
#define AR_VirtMoreFrag
Definition mac.h:355
#define AR_RxKeyIdxValid
Definition mac.h:564
#define ATH9K_TXDESC_RTSENA
Definition mac.h:251
#define ATH9K_TXDESC_VMF
Definition mac.h:270
ath9k_key_type
Definition mac.h:665
#define AR_KeyIdx
Definition mac.h:565
#define AR_RxAntenna
Definition mac.h:540
#define AR_DataFailCnt
Definition mac.h:469
#define AR_TxRSSIAnt02
Definition mac.h:452
#define AR_ExtOnly
Definition mac.h:375
#define ATH9K_RXERR_DECRYPT
Definition mac.h:193
#define AR_RxRate
Definition mac.h:523
#define ATH9K_TX_DATA_UNDERRUN
Definition mac.h:97
#define AR_TxRSSICombined
Definition mac.h:489
#define AR_VirtRetryCnt
Definition mac.h:471
#define AR_RxRSSIAnt10
Definition mac.h:543
#define AR_PHYErr
Definition mac.h:560
#define AR_RxMore
Definition mac.h:528
#define AR_TxDone
Definition mac.h:499
#define AR_IsAggr
Definition mac.h:378
#define AR_FrameType
Definition mac.h:370
#define AR_TxDelimUnderrun
Definition mac.h:473
#define ATH9K_RX_DELIM_CRC_POST
Definition mac.h:201
#define AR_RTSFailCnt
Definition mac.h:467
#define AR_PadDelim
Definition mac.h:418
#define set11nPktDurRTSCTS(_series, _index)
Definition mac.h:38
#define AR_TxMore
Definition mac.h:367
#define AR_DecryptBusyErr
Definition mac.h:573
#define AR_TxOpExceeded
Definition mac.h:503
#define AR_BurstDur
Definition mac.h:380
#define AR_2040
Definition mac.h:536
#define AR_RxMoreAggr
Definition mac.h:569
#define AR_DurUpdateEna
Definition mac.h:382
#define AR_XmitPower
Definition mac.h:357
#define AR_TxRSSIAnt00
Definition mac.h:448
#define ATH9K_TXDESC_VEOL
Definition mac.h:267
#define AR_RxRSSIAnt01
Definition mac.h:519
#define ATH9K_TXERR_FIFO
Definition mac.h:86
#define AR_EncrType
Definition mac.h:420
#define AR_RxRSSICombined
Definition mac.h:549
#define ATH9K_RXERR_MIC
Definition mac.h:194
#define AR_KeyMiss
Definition mac.h:574
ath9k_pkt_type
Definition mac.h:605
#define AR_RxAggr
Definition mac.h:570
#define ATH9K_TX_DELIM_UNDERRUN
Definition mac.h:98
#define ATH9K_RX_GI
Definition mac.h:198
#define AR_RxRSSIAnt12
Definition mac.h:547
#define ATH9K_TXERR_FILT
Definition mac.h:85
#define AR_VEOL
Definition mac.h:360
#define AR_GI
Definition mac.h:535
#define AR_TxBaStatus
Definition mac.h:455
#define AR_CRCErr
Definition mac.h:558
#define AR_FinalTxIdx
Definition mac.h:505
#define AR_RxRSSIAnt02
Definition mac.h:521
#define ATH9K_TXERR_XRETRY
Definition mac.h:84
#define ATH9K_RXERR_CRC
Definition mac.h:190
#define AR_NoAck
Definition mac.h:372
#define AR_MichaelErr
Definition mac.h:561
#define AR_DestIdxValid
Definition mac.h:364
#define AR_RxRSSIAnt11
Definition mac.h:545
#define AR_CTSEnable
Definition mac.h:365
#define AR_PostDelimCRCErr
Definition mac.h:571
#define AR_PHYErrCode
Definition mac.h:567
#define AR_DescCfgErr
Definition mac.h:475
#define ATH9K_TXDESC_CTSENA
Definition mac.h:252
#define AR_DecryptCRCErr
Definition mac.h:559
#define set11nRateFlags(_series, _index)
Definition mac.h:43
#define AR_ClrDestMask
Definition mac.h:361
#define ATH9K_TXKEYIX_INVALID
Definition mac.h:205
#define ATH9K_TXERR_TIMER_EXPIRED
Definition mac.h:88
#define AR_TxDataUnderrun
Definition mac.h:474
#define AR_TxRSSIAnt10
Definition mac.h:483
#define AR_RTSCTSRate
Definition mac.h:441
#define AR_FrameLen
Definition mac.h:354
#define AR_DataLen
Definition mac.h:527
#define AR_MoreAggr
Definition mac.h:377
#define AR_ExtAndCtl
Definition mac.h:376
#define ATH9K_TXDESC_NOACK
Definition mac.h:250
#define ATH9K_RXKEYIX_INVALID
Definition mac.h:204
#define AR_DestIdx
Definition mac.h:368
#define ATH9K_RXERR_PHY
Definition mac.h:191
#define AR_TxTimerExpired
Definition mac.h:476
#define ATH9K_TXDESC_LDPC
Definition mac.h:273
#define ATH9K_TXDESC_LOWRXCHAIN
Definition mac.h:272
#define AR_RTSEnable
Definition mac.h:359
#define ATH9K_TX_DESC_CFG_ERR
Definition mac.h:96
#define AR_TxTid
Definition mac.h:492
#define AR_RxDone
Definition mac.h:556
@ ATH9K_PHYERR_OFDM_RESTART
Definition mac.h:223
#define AR_FIFOUnderrun
Definition mac.h:465
#define AR_RxRSSIAnt00
Definition mac.h:517
#define AR_RxFrameOK
Definition mac.h:557
#define AR_TxRSSIAnt12
Definition mac.h:487
#define ATH9K_RX_DECRYPT_BUSY
Definition mac.h:202
#define AR_Filtered
Definition mac.h:466
#define ATH9K_TXDESC_EXT_ONLY
Definition mac.h:268
#define set11nTries(_series, _index)
Definition mac.h:32
#define AR_AggrLen
Definition mac.h:415
#define AR_TxRSSIAnt01
Definition mac.h:450
#define ATH9K_RX_DELIM_CRC_PRE
Definition mac.h:200
#define AR_LDPC
Definition mac.h:423
#define AR_PreDelimCRCErr
Definition mac.h:562
#define ATH9K_TXDESC_EXT_AND_CTL
Definition mac.h:269
#define ATH9K_TXERR_XTXOP
Definition mac.h:87
#define ATH9K_RX_2040
Definition mac.h:199
#define set11nRate(_series, _index)
Definition mac.h:35
#define AR_TxRSSIAnt11
Definition mac.h:485
#define AR_SeqNum
Definition mac.h:500
uint8_t checksum
Checksum.
Definition pnpbios.c:12
uint8_t ah
Definition registers.h:1
@ isr
Definition sis900.h:26
@ rxdp
Definition sis900.h:32
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition hw.h:604
void(* set11n_aggr_first)(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition hw.h:633
int(* proc_txdesc)(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition hw.h:620
void(* rx_enable)(struct ath_hw *ah)
Definition hw.h:608
void(* set_desc_link)(void *ds, u32 link)
Definition hw.h:609
void(* set11n_ratescenario)(struct ath_hw *ah, void *ds, void *lastds, u32 durUpdateEn, u32 rtsctsRate, u32 rtsctsDuration, struct ath9k_11n_rate_series series[], u32 nseries, u32 flags)
Definition hw.h:627
void(* clr11n_aggr)(struct ath_hw *ah, void *ds)
Definition hw.h:638
void(* set11n_txdesc)(struct ath_hw *ah, void *ds, u32 pktLen, enum ath9k_pkt_type type, u32 txPower, u32 keyIx, enum ath9k_key_type keyType, u32 flags)
Definition hw.h:622
void(* set_clrdmask)(struct ath_hw *ah, void *ds, int val)
Definition hw.h:639
void(* set11n_aggr_last)(struct ath_hw *ah, void *ds)
Definition hw.h:637
void(* fill_txdesc)(struct ath_hw *ah, void *ds, u32 seglen, int is_firstseg, int is_is_lastseg, const void *ds0, u32 buf_addr, unsigned int qcu)
Definition hw.h:616
int(* get_isr)(struct ath_hw *ah, enum ath9k_int *masked)
Definition hw.h:615
void(* get_desc_link)(void *ds, u32 **link)
Definition hw.h:610
void(* set11n_aggr_middle)(struct ath_hw *ah, void *ds, u32 numDelims)
Definition hw.h:635
Definition hw.h:657
u8 rs_flags
Definition mac.h:156
int8_t rs_rssi_ext1
Definition mac.h:151
u8 rs_rate
Definition mac.h:144
u8 rs_more
Definition mac.h:146
int8_t rs_rssi_ctl1
Definition mac.h:148
u8 rs_status
Definition mac.h:140
int8_t rs_rssi_ext2
Definition mac.h:152
u32 evm4
Definition mac.h:161
u8 rs_moreaggr
Definition mac.h:154
int8_t rs_rssi_ext0
Definition mac.h:150
int8_t rs_rssi_ctl0
Definition mac.h:147
u8 rs_phyerr
Definition mac.h:141
u8 rs_antenna
Definition mac.h:145
u8 rs_isaggr
Definition mac.h:153
u32 evm0
Definition mac.h:157
u16 rs_datalen
Definition mac.h:139
u8 rs_keyix
Definition mac.h:143
int8_t rs_rssi_ctl2
Definition mac.h:149
u32 evm1
Definition mac.h:158
u32 rs_tstamp
Definition mac.h:138
int8_t rs_rssi
Definition mac.h:142
u32 evm2
Definition mac.h:159
u32 evm3
Definition mac.h:160
int8_t ts_rssi_ctl0
Definition mac.h:121
u32 ba_low
Definition mac.h:130
u8 ts_shortretry
Definition mac.h:117
u8 ts_virtcol
Definition mac.h:119
u8 ts_status
Definition mac.h:114
int8_t ts_rssi
Definition mac.h:116
u16 desc_id
Definition mac.h:128
u32 ts_tstamp
Definition mac.h:112
u16 ts_seqnum
Definition mac.h:113
int8_t ts_rssi_ext2
Definition mac.h:126
u8 ts_longretry
Definition mac.h:118
u32 ba_high
Definition mac.h:131
int8_t ts_rssi_ext1
Definition mac.h:125
u8 ts_flags
Definition mac.h:120
int8_t ts_rssi_ext0
Definition mac.h:124
u8 ts_rateindex
Definition mac.h:115
int8_t ts_rssi_ctl1
Definition mac.h:122
int8_t ts_rssi_ctl2
Definition mac.h:123
Definition hw.c:16
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21