smp.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef __SMP_H
  2. #define __SMP_H
  3. struct smp_command_hdr {
  4. __u8 code;
  5. } __packed;
  6. #define SMP_CMD_PAIRING_REQ 0x01
  7. #define SMP_CMD_PAIRING_RSP 0x02
  8. struct smp_cmd_pairing {
  9. __u8 io_capability;
  10. __u8 oob_flag;
  11. __u8 auth_req;
  12. __u8 max_key_size;
  13. __u8 init_key_dist;
  14. __u8 resp_key_dist;
  15. } __packed;
  16. #define SMP_CMD_PAIRING_CONFIRM 0x03
  17. struct smp_cmd_pairing_confirm {
  18. __u8 confirm_val[16];
  19. } __packed;
  20. #define SMP_CMD_PAIRING_RANDOM 0x04
  21. struct smp_cmd_pairing_random {
  22. __u8 rand_val[16];
  23. } __packed;
  24. #define SMP_CMD_PAIRING_FAIL 0x05
  25. struct smp_cmd_pairing_fail {
  26. __u8 reason;
  27. } __packed;
  28. #define SMP_CMD_ENCRYPT_INFO 0x06
  29. struct smp_cmd_encrypt_info {
  30. __u8 ltk[16];
  31. } __packed;
  32. #define SMP_CMD_MASTER_IDENT 0x07
  33. struct smp_cmd_master_ident {
  34. __u16 ediv;
  35. __u8 rand[8];
  36. } __packed;
  37. #define SMP_CMD_IDENT_INFO 0x08
  38. struct smp_cmd_ident_info {
  39. __u8 irk[16];
  40. } __packed;
  41. #define SMP_CMD_IDENT_ADDR_INFO 0x09
  42. struct smp_cmd_ident_addr_info {
  43. __u8 addr_type;
  44. bdaddr_t bdaddr;
  45. } __packed;
  46. #define SMP_CMD_SIGN_INFO 0x0a
  47. struct smp_cmd_sign_info {
  48. __u8 csrk[16];
  49. } __packed;
  50. #define SMP_CMD_SECURITY_REQ 0x0b
  51. struct smp_cmd_security_req {
  52. __u8 auth_req;
  53. } __packed;
  54. #define SMP_PASSKEY_ENTRY_FAILED 0x01
  55. #define SMP_OOB_NOT_AVAIL 0x02
  56. #define SMP_AUTH_REQUIREMENTS 0x03
  57. #define SMP_CONFIRM_FAILED 0x04
  58. #define SMP_PAIRING_NOTSUPP 0x05
  59. #define SMP_ENC_KEY_SIZE 0x06
  60. #define SMP_CMD_NOTSUPP 0x07
  61. #define SMP_UNSPECIFIED 0x08
  62. #define SMP_REPEATED_ATTEMPTS 0x09
  63. #endif /* __SMP_H */