diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-04-15 17:39:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:44 -0400 |
commit | 744d402580f959072f6b805a98745837f185c8e0 (patch) | |
tree | 660ea24e3a9d7326d63c249f02a10a7e047be1cf | |
parent | cc610ac0557b0ad0dcffdff1230cef28a970d755 (diff) |
ath9k_hw: Add function to configure tx status ring buffer
Also reset tx status ring suring chip reset.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 3 |
5 files changed, 59 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index c270bbe25168..81ad09a7ddff 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c | |||
@@ -347,3 +347,33 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, | |||
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
349 | EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); | 349 | EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); |
350 | |||
351 | void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah) | ||
352 | { | ||
353 | ah->ts_tail = 0; | ||
354 | |||
355 | memset((void *) ah->ts_ring, 0, | ||
356 | ah->ts_size * sizeof(struct ar9003_txs)); | ||
357 | |||
358 | ath_print(ath9k_hw_common(ah), ATH_DBG_XMIT, | ||
359 | "TS Start 0x%x End 0x%x Virt %p, Size %d\n", | ||
360 | ah->ts_paddr_start, ah->ts_paddr_end, | ||
361 | ah->ts_ring, ah->ts_size); | ||
362 | |||
363 | REG_WRITE(ah, AR_Q_STATUS_RING_START, ah->ts_paddr_start); | ||
364 | REG_WRITE(ah, AR_Q_STATUS_RING_END, ah->ts_paddr_end); | ||
365 | } | ||
366 | |||
367 | void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start, | ||
368 | u32 ts_paddr_start, | ||
369 | u8 size) | ||
370 | { | ||
371 | |||
372 | ah->ts_paddr_start = ts_paddr_start; | ||
373 | ah->ts_paddr_end = ts_paddr_start + (size * sizeof(struct ar9003_txs)); | ||
374 | ah->ts_size = size; | ||
375 | ah->ts_ring = (struct ar9003_txs *) ts_start; | ||
376 | |||
377 | ath9k_hw_reset_txstatus_ring(ah); | ||
378 | } | ||
379 | EXPORT_SYMBOL(ath9k_hw_setup_statusring); | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.h b/drivers/net/wireless/ath/ath9k/ar9003_mac.h index 2ba06d7674e8..ef7999636ea0 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.h | |||
@@ -73,6 +73,18 @@ struct ar9003_txc { | |||
73 | u32 pad[9]; /* pad to cache line (128 bytes/32 dwords) */ | 73 | u32 pad[9]; /* pad to cache line (128 bytes/32 dwords) */ |
74 | } __packed; | 74 | } __packed; |
75 | 75 | ||
76 | struct ar9003_txs { | ||
77 | u32 ds_info; | ||
78 | u32 status1; | ||
79 | u32 status2; | ||
80 | u32 status3; | ||
81 | u32 status4; | ||
82 | u32 status5; | ||
83 | u32 status6; | ||
84 | u32 status7; | ||
85 | u32 status8; | ||
86 | } __packed; | ||
87 | |||
76 | void ar9003_hw_attach_mac_ops(struct ath_hw *hw); | 88 | void ar9003_hw_attach_mac_ops(struct ath_hw *hw); |
77 | void ath9k_hw_set_rx_bufsize(struct ath_hw *ah, u16 buf_size); | 89 | void ath9k_hw_set_rx_bufsize(struct ath_hw *ah, u16 buf_size); |
78 | void ath9k_hw_addrxbuf_edma(struct ath_hw *ah, u32 rxdp, | 90 | void ath9k_hw_addrxbuf_edma(struct ath_hw *ah, u32 rxdp, |
@@ -81,5 +93,8 @@ void ath9k_hw_addrxbuf_edma(struct ath_hw *ah, u32 rxdp, | |||
81 | int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, | 93 | int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, |
82 | struct ath_rx_status *rxs, | 94 | struct ath_rx_status *rxs, |
83 | void *buf_addr); | 95 | void *buf_addr); |
84 | 96 | void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah); | |
97 | void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start, | ||
98 | u32 ts_paddr_start, | ||
99 | u8 size); | ||
85 | #endif | 100 | #endif |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 824dd9e72564..19e2c3cd1473 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -895,6 +895,9 @@ static inline void ath9k_hw_set_dma(struct ath_hw *ah) | |||
895 | REG_WRITE(ah, AR_PCU_TXBUF_CTRL, | 895 | REG_WRITE(ah, AR_PCU_TXBUF_CTRL, |
896 | AR_PCU_TXBUF_CTRL_USABLE_SIZE); | 896 | AR_PCU_TXBUF_CTRL_USABLE_SIZE); |
897 | } | 897 | } |
898 | |||
899 | if (AR_SREV_9300_20_OR_LATER(ah)) | ||
900 | ath9k_hw_reset_txstatus_ring(ah); | ||
898 | } | 901 | } |
899 | 902 | ||
900 | static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) | 903 | static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 457d8ddebf83..6dbbab95df59 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -761,6 +761,13 @@ struct ath_hw { | |||
761 | u32 intr_gen_timer_trigger; | 761 | u32 intr_gen_timer_trigger; |
762 | u32 intr_gen_timer_thresh; | 762 | u32 intr_gen_timer_thresh; |
763 | struct ath_gen_timer_table hw_gen_timers; | 763 | struct ath_gen_timer_table hw_gen_timers; |
764 | |||
765 | struct ar9003_txs *ts_ring; | ||
766 | void *ts_start; | ||
767 | u32 ts_paddr_start; | ||
768 | u32 ts_paddr_end; | ||
769 | u16 ts_tail; | ||
770 | u8 ts_size; | ||
764 | }; | 771 | }; |
765 | 772 | ||
766 | static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah) | 773 | static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah) |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 2ca478c802c4..ff8914049c53 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -383,6 +383,9 @@ | |||
383 | #define AR_Q9_TXDP 0x0824 | 383 | #define AR_Q9_TXDP 0x0824 |
384 | #define AR_QTXDP(_i) (AR_Q0_TXDP + ((_i)<<2)) | 384 | #define AR_QTXDP(_i) (AR_Q0_TXDP + ((_i)<<2)) |
385 | 385 | ||
386 | #define AR_Q_STATUS_RING_START 0x830 | ||
387 | #define AR_Q_STATUS_RING_END 0x834 | ||
388 | |||
386 | #define AR_Q_TXE 0x0840 | 389 | #define AR_Q_TXE 0x0840 |
387 | #define AR_Q_TXE_M 0x000003FF | 390 | #define AR_Q_TXE_M 0x000003FF |
388 | 391 | ||