Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _COMEDI_INTERNAL_H
0003 #define _COMEDI_INTERNAL_H
0004 
0005 #include <linux/compiler.h>
0006 #include <linux/types.h>
0007 
0008 /*
0009  * various internal comedi stuff
0010  */
0011 
0012 struct comedi_buf_map;
0013 struct comedi_devconfig;
0014 struct comedi_device;
0015 struct comedi_insn;
0016 struct comedi_rangeinfo;
0017 struct comedi_subdevice;
0018 struct device;
0019 
0020 int do_rangeinfo_ioctl(struct comedi_device *dev,
0021                struct comedi_rangeinfo *it);
0022 struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device);
0023 void comedi_release_hardware_device(struct device *hardware_device);
0024 int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
0025 void comedi_free_subdevice_minor(struct comedi_subdevice *s);
0026 
0027 int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
0028              unsigned long new_size);
0029 void comedi_buf_reset(struct comedi_subdevice *s);
0030 bool comedi_buf_is_mmapped(struct comedi_subdevice *s);
0031 void comedi_buf_map_get(struct comedi_buf_map *bm);
0032 int comedi_buf_map_put(struct comedi_buf_map *bm);
0033 int comedi_buf_map_access(struct comedi_buf_map *bm, unsigned long offset,
0034               void *buf, int len, int write);
0035 struct comedi_buf_map *
0036 comedi_buf_map_from_subdev_get(struct comedi_subdevice *s);
0037 unsigned int comedi_buf_write_n_available(struct comedi_subdevice *s);
0038 unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s);
0039 void comedi_device_cancel_all(struct comedi_device *dev);
0040 bool comedi_can_auto_free_spriv(struct comedi_subdevice *s);
0041 
0042 extern unsigned int comedi_default_buf_size_kb;
0043 extern unsigned int comedi_default_buf_maxsize_kb;
0044 
0045 /* drivers.c */
0046 
0047 extern struct comedi_driver *comedi_drivers;
0048 extern struct mutex comedi_drivers_list_lock;
0049 
0050 int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
0051            struct comedi_insn *insn, unsigned int *data);
0052 
0053 void comedi_device_detach(struct comedi_device *dev);
0054 int comedi_device_attach(struct comedi_device *dev,
0055              struct comedi_devconfig *it);
0056 
0057 #ifdef CONFIG_PROC_FS
0058 
0059 /* proc.c */
0060 
0061 void comedi_proc_init(void);
0062 void comedi_proc_cleanup(void);
0063 #else
0064 static inline void comedi_proc_init(void)
0065 {
0066 }
0067 
0068 static inline void comedi_proc_cleanup(void)
0069 {
0070 }
0071 #endif
0072 
0073 #endif /* _COMEDI_INTERNAL_H */