cobalt-omnitek.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Omnitek Scatter-Gather DMA Controller
  4. *
  5. * Copyright 2012-2015 Cisco Systems, Inc. and/or its affiliates.
  6. * All rights reserved.
  7. */
  8. #ifndef COBALT_OMNITEK_H
  9. #define COBALT_OMNITEK_H
  10. #include <linux/scatterlist.h>
  11. #include "cobalt-driver.h"
  12. struct sg_dma_descriptor {
  13. u32 pci_l;
  14. u32 pci_h;
  15. u32 local;
  16. u32 reserved0;
  17. u32 next_l;
  18. u32 next_h;
  19. u32 bytes;
  20. u32 reserved1;
  21. };
  22. int omni_sg_dma_init(struct cobalt *cobalt);
  23. void omni_sg_dma_abort_channel(struct cobalt_stream *s);
  24. void omni_sg_dma_start(struct cobalt_stream *s, struct sg_dma_desc_info *desc);
  25. bool is_dma_done(struct cobalt_stream *s);
  26. int descriptor_list_create(struct cobalt *cobalt,
  27. struct scatterlist *scatter_list, bool to_pci, unsigned sglen,
  28. unsigned size, unsigned width, unsigned stride,
  29. struct sg_dma_desc_info *desc);
  30. void descriptor_list_chain(struct sg_dma_desc_info *this,
  31. struct sg_dma_desc_info *next);
  32. void descriptor_list_loopback(struct sg_dma_desc_info *desc);
  33. void descriptor_list_end_of_chain(struct sg_dma_desc_info *desc);
  34. void *descriptor_list_allocate(struct sg_dma_desc_info *desc, size_t bytes);
  35. void descriptor_list_free(struct sg_dma_desc_info *desc);
  36. void descriptor_list_interrupt_enable(struct sg_dma_desc_info *desc);
  37. void descriptor_list_interrupt_disable(struct sg_dma_desc_info *desc);
  38. #endif