Xenomai API
2.5.6.1
|
00001 00023 #ifndef __ANALOGY_TRANSFER__ 00024 #define __ANALOGY_TRANSFER__ 00025 00026 #ifndef DOXYGEN_CPP 00027 00028 #include <analogy/context.h> 00029 #include <analogy/subdevice.h> 00030 #include <analogy/buffer.h> 00031 00032 /* Status flags / bits */ 00033 #define A4L_TSF_CLEAN 0 00034 00035 /* Fields init values */ 00036 #define A4L_IRQ_UNUSED (unsigned int)((unsigned short)(~0)) 00037 #define A4L_IDX_UNUSED (unsigned int)(~0) 00038 00039 /* TODO: IRQ handling must leave transfer for os_facilities */ 00040 00041 /* IRQ types */ 00042 #define A4L_IRQ_SHARED RTDM_IRQTYPE_SHARED 00043 #define A4L_IRQ_EDGE RTDM_IRQTYPE_EDGE 00044 #define A4L_IRQ_DISABLED 0 00045 00046 /* Poll timeout values */ 00047 #define A4L_INFINITE 0 00048 #define A4L_NONBLOCK (-1) 00049 00050 #ifdef __KERNEL__ 00051 00052 struct a4l_device; 00053 /* Analogy transfer descriptor */ 00054 struct a4l_transfer { 00055 00056 /* Subdevices desc */ 00057 unsigned int nb_subd; 00058 a4l_subd_t **subds; 00059 00060 /* Buffer stuff: the default size */ 00061 unsigned int default_bufsize; 00062 00063 /* IRQ in use */ 00064 /* TODO: irq_desc should vanish */ 00065 a4l_irq_desc_t irq_desc; 00066 }; 00067 typedef struct a4l_transfer a4l_trf_t; 00068 00069 /* --- Proc function --- */ 00070 00071 int a4l_rdproc_transfer(char *page, 00072 char **start, 00073 off_t off, int count, int *eof, void *data); 00074 00075 /* --- Upper layer functions --- */ 00076 00077 void a4l_presetup_transfer(a4l_cxt_t * cxt); 00078 int a4l_setup_transfer(a4l_cxt_t * cxt); 00079 int a4l_precleanup_transfer(a4l_cxt_t * cxt); 00080 int a4l_cleanup_transfer(a4l_cxt_t * cxt); 00081 int a4l_reserve_transfer(a4l_cxt_t * cxt, int idx_subd); 00082 int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd); 00083 int a4l_cancel_transfer(a4l_cxt_t * cxt, int idx_subd); 00084 int a4l_cancel_transfers(a4l_cxt_t * cxt); 00085 00086 ssize_t a4l_put(a4l_cxt_t * cxt, void *buf, size_t nbytes); 00087 ssize_t a4l_get(a4l_cxt_t * cxt, void *buf, size_t nbytes); 00088 00089 int a4l_request_irq(struct a4l_device *dev, 00090 unsigned int irq, 00091 a4l_irq_hdlr_t handler, 00092 unsigned long flags, void *cookie); 00093 int a4l_free_irq(struct a4l_device *dev, unsigned int irq); 00094 unsigned int a4l_get_irq(struct a4l_device *dev); 00095 00096 int a4l_ioctl_cancel(a4l_cxt_t * cxt, void *arg); 00097 00098 #endif /* __KERNEL__ */ 00099 00100 #endif /* !DOXYGEN_CPP */ 00101 00102 #endif /* __ANALOGY_TRANSFER__ */