00001
00002
00003
00004
00005
00006
00007 #ifndef _LIBPDMA_H_
00008 #define _LIBPDMA_H_
00009
00010 #define PDMA_MAX_SIZE (2*1024*1024)
00011 #define PDMA_SG_SIZE (PDMA_MAX_SIZE / 2048)
00012 #define PDMA_PAGESIZE (PDMA_MAX_SIZE / 512)
00013
00014 typedef struct {
00015 u_int *dma_sglist;
00016 u_int dma_sglist_copy[PDMA_SG_SIZE];
00017 u_int *dmacmd;
00018 u_int *dmaaddr;
00019 u_int *dmacfg;
00020 u_int *dmacnt;
00021 u_char *off_p;
00022 u_char *data_p;
00023 u_int dma_count;
00024 u_int sv_dma_cfg;
00025 u_int sg_paddr;
00026 u_int pdma_size;
00027 u_int dma_intr_en;
00028 u_char **pdma_databufs;
00029 } Pdma_t;
00030
00031 int pdma_init(EdtDev *edt_p, int bufsize, int numbufs, u_char **bufs);
00032 int pdma_close(EdtDev *edt_p);
00033 int pdma_set_size(EdtDev *edt_p, int size);
00034 int pdma_write_databuf(EdtDev *edt_p, int bufnum, void *buf, int size);
00035 int pdma_start_dma(EdtDev *edt_p);
00036 int pdma_flush_fifo(EdtDev *edt_p);
00037 int pdma_abort_dma(EdtDev * edt_p);
00038 void pdma_dmaint_enable(EdtDev * edt_p, int enable);
00039
00040 #endif