libpdma.h

00001 /* #pragma ident "@(#)libpdma.h 1.15 04/23/07 EDT" */
00002 
00003 /*
00004  * See /opt/EDTpcd/README.pdma
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) /* 1024 */
00012 #define PDMA_PAGESIZE (PDMA_MAX_SIZE / 512) /* 4096 */
00013 
00014 typedef struct {
00015     u_int  *dma_sglist;                    /* mmap to driver sglist     */
00016     u_int   dma_sglist_copy[PDMA_SG_SIZE]; /* copy of original sglist   */
00017     u_int  *dmacmd;                        /* mmap to SG_NXT_CNT_CTRL   */
00018     u_int  *dmaaddr;                       /* mmap to SG_NXT_CNT_ADDR   */
00019     u_int  *dmacfg;                        /* mmap to EDT_DMA_INTCFG    */
00020     u_int  *dmacnt;                        /* mmap to EDT_DMA_CUR_CNT   */
00021     u_char *off_p;                         /* mmap to intfc reg index   */
00022     u_char *data_p;                        /* mmap to intfc reg data    */
00023     u_int   dma_count;                     /* num sglist entries        */
00024     u_int   sv_dma_cfg;                    /* saved dma_cfg state       */
00025     u_int   sg_paddr;                      /* sg physical address       */
00026     u_int   pdma_size;                     /* max configured pdma size  */
00027     u_int   dma_intr_en;                   /* enable dma intr when != 0 */
00028     u_char **pdma_databufs;                /* pdma data buffer          */
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 /* _LIBPDMA_H */

Generated on 19 Jun 2015 by  doxygen 1.4.7