diff options
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r-- | include/net/bluetooth/hci.h | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 0c20227e57f..915d7ae527b 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #define HCI_DEV_DOWN 4 | 37 | #define HCI_DEV_DOWN 4 |
38 | #define HCI_DEV_SUSPEND 5 | 38 | #define HCI_DEV_SUSPEND 5 |
39 | #define HCI_DEV_RESUME 6 | 39 | #define HCI_DEV_RESUME 6 |
40 | #define HCI_DEV_WRITE 7 | ||
40 | 41 | ||
41 | /* HCI notify events */ | 42 | /* HCI notify events */ |
42 | #define HCI_NOTIFY_CONN_ADD 1 | 43 | #define HCI_NOTIFY_CONN_ADD 1 |
@@ -157,8 +158,10 @@ enum { | |||
157 | #define ESCO_2EV5 0x0100 | 158 | #define ESCO_2EV5 0x0100 |
158 | #define ESCO_3EV5 0x0200 | 159 | #define ESCO_3EV5 0x0200 |
159 | 160 | ||
160 | #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) | 161 | #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) |
161 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) | 162 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) |
163 | #define ALL_ESCO_MASK (SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO_EV5 | \ | ||
164 | EDR_ESCO_MASK) | ||
162 | 165 | ||
163 | /* ACL flags */ | 166 | /* ACL flags */ |
164 | #define ACL_START_NO_FLUSH 0x00 | 167 | #define ACL_START_NO_FLUSH 0x00 |
@@ -211,11 +214,16 @@ enum { | |||
211 | #define LMP_EDR_3S_ESCO 0x80 | 214 | #define LMP_EDR_3S_ESCO 0x80 |
212 | 215 | ||
213 | #define LMP_EXT_INQ 0x01 | 216 | #define LMP_EXT_INQ 0x01 |
217 | #define LMP_SIMUL_LE_BR 0x02 | ||
214 | #define LMP_SIMPLE_PAIR 0x08 | 218 | #define LMP_SIMPLE_PAIR 0x08 |
215 | #define LMP_NO_FLUSH 0x40 | 219 | #define LMP_NO_FLUSH 0x40 |
216 | 220 | ||
217 | #define LMP_LSTO 0x01 | 221 | #define LMP_LSTO 0x01 |
218 | #define LMP_INQ_TX_PWR 0x02 | 222 | #define LMP_INQ_TX_PWR 0x02 |
223 | #define LMP_EXTFEATURES 0x80 | ||
224 | |||
225 | /* Extended LMP features */ | ||
226 | #define LMP_HOST_LE 0x02 | ||
219 | 227 | ||
220 | /* Connection modes */ | 228 | /* Connection modes */ |
221 | #define HCI_CM_ACTIVE 0x0000 | 229 | #define HCI_CM_ACTIVE 0x0000 |
@@ -254,6 +262,10 @@ enum { | |||
254 | #define HCI_LK_UNAUTH_COMBINATION 0x04 | 262 | #define HCI_LK_UNAUTH_COMBINATION 0x04 |
255 | #define HCI_LK_AUTH_COMBINATION 0x05 | 263 | #define HCI_LK_AUTH_COMBINATION 0x05 |
256 | #define HCI_LK_CHANGED_COMBINATION 0x06 | 264 | #define HCI_LK_CHANGED_COMBINATION 0x06 |
265 | /* The spec doesn't define types for SMP keys */ | ||
266 | #define HCI_LK_SMP_LTK 0x81 | ||
267 | #define HCI_LK_SMP_IRK 0x82 | ||
268 | #define HCI_LK_SMP_CSRK 0x83 | ||
257 | 269 | ||
258 | /* ----- HCI Commands ---- */ | 270 | /* ----- HCI Commands ---- */ |
259 | #define HCI_OP_NOP 0x0000 | 271 | #define HCI_OP_NOP 0x0000 |
@@ -653,6 +665,12 @@ struct hci_rp_read_local_oob_data { | |||
653 | 665 | ||
654 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | 666 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
655 | 667 | ||
668 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d | ||
669 | struct hci_cp_write_le_host_supported { | ||
670 | __u8 le; | ||
671 | __u8 simul; | ||
672 | } __packed; | ||
673 | |||
656 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 674 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
657 | struct hci_rp_read_local_version { | 675 | struct hci_rp_read_local_version { |
658 | __u8 status; | 676 | __u8 status; |
@@ -676,6 +694,9 @@ struct hci_rp_read_local_features { | |||
676 | } __packed; | 694 | } __packed; |
677 | 695 | ||
678 | #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 | 696 | #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 |
697 | struct hci_cp_read_local_ext_features { | ||
698 | __u8 page; | ||
699 | } __packed; | ||
679 | struct hci_rp_read_local_ext_features { | 700 | struct hci_rp_read_local_ext_features { |
680 | __u8 status; | 701 | __u8 status; |
681 | __u8 page; | 702 | __u8 page; |
@@ -710,6 +731,12 @@ struct hci_rp_le_read_buffer_size { | |||
710 | __u8 le_max_pkt; | 731 | __u8 le_max_pkt; |
711 | } __packed; | 732 | } __packed; |
712 | 733 | ||
734 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c | ||
735 | struct hci_cp_le_set_scan_enable { | ||
736 | __u8 enable; | ||
737 | __u8 filter_dup; | ||
738 | } __packed; | ||
739 | |||
713 | #define HCI_OP_LE_CREATE_CONN 0x200d | 740 | #define HCI_OP_LE_CREATE_CONN 0x200d |
714 | struct hci_cp_le_create_conn { | 741 | struct hci_cp_le_create_conn { |
715 | __le16 scan_interval; | 742 | __le16 scan_interval; |
@@ -739,6 +766,33 @@ struct hci_cp_le_conn_update { | |||
739 | __le16 max_ce_len; | 766 | __le16 max_ce_len; |
740 | } __packed; | 767 | } __packed; |
741 | 768 | ||
769 | #define HCI_OP_LE_START_ENC 0x2019 | ||
770 | struct hci_cp_le_start_enc { | ||
771 | __le16 handle; | ||
772 | __u8 rand[8]; | ||
773 | __le16 ediv; | ||
774 | __u8 ltk[16]; | ||
775 | } __packed; | ||
776 | |||
777 | #define HCI_OP_LE_LTK_REPLY 0x201a | ||
778 | struct hci_cp_le_ltk_reply { | ||
779 | __le16 handle; | ||
780 | __u8 ltk[16]; | ||
781 | } __packed; | ||
782 | struct hci_rp_le_ltk_reply { | ||
783 | __u8 status; | ||
784 | __le16 handle; | ||
785 | } __packed; | ||
786 | |||
787 | #define HCI_OP_LE_LTK_NEG_REPLY 0x201b | ||
788 | struct hci_cp_le_ltk_neg_reply { | ||
789 | __le16 handle; | ||
790 | } __packed; | ||
791 | struct hci_rp_le_ltk_neg_reply { | ||
792 | __u8 status; | ||
793 | __le16 handle; | ||
794 | } __packed; | ||
795 | |||
742 | /* ---- HCI Events ---- */ | 796 | /* ---- HCI Events ---- */ |
743 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 797 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
744 | 798 | ||
@@ -1029,6 +1083,32 @@ struct hci_ev_le_conn_complete { | |||
1029 | __u8 clk_accurancy; | 1083 | __u8 clk_accurancy; |
1030 | } __packed; | 1084 | } __packed; |
1031 | 1085 | ||
1086 | #define HCI_EV_LE_LTK_REQ 0x05 | ||
1087 | struct hci_ev_le_ltk_req { | ||
1088 | __le16 handle; | ||
1089 | __u8 random[8]; | ||
1090 | __le16 ediv; | ||
1091 | } __packed; | ||
1092 | |||
1093 | /* Advertising report event types */ | ||
1094 | #define ADV_IND 0x00 | ||
1095 | #define ADV_DIRECT_IND 0x01 | ||
1096 | #define ADV_SCAN_IND 0x02 | ||
1097 | #define ADV_NONCONN_IND 0x03 | ||
1098 | #define ADV_SCAN_RSP 0x04 | ||
1099 | |||
1100 | #define ADDR_LE_DEV_PUBLIC 0x00 | ||
1101 | #define ADDR_LE_DEV_RANDOM 0x01 | ||
1102 | |||
1103 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 | ||
1104 | struct hci_ev_le_advertising_info { | ||
1105 | __u8 evt_type; | ||
1106 | __u8 bdaddr_type; | ||
1107 | bdaddr_t bdaddr; | ||
1108 | __u8 length; | ||
1109 | __u8 data[0]; | ||
1110 | } __packed; | ||
1111 | |||
1032 | /* Internal events generated by Bluetooth stack */ | 1112 | /* Internal events generated by Bluetooth stack */ |
1033 | #define HCI_EV_STACK_INTERNAL 0xfd | 1113 | #define HCI_EV_STACK_INTERNAL 0xfd |
1034 | struct hci_ev_stack_internal { | 1114 | struct hci_ev_stack_internal { |
@@ -1184,6 +1264,9 @@ struct hci_conn_info { | |||
1184 | __u8 out; | 1264 | __u8 out; |
1185 | __u16 state; | 1265 | __u16 state; |
1186 | __u32 link_mode; | 1266 | __u32 link_mode; |
1267 | __u32 mtu; | ||
1268 | __u32 cnt; | ||
1269 | __u32 pkts; | ||
1187 | }; | 1270 | }; |
1188 | 1271 | ||
1189 | struct hci_dev_req { | 1272 | struct hci_dev_req { |