iPXE
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()

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
Definition reg.h:25
#define AR_CR_RXE
Definition reg.h:26
#define REG_WRITE(_ah, _reg, _val)
Definition hw.h:78
uint8_t ah
Definition registers.h:1

References ah, AR_CR, AR_CR_RXE, and REG_WRITE.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set_desc_link()

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}
u32 ds_link
Definition desc.h:0
uint32_t ds
Definition librm.h:5

References ds, ds_link, and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_get_desc_link()

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}

References ds, ds_link, and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_get_isr()

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)) {
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;
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) &&
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_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_ISR_S0_QCU_TXOK
Definition reg.h:209
#define AR_ISR_S0_S
Definition reg.h:335
#define AR_ISR_S0_QCU_TXDESC
Definition reg.h:211
#define AR_RC_HOSTIF
Definition reg.h:697
#define AR_ISR_TXDESC
Definition reg.h:182
#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_ISR_TXEOL
Definition reg.h:185
#define AR_ISR_RXORN
Definition reg.h:180
#define AR_ISR_S1_QCU_TXERR
Definition reg.h:215
#define AR_ISR_S2_DTIMSYNC
Definition reg.h:227
#define AR_IER_ENABLE
Definition reg.h:56
#define AR_ISR_S5_GENTIMER_THRESH
Definition reg.h:252
#define AR_SREV_9100(ah)
Definition reg.h:811
#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_S2_TIM
Definition reg.h:225
#define AR_ISR_TXOK
Definition reg.h:181
#define AR_ISR_GENTMR
Definition reg.h:201
#define AR_ISR_TXERR
Definition reg.h:183
#define AR_ISR_S2_CST
Definition reg.h:223
#define AR_ISR_S1_S
Definition reg.h:341
#define AR_ISR_S2_DTIM
Definition reg.h:230
#define AR_ISR_S2_GTT
Definition reg.h:224
#define AR_ISR_RXOK
Definition reg.h:173
#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_RTC_STATUS_ON
Definition reg.h:1209
#define AR_ISR_BCNMISC
Definition reg.h:196
#define AR_ISR_S1_QCU_TXEOL
Definition reg.h:217
@ AR_INTR_SYNC_RADM_CPL_TIMEOUT
Definition reg.h:944
@ AR_INTR_SYNC_HOST1_FATAL
Definition reg.h:937
@ AR_INTR_SYNC_HOST1_PERR
Definition reg.h:938
@ AR_INTR_SYNC_LOCAL_TIMEOUT
Definition reg.h:945
@ AR_INTR_SYNC_DEFAULT
Definition reg.h:953
#define AR_ISR_S5_TIM_TIMER
Definition reg.h:245
#define AR_RC
Definition reg.h:694
#define AR_RTC_STATUS
Definition reg.h:1200
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
@ ATH9K_HW_CAP_AUTOSLEEP
Definition hw.h:185
#define MS(_v, _f)
Definition hw.h:103
#define REG_READ(_ah, _reg)
Definition hw.h:81
@ ATH9K_INT_CST
Definition hw.h:278
@ ATH9K_INT_GENTIMER
Definition hw.h:277
@ ATH9K_INT_RX
Definition hw.h:253
@ ATH9K_INT_GTT
Definition hw.h:279
@ ATH9K_INT_COMMON
Definition hw.h:287
@ ATH9K_INT_CABEND
Definition hw.h:275
@ ATH9K_INT_TX
Definition hw.h:260
@ ATH9K_INT_DTIM
Definition hw.h:272
@ ATH9K_INT_DTIMSYNC
Definition hw.h:273
@ ATH9K_INT_TIM
Definition hw.h:271
@ ATH9K_INT_TSFOOR
Definition hw.h:276
@ ATH9K_INT_TIM_TIMER
Definition hw.h:262
@ ATH9K_INT_FATAL
Definition hw.h:280
@ isr
Definition sis900.h:26
#define u32
Definition vga.h:21

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, REG_WRITE, and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_fill_txdesc()

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}
#define AR_TxMore
Definition mac.h:367
#define AR5416DESC(_ds)
Definition mac.h:319
#define AR5416DESC_CONST(_ds)
Definition mac.h:320
u32 ds_data
Definition mac.h:279
u32 ds_ctl1
Definition mac.h:281
u32 ds_ctl0
Definition mac.h:280

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

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_proc_txdesc()

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
229 ts->tid = MS(status, AR_TxTid);
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)
246 else {
249 if (status & AR_Filtered)
251 if (status & AR_FIFOUnderrun) {
254 }
255 }
258 if (status & AR_DescCfgErr)
263 }
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}
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48
int ath9k_hw_updatetxtriglevel(struct ath_hw *ah, int bIncTrigLevel)
ath9k_hw_updatetxtriglevel - adjusts the frame trigger level
Definition ath9k_mac.c:103
uint8_t status
Status.
Definition ena.h:5
#define EINPROGRESS
Operation in progress.
Definition errno.h:419
#define AR_ExcessiveRetries
Definition mac.h:464
#define ATH9K_TX_BA
Definition mac.h:94
#define AR_DataFailCnt
Definition mac.h:469
#define AR_TxRSSIAnt02
Definition mac.h:452
#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_TxDone
Definition mac.h:499
#define AR_TxDelimUnderrun
Definition mac.h:473
#define AR_RTSFailCnt
Definition mac.h:467
#define AR_TxOpExceeded
Definition mac.h:503
#define ATH9K_TX_ACKED
Definition mac.h:89
#define AR_TxRSSIAnt00
Definition mac.h:448
#define ATH9K_TXERR_FIFO
Definition mac.h:86
#define ATH9K_TX_DELIM_UNDERRUN
Definition mac.h:98
#define ATH9K_TXERR_FILT
Definition mac.h:85
#define AR_TxBaStatus
Definition mac.h:455
#define AR_FinalTxIdx
Definition mac.h:505
#define ATH9K_TXERR_XRETRY
Definition mac.h:84
#define AR_DescCfgErr
Definition mac.h:475
#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_TxTimerExpired
Definition mac.h:476
#define AR_FrmXmitOK
Definition mac.h:463
#define ATH9K_TX_DESC_CFG_ERR
Definition mac.h:96
#define AR_TxTid
Definition mac.h:492
#define AR_FIFOUnderrun
Definition mac.h:465
#define AR_TxRSSIAnt12
Definition mac.h:487
#define AR_Filtered
Definition mac.h:466
#define AR_TxRSSIAnt01
Definition mac.h:450
#define ATH9K_TXERR_XTXOP
Definition mac.h:87
#define AR_TxRSSIAnt11
Definition mac.h:485
#define AR_SeqNum
Definition mac.h:500
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
u32 evm0
Definition mac.h:132
int8_t ts_rssi
Definition mac.h:116
u32 evm1
Definition mac.h:133
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
u32 evm2
Definition mac.h:134
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

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, typeof(), and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_txdesc()

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)
300 | (keyIx != ATH9K_TXKEYIX_INVALID ? AR_DestIdxValid : 0);
301
302 ads->ds_ctl1 =
303 (keyIx != ATH9K_TXKEYIX_INVALID ? SM(keyIx, AR_DestIdx) : 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 AR_SREV_9285(_ah)
Definition reg.h:830
#define AR_SREV_9271(_ah)
Definition reg.h:854
uint32_t type
Operating system type.
Definition ena.h:1
uint8_t flags
Flags.
Definition ena.h:7
#define SM(_v, _f)
Definition hw.h:102
#define AR_VirtMoreFrag
Definition mac.h:355
#define ATH9K_TXDESC_VMF
Definition mac.h:270
#define AR_ExtOnly
Definition mac.h:375
#define AR_TxIntrReq
Definition mac.h:363
#define AR_FrameType
Definition mac.h:370
#define ATH9K_TXDESC_INTREQ
Definition mac.h:266
#define AR_XmitPower
Definition mac.h:357
#define ATH9K_TXDESC_VEOL
Definition mac.h:267
#define AR_EncrType
Definition mac.h:420
#define AR_VEOL
Definition mac.h:360
#define AR_NoAck
Definition mac.h:372
#define AR_DestIdxValid
Definition mac.h:364
#define ATH9K_TXKEYIX_INVALID
Definition mac.h:205
#define AR_FrameLen
Definition mac.h:354
#define AR_ExtAndCtl
Definition mac.h:376
#define ATH9K_TXDESC_NOACK
Definition mac.h:250
#define AR_DestIdx
Definition mac.h:368
#define ATH9K_TXDESC_EXT_ONLY
Definition mac.h:268
#define ATH9K_TXDESC_EXT_AND_CTL
Definition mac.h:269

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, type, and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set_clrdmask()

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}
void __asmcall int val
Definition setjmp.h:12
#define AR_ClrDestMask
Definition mac.h:361

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

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_ratescenario()

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
346 } else {
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}
#define ATH9K_TXDESC_RTSENA
Definition mac.h:251
#define set11nPktDurRTSCTS(_series, _index)
Definition mac.h:38
#define AR_BurstDur
Definition mac.h:380
#define AR_DurUpdateEna
Definition mac.h:382
#define AR_CTSEnable
Definition mac.h:365
#define ATH9K_TXDESC_CTSENA
Definition mac.h:252
#define set11nRateFlags(_series, _index)
Definition mac.h:43
#define AR_RTSCTSRate
Definition mac.h:441
#define AR_RTSEnable
Definition mac.h:359
#define set11nTries(_series, _index)
Definition mac.h:32
#define set11nRate(_series, _index)
Definition mac.h:35

References __unused, ah, 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, SM, and u32.

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_first()

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 AR_AggrLen
Definition mac.h:415

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

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_middle()

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;
404 ctl6 |= SM(numDelims, AR_PadDelim);
405 ads->ds_ctl6 = ctl6;
406}
#define AR_PadDelim
Definition mac.h:418
u32 ctl6
Definition mac.h:288

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

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_set11n_aggr_last()

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}

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

Referenced by ar9002_hw_attach_mac_ops().

◆ ar9002_hw_clr11n_aggr()

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}

References __unused, ah, 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}
#define AR_BufLen
Definition ar9003_mac.h:34
uint16_t size
Buffer size.
Definition dwmac.h:3
void * memset(void *dest, int character, size_t len) __nonnull
#define AR_RxIntrReq
Definition mac.h:514
#define AR_RxDone
Definition mac.h:556
#define ATH9K_RXDESC_INTREQ
Definition mac.h:275
union ar5416_desc::@121210011246275171146040323047134135046230216042 u

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, ar5416_desc::u, and u32.

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
456}
static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
static void ar9002_hw_get_desc_link(void *ds, u32 **ds_link)
static void ar9002_hw_set11n_aggr_first(struct ath_hw *ah __unused, void *ds, u32 aggrLen)
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 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_set_clrdmask(struct ath_hw *ah __unused, void *ds, int val)
static void ar9002_hw_set11n_aggr_last(struct ath_hw *ah __unused, void *ds)
static void ar9002_hw_rx_enable(struct ath_hw *ah)
static void ar9002_hw_set11n_aggr_middle(struct ath_hw *ah __unused, void *ds, u32 numDelims)
static void ar9002_hw_clr11n_aggr(struct ath_hw *ah __unused, void *ds)
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)
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition hw.h:885
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

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().