hiddev.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (c) 1999-2000 Vojtech Pavlik
  4. *
  5. * Sponsored by SuSE
  6. */
  7. /*
  8. *
  9. * Should you need to contact me, the author, you can do so either by
  10. * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
  11. * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  12. */
  13. #ifndef _HIDDEV_H
  14. #define _HIDDEV_H
  15. #include <uapi/linux/hiddev.h>
  16. /*
  17. * In-kernel definitions.
  18. */
  19. struct hiddev {
  20. int minor;
  21. int exist;
  22. int open;
  23. struct mutex existancelock;
  24. wait_queue_head_t wait;
  25. struct hid_device *hid;
  26. struct list_head list;
  27. spinlock_t list_lock;
  28. bool initialized;
  29. };
  30. struct hid_device;
  31. struct hid_usage;
  32. struct hid_field;
  33. struct hid_report;
  34. #ifdef CONFIG_USB_HIDDEV
  35. int hiddev_connect(struct hid_device *hid, unsigned int force);
  36. void hiddev_disconnect(struct hid_device *);
  37. void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
  38. struct hid_usage *usage, __s32 value);
  39. void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
  40. #else
  41. static inline int hiddev_connect(struct hid_device *hid,
  42. unsigned int force)
  43. { return -1; }
  44. static inline void hiddev_disconnect(struct hid_device *hid) { }
  45. static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
  46. struct hid_usage *usage, __s32 value) { }
  47. static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
  48. #endif
  49. #endif