diff options
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r-- | include/net/bluetooth/hci.h | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 29a7a8ca0438..2c0d309c7381 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -76,6 +76,16 @@ enum { | |||
76 | HCI_INQUIRY, | 76 | HCI_INQUIRY, |
77 | 77 | ||
78 | HCI_RAW, | 78 | HCI_RAW, |
79 | |||
80 | HCI_SETUP, | ||
81 | HCI_AUTO_OFF, | ||
82 | HCI_MGMT, | ||
83 | HCI_PAIRABLE, | ||
84 | HCI_SERVICE_CACHE, | ||
85 | HCI_LINK_KEYS, | ||
86 | HCI_DEBUG_KEYS, | ||
87 | |||
88 | HCI_RESET, | ||
79 | }; | 89 | }; |
80 | 90 | ||
81 | /* HCI ioctl defines */ | 91 | /* HCI ioctl defines */ |
@@ -111,6 +121,7 @@ enum { | |||
111 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 121 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ |
112 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ | 122 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ |
113 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 123 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ |
124 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | ||
114 | 125 | ||
115 | /* HCI data types */ | 126 | /* HCI data types */ |
116 | #define HCI_COMMAND_PKT 0x01 | 127 | #define HCI_COMMAND_PKT 0x01 |
@@ -150,6 +161,7 @@ enum { | |||
150 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) | 161 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) |
151 | 162 | ||
152 | /* ACL flags */ | 163 | /* ACL flags */ |
164 | #define ACL_START_NO_FLUSH 0x00 | ||
153 | #define ACL_CONT 0x01 | 165 | #define ACL_CONT 0x01 |
154 | #define ACL_START 0x02 | 166 | #define ACL_START 0x02 |
155 | #define ACL_ACTIVE_BCAST 0x04 | 167 | #define ACL_ACTIVE_BCAST 0x04 |
@@ -159,6 +171,8 @@ enum { | |||
159 | #define SCO_LINK 0x00 | 171 | #define SCO_LINK 0x00 |
160 | #define ACL_LINK 0x01 | 172 | #define ACL_LINK 0x01 |
161 | #define ESCO_LINK 0x02 | 173 | #define ESCO_LINK 0x02 |
174 | /* Low Energy links do not have defined link type. Use invented one */ | ||
175 | #define LE_LINK 0x80 | ||
162 | 176 | ||
163 | /* LMP features */ | 177 | /* LMP features */ |
164 | #define LMP_3SLOT 0x01 | 178 | #define LMP_3SLOT 0x01 |
@@ -183,17 +197,25 @@ enum { | |||
183 | #define LMP_PSCHEME 0x02 | 197 | #define LMP_PSCHEME 0x02 |
184 | #define LMP_PCONTROL 0x04 | 198 | #define LMP_PCONTROL 0x04 |
185 | 199 | ||
200 | #define LMP_RSSI_INQ 0x40 | ||
186 | #define LMP_ESCO 0x80 | 201 | #define LMP_ESCO 0x80 |
187 | 202 | ||
188 | #define LMP_EV4 0x01 | 203 | #define LMP_EV4 0x01 |
189 | #define LMP_EV5 0x02 | 204 | #define LMP_EV5 0x02 |
205 | #define LMP_LE 0x40 | ||
190 | 206 | ||
191 | #define LMP_SNIFF_SUBR 0x02 | 207 | #define LMP_SNIFF_SUBR 0x02 |
208 | #define LMP_PAUSE_ENC 0x04 | ||
192 | #define LMP_EDR_ESCO_2M 0x20 | 209 | #define LMP_EDR_ESCO_2M 0x20 |
193 | #define LMP_EDR_ESCO_3M 0x40 | 210 | #define LMP_EDR_ESCO_3M 0x40 |
194 | #define LMP_EDR_3S_ESCO 0x80 | 211 | #define LMP_EDR_3S_ESCO 0x80 |
195 | 212 | ||
213 | #define LMP_EXT_INQ 0x01 | ||
196 | #define LMP_SIMPLE_PAIR 0x08 | 214 | #define LMP_SIMPLE_PAIR 0x08 |
215 | #define LMP_NO_FLUSH 0x40 | ||
216 | |||
217 | #define LMP_LSTO 0x01 | ||
218 | #define LMP_INQ_TX_PWR 0x02 | ||
197 | 219 | ||
198 | /* Connection modes */ | 220 | /* Connection modes */ |
199 | #define HCI_CM_ACTIVE 0x0000 | 221 | #define HCI_CM_ACTIVE 0x0000 |
@@ -225,6 +247,8 @@ enum { | |||
225 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | 247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
226 | 248 | ||
227 | /* ----- HCI Commands ---- */ | 249 | /* ----- HCI Commands ---- */ |
250 | #define HCI_OP_NOP 0x0000 | ||
251 | |||
228 | #define HCI_OP_INQUIRY 0x0401 | 252 | #define HCI_OP_INQUIRY 0x0401 |
229 | struct hci_cp_inquiry { | 253 | struct hci_cp_inquiry { |
230 | __u8 lap[3]; | 254 | __u8 lap[3]; |
@@ -292,11 +316,19 @@ struct hci_cp_pin_code_reply { | |||
292 | __u8 pin_len; | 316 | __u8 pin_len; |
293 | __u8 pin_code[16]; | 317 | __u8 pin_code[16]; |
294 | } __packed; | 318 | } __packed; |
319 | struct hci_rp_pin_code_reply { | ||
320 | __u8 status; | ||
321 | bdaddr_t bdaddr; | ||
322 | } __packed; | ||
295 | 323 | ||
296 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e | 324 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e |
297 | struct hci_cp_pin_code_neg_reply { | 325 | struct hci_cp_pin_code_neg_reply { |
298 | bdaddr_t bdaddr; | 326 | bdaddr_t bdaddr; |
299 | } __packed; | 327 | } __packed; |
328 | struct hci_rp_pin_code_neg_reply { | ||
329 | __u8 status; | ||
330 | bdaddr_t bdaddr; | ||
331 | } __packed; | ||
300 | 332 | ||
301 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f | 333 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f |
302 | struct hci_cp_change_conn_ptype { | 334 | struct hci_cp_change_conn_ptype { |
@@ -377,6 +409,31 @@ struct hci_cp_reject_sync_conn_req { | |||
377 | __u8 reason; | 409 | __u8 reason; |
378 | } __packed; | 410 | } __packed; |
379 | 411 | ||
412 | #define HCI_OP_IO_CAPABILITY_REPLY 0x042b | ||
413 | struct hci_cp_io_capability_reply { | ||
414 | bdaddr_t bdaddr; | ||
415 | __u8 capability; | ||
416 | __u8 oob_data; | ||
417 | __u8 authentication; | ||
418 | } __packed; | ||
419 | |||
420 | #define HCI_OP_USER_CONFIRM_REPLY 0x042c | ||
421 | struct hci_cp_user_confirm_reply { | ||
422 | bdaddr_t bdaddr; | ||
423 | } __packed; | ||
424 | struct hci_rp_user_confirm_reply { | ||
425 | __u8 status; | ||
426 | bdaddr_t bdaddr; | ||
427 | } __packed; | ||
428 | |||
429 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d | ||
430 | |||
431 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 | ||
432 | struct hci_cp_io_capability_neg_reply { | ||
433 | bdaddr_t bdaddr; | ||
434 | __u8 reason; | ||
435 | } __packed; | ||
436 | |||
380 | #define HCI_OP_SNIFF_MODE 0x0803 | 437 | #define HCI_OP_SNIFF_MODE 0x0803 |
381 | struct hci_cp_sniff_mode { | 438 | struct hci_cp_sniff_mode { |
382 | __le16 handle; | 439 | __le16 handle; |
@@ -474,6 +531,12 @@ struct hci_cp_set_event_flt { | |||
474 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 | 531 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 |
475 | #define HCI_CONN_SETUP_AUTO_ON 0x02 | 532 | #define HCI_CONN_SETUP_AUTO_ON 0x02 |
476 | 533 | ||
534 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 | ||
535 | struct hci_cp_delete_stored_link_key { | ||
536 | bdaddr_t bdaddr; | ||
537 | __u8 delete_all; | ||
538 | } __packed; | ||
539 | |||
477 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 540 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
478 | struct hci_cp_write_local_name { | 541 | struct hci_cp_write_local_name { |
479 | __u8 name[248]; | 542 | __u8 name[248]; |
@@ -537,6 +600,8 @@ struct hci_cp_host_buffer_size { | |||
537 | __le16 sco_max_pkt; | 600 | __le16 sco_max_pkt; |
538 | } __packed; | 601 | } __packed; |
539 | 602 | ||
603 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | ||
604 | |||
540 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 605 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
541 | struct hci_rp_read_ssp_mode { | 606 | struct hci_rp_read_ssp_mode { |
542 | __u8 status; | 607 | __u8 status; |
@@ -548,6 +613,8 @@ struct hci_cp_write_ssp_mode { | |||
548 | __u8 mode; | 613 | __u8 mode; |
549 | } __packed; | 614 | } __packed; |
550 | 615 | ||
616 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | ||
617 | |||
551 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 618 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
552 | struct hci_rp_read_local_version { | 619 | struct hci_rp_read_local_version { |
553 | __u8 status; | 620 | __u8 status; |
@@ -593,6 +660,47 @@ struct hci_rp_read_bd_addr { | |||
593 | bdaddr_t bdaddr; | 660 | bdaddr_t bdaddr; |
594 | } __packed; | 661 | } __packed; |
595 | 662 | ||
663 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | ||
664 | struct hci_cp_le_set_event_mask { | ||
665 | __u8 mask[8]; | ||
666 | } __packed; | ||
667 | |||
668 | #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 | ||
669 | struct hci_rp_le_read_buffer_size { | ||
670 | __u8 status; | ||
671 | __le16 le_mtu; | ||
672 | __u8 le_max_pkt; | ||
673 | } __packed; | ||
674 | |||
675 | #define HCI_OP_LE_CREATE_CONN 0x200d | ||
676 | struct hci_cp_le_create_conn { | ||
677 | __le16 scan_interval; | ||
678 | __le16 scan_window; | ||
679 | __u8 filter_policy; | ||
680 | __u8 peer_addr_type; | ||
681 | bdaddr_t peer_addr; | ||
682 | __u8 own_address_type; | ||
683 | __le16 conn_interval_min; | ||
684 | __le16 conn_interval_max; | ||
685 | __le16 conn_latency; | ||
686 | __le16 supervision_timeout; | ||
687 | __le16 min_ce_len; | ||
688 | __le16 max_ce_len; | ||
689 | } __packed; | ||
690 | |||
691 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e | ||
692 | |||
693 | #define HCI_OP_LE_CONN_UPDATE 0x2013 | ||
694 | struct hci_cp_le_conn_update { | ||
695 | __le16 handle; | ||
696 | __le16 conn_interval_min; | ||
697 | __le16 conn_interval_max; | ||
698 | __le16 conn_latency; | ||
699 | __le16 supervision_timeout; | ||
700 | __le16 min_ce_len; | ||
701 | __le16 max_ce_len; | ||
702 | } __packed; | ||
703 | |||
596 | /* ---- HCI Events ---- */ | 704 | /* ---- HCI Events ---- */ |
597 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 705 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
598 | 706 | ||
@@ -833,6 +941,20 @@ struct hci_ev_io_capa_request { | |||
833 | bdaddr_t bdaddr; | 941 | bdaddr_t bdaddr; |
834 | } __packed; | 942 | } __packed; |
835 | 943 | ||
944 | #define HCI_EV_IO_CAPA_REPLY 0x32 | ||
945 | struct hci_ev_io_capa_reply { | ||
946 | bdaddr_t bdaddr; | ||
947 | __u8 capability; | ||
948 | __u8 oob_data; | ||
949 | __u8 authentication; | ||
950 | } __packed; | ||
951 | |||
952 | #define HCI_EV_USER_CONFIRM_REQUEST 0x33 | ||
953 | struct hci_ev_user_confirm_req { | ||
954 | bdaddr_t bdaddr; | ||
955 | __le32 passkey; | ||
956 | } __packed; | ||
957 | |||
836 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 958 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
837 | struct hci_ev_simple_pair_complete { | 959 | struct hci_ev_simple_pair_complete { |
838 | __u8 status; | 960 | __u8 status; |
@@ -845,6 +967,25 @@ struct hci_ev_remote_host_features { | |||
845 | __u8 features[8]; | 967 | __u8 features[8]; |
846 | } __packed; | 968 | } __packed; |
847 | 969 | ||
970 | #define HCI_EV_LE_META 0x3e | ||
971 | struct hci_ev_le_meta { | ||
972 | __u8 subevent; | ||
973 | } __packed; | ||
974 | |||
975 | /* Low energy meta events */ | ||
976 | #define HCI_EV_LE_CONN_COMPLETE 0x01 | ||
977 | struct hci_ev_le_conn_complete { | ||
978 | __u8 status; | ||
979 | __le16 handle; | ||
980 | __u8 role; | ||
981 | __u8 bdaddr_type; | ||
982 | bdaddr_t bdaddr; | ||
983 | __le16 interval; | ||
984 | __le16 latency; | ||
985 | __le16 supervision_timeout; | ||
986 | __u8 clk_accurancy; | ||
987 | } __packed; | ||
988 | |||
848 | /* Internal events generated by Bluetooth stack */ | 989 | /* Internal events generated by Bluetooth stack */ |
849 | #define HCI_EV_STACK_INTERNAL 0xfd | 990 | #define HCI_EV_STACK_INTERNAL 0xfd |
850 | struct hci_ev_stack_internal { | 991 | struct hci_ev_stack_internal { |