These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[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_available(struct comedi_subdevice *s);
35 unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s);
36 void comedi_device_cancel_all(struct comedi_device *dev);
37 bool comedi_can_auto_free_spriv(struct comedi_subdevice *s);
38
39 extern unsigned int comedi_default_buf_size_kb;
40 extern unsigned int comedi_default_buf_maxsize_kb;
41
42 /* drivers.c */
43
44 extern struct comedi_driver *comedi_drivers;
45 extern struct mutex comedi_drivers_list_lock;
46
47 int insn_inval(struct comedi_device *, struct comedi_subdevice *,
48                struct comedi_insn *, unsigned int *);
49
50 void comedi_device_detach(struct comedi_device *);
51 int comedi_device_attach(struct comedi_device *, struct comedi_devconfig *);
52
53 #ifdef CONFIG_PROC_FS
54
55 /* proc.c */
56
57 void comedi_proc_init(void);
58 void comedi_proc_cleanup(void);
59 #else
60 static inline void comedi_proc_init(void)
61 {
62 }
63
64 static inline void comedi_proc_cleanup(void)
65 {
66 }
67 #endif
68
69 #endif /* _COMEDI_INTERNAL_H */