iPXE
Macros | Functions
ath9k_ar9002_mac.c File Reference
#include <ipxe/io.h>
#include "hw.h"

Go to the source code of this file.

Macros

#define AR_BufLen   0x00000fff
 

Functions

 FILE_SECBOOT (FORBIDDEN)
 
static void ar9002_hw_rx_enable (struct ath_hw *ah)
 
static void ar9002_hw_set_desc_link (void *ds, u32 ds_link)
 
static void ar9002_hw_get_desc_link (void *ds, u32 **ds_link)
 
static int ar9002_hw_get_isr (struct ath_hw *ah, enum ath9k_int *masked)
 
static void ar9002_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 __unused)
 
static int ar9002_hw_proc_txdesc (struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
 
static void ar9002_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 ar9002_hw_set_clrdmask (struct ath_hw *ah __unused, void *ds, int val)
 
static void ar9002_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 ar9002_hw_set11n_aggr_first (struct ath_hw *ah __unused, void *ds, u32 aggrLen)
 
static void ar9002_hw_set11n_aggr_middle (struct ath_hw *ah __unused, void *ds, u32 numDelims)
 
static void ar9002_hw_set11n_aggr_last (struct ath_hw *ah __unused, void *ds)
 
static void ar9002_hw_clr11n_aggr (struct ath_hw *ah __unused, void *ds)
 
void ath9k_hw_setuprxdesc (struct ath_hw *ah, struct ath_desc *ds, u32 size, u32 flags)
 
void ar9002_hw_attach_mac_ops (struct ath_hw *ah)
 

Macro Definition Documentation

◆ AR_BufLen

#define AR_BufLen   0x00000fff

Definition at line 26 of file ath9k_ar9002_mac.c.

Function Documentation

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN  )

◆ ar9002_hw_rx_enable()

static void ar9002_hw_rx_enable ( struct ath_hw ah)
static

Definition at line 28 of file ath9k_ar9002_mac.c.

29 {
31 }
#define AR_CR_RXE
Definition: reg.h:26
#define AR_CR
Definition: reg.h:25
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85

References ah, AR_CR, AR_CR_RXE, and REG_WRITE.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set_desc_link()

static void ar9002_hw_set_desc_link ( void *  ds,
u32  ds_link 
)
static

Definition at line 33 of file ath9k_ar9002_mac.c.

34 {
35  ((struct ath_desc*) ds)->ds_link = ds_link;
36 }
Definition: mac.h:241
u32 ds_link
Definition: desc.h:20
uint32_t ds
Definition: librm.h:140

References ds, and ds_link.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_get_desc_link()

static void ar9002_hw_get_desc_link ( void *  ds,
u32 **  ds_link 
)
static

Definition at line 38 of file ath9k_ar9002_mac.c.

39 {
40  *ds_link = &((struct ath_desc *)ds)->ds_link;
41 }
Definition: mac.h:241
u32 ds_link
Definition: desc.h:20
uint32_t ds
Definition: librm.h:140

References ds, and ds_link.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_get_isr()

static int ar9002_hw_get_isr ( struct ath_hw ah,
enum ath9k_int masked 
)
static

Definition at line 43 of file ath9k_ar9002_mac.c.

