Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / comedi / comedi_internal.h
1 #ifndef _COMEDI_INTERNAL_H
2 #define _COMEDI_INTERNAL_H
3
4 #include <linux/compiler.h>
5 #include <linux/types.h>
6
7 /*
8  * various internal comedi stuff
9  */
10
11 struct comedi_buf_map;
12 struct comedi_devconfig;
13 struct comedi_device;
14 struct comedi_insn;
15 struct comedi_rangeinfo;
16 struct comedi_subdevice;
17 struct device;
18
19 int do_rangeinfo_ioctl(struct comedi_device *dev,
20                        struct comedi_rangeinfo __user *arg);
21 struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device);
22 void comedi_release_hardware_device(struct device *hardware_device);
23 int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
24 void comedi_free_subdevice_minor(struct comedi_subdevice *s);
25
26 int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
27                      unsigned long new_size);
28 void comedi_buf_reset(struct comedi_subdevice *s);
29 bool comedi_buf_is_mmapped(struct comedi_subdevice *s);
30 void comedi_buf_map_get(struct comedi_buf_map *bm);
31 int comedi_buf_map_put(struct comedi_buf_map *bm);
32 struct comedi_buf_map *comedi_buf_map_from_subdev_get(
33                 struct comedi_subdevice *s);
34 unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s);
35 void comedi_device_cancel_all(struct comedi_device *dev);
36
37 extern unsigned int comedi_default_buf_size_kb;
38 extern unsigned int comedi_default_buf_maxsize_kb;
39
40 /* drivers.c */
41
42 extern struct comedi_driver *comedi_drivers;
43 extern struct mutex comedi_drivers_list_lock;
44
45 int insn_inval(struct comedi_device *, struct comedi_subdevice *,
46                struct comedi_insn *, unsigned int *);
47
48 void comedi_device_detach(struct comedi_device *);
49 int comedi_device_attach(struct comedi_device *, struct comedi_devconfig *);
50
51 #ifdef CONFIG_PROC_FS
52
53 /* proc.c */
54
55 void comedi_proc_init(void);
56 void comedi_proc_cleanup(void);
57 #else
58 static inline void comedi_proc_init(void)
59 {
60 }
61
62 static inline void comedi_proc_cleanup(void)
63 {
64 }
65 #endif
66
67 #endif /* _COMEDI_INTERNAL_H */