ebus_dma.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __ASM_SPARC_EBUS_DMA_H
  2. #define __ASM_SPARC_EBUS_DMA_H
  3. struct ebus_dma_info {
  4. spinlock_t lock;
  5. void __iomem *regs;
  6. unsigned int flags;
  7. #define EBUS_DMA_FLAG_USE_EBDMA_HANDLER 0x00000001
  8. #define EBUS_DMA_FLAG_TCI_DISABLE 0x00000002
  9. /* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
  10. * set.
  11. */
  12. void (*callback)(struct ebus_dma_info *p, int event, void *cookie);
  13. void *client_cookie;
  14. unsigned int irq;
  15. #define EBUS_DMA_EVENT_ERROR 1
  16. #define EBUS_DMA_EVENT_DMA 2
  17. #define EBUS_DMA_EVENT_DEVICE 4
  18. unsigned char name[64];
  19. };
  20. int ebus_dma_register(struct ebus_dma_info *p);
  21. int ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
  22. void ebus_dma_unregister(struct ebus_dma_info *p);
  23. int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
  24. size_t len);
  25. void ebus_dma_prepare(struct ebus_dma_info *p, int write);
  26. unsigned int ebus_dma_residue(struct ebus_dma_info *p);
  27. unsigned int ebus_dma_addr(struct ebus_dma_info *p);
  28. void ebus_dma_enable(struct ebus_dma_info *p, int on);
  29. #endif /* __ASM_SPARC_EBUS_DMA_H */