44 {
45  u32 isr = 0;
46  u32 mask2 = 0;
47  struct ath9k_hw_capabilities *pCap = &ah->caps;
48  u32 sync_cause = 0;
49  int fatal_int = 0;
50 
51  if (!AR_SREV_9100(ah) && (ah->ah_ier & AR_IER_ENABLE)) {
54  == AR_RTC_STATUS_ON) {
55  isr = REG_READ(ah, AR_ISR);
56  }
57  }
58 
59  sync_cause = REG_READ(ah, AR_INTR_SYNC_CAUSE) &
61 
62  *masked = 0;
63 
64  if (!isr && !sync_cause)
65  return 0;
66  } else {
67  *masked = 0;
68  isr = REG_READ(ah, AR_ISR);
69  }
70 
71  if (isr) {
72  if (isr & AR_ISR_BCNMISC) {
73  u32 isr2;
74  isr2 = REG_READ(ah, AR_ISR_S2);
75  if (isr2 & AR_ISR_S2_TIM)
76  mask2 |= ATH9K_INT_TIM;
77  if (isr2 & AR_ISR_S2_DTIM)
78  mask2 |= ATH9K_INT_DTIM;
79  if (isr2 & AR_ISR_S2_DTIMSYNC)
80  mask2 |= ATH9K_INT_DTIMSYNC;
81  if (isr2 & (AR_ISR_S2_CABEND))
82  mask2 |= ATH9K_INT_CABEND;
83  if (isr2 & AR_ISR_S2_GTT)
84  mask2 |= ATH9K_INT_GTT;
85  if (isr2 & AR_ISR_S2_CST)
86  mask2 |= ATH9K_INT_CST;
87  if (isr2 & AR_ISR_S2_TSFOOR)
88  mask2 |= ATH9K_INT_TSFOOR;
89  }
90 
92  if (isr == 0xffffffff) {
93  *masked = 0;
94  return 0;
95  }
96 
97  *masked = isr & ATH9K_INT_COMMON;
98 
101  *masked |= ATH9K_INT_RX;
102 
103  if (isr &
105  AR_ISR_TXEOL)) {
106  u32 s0_s, s1_s;
107 
108  *masked |= ATH9K_INT_TX;
109 
110  s0_s = REG_READ(ah, AR_ISR_S0_S);
111  ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXOK);
112  ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXDESC);
113 
114  s1_s = REG_READ(ah, AR_ISR_S1_S);
115  ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXERR);
116  ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXEOL);
117  }
118 
119  if (isr & AR_ISR_RXORN) {
120  DBG("ath9k: "
121  "receive FIFO overrun interrupt\n");
122  }
123 
124  *masked |= mask2;
125  }
126 
127  if (AR_SREV_9100(ah))
128  return 1;
129 
130  if (isr & AR_ISR_GENTMR) {
131  u32 s5_s;
132 
133  s5_s = REG_READ(ah, AR_ISR_S5_S);
134  ah->intr_gen_timer_trigger =
136 
137  ah->intr_gen_timer_thresh =
139 
140  if (ah->intr_gen_timer_trigger)
141  *masked |= ATH9K_INT_GENTIMER;
142 
143  if ((s5_s & AR_ISR_S5_TIM_TIMER) &&
144  !(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
145  *masked |= ATH9K_INT_TIM_TIMER;
146  }
147 
148  if (sync_cause) {
149  fatal_int =
150  (sync_cause &
152  ? 1 : 0;
153 
154  if (fatal_int) {
155  if (sync_cause & AR_INTR_SYNC_HOST1_FATAL) {
156  DBG("ath9k: "
157  "received PCI FATAL interrupt\n");
158  }
159  if (sync_cause & AR_INTR_SYNC_HOST1_PERR) {
160  DBG("ath9k: "
161  "received PCI PERR interrupt\n");
162  }
163  *masked |= ATH9K_INT_FATAL;
164  }
165  if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) {
166  DBG("ath9k: "
167  "AR_INTR_SYNC_RADM_CPL_TIMEOUT\n");
169  REG_WRITE(ah, AR_RC, 0);
170  *masked |= ATH9K_INT_FATAL;
171  }
172  if (sync_cause & AR_INTR_SYNC_LOCAL_TIMEOUT) {
173  DBG("ath9k: "
174  "AR_INTR_SYNC_LOCAL_TIMEOUT\n");
175  }
176 
177  REG_WRITE(ah, AR_INTR_SYNC_CAUSE_CLR, sync_cause);
179  }
180 
181  return 1;
182 }
#define AR_ISR_RAC
Definition: reg.h:334
#define AR_RTC_STATUS_ON
Definition: reg.h:1209
#define AR_INTR_SYNC_CAUSE_CLR
Definition: reg.h:924
#define AR_RTC_STATUS
Definition: reg.h:1200
#define AR_INTR_ASYNC_CAUSE
Definition: reg.h:976
#define AR_ISR_S2_DTIM
Definition: reg.h:230
#define AR_ISR_S5_TIM_TIMER
Definition: reg.h:245
#define AR_ISR_S1_S
Definition: reg.h:341
#define AR_ISR_S2_CST
Definition: reg.h:223
#define MS(_v, _f)
Definition: hw.h:103
#define AR_ISR_S5_GENTIMER_THRESH
Definition: reg.h:252
#define AR_ISR_TXEOL
Definition: reg.h:185
#define AR_SREV_9100(ah)
Definition: reg.h:811
#define AR_ISR_S2_GTT
Definition: reg.h:224
#define AR_ISR_S2_TSFOOR
Definition: reg.h:231
#define AR_RTC_STATUS_M
Definition: reg.h:1203
#define AR_IER_ENABLE
Definition: reg.h:56
#define AR_RC_HOSTIF
Definition: reg.h:697
#define AR_ISR_S1_QCU_TXERR
Definition: reg.h:342
#define AR_ISR_S0_QCU_TXOK
Definition: reg.h:336
#define AR_ISR_RXORN
Definition: reg.h:180
#define AR_ISR_S5_S
Definition: reg.h:350
#define AR_ISR_S5_GENTIMER_TRIG
Definition: reg.h:250
#define AR_ISR_TXDESC
Definition: reg.h:182
#define AR_ISR_S0_QCU_TXDESC
Definition: reg.h:338
#define AR_ISR_S0_S
Definition: reg.h:335
#define AR_ISR_RXOK
Definition: reg.h:173
Definition: sis900.h:26
#define AR_ISR_TXOK
Definition: reg.h:181
#define AR_INTR_SYNC_CAUSE
Definition: reg.h:923
#define AR_ISR_S2
Definition: reg.h:220
#define AR_ISR_S2_CABEND
Definition: reg.h:226
#define AR_ISR_S2_DTIMSYNC
Definition: reg.h:227
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define AR_ISR_TXERR
Definition: reg.h:183
#define AR_ISR_S1_QCU_TXEOL
Definition: reg.h:344
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
#define AR_INTR_MAC_IRQ
Definition: reg.h:916
#define AR_ISR_RXMINTR
Definition: reg.h:204
#define AR_ISR_BCNMISC
Definition: reg.h:196
#define AR_ISR_GENTMR
Definition: reg.h:201
#define AR_ISR
Definition: reg.h:172
uint8_t ah
Definition: registers.h:85
#define AR_ISR_RXINTM
Definition: reg.h:206
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define AR_ISR_RXERR
Definition: reg.h:177
#define AR_RC
Definition: reg.h:694
uint32_t u32
Definition: stdint.h:24
#define AR_ISR_S2_TIM
Definition: reg.h:225

References ah, AR_IER_ENABLE, AR_INTR_ASYNC_CAUSE, AR_INTR_MAC_IRQ, AR_INTR_SYNC_CAUSE, AR_INTR_SYNC_CAUSE_CLR, AR_INTR_SYNC_DEFAULT, AR_INTR_SYNC_HOST1_FATAL, AR_INTR_SYNC_HOST1_PERR, AR_INTR_SYNC_LOCAL_TIMEOUT, AR_INTR_SYNC_RADM_CPL_TIMEOUT, AR_ISR, AR_ISR_BCNMISC, AR_ISR_GENTMR, AR_ISR_RAC, AR_ISR_RXERR, AR_ISR_RXINTM, AR_ISR_RXMINTR, AR_ISR_RXOK, AR_ISR_RXORN, AR_ISR_S0_QCU_TXDESC, AR_ISR_S0_QCU_TXOK, AR_ISR_S0_S, AR_ISR_S1_QCU_TXEOL, AR_ISR_S1_QCU_TXERR, AR_ISR_S1_S, AR_ISR_S2, AR_ISR_S2_CABEND, AR_ISR_S2_CST, AR_ISR_S2_DTIM, AR_ISR_S2_DTIMSYNC, AR_ISR_S2_GTT, AR_ISR_S2_TIM, AR_ISR_S2_TSFOOR, AR_ISR_S5_GENTIMER_THRESH, AR_ISR_S5_GENTIMER_TRIG, AR_ISR_S5_S, AR_ISR_S5_TIM_TIMER, AR_ISR_TXDESC, AR_ISR_TXEOL, AR_ISR_TXERR, AR_ISR_TXOK, AR_RC, AR_RC_HOSTIF, AR_RTC_STATUS, AR_RTC_STATUS_M, AR_RTC_STATUS_ON, AR_SREV_9100, ATH9K_HW_CAP_AUTOSLEEP, ATH9K_INT_CABEND, ATH9K_INT_COMMON, ATH9K_INT_CST, ATH9K_INT_DTIM, ATH9K_INT_DTIMSYNC, ATH9K_INT_FATAL, ATH9K_INT_GENTIMER, ATH9K_INT_GTT, ATH9K_INT_RX, ATH9K_INT_TIM, ATH9K_INT_TIM_TIMER, ATH9K_INT_TSFOOR, ATH9K_INT_TX, DBG, ath9k_hw_capabilities::hw_caps, isr, MS, REG_READ, and REG_WRITE.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_fill_txdesc()

static void ar9002_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  __unused 
)
static

