Xenomai API  2.6.5
transfer.h
Go to the documentation of this file.
1 
23 #ifndef __ANALOGY_TRANSFER__
24 #define __ANALOGY_TRANSFER__
25 
26 #ifndef DOXYGEN_CPP
27 
28 #include <analogy/context.h>
29 #include <analogy/subdevice.h>
30 #include <analogy/buffer.h>
31 
32 /* Status flags / bits */
33 #define A4L_TSF_CLEAN 0
34 
35 /* Fields init values */
36 #define A4L_IRQ_UNUSED (unsigned int)((unsigned short)(~0))
37 #define A4L_IDX_UNUSED (unsigned int)(~0)
38 
39 /* TODO: IRQ handling must leave transfer for os_facilities */
40 
41 /* IRQ types */
42 #define A4L_IRQ_SHARED RTDM_IRQTYPE_SHARED
43 #define A4L_IRQ_EDGE RTDM_IRQTYPE_EDGE
44 #define A4L_IRQ_DISABLED 0
45 
46 /* Poll timeout values */
47 #define A4L_INFINITE 0
48 #define A4L_NONBLOCK (-1)
49 
50 #ifdef __KERNEL__
51 
52 struct a4l_device;
53 /* Analogy transfer descriptor */
54 struct a4l_transfer {
55 
56  /* Subdevices desc */
57  unsigned int nb_subd;
58  a4l_subd_t **subds;
59 
60  /* Buffer stuff: the default size */
61  unsigned int default_bufsize;
62 
63  /* IRQ in use */
64  /* TODO: irq_desc should vanish */
65  a4l_irq_desc_t irq_desc;
66 };
67 typedef struct a4l_transfer a4l_trf_t;
68 
69 /* --- Proc function --- */
70 
71 int a4l_rdproc_transfer(struct seq_file *p, void *data);
72 
73 /* --- Upper layer functions --- */
74 
75 void a4l_presetup_transfer(a4l_cxt_t * cxt);
76 int a4l_setup_transfer(a4l_cxt_t * cxt);
77 int a4l_precleanup_transfer(a4l_cxt_t * cxt);
78 int a4l_cleanup_transfer(a4l_cxt_t * cxt);
79 int a4l_reserve_transfer(a4l_cxt_t * cxt, int idx_subd);
80 int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd);
81 int a4l_cancel_transfer(a4l_cxt_t * cxt, int idx_subd);
82 int a4l_cancel_transfers(a4l_cxt_t * cxt);
83 
84 ssize_t a4l_put(a4l_cxt_t * cxt, void *buf, size_t nbytes);
85 ssize_t a4l_get(a4l_cxt_t * cxt, void *buf, size_t nbytes);
86 
87 int a4l_request_irq(struct a4l_device *dev,
88  unsigned int irq,
89  a4l_irq_hdlr_t handler,
90  unsigned long flags, void *cookie);
91 int a4l_free_irq(struct a4l_device *dev, unsigned int irq);
92 unsigned int a4l_get_irq(struct a4l_device *dev);
93 
94 int a4l_ioctl_cancel(a4l_cxt_t * cxt, void *arg);
95 
96 #endif /* __KERNEL__ */
97 
98 #endif /* !DOXYGEN_CPP */
99 
100 #endif /* __ANALOGY_TRANSFER__ */
unsigned int a4l_get_irq(a4l_dev_t *dev)
Get the interrupt number in use for a specific device.
Analogy for Linux, context structure / macros declarations.
Structure describing the asynchronous instruction.
Definition: command.h:198
Analogy for Linux, subdevice related features.
int a4l_request_irq(a4l_dev_t *dev, unsigned int irq, a4l_irq_hdlr_t handler, unsigned long flags, void *cookie)
Register an interrupt handler for a specific device.
Structure describing the subdevice.
Definition: subdevice.h:180
Analogy for Linux, buffer related features.
int a4l_free_irq(a4l_dev_t *dev, unsigned int irq)
Release an interrupt handler for a specific device.