comedi_internal.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _COMEDI_INTERNAL_H
  3. #define _COMEDI_INTERNAL_H
  4. #include <linux/compiler.h>
  5. #include <linux/types.h>
  6. /*
  7. * various internal comedi stuff
  8. */
  9. struct comedi_buf_map;
  10. struct comedi_devconfig;
  11. struct comedi_device;
  12. struct comedi_insn;
  13. struct comedi_rangeinfo;
  14. struct comedi_subdevice;
  15. struct device;
  16. int do_rangeinfo_ioctl(struct comedi_device *dev,
  17. struct comedi_rangeinfo *it);
  18. struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device);
  19. void comedi_release_hardware_device(struct device *hardware_device);
  20. int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
  21. void comedi_free_subdevice_minor(struct comedi_subdevice *s);
  22. int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
  23. unsigned long new_size);
  24. void comedi_buf_reset(struct comedi_subdevice *s);
  25. bool comedi_buf_is_mmapped(struct comedi_subdevice *s);
  26. void comedi_buf_map_get(struct comedi_buf_map *bm);
  27. int comedi_buf_map_put(struct comedi_buf_map *bm);
  28. int comedi_buf_map_access(struct comedi_buf_map *bm, unsigned long offset,
  29. void *buf, int len, int write);
  30. struct comedi_buf_map *
  31. comedi_buf_map_from_subdev_get(struct comedi_subdevice *s);
  32. unsigned int comedi_buf_write_n_available(struct comedi_subdevice *s);
  33. unsigned int comedi_buf_write_n_allocated(struct comedi_subdevice *s);
  34. void comedi_device_cancel_all(struct comedi_device *dev);
  35. bool comedi_can_auto_free_spriv(struct comedi_subdevice *s);
  36. extern unsigned int comedi_default_buf_size_kb;
  37. extern unsigned int comedi_default_buf_maxsize_kb;
  38. /* drivers.c */
  39. extern struct comedi_driver *comedi_drivers;
  40. extern struct mutex comedi_drivers_list_lock;
  41. int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
  42. struct comedi_insn *insn, unsigned int *data);
  43. void comedi_device_detach_locked(struct comedi_device *dev);
  44. void comedi_device_detach(struct comedi_device *dev);
  45. int comedi_device_attach(struct comedi_device *dev,
  46. struct comedi_devconfig *it);
  47. #ifdef CONFIG_PROC_FS
  48. /* proc.c */
  49. void comedi_proc_init(void);
  50. void comedi_proc_cleanup(void);
  51. #else
  52. static inline void comedi_proc_init(void)
  53. {
  54. }
  55. static inline void comedi_proc_cleanup(void)
  56. {
  57. }
  58. #endif
  59. #endif /* _COMEDI_INTERNAL_H */