Definition at line 184 of file ath9k_ar9002_mac.c.

188 {
189  struct ar5416_desc *ads = AR5416DESC(ds);
190 
191  ads->ds_data = buf_addr;
192 
193  if (is_firstseg) {
194  ads->ds_ctl1 |= seglen | (is_lastseg ? 0 : AR_TxMore);
195  } else if (is_lastseg) {
196  ads->ds_ctl0 = 0;
197  ads->ds_ctl1 = seglen;
198  ads->ds_ctl2 = AR5416DESC_CONST(ds0)->ds_ctl2;
199  ads->ds_ctl3 = AR5416DESC_CONST(ds0)->ds_ctl3;
200  } else {
201  ads->ds_ctl0 = 0;
202  ads->ds_ctl1 = seglen | AR_TxMore;
203  ads->ds_ctl2 = 0;
204  ads->ds_ctl3 = 0;
205  }
206  ads->ds_txstatus0 = ads->ds_txstatus1 = 0;
207  ads->ds_txstatus2 = ads->ds_txstatus3 = 0;
208  ads->ds_txstatus4 = ads->ds_txstatus5 = 0;
209  ads->ds_txstatus6 = ads->ds_txstatus7 = 0;
210  ads->ds_txstatus8 = ads->ds_txstatus9 = 0;
211 }
u32 ds_ctl0
Definition: mac.h:280
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
uint32_t ds
Definition: librm.h:140
#define AR5416DESC_CONST(_ds)
Definition: mac.h:320
#define AR_TxMore
Definition: mac.h:367
u32 ds_data
Definition: mac.h:279

References AR5416DESC, AR5416DESC_CONST, AR_TxMore, ds, ar5416_desc::ds_ctl0, ar5416_desc::ds_ctl1, and ar5416_desc::ds_data.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_proc_txdesc()

