diff options
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r-- | include/net/bluetooth/hci.h | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 2c0d309c7381..0c20227e57f6 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -246,6 +246,15 @@ enum { | |||
246 | #define HCI_AT_GENERAL_BONDING 0x04 | 246 | #define HCI_AT_GENERAL_BONDING 0x04 |
247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | 247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
248 | 248 | ||
249 | /* Link Key types */ | ||
250 | #define HCI_LK_COMBINATION 0x00 | ||
251 | #define HCI_LK_LOCAL_UNIT 0x01 | ||
252 | #define HCI_LK_REMOTE_UNIT 0x02 | ||
253 | #define HCI_LK_DEBUG_COMBINATION 0x03 | ||
254 | #define HCI_LK_UNAUTH_COMBINATION 0x04 | ||
255 | #define HCI_LK_AUTH_COMBINATION 0x05 | ||
256 | #define HCI_LK_CHANGED_COMBINATION 0x06 | ||
257 | |||
249 | /* ----- HCI Commands ---- */ | 258 | /* ----- HCI Commands ---- */ |
250 | #define HCI_OP_NOP 0x0000 | 259 | #define HCI_OP_NOP 0x0000 |
251 | 260 | ||
@@ -428,6 +437,18 @@ struct hci_rp_user_confirm_reply { | |||
428 | 437 | ||
429 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d | 438 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d |
430 | 439 | ||
440 | #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 | ||
441 | struct hci_cp_remote_oob_data_reply { | ||
442 | bdaddr_t bdaddr; | ||
443 | __u8 hash[16]; | ||
444 | __u8 randomizer[16]; | ||
445 | } __packed; | ||
446 | |||
447 | #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 | ||
448 | struct hci_cp_remote_oob_data_neg_reply { | ||
449 | bdaddr_t bdaddr; | ||
450 | } __packed; | ||
451 | |||
431 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 | 452 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 |
432 | struct hci_cp_io_capability_neg_reply { | 453 | struct hci_cp_io_capability_neg_reply { |
433 | bdaddr_t bdaddr; | 454 | bdaddr_t bdaddr; |
@@ -537,15 +558,17 @@ struct hci_cp_delete_stored_link_key { | |||
537 | __u8 delete_all; | 558 | __u8 delete_all; |
538 | } __packed; | 559 | } __packed; |
539 | 560 | ||
561 | #define HCI_MAX_NAME_LENGTH 248 | ||
562 | |||
540 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 563 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
541 | struct hci_cp_write_local_name { | 564 | struct hci_cp_write_local_name { |
542 | __u8 name[248]; | 565 | __u8 name[HCI_MAX_NAME_LENGTH]; |
543 | } __packed; | 566 | } __packed; |
544 | 567 | ||
545 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 | 568 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 |
546 | struct hci_rp_read_local_name { | 569 | struct hci_rp_read_local_name { |
547 | __u8 status; | 570 | __u8 status; |
548 | __u8 name[248]; | 571 | __u8 name[HCI_MAX_NAME_LENGTH]; |
549 | } __packed; | 572 | } __packed; |
550 | 573 | ||
551 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 | 574 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 |
@@ -602,6 +625,14 @@ struct hci_cp_host_buffer_size { | |||
602 | 625 | ||
603 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | 626 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 |
604 | 627 | ||
628 | #define HCI_MAX_EIR_LENGTH 240 | ||
629 | |||
630 | #define HCI_OP_WRITE_EIR 0x0c52 | ||
631 | struct hci_cp_write_eir { | ||
632 | uint8_t fec; | ||
633 | uint8_t data[HCI_MAX_EIR_LENGTH]; | ||
634 | } __packed; | ||
635 | |||
605 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 636 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
606 | struct hci_rp_read_ssp_mode { | 637 | struct hci_rp_read_ssp_mode { |
607 | __u8 status; | 638 | __u8 status; |
@@ -613,6 +644,13 @@ struct hci_cp_write_ssp_mode { | |||
613 | __u8 mode; | 644 | __u8 mode; |
614 | } __packed; | 645 | } __packed; |
615 | 646 | ||
647 | #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 | ||
648 | struct hci_rp_read_local_oob_data { | ||
649 | __u8 status; | ||
650 | __u8 hash[16]; | ||
651 | __u8 randomizer[16]; | ||
652 | } __packed; | ||
653 | |||
616 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | 654 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
617 | 655 | ||
618 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 656 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
@@ -747,7 +785,7 @@ struct hci_ev_auth_complete { | |||
747 | struct hci_ev_remote_name { | 785 | struct hci_ev_remote_name { |
748 | __u8 status; | 786 | __u8 status; |
749 | bdaddr_t bdaddr; | 787 | bdaddr_t bdaddr; |
750 | __u8 name[248]; | 788 | __u8 name[HCI_MAX_NAME_LENGTH]; |
751 | } __packed; | 789 | } __packed; |
752 | 790 | ||
753 | #define HCI_EV_ENCRYPT_CHANGE 0x08 | 791 | #define HCI_EV_ENCRYPT_CHANGE 0x08 |
@@ -955,6 +993,11 @@ struct hci_ev_user_confirm_req { | |||
955 | __le32 passkey; | 993 | __le32 passkey; |
956 | } __packed; | 994 | } __packed; |
957 | 995 | ||
996 | #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 | ||
997 | struct hci_ev_remote_oob_data_request { | ||
998 | bdaddr_t bdaddr; | ||
999 | } __packed; | ||
1000 | |||
958 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 1001 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
959 | struct hci_ev_simple_pair_complete { | 1002 | struct hci_ev_simple_pair_complete { |
960 | __u8 status; | 1003 | __u8 status; |
@@ -1033,7 +1076,6 @@ struct hci_sco_hdr { | |||
1033 | __u8 dlen; | 1076 | __u8 dlen; |
1034 | } __packed; | 1077 | } __packed; |
1035 | 1078 | ||
1036 | #ifdef __KERNEL__ | ||
1037 | #include <linux/skbuff.h> | 1079 | #include <linux/skbuff.h> |
1038 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | 1080 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
1039 | { | 1081 | { |
@@ -1049,7 +1091,6 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
1049 | { | 1091 | { |
1050 | return (struct hci_sco_hdr *) skb->data; | 1092 | return (struct hci_sco_hdr *) skb->data; |
1051 | } | 1093 | } |
1052 | #endif | ||
1053 | 1094 | ||
1054 | /* Command opcode pack/unpack */ | 1095 | /* Command opcode pack/unpack */ |
1055 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1096 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) |