uhid.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __UHID_H_
  2. #define __UHID_H_
  3. /*
  4. * User-space I/O driver support for HID subsystem
  5. * Copyright (c) 2012 David Herrmann
  6. */
  7. /*
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the Free
  10. * Software Foundation; either version 2 of the License, or (at your option)
  11. * any later version.
  12. */
  13. /*
  14. * Public header for user-space communication. We try to keep every structure
  15. * aligned but to be safe we also use __attribute__((__packed__)). Therefore,
  16. * the communication should be ABI compatible even between architectures.
  17. */
  18. #include <linux/input.h>
  19. #include <linux/types.h>
  20. enum uhid_event_type {
  21. UHID_CREATE,
  22. UHID_DESTROY,
  23. };
  24. struct uhid_create_req {
  25. __u8 name[128];
  26. __u8 phys[64];
  27. __u8 uniq[64];
  28. __u8 __user *rd_data;
  29. __u16 rd_size;
  30. __u16 bus;
  31. __u32 vendor;
  32. __u32 product;
  33. __u32 version;
  34. __u32 country;
  35. } __attribute__((__packed__));
  36. struct uhid_event {
  37. __u32 type;
  38. union {
  39. struct uhid_create_req create;
  40. } u;
  41. } __attribute__((__packed__));
  42. #endif /* __UHID_H_ */