License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / drivers / staging / comedi / comedi_internal.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
97ce84de
IA
2#ifndef _COMEDI_INTERNAL_H
3#define _COMEDI_INTERNAL_H
4
78cff59e 5#include <linux/compiler.h>
f286766e
IA
6#include <linux/types.h>
7
2434358a 8/*
4d7df821 9 * various internal comedi stuff
2434358a 10 */
78cff59e
IA
11
12struct comedi_buf_map;
13struct comedi_devconfig;
14struct comedi_device;
15struct comedi_insn;
16struct comedi_rangeinfo;
17struct comedi_subdevice;
18struct device;
19
3b6b25b5
GKH
20int do_rangeinfo_ioctl(struct comedi_device *dev,
21 struct comedi_rangeinfo __user *arg);
7638ffcb 22struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device);
3346b798 23void comedi_release_hardware_device(struct device *hardware_device);
f65cc544 24int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
e9ab1c2f 25void comedi_free_subdevice_minor(struct comedi_subdevice *s);
61c9fb0e 26
7029a874
GKH
27int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
28 unsigned long new_size);
fcc18a9a 29void comedi_buf_reset(struct comedi_subdevice *s);
d4526ab4 30bool comedi_buf_is_mmapped(struct comedi_subdevice *s);
af93da31
IA
31void comedi_buf_map_get(struct comedi_buf_map *bm);
32int comedi_buf_map_put(struct comedi_buf_map *bm);
255364f7
IA
33int comedi_buf_map_access(struct comedi_buf_map *bm, unsigned long offset,
34 void *buf, int len, int write);
b34aa86f
IA
35struct comedi_buf_map *comedi_buf_map_from_subdev_get(
36 struct comedi_subdevice *s);
432fbde7 37unsigned int comedi_buf_write_n_available(struct comedi_subdevice *s);
0f1f34e8 38unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s);
d19db51a 39void comedi_device_cancel_all(struct comedi_device *dev);
8fc369ae 40bool comedi_can_auto_free_spriv(struct comedi_subdevice *s);
4d7df821
IA
41
42extern unsigned int comedi_default_buf_size_kb;
43extern unsigned int comedi_default_buf_maxsize_kb;
39bd5e59
HS
44
45/* drivers.c */
46
f286766e 47extern struct comedi_driver *comedi_drivers;
c383e2d6 48extern struct mutex comedi_drivers_list_lock;
97ce84de 49
751922da
IA
50int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
51 struct comedi_insn *insn, unsigned int *data);
39bd5e59 52
751922da
IA
53void comedi_device_detach(struct comedi_device *dev);
54int comedi_device_attach(struct comedi_device *dev,
55 struct comedi_devconfig *it);
39bd5e59 56
085494ac
HS
57#ifdef CONFIG_PROC_FS
58
59/* proc.c */
60
61void comedi_proc_init(void);
62void comedi_proc_cleanup(void);
63#else
64static inline void comedi_proc_init(void)
65{
66}
663dfc05 67
085494ac
HS
68static inline void comedi_proc_cleanup(void)
69{
70}
71#endif
72
97ce84de 73#endif /* _COMEDI_INTERNAL_H */