Xenomai  3.0-rc3
transfer.h
Go to the documentation of this file.
1 
22 #ifndef _COBALT_RTDM_ANALOGY_TRANSFER_H
23 #define _COBALT_RTDM_ANALOGY_TRANSFER_H
24 
25 #include <rtdm/analogy/buffer.h>
26 
27 /* IRQ types */
28 #define A4L_IRQ_DISABLED 0
29 
30 /* Fields init values */
31 #define A4L_IRQ_UNUSED (unsigned int)((unsigned short)(~0))
32 #define A4L_IDX_UNUSED (unsigned int)(~0)
33 
34 /* TODO: IRQ handling must leave transfer for os_facilities */
35 
36 struct a4l_device;
37 /* Analogy transfer descriptor */
38 struct a4l_transfer {
39 
40  /* Subdevices desc */
41  unsigned int nb_subd;
42  struct a4l_subdevice **subds;
43 
44  /* Buffer stuff: the default size */
45  unsigned int default_bufsize;
46 
47  /* IRQ in use */
48  /* TODO: irq_desc should vanish */
49  struct a4l_irq_descriptor irq_desc;
50 };
51 
52 /* --- Proc function --- */
53 
54 int a4l_rdproc_transfer(struct seq_file *p, void *data);
55 
56 /* --- Upper layer functions --- */
57 
58 void a4l_presetup_transfer(struct a4l_device_context * cxt);
59 int a4l_setup_transfer(struct a4l_device_context * cxt);
60 int a4l_precleanup_transfer(struct a4l_device_context * cxt);
61 int a4l_cleanup_transfer(struct a4l_device_context * cxt);
62 int a4l_reserve_transfer(struct a4l_device_context * cxt, int idx_subd);
63 int a4l_init_transfer(struct a4l_device_context * cxt, struct a4l_cmd_desc * cmd);
64 int a4l_cancel_transfer(struct a4l_device_context * cxt, int idx_subd);
65 int a4l_cancel_transfers(struct a4l_device_context * cxt);
66 
67 ssize_t a4l_put(struct a4l_device_context * cxt, void *buf, size_t nbytes);
68 ssize_t a4l_get(struct a4l_device_context * cxt, void *buf, size_t nbytes);
69 
70 int a4l_request_irq(struct a4l_device *dev,
71  unsigned int irq,
72  a4l_irq_hdlr_t handler,
73  unsigned long flags, void *cookie);
74 int a4l_free_irq(struct a4l_device *dev, unsigned int irq);
75 unsigned int a4l_get_irq(struct a4l_device *dev);
76 
77 int a4l_ioctl_cancel(struct a4l_device_context * cxt, void *arg);
78 
79 #endif /* !_COBALT_RTDM_ANALOGY_TRANSFER_H */
Analogy for Linux, buffer related features.
Structure describing the asynchronous instruction.
Definition: analogy.h:289
Structure describing the subdevice.
Definition: subdevice.h:40