1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Omnitek Scatter-Gather DMA Controller
5 * Copyright 2012-2015 Cisco Systems, Inc. and/or its affiliates.
9 #ifndef COBALT_OMNITEK_H
10 #define COBALT_OMNITEK_H
12 #include <linux/scatterlist.h>
13 #include "cobalt-driver.h"
15 struct sg_dma_descriptor
{
29 int omni_sg_dma_init(struct cobalt
*cobalt
);
30 void omni_sg_dma_abort_channel(struct cobalt_stream
*s
);
31 void omni_sg_dma_start(struct cobalt_stream
*s
, struct sg_dma_desc_info
*desc
);
32 bool is_dma_done(struct cobalt_stream
*s
);
34 int descriptor_list_create(struct cobalt
*cobalt
,
35 struct scatterlist
*scatter_list
, bool to_pci
, unsigned sglen
,
36 unsigned size
, unsigned width
, unsigned stride
,
37 struct sg_dma_desc_info
*desc
);
39 void descriptor_list_chain(struct sg_dma_desc_info
*this,
40 struct sg_dma_desc_info
*next
);
41 void descriptor_list_loopback(struct sg_dma_desc_info
*desc
);
42 void descriptor_list_end_of_chain(struct sg_dma_desc_info
*desc
);
44 void *descriptor_list_allocate(struct sg_dma_desc_info
*desc
, size_t bytes
);
45 void descriptor_list_free(struct sg_dma_desc_info
*desc
);
47 void descriptor_list_interrupt_enable(struct sg_dma_desc_info
*desc
);
48 void descriptor_list_interrupt_disable(struct sg_dma_desc_info
*desc
);