Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:53

0001 /**
0002  *  @file
0003  *
0004  *  @ingroup shared_bspvmedmalist
0005  *
0006  *  @brief This header should only be used inside a BSP
0007  * chosing to use bspVmeDmaList for implementing VMEDMA.h
0008  */
0009 
0010 #ifndef BSP_VME_DMA_LIST_H
0011 #define BSP_VME_DMA_LIST_H
0012 
0013 
0014 
0015 /*
0016  * The bspVmeDmaList utility implements part of the API defined by
0017  * 'VMEDMA.h' namely all 'VMEDmaListDescriptor' related entry points:
0018  *
0019  * BSP_VMEDmaListDescriptorDestroy(),
0020  * BSP_VMEDmaListDestroy(),
0021  * BSP_VMEDmaListDescriptorEnq(),
0022  * BSP_VMEDmaListDescriptorNext(),
0023  * BSP_VMEDmaListDescriptorPrev(),
0024  * BSP_VMEDmaListDescriptorSetUsr(),
0025  * BSP_VMEDmaListDescriptorGetUsr(),
0026  * BSP_VMEDmaListRefresh()
0027  *
0028  * Also, it provides helper routines to assist BSPs with implementing
0029  *
0030  * BSP_VMEDmaListDescriptorSetup()
0031  *
0032  * and
0033  *
0034  * BSP_VMEDmaListStart()
0035  *
0036  * by providing
0037  *
0038  * BSP_VMEDmaListDescriptorNewTool(),
0039  * BSP_VMEDmaListDescriptorSetupTool(),
0040  *
0041  * and
0042  *
0043  * BSP_VMEDmaListDescriptorStartTool()
0044  */
0045 
0046 /*
0047  * Authorship
0048  * ----------
0049  * This software was created by
0050  *     Till Straumann <strauman@slac.stanford.edu>, 2006, 2007
0051  *     Stanford Linear Accelerator Center, Stanford University.
0052  *
0053  * Acknowledgement of sponsorship
0054  * ------------------------------
0055  * This software was produced by
0056  *     the Stanford Linear Accelerator Center, Stanford University,
0057  *     under Contract DE-AC03-76SFO0515 with the Department of Energy.
0058  *
0059  * Government disclaimer of liability
0060  * ----------------------------------
0061  * Neither the United States nor the United States Department of Energy,
0062  * nor any of their employees, makes any warranty, express or implied, or
0063  * assumes any legal liability or responsibility for the accuracy,
0064  * completeness, or usefulness of any data, apparatus, product, or process
0065  * disclosed, or represents that its use would not infringe privately owned
0066  * rights.
0067  *
0068  * Stanford disclaimer of liability
0069  * --------------------------------
0070  * Stanford University makes no representations or warranties, express or
0071  * implied, nor assumes any liability for the use of this software.
0072  *
0073  * Stanford disclaimer of copyright
0074  * --------------------------------
0075  * Stanford University, owner of the copyright, hereby disclaims its
0076  * copyright and all other rights in this software.  Hence, anyone may
0077  * freely use it for any purpose without restriction.
0078  *
0079  * Maintenance of notices
0080  * ----------------------
0081  * In the interest of clarity regarding the origin and status of this
0082  * SLAC software, this and all the preceding Stanford University notices
0083  * are to remain affixed to any copy or derivative of this software made
0084  * or distributed by the recipient and are to be affixed to any copy of
0085  * software made or distributed by the recipient that contains a copy or
0086  * derivative of this software.
0087  *
0088  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
0089  */
0090 #include <stdint.h>
0091 
0092 #include <bsp/VMEDMA.h>
0093 
0094 #ifdef __cplusplus
0095 extern "C" {
0096 #endif
0097 
0098 typedef struct VMEDmaListNodeRec_    *VMEDmaListNode;
0099 
0100 typedef struct VMEDmaListClassRec_   *VMEDmaListClass;
0101 
0102 /**
0103  *  @defgroup shared_bspvmedmalist Create and setup a new descriptor.
0104  *
0105  *  @ingroup shared_vmeuniverse
0106  *
0107  *  @brief The BSP must supply the appropriate controller class.
0108  */
0109 
0110 VMEDmaListNode
0111 BSP_VMEDmaListDescriptorNewTool(
0112         VMEDmaListClass pc,
0113         uint32_t    attr_mask,
0114         uint32_t    xfer_mode,
0115         uint32_t    pci_addr,
0116         uint32_t    vme_addr,
0117         uint32_t    n_bytes);
0118 
0119 /* Setup an existing descriptor */
0120 VMEDmaListNode
0121 BSP_VMEDmaListDescriptorSetupTool(
0122         VMEDmaListNode n,
0123         uint32_t    attr_mask,
0124         uint32_t    xfer_mode,
0125         uint32_t    pci_addr,
0126         uint32_t    vme_addr,
0127         uint32_t    n_bytes);
0128 
0129 
0130 /* Start a list DMA transfer on 'controller'. The 'controller' information
0131  * must be provided by the BSP.
0132  */
0133 int
0134 BSP_VMEDmaListDescriptorStartTool(volatile void *controller, int channel, VMEDmaListNode n);
0135 
0136 #ifdef __cplusplus
0137 }
0138 #endif
0139 
0140 #endif