hidp_defs.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2003-2014 Marcel Holtmann <marcel@holtmann.org>
  7. * Copyright (C) 2014 Google Inc.
  8. *
  9. *
  10. */
  11. #ifndef __HIDP_DEFS_H
  12. #define __HIDP_DEFS_H
  13. /* HIDP header masks */
  14. #define HIDP_HEADER_TRANS_MASK 0xf0
  15. #define HIDP_HEADER_PARAM_MASK 0x0f
  16. /* HIDP transaction types */
  17. #define HIDP_TRANS_HANDSHAKE 0x00
  18. #define HIDP_TRANS_HID_CONTROL 0x10
  19. #define HIDP_TRANS_GET_REPORT 0x40
  20. #define HIDP_TRANS_SET_REPORT 0x50
  21. #define HIDP_TRANS_GET_PROTOCOL 0x60
  22. #define HIDP_TRANS_SET_PROTOCOL 0x70
  23. #define HIDP_TRANS_GET_IDLE 0x80
  24. #define HIDP_TRANS_SET_IDLE 0x90
  25. #define HIDP_TRANS_DATA 0xa0
  26. #define HIDP_TRANS_DATC 0xb0
  27. /* HIDP handshake results */
  28. #define HIDP_HSHK_SUCCESSFUL 0x00
  29. #define HIDP_HSHK_NOT_READY 0x01
  30. #define HIDP_HSHK_ERR_INVALID_REPORT_ID 0x02
  31. #define HIDP_HSHK_ERR_UNSUPPORTED_REQUEST 0x03
  32. #define HIDP_HSHK_ERR_INVALID_PARAMETER 0x04
  33. #define HIDP_HSHK_ERR_UNKNOWN 0x0e
  34. #define HIDP_HSHK_ERR_FATAL 0x0f
  35. /* HIDP control operation parameters */
  36. #define HIDP_CTRL_NOP 0x00
  37. #define HIDP_CTRL_HARD_RESET 0x01
  38. #define HIDP_CTRL_SOFT_RESET 0x02
  39. #define HIDP_CTRL_SUSPEND 0x03
  40. #define HIDP_CTRL_EXIT_SUSPEND 0x04
  41. #define HIDP_CTRL_VIRTUAL_CABLE_UNPLUG 0x05
  42. /* HIDP data transaction headers */
  43. #define HIDP_DATA_RTYPE_MASK 0x03
  44. #define HIDP_DATA_RSRVD_MASK 0x0c
  45. #define HIDP_DATA_RTYPE_OTHER 0x00
  46. #define HIDP_DATA_RTYPE_INPUT 0x01
  47. #define HIDP_DATA_RTYPE_OUTPUT 0x02
  48. #define HIDP_DATA_RTYPE_FEATURE 0x03
  49. /* HIDP protocol header parameters */
  50. #define HIDP_PROTO_BOOT 0x00
  51. #define HIDP_PROTO_REPORT 0x01
  52. #define HIDP_VIRTUAL_CABLE_UNPLUG 0
  53. #define HIDP_BOOT_PROTOCOL_MODE 1
  54. #define HIDP_BLUETOOTH_VENDOR_ID 9
  55. #define HIDP_WAITING_FOR_RETURN 10
  56. #define HIDP_WAITING_FOR_SEND_ACK 11
  57. #endif /* __HIDP_DEFS_H */