Setting up repository
[linux-libre-firmware.git] / ath9k_htc / target_firmware / magpie_fw_dev / target / inc / magpie / dma_lib.h
1 #ifndef __DMA_LIB_H
2 #define __DMA_LIB_H
3
4
5 /***********************External***************************/
6
7 /**
8  * @brief DMA engine numbers, HIF need to map them to there
9  *        respective order
10  */
11 typedef enum dma_engine{
12     DMA_ENGINE_RX0,
13     DMA_ENGINE_RX1,
14     DMA_ENGINE_RX2,
15     DMA_ENGINE_RX3,
16     DMA_ENGINE_TX0,
17     DMA_ENGINE_TX1,
18     DMA_ENGINE_MAX
19 }dma_engine_t;
20
21 /**
22  * @brief Interface type, each HIF should call with its own interface type
23  */
24 typedef enum dma_iftype{
25     DMA_IF_GMAC = 0x0,/* GMAC */
26     DMA_IF_PCI  = 0x1,/*PCI */
27     DMA_IF_PCIE = 0x2 /*PCI Express */
28 }dma_iftype_t;
29
30
31 struct dma_lib_api{
32     A_UINT16  (*tx_init)(dma_engine_t eng_no, dma_iftype_t  if_type);
33     void        (*tx_start)(dma_engine_t eng_no);
34     A_UINT16  (*rx_init)(dma_engine_t eng_no, dma_iftype_t  if_type);
35     void        (*rx_config)(dma_engine_t eng_no, a_uint16_t num_desc,
36                                                  a_uint16_t   gran);
37     void        (*rx_start)(dma_engine_t  eng_no); 
38     A_UINT32  (*intr_status)(dma_iftype_t  if_type);
39     A_UINT16  (*hard_xmit)(dma_engine_t eng_no, VBUF *buf);
40     void        (*flush_xmit)(dma_engine_t  eng_no);
41     A_UINT16    (*xmit_done)(dma_engine_t   eng_no);
42     VBUF *      (*reap_xmitted)(dma_engine_t  eng_no);
43     VBUF *      (*reap_recv)(dma_engine_t  eng_no);
44     void        (*return_recv)(dma_engine_t  eng_no, VBUF *buf);
45     A_UINT16    (*recv_pkt)(dma_engine_t  eng_no);
46 };
47
48
49 /**
50  * @brief Install the DMA lib api's this for ROM patching
51  *        support
52  * 
53  * @param apis
54  */
55 void        dma_lib_module_install(struct dma_lib_api  *apis);
56
57 #endif