hid.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 1999 Andreas Gal
  4. * Copyright (c) 2000-2001 Vojtech Pavlik
  5. * Copyright (c) 2006-2007 Jiri Kosina
  6. */
  7. /*
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. * Should you need to contact me, the author, you can do so either by
  23. * e-mail - mail your message to <[email protected]>, or by paper mail:
  24. * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  25. */
  26. #ifndef _UAPI__HID_H
  27. #define _UAPI__HID_H
  28. /*
  29. * USB HID (Human Interface Device) interface class code
  30. */
  31. #define USB_INTERFACE_CLASS_HID 3
  32. /*
  33. * USB HID interface subclass and protocol codes
  34. */
  35. #define USB_INTERFACE_SUBCLASS_BOOT 1
  36. #define USB_INTERFACE_PROTOCOL_KEYBOARD 1
  37. #define USB_INTERFACE_PROTOCOL_MOUSE 2
  38. /*
  39. * HID report types --- Ouch! HID spec says 1 2 3!
  40. */
  41. enum hid_report_type {
  42. HID_INPUT_REPORT = 0,
  43. HID_OUTPUT_REPORT = 1,
  44. HID_FEATURE_REPORT = 2,
  45. HID_REPORT_TYPES,
  46. };
  47. /*
  48. * HID class requests
  49. */
  50. enum hid_class_request {
  51. HID_REQ_GET_REPORT = 0x01,
  52. HID_REQ_GET_IDLE = 0x02,
  53. HID_REQ_GET_PROTOCOL = 0x03,
  54. HID_REQ_SET_REPORT = 0x09,
  55. HID_REQ_SET_IDLE = 0x0A,
  56. HID_REQ_SET_PROTOCOL = 0x0B,
  57. };
  58. /*
  59. * HID class descriptor types
  60. */
  61. #define HID_DT_HID (USB_TYPE_CLASS | 0x01)
  62. #define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
  63. #define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
  64. #define HID_MAX_DESCRIPTOR_SIZE 4096
  65. #endif /* _UAPI__HID_H */