Back to home page

LXR

 
 

    


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

0001 /**
0002  *  @file
0003  *
0004  *  @ingroup shared_bspvmedmalistp
0005  *
0006  *  @brief Private Interface to the bspVmeDmaList facility
0007  */
0008 
0009 #ifndef BSP_VME_DMA_LIST_P_H
0010 #define BSP_VME_DMA_LIST_P_H
0011 
0012 #include <bsp/bspVmeDmaList.h>
0013 
0014 /*
0015  * This is used by chip drivers to implement the
0016  * 'class' members so that 'bspVmeDmaList' can access
0017  * the device in an abstract manner.
0018  */
0019 
0020 /*
0021  * Authorship
0022  * ----------
0023  * This software was created by
0024  *     Till Straumann <strauman@slac.stanford.edu>, 2006, 2007
0025  *     Stanford Linear Accelerator Center, Stanford University.
0026  *
0027  * Acknowledgement of sponsorship
0028  * ------------------------------
0029  * This software was produced by
0030  *     the Stanford Linear Accelerator Center, Stanford University,
0031  *     under Contract DE-AC03-76SFO0515 with the Department of Energy.
0032  *
0033  * Government disclaimer of liability
0034  * ----------------------------------
0035  * Neither the United States nor the United States Department of Energy,
0036  * nor any of their employees, makes any warranty, express or implied, or
0037  * assumes any legal liability or responsibility for the accuracy,
0038  * completeness, or usefulness of any data, apparatus, product, or process
0039  * disclosed, or represents that its use would not infringe privately owned
0040  * rights.
0041  *
0042  * Stanford disclaimer of liability
0043  * --------------------------------
0044  * Stanford University makes no representations or warranties, express or
0045  * implied, nor assumes any liability for the use of this software.
0046  *
0047  * Stanford disclaimer of copyright
0048  * --------------------------------
0049  * Stanford University, owner of the copyright, hereby disclaims its
0050  * copyright and all other rights in this software.  Hence, anyone may
0051  * freely use it for any purpose without restriction.
0052  *
0053  * Maintenance of notices
0054  * ----------------------
0055  * In the interest of clarity regarding the origin and status of this
0056  * SLAC software, this and all the preceding Stanford University notices
0057  * are to remain affixed to any copy or derivative of this software made
0058  * or distributed by the recipient and are to be affixed to any copy of
0059  * software made or distributed by the recipient that contains a copy or
0060  * derivative of this software.
0061  *
0062  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
0063  */
0064 #ifdef __cplusplus
0065 extern "C" {
0066 #endif
0067 
0068 typedef void           *DmaDescriptor;
0069 
0070 /**
0071  *  @defgroup shared_bspvmedmalistp member functions
0072  *
0073  *  @ingroup shared_vmeuniverse
0074  *
0075  *  @brief Member functions to be implemented by chip drivers
0076  */
0077 
0078 typedef DmaDescriptor (*DmaDescriptorAlloc)(void);
0079 typedef void          (*DmaDescriptorFree) (DmaDescriptor d);
0080 typedef void          (*DmaDescriptorInit) (DmaDescriptor d);
0081 /* Setup takes the parameters declared in VMEDMA.h */
0082 typedef int           (*DmaDescriptorSetup)(DmaDescriptor d, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
0083 typedef void          (*DmaDescriptorSetNxt)(DmaDescriptor d, DmaDescriptor next);
0084 typedef int           (*DmaDescriptorStart)(volatile void *controller_addr, int channel, DmaDescriptor);
0085 typedef int           (*DmaDescriptorRefr) (DmaDescriptor);
0086 typedef void          (*DmaDescriptorDump) (DmaDescriptor);
0087 
0088 
0089 typedef struct VMEDmaListClassRec_ {
0090     int                 desc_size;  /* size of a descritor */
0091     int                 desc_align; /* alignment of a descriptor */
0092     VMEDmaListNode          freeList;   /* list of free descriptors of this class, MUST be initialized to NULL */
0093     DmaDescriptorAlloc  desc_alloc; /* [optional, may be NULL] allocator for one descriptor */
0094     DmaDescriptorFree   desc_free;  /* [optional, may be NULL] destructor for one descriptor */
0095     DmaDescriptorInit   desc_init;  /* [optional, may be NULL] set stuff that don't change during lifetime */
0096     DmaDescriptorSetNxt desc_setnxt;/* set 'NEXT' pointer in descriptor; mark as LAST if next == 0 */
0097     DmaDescriptorSetup  desc_setup; /* setup a descriptor   */
0098     DmaDescriptorStart  desc_start; /* start list at a descriptor   */
0099     DmaDescriptorRefr   desc_refr;  /* refresh a descriptor */
0100     DmaDescriptorDump   desc_dump;  /* dump a descriptor (for debugging) */
0101 } VMEDmaListClassRec;
0102 
0103 #ifdef __cplusplus
0104 }
0105 #endif
0106 
0107 #endif