Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Omnitek Scatter-Gather DMA Controller
0004  *
0005  *  Copyright 2012-2015 Cisco Systems, Inc. and/or its affiliates.
0006  *  All rights reserved.
0007  */
0008 
0009 #ifndef COBALT_OMNITEK_H
0010 #define COBALT_OMNITEK_H
0011 
0012 #include <linux/scatterlist.h>
0013 #include "cobalt-driver.h"
0014 
0015 struct sg_dma_descriptor {
0016     u32 pci_l;
0017     u32 pci_h;
0018 
0019     u32 local;
0020     u32 reserved0;
0021 
0022     u32 next_l;
0023     u32 next_h;
0024 
0025     u32 bytes;
0026     u32 reserved1;
0027 };
0028 
0029 int omni_sg_dma_init(struct cobalt *cobalt);
0030 void omni_sg_dma_abort_channel(struct cobalt_stream *s);
0031 void omni_sg_dma_start(struct cobalt_stream *s, struct sg_dma_desc_info *desc);
0032 bool is_dma_done(struct cobalt_stream *s);
0033 
0034 int descriptor_list_create(struct cobalt *cobalt,
0035     struct scatterlist *scatter_list, bool to_pci, unsigned sglen,
0036     unsigned size, unsigned width, unsigned stride,
0037     struct sg_dma_desc_info *desc);
0038 
0039 void descriptor_list_chain(struct sg_dma_desc_info *this,
0040                struct sg_dma_desc_info *next);
0041 void descriptor_list_loopback(struct sg_dma_desc_info *desc);
0042 void descriptor_list_end_of_chain(struct sg_dma_desc_info *desc);
0043 
0044 void *descriptor_list_allocate(struct sg_dma_desc_info *desc, size_t bytes);
0045 void descriptor_list_free(struct sg_dma_desc_info *desc);
0046 
0047 void descriptor_list_interrupt_enable(struct sg_dma_desc_info *desc);
0048 void descriptor_list_interrupt_disable(struct sg_dma_desc_info *desc);
0049 
0050 #endif