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
00033 #define A4L_TSF_BUSY 0
00034 #define A4L_TSF_BULK 1
00035 #define A4L_TSF_MMAP 2
00036 #define A4L_TSF_CLEAN 3
00037
00038
00039 #define A4L_IRQ_UNUSED (unsigned int)((unsigned short)(~0))
00040 #define A4L_IDX_UNUSED (unsigned int)(~0)
00041
00042
00043 #define A4L_IRQ_SHARED RTDM_IRQTYPE_SHARED
00044 #define A4L_IRQ_EDGE RTDM_IRQTYPE_EDGE
00045 #define A4L_IRQ_DISABLED 0
00046
00047
00048 #define A4L_INFINITE 0
00049 #define A4L_NONBLOCK (-1)
00050
00051 #ifdef __KERNEL__
00052
00053 struct a4l_device;
00054
00055
00056 struct a4l_transfer {
00057
00058
00059 unsigned int nb_subd;
00060 a4l_subd_t **subds;
00061 int idx_read_subd;
00062 int idx_write_subd;
00063
00064
00065 a4l_buf_t **bufs;
00066
00067
00068 a4l_irq_desc_t irq_desc;
00069
00070
00071 unsigned long *status;
00072 };
00073 typedef struct a4l_transfer a4l_trf_t;
00074
00075
00076
00077 int a4l_rdproc_transfer(char *page,
00078 char **start,
00079 off_t off, int count, int *eof, void *data);
00080
00081
00082
00083 void a4l_presetup_transfer(a4l_cxt_t * cxt);
00084 int a4l_setup_transfer(a4l_cxt_t * cxt);
00085 int a4l_precleanup_transfer(a4l_cxt_t * cxt);
00086 int a4l_cleanup_transfer(a4l_cxt_t * cxt);
00087 int a4l_reserve_transfer(a4l_cxt_t * cxt, int idx_subd);
00088 int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd);
00089 int a4l_cancel_transfer(a4l_cxt_t * cxt, int idx_subd);
00090 int a4l_cancel_transfers(a4l_cxt_t * cxt);
00091
00092 ssize_t a4l_put(a4l_cxt_t * cxt, void *buf, size_t nbytes);
00093 ssize_t a4l_get(a4l_cxt_t * cxt, void *buf, size_t nbytes);
00094
00095 int a4l_request_irq(struct a4l_device *dev,
00096 unsigned int irq,
00097 a4l_irq_hdlr_t handler,
00098 unsigned long flags, void *cookie);
00099 int a4l_free_irq(struct a4l_device *dev, unsigned int irq);
00100 unsigned int a4l_get_irq(struct a4l_device *dev);
00101
00102 int a4l_ioctl_cancel(a4l_cxt_t * cxt, void *arg);
00103
00104 #endif
00105
00106 #endif
00107
00108 #endif