static int ar9002_hw_proc_txdesc ( struct ath_hw ah,
void *  ds,
struct ath_tx_status ts 
)
static

Definition at line 213 of file ath9k_ar9002_mac.c.

215 {
216  struct ar5416_desc *ads = AR5416DESC(ds);
217  u32 status;
218 
219  status = *(volatile typeof(ads->ds_txstatus9) *)&(ads->ds_txstatus9);
220  if ((status & AR_TxDone) == 0)
221  return -EINPROGRESS;
222 
223  ts->ts_tstamp = ads->AR_SendTimestamp;
224  ts->ts_status = 0;
225  ts->ts_flags = 0;
226 
227  if (status & AR_TxOpExceeded)
229  ts->tid = MS(status, AR_TxTid);
231  ts->ts_seqnum = MS(status, AR_SeqNum);
232 
233  status = *(volatile typeof(ads->ds_txstatus0) *)&(ads->ds_txstatus0);
237  if (status & AR_TxBaStatus) {
238  ts->ts_flags |= ATH9K_TX_BA;
239  ts->ba_low = ads->AR_BaBitmapLow;
240  ts->ba_high = ads->AR_BaBitmapHigh;
241  }
242 
243  status = *(volatile typeof(ads->ds_txstatus1) *)&(ads->ds_txstatus1);
244  if (status & AR_FrmXmitOK)
245  ts->ts_status |= ATH9K_TX_ACKED;
246  else {
249  if (status & AR_Filtered)
251  if (status & AR_FIFOUnderrun) {
254  }
255  }
258  if (status & AR_DescCfgErr)
260  if (status & AR_TxDataUnderrun) {
263  }
264  if (status & AR_TxDelimUnderrun) {
267  }
271 
272  status = *(volatile typeof(ads->ds_txstatus5) *)&(ads->ds_txstatus5);
277 
278  ts->evm0 = ads->AR_TxEVM0;
279  ts->evm1 = ads->AR_TxEVM1;
280  ts->evm2 = ads->AR_TxEVM2;
281 
282  return 0;
283 }
#define ATH9K_TX_DATA_UNDERRUN
Definition: mac.h:97
u8 ts_flags
Definition: mac.h:120
u8 ts_longretry
Definition: mac.h:118
int8_t ts_rssi_ext1
Definition: mac.h:125
#define ATH9K_TXERR_FILT
Definition: mac.h:85
#define AR_TxRSSIAnt10
Definition: mac.h:483
#define AR_VirtRetryCnt
Definition: mac.h:471
u32 evm0
Definition: mac.h:132
int8_t ts_rssi_ctl1
Definition: mac.h:122
#define AR_TxRSSIAnt12
Definition: mac.h:487
int8_t ts_rssi
Definition: mac.h:116
#define MS(_v, _f)
Definition: hw.h:103
u8 ts_status
Definition: mac.h:114
#define AR_TxRSSIAnt01
Definition: mac.h:450
u16 ts_seqnum
Definition: mac.h:113
#define AR_TxDone
Definition: mac.h:499
u8 ts_rateindex
Definition: mac.h:115
u8 tid
Definition: mac.h:129
#define ATH9K_TX_BA
Definition: mac.h:94
#define AR_TxOpExceeded
Definition: mac.h:503
#define AR_TxDelimUnderrun
Definition: mac.h:473
#define AR_TxTid
Definition: mac.h:492
#define AR_TxRSSICombined
Definition: mac.h:489
#define AR5416DESC(_ds)
Definition: mac.h:319
int8_t ts_rssi_ext0
Definition: mac.h:124
int8_t ts_rssi_ctl0
Definition: mac.h:121
u32 ba_high
Definition: mac.h:131
#define ATH9K_TX_DESC_CFG_ERR
Definition: mac.h:96
#define EINPROGRESS
Operation in progress.
Definition: errno.h:419
#define ATH9K_TX_ACKED
Definition: mac.h:89
u8 ts_shortretry
Definition: mac.h:117
u32 evm2
Definition: mac.h:134
#define AR_TxRSSIAnt02
Definition: mac.h:452
#define AR_SeqNum
Definition: mac.h:500
u32 ts_tstamp
Definition: mac.h:112
#define AR_FinalTxIdx
Definition: mac.h:505
int ath9k_hw_updatetxtriglevel(struct ath_hw *ah, int bIncTrigLevel)
ath9k_hw_updatetxtriglevel - adjusts the frame trigger level
Definition: ath9k_mac.c:103
#define AR_RTSFailCnt
Definition: mac.h:467
#define AR_Filtered
Definition: mac.h:466
uint32_t ds
Definition: librm.h:140
uint8_t status
Status.
Definition: ena.h:16
#define ATH9K_TXERR_FIFO
Definition: mac.h:86
#define AR_TxRSSIAnt00
Definition: mac.h:448
int8_t ts_rssi_ext2
Definition: mac.h:126
#define AR_ExcessiveRetries
Definition: mac.h:464
u32 evm1
Definition: mac.h:133
#define AR_TxDataUnderrun
Definition: mac.h:474
#define ATH9K_TX_DELIM_UNDERRUN
Definition: mac.h:98
#define ATH9K_TXERR_XTXOP
Definition: mac.h:87
#define ATH9K_TXERR_TIMER_EXPIRED
Definition: mac.h:88
#define AR_TxRSSIAnt11
Definition: mac.h:485
#define AR_TxTimerExpired
Definition: mac.h:476
#define AR_FrmXmitOK
Definition: mac.h:463
uint8_t ah
Definition: registers.h:85
#define AR_DescCfgErr
Definition: mac.h:475
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition: acpi.c:48
#define AR_DataFailCnt
Definition: mac.h:469
int8_t ts_rssi_ctl2
Definition: mac.h:123
#define AR_TxBaStatus
Definition: mac.h:455
#define ATH9K_TXERR_XRETRY
Definition: mac.h:84
u32 ba_low
Definition: mac.h:130
u8 ts_virtcol
Definition: mac.h:119
uint32_t u32
Definition: stdint.h:24
#define AR_FIFOUnderrun
Definition: mac.h:465

References ah, AR5416DESC, AR_DataFailCnt, AR_DescCfgErr, AR_ExcessiveRetries, AR_FIFOUnderrun, AR_Filtered, AR_FinalTxIdx, AR_FrmXmitOK, AR_RTSFailCnt, AR_SeqNum, AR_TxBaStatus, AR_TxDataUnderrun, AR_TxDelimUnderrun, AR_TxDone, AR_TxOpExceeded, AR_TxRSSIAnt00, AR_TxRSSIAnt01, AR_TxRSSIAnt02, AR_TxRSSIAnt10, AR_TxRSSIAnt11, AR_TxRSSIAnt12, AR_TxRSSICombined, AR_TxTid, AR_TxTimerExpired, AR_VirtRetryCnt, ath9k_hw_updatetxtriglevel(), ATH9K_TX_ACKED, ATH9K_TX_BA, ATH9K_TX_DATA_UNDERRUN, ATH9K_TX_DELIM_UNDERRUN, ATH9K_TX_DESC_CFG_ERR, ATH9K_TXERR_FIFO, ATH9K_TXERR_FILT, ATH9K_TXERR_TIMER_EXPIRED, ATH9K_TXERR_XRETRY, ATH9K_TXERR_XTXOP, ath_tx_status::ba_high, ath_tx_status::ba_low, ds, EINPROGRESS, ath_tx_status::evm0, ath_tx_status::evm1, ath_tx_status::evm2, MS, status, ath_tx_status::tid, ath_tx_status::ts_flags, ath_tx_status::ts_longretry, ath_tx_status::ts_rateindex, ath_tx_status::ts_rssi, ath_tx_status::ts_rssi_ctl0, ath_tx_status::ts_rssi_ctl1, ath_tx_status::ts_rssi_ctl2, ath_tx_status::ts_rssi_ext0, ath_tx_status::ts_rssi_ext1, ath_tx_status::ts_rssi_ext2, ath_tx_status::ts_seqnum, ath_tx_status::ts_shortretry, ath_tx_status::ts_status, ath_tx_status::ts_tstamp, ath_tx_status::ts_virtcol, and typeof().

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_txdesc()

static void ar9002_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

Definition at line 285 of file ath9k_ar9002_mac.c.

289 {
290  struct ar5416_desc *ads = AR5416DESC(ds);
291 
292  if (txPower > 63)
293  txPower = 63;
294 
295  ads->ds_ctl0 = (pktLen & AR_FrameLen)
297  | SM(txPower, AR_XmitPower)
298  | (flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
300  | (keyIx != ATH9K_TXKEYIX_INVALID ? AR_DestIdxValid : 0);
301 
302  ads->ds_ctl1 =
303  (keyIx != ATH9K_TXKEYIX_INVALID ? SM(keyIx, AR_DestIdx) : 0)
304  | SM(type, AR_FrameType)
305  | (flags & ATH9K_TXDESC_NOACK ? AR_NoAck : 0)
308 
309  ads->ds_ctl6 = SM(keyType, AR_EncrType);
310 
311  if (AR_SREV_9285(ah) || AR_SREV_9271(ah)) {
312  ads->ds_ctl8 = 0;
313  ads->ds_ctl9 = 0;
314  ads->ds_ctl10 = 0;
315  ads->ds_ctl11 = 0;
316  }
317 }
#define ATH9K_TXDESC_NOACK
Definition: mac.h:250
u32 ds_ctl0
Definition: mac.h:280
#define ATH9K_TXDESC_EXT_ONLY
Definition: mac.h:268
#define ATH9K_TXDESC_VEOL
Definition: mac.h:267
uint32_t type
Operating system type.
Definition: ena.h:12
#define AR_TxIntrReq
Definition: mac.h:363
#define ATH9K_TXDESC_EXT_AND_CTL
Definition: mac.h:269
#define AR_SREV_9285(_ah)
Definition: reg.h:830
#define AR_ExtAndCtl
Definition: mac.h:376
#define ATH9K_TXDESC_INTREQ
Definition: mac.h:266
#define AR_EncrType
Definition: mac.h:420
#define AR_FrameType
Definition: mac.h:370
#define AR_DestIdxValid
Definition: mac.h:364
#define AR_NoAck
Definition: mac.h:372
#define SM(_v, _f)
Definition: hw.h:102
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
#define AR_FrameLen
Definition: mac.h:354
uint8_t flags
Flags.
Definition: ena.h:18
#define AR_VirtMoreFrag
Definition: mac.h:355
uint32_t ds
Definition: librm.h:140
#define AR_DestIdx
Definition: mac.h:368
#define AR_SREV_9271(_ah)
Definition: reg.h:854
#define ATH9K_TXDESC_VMF
Definition: mac.h:270
#define AR_ExtOnly
Definition: mac.h:375
uint8_t ah
Definition: registers.h:85
#define AR_XmitPower
Definition: mac.h:357
#define AR_VEOL
Definition: mac.h:360
#define ATH9K_TXKEYIX_INVALID
Definition: mac.h:205

References ah, AR5416DESC, AR_DestIdx, AR_DestIdxValid, AR_EncrType, AR_ExtAndCtl, AR_ExtOnly, AR_FrameLen, AR_FrameType, AR_NoAck, AR_SREV_9271, AR_SREV_9285, AR_TxIntrReq, AR_VEOL, AR_VirtMoreFrag, AR_XmitPower, ATH9K_TXDESC_EXT_AND_CTL, ATH9K_TXDESC_EXT_ONLY, ATH9K_TXDESC_INTREQ, ATH9K_TXDESC_NOACK, ATH9K_TXDESC_VEOL, ATH9K_TXDESC_VMF, ATH9K_TXKEYIX_INVALID, ds, ar5416_desc::ds_ctl0, ar5416_desc::ds_ctl1, flags, SM, and type.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set_clrdmask()

static void ar9002_hw_set_clrdmask ( struct ath_hw *ah  __unused,
void *  ds,
int  val 
)
static

Definition at line 319 of file ath9k_ar9002_mac.c.

320 {
321  struct ar5416_desc *ads = AR5416DESC(ds);
322 
323  if (val)
324  ads->ds_ctl0 |= AR_ClrDestMask;
325  else
326  ads->ds_ctl0 &= ~AR_ClrDestMask;
327 }
u32 ds_ctl0
Definition: mac.h:280
void __asmcall int val
Definition: setjmp.h:12
#define AR_ClrDestMask
Definition: mac.h:361
#define AR5416DESC(_ds)
Definition: mac.h:319
uint32_t ds
Definition: librm.h:140

References AR5416DESC, AR_ClrDestMask, ds, ar5416_desc::ds_ctl0, and val.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_ratescenario()

static void ar9002_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

Definition at line 329 of file ath9k_ar9002_mac.c.

335 {
336  struct ar5416_desc *ads = AR5416DESC(ds);
337  struct ar5416_desc *last_ads = AR5416DESC(lastds);
338  u32 ds_ctl0;
339 
341  ds_ctl0 = ads->ds_ctl0;
342 
343  if (flags & ATH9K_TXDESC_RTSENA) {
344  ds_ctl0 &= ~AR_CTSEnable;
346  } else {
347  ds_ctl0 &= ~AR_RTSEnable;
349  }
350 
351  ads->ds_ctl0 = ds_ctl0;
352  } else {
353  ads->ds_ctl0 =
354  (ads->ds_ctl0 & ~(AR_RTSEnable | AR_CTSEnable));
355  }
356 
357  ads->ds_ctl2 = set11nTries(series, 0)
358  | set11nTries(series, 1)
359  | set11nTries(series, 2)
360  | set11nTries(series, 3)
361  | (durUpdateEn ? AR_DurUpdateEna : 0)
362  | SM(0, AR_BurstDur);
363 
364  ads->ds_ctl3 = set11nRate(series, 0)
365  | set11nRate(series, 1)
366  | set11nRate(series, 2)
367  | set11nRate(series, 3);
368 
369  ads->ds_ctl4 = set11nPktDurRTSCTS(series, 0)
370  | set11nPktDurRTSCTS(series, 1);
371 
372  ads->ds_ctl5 = set11nPktDurRTSCTS(series, 2)
373  | set11nPktDurRTSCTS(series, 3);
374 
375  ads->ds_ctl7 = set11nRateFlags(series, 0)
376  | set11nRateFlags(series, 1)
377  | set11nRateFlags(series, 2)
378  | set11nRateFlags(series, 3)
379  | SM(rtsctsRate, AR_RTSCTSRate);
380  last_ads->ds_ctl2 = ads->ds_ctl2;
381  last_ads->ds_ctl3 = ads->ds_ctl3;
382 }
u32 ds_ctl0
Definition: mac.h:280
#define ATH9K_TXDESC_CTSENA
Definition: mac.h:252
#define AR_RTSCTSRate
Definition: mac.h:441
#define AR_RTSEnable
Definition: mac.h:359
#define AR_DurUpdateEna
Definition: mac.h:382
#define set11nTries(_series, _index)
Definition: mac.h:32
#define set11nRate(_series, _index)
Definition: mac.h:35
#define set11nRateFlags(_series, _index)
Definition: mac.h:43
#define set11nPktDurRTSCTS(_series, _index)
Definition: mac.h:38
#define SM(_v, _f)
Definition: hw.h:102
#define AR_BurstDur
Definition: mac.h:380
#define AR5416DESC(_ds)
Definition: mac.h:319
uint8_t flags
Flags.
Definition: ena.h:18
#define ATH9K_TXDESC_RTSENA
Definition: mac.h:251
uint32_t ds
Definition: librm.h:140
uint32_t u32
Definition: stdint.h:24
#define AR_CTSEnable
Definition: mac.h:365

References AR5416DESC, AR_BurstDur, AR_CTSEnable, AR_DurUpdateEna, AR_RTSCTSRate, AR_RTSEnable, ATH9K_TXDESC_CTSENA, ATH9K_TXDESC_RTSENA, ds, ar5416_desc::ds_ctl0, flags, set11nPktDurRTSCTS, set11nRate, set11nRateFlags, set11nTries, and SM.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_first()

static void ar9002_hw_set11n_aggr_first ( struct ath_hw *ah  __unused,
void *  ds,
u32  aggrLen 
)
static

Definition at line 384 of file ath9k_ar9002_mac.c.

386 {
387  struct ar5416_desc *ads = AR5416DESC(ds);
388 
389  ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr);
390  ads->ds_ctl6 &= ~AR_AggrLen;
391  ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen);
392 }
#define AR_IsAggr
Definition: mac.h:378
#define AR_MoreAggr
Definition: mac.h:377
#define SM(_v, _f)
Definition: hw.h:102
#define AR5416DESC(_ds)
Definition: mac.h:319
#define AR_AggrLen
Definition: mac.h:415
u32 ds_ctl1
Definition: mac.h:281
uint32_t ds
Definition: librm.h:140

References AR5416DESC, AR_AggrLen, AR_IsAggr, AR_MoreAggr, ds, ar5416_desc::ds_ctl1, and SM.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_middle()

static void ar9002_hw_set11n_aggr_middle ( struct ath_hw *ah  __unused,
void *  ds,
u32  numDelims 
)
static

Definition at line 394 of file ath9k_ar9002_mac.c.

396 {
397  struct ar5416_desc *ads = AR5416DESC(ds);
398  unsigned int ctl6;
399 
400  ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr);
401 
402  ctl6 = ads->ds_ctl6;
403  ctl6 &= ~AR_PadDelim;
404  ctl6 |= SM(numDelims, AR_PadDelim);
405  ads->ds_ctl6 = ctl6;
406 }
#define AR_IsAggr
Definition: mac.h:378
#define AR_PadDelim
Definition: mac.h:418
#define AR_MoreAggr
Definition: mac.h:377
#define SM(_v, _f)
Definition: hw.h:102
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
u32 ctl6
Definition: mac.h:288
uint32_t ds
Definition: librm.h:140

References AR5416DESC, AR_IsAggr, AR_MoreAggr, AR_PadDelim, ar5416_desc::ctl6, ds, ar5416_desc::ds_ctl1, and SM.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_last()

static void ar9002_hw_set11n_aggr_last ( struct ath_hw *ah  __unused,
void *  ds 
)
static

Definition at line 408 of file ath9k_ar9002_mac.c.

409 {
410  struct ar5416_desc *ads = AR5416DESC(ds);
411 
412  ads->ds_ctl1 |= AR_IsAggr;
413  ads->ds_ctl1 &= ~AR_MoreAggr;
414  ads->ds_ctl6 &= ~AR_PadDelim;
415 }
#define AR_IsAggr
Definition: mac.h:378
#define AR_PadDelim
Definition: mac.h:418
#define AR_MoreAggr
Definition: mac.h:377
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
uint32_t ds
Definition: librm.h:140

References AR5416DESC, AR_IsAggr, AR_MoreAggr, AR_PadDelim, ds, and ar5416_desc::ds_ctl1.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_clr11n_aggr()

static void ar9002_hw_clr11n_aggr ( struct ath_hw *ah  __unused,
void *  ds 
)
static

Definition at line 417 of file ath9k_ar9002_mac.c.

418 {
419  struct ar5416_desc *ads = AR5416DESC(ds);
420 
421  ads->ds_ctl1 &= (~AR_IsAggr & ~AR_MoreAggr);
422 }
#define AR_IsAggr
Definition: mac.h:378
#define AR_MoreAggr
Definition: mac.h:377
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
uint32_t ds
Definition: librm.h:140

References AR5416DESC, AR_IsAggr, AR_MoreAggr, ds, and ar5416_desc::ds_ctl1.

Referenced by ar9002_hw_attach_mac_ops().

◆ ath9k_hw_setuprxdesc()

void ath9k_hw_setuprxdesc ( struct ath_hw ah,
struct ath_desc ds,
u32  size,
u32  flags 
)

Definition at line 424 of file ath9k_ar9002_mac.c.

426 {
427  struct ar5416_desc *ads = AR5416DESC(ds);
428  struct ath9k_hw_capabilities *pCap = &ah->caps;
429 
430  ads->ds_ctl1 = size & AR_BufLen;
432  ads->ds_ctl1 |= AR_RxIntrReq;
433 
434  ads->ds_rxstatus8 &= ~AR_RxDone;
435  if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
436  memset(&(ads->u), 0, sizeof(ads->u));
437 }
uint16_t size
Buffer size.
Definition: dwmac.h:14
#define AR_RxDone
Definition: mac.h:556
#define AR5416DESC(_ds)
Definition: mac.h:319
u32 ds_ctl1
Definition: mac.h:281
uint8_t flags
Flags.
Definition: ena.h:18
union ar5416_desc::@34 u
uint32_t ds
Definition: librm.h:140
#define ATH9K_RXDESC_INTREQ
Definition: mac.h:275
#define AR_RxIntrReq
Definition: mac.h:514
#define AR_BufLen
uint8_t ah
Definition: registers.h:85
void * memset(void *dest, int character, size_t len) __nonnull

References ah, AR5416DESC, AR_BufLen, AR_RxDone, AR_RxIntrReq, ATH9K_HW_CAP_AUTOSLEEP, ATH9K_RXDESC_INTREQ, ds, ar5416_desc::ds_ctl1, flags, ath9k_hw_capabilities::hw_caps, memset(), size, and ar5416_desc::u.

Referenced by ath_rx_buf_link().

◆ ar9002_hw_attach_mac_ops()

void ar9002_hw_attach_mac_ops ( struct ath_hw ah)

Definition at line 439 of file ath9k_ar9002_mac.c.

440 {
441  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
442 
446  ops->get_isr = ar9002_hw_get_isr;
456 }
static void ar9002_hw_clr11n_aggr(struct ath_hw *ah __unused, void *ds)
static void ar9002_hw_set11n_aggr_middle(struct ath_hw *ah __unused, void *ds, u32 numDelims)
static void ar9002_hw_rx_enable(struct ath_hw *ah)
void(* rx_enable)(struct ath_hw *ah)
Definition: hw.h:608
static void ar9002_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 __unused)
void(* clr11n_aggr)(struct ath_hw *ah, void *ds)
Definition: hw.h:638
static void ar9002_hw_set11n_aggr_last(struct ath_hw *ah __unused, void *ds)
void(* set11n_aggr_last)(struct ath_hw *ah, void *ds)
Definition: hw.h:637
static void ar9002_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)
int(* get_isr)(struct ath_hw *ah, enum ath9k_int *masked)
Definition: hw.h:615
static void ar9002_hw_set_desc_link(void *ds, u32 ds_link)
static int ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
static void ar9002_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)
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
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
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
static void ar9002_hw_set_clrdmask(struct ath_hw *ah __unused, void *ds, int val)
static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
void(* set_clrdmask)(struct ath_hw *ah, void *ds, int val)
Definition: hw.h:639
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
int(* proc_txdesc)(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
Definition: hw.h:620
static void ar9002_hw_set11n_aggr_first(struct ath_hw *ah __unused, void *ds, u32 aggrLen)
void(* set11n_aggr_middle)(struct ath_hw *ah, void *ds, u32 numDelims)
Definition: hw.h:635
void(* set11n_aggr_first)(struct ath_hw *ah, void *ds, u32 aggrLen)
Definition: hw.h:633
uint8_t ah
Definition: registers.h:85
static void ar9002_hw_get_desc_link(void *ds, u32 **ds_link)
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
void(* get_desc_link)(void *ds, u32 **link)
Definition: hw.h:610
void(* set_desc_link)(void *ds, u32 link)
Definition: hw.h:609

References ah, ar9002_hw_clr11n_aggr(), ar9002_hw_fill_txdesc(), ar9002_hw_get_desc_link(), ar9002_hw_get_isr(), ar9002_hw_proc_txdesc(), ar9002_hw_rx_enable(), ar9002_hw_set11n_aggr_first(), ar9002_hw_set11n_aggr_last(), ar9002_hw_set11n_aggr_middle(), ar9002_hw_set11n_ratescenario(), ar9002_hw_set11n_txdesc(), ar9002_hw_set_clrdmask(), ar9002_hw_set_desc_link(), ath9k_hw_ops(), ath_hw_ops::clr11n_aggr, ath_hw_ops::fill_txdesc, ath_hw_ops::get_desc_link, ath_hw_ops::get_isr, ath_hw_ops::proc_txdesc, ath_hw_ops::rx_enable, ath_hw_ops::set11n_aggr_first, ath_hw_ops::set11n_aggr_last, ath_hw_ops::set11n_aggr_middle, ath_hw_ops::set11n_ratescenario, ath_hw_ops::set11n_txdesc, ath_hw_ops::set_clrdmask, and ath_hw_ops::set_desc_link.

Referenced by ar9002_hw_attach_ops().