32 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
68 for (i = 1000; i > 0 &&
75 "failed to stop RX DMA !\n");
77 return i ? 0 : -
EBUSY;
102 "tried to set RXDP while rx was active !\n");
106 ath5k_hw_reg_write(ah, phys_addr,
AR5K_RXDP);
141 tx_queue = ath5k_hw_reg_read(ah,
AR5K_CR);
146 switch (ah->
ah_txq[queue].tqi_type) {
164 ath5k_hw_reg_write(ah, tx_queue,
AR5K_CR);
165 ath5k_hw_reg_read(ah,
AR5K_CR);
188 ath5k_hw_stop_tx_dma(
struct ath5k_hw *ah,
unsigned int queue)
200 tx_queue = ath5k_hw_reg_read(ah,
AR5K_CR);
205 switch (ah->
ah_txq[queue].tqi_type) {
213 ath5k_hw_reg_write(ah, 0,
AR5K_BSR);
220 ath5k_hw_reg_write(ah, tx_queue,
AR5K_CR);
221 ath5k_hw_reg_read(ah,
AR5K_CR);
237 for (i = 1000; i > 0 &&
244 "queue %i didn't stop !\n", queue);
249 pending = ath5k_hw_reg_read(ah,
253 }
while (--i && pending);
260 ath5k_hw_reg_write(ah,
266 ath5k_hw_reg_write(ah,
285 pending = ath5k_hw_reg_read(ah,
289 }
while (--i && pending);
296 "quiet mechanism didn't work q:%i !\n",
310 "tx dma didn't stop (q:%i, frm:%i) !\n",
331 ret = ath5k_hw_stop_tx_dma(ah, queue);
334 "beacon queue didn't stop !\n");
364 switch (ah->
ah_txq[queue].tqi_type) {
379 return ath5k_hw_reg_read(ah, tx_reg);
407 switch (ah->
ah_txq[queue].tqi_type) {
431 ath5k_hw_reg_write(ah, phys_addr, tx_reg);
508 return ath5k_hw_reg_read(ah,
AR5K_INTPEND) == 1 ? 1 : 0;
539 isr = ath5k_hw_reg_read(ah,
AR5K_ISR);
541 *interrupt_mask =
isr;
577 *interrupt_mask = pisr;
634 ath5k_hw_reg_write(ah, pisr_clear,
AR5K_PISR);
784 if (new_mask & AR5K_INT_TIM)
801 ath5k_hw_reg_write(ah, int_mask,
AR5K_PIMR);
811 ath5k_hw_reg_write(ah, int_mask,
AR5K_IMR);
823 if (new_mask & AR5K_INT_GLOBAL) {
896 err = ath5k_hw_stop_rx_dma(ah);
903 ath5k_hw_reg_write(ah, 0xffffffff,
AR5K_PISR);
911 for (i = 0; i < qmax; i++) {
912 err = ath5k_hw_stop_tx_dma(ah, i);
914 if (err && err != -
EINVAL)