diff options
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r-- | include/net/bluetooth/hci.h | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 29a7a8ca0438..a5f8c4684a32 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -76,6 +76,14 @@ 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, | ||
79 | }; | 87 | }; |
80 | 88 | ||
81 | /* HCI ioctl defines */ | 89 | /* HCI ioctl defines */ |
@@ -111,6 +119,7 @@ enum { | |||
111 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 119 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ |
112 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ | 120 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ |
113 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 121 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ |
122 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | ||
114 | 123 | ||
115 | /* HCI data types */ | 124 | /* HCI data types */ |
116 | #define HCI_COMMAND_PKT 0x01 | 125 | #define HCI_COMMAND_PKT 0x01 |
@@ -150,6 +159,7 @@ enum { | |||
150 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) | 159 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) |
151 | 160 | ||
152 | /* ACL flags */ | 161 | /* ACL flags */ |
162 | #define ACL_START_NO_FLUSH 0x00 | ||
153 | #define ACL_CONT 0x01 | 163 | #define ACL_CONT 0x01 |
154 | #define ACL_START 0x02 | 164 | #define ACL_START 0x02 |
155 | #define ACL_ACTIVE_BCAST 0x04 | 165 | #define ACL_ACTIVE_BCAST 0x04 |
@@ -159,6 +169,8 @@ enum { | |||
159 | #define SCO_LINK 0x00 | 169 | #define SCO_LINK 0x00 |
160 | #define ACL_LINK 0x01 | 170 | #define ACL_LINK 0x01 |
161 | #define ESCO_LINK 0x02 | 171 | #define ESCO_LINK 0x02 |
172 | /* Low Energy links do not have defined link type. Use invented one */ | ||
173 | #define LE_LINK 0x80 | ||
162 | 174 | ||
163 | /* LMP features */ | 175 | /* LMP features */ |
164 | #define LMP_3SLOT 0x01 | 176 | #define LMP_3SLOT 0x01 |
@@ -183,17 +195,25 @@ enum { | |||
183 | #define LMP_PSCHEME 0x02 | 195 | #define LMP_PSCHEME 0x02 |
184 | #define LMP_PCONTROL 0x04 | 196 | #define LMP_PCONTROL 0x04 |
185 | 197 | ||
198 | #define LMP_RSSI_INQ 0x40 | ||
186 | #define LMP_ESCO 0x80 | 199 | #define LMP_ESCO 0x80 |
187 | 200 | ||
188 | #define LMP_EV4 0x01 | 201 | #define LMP_EV4 0x01 |
189 | #define LMP_EV5 0x02 | 202 | #define LMP_EV5 0x02 |
203 | #define LMP_LE 0x40 | ||
190 | 204 | ||
191 | #define LMP_SNIFF_SUBR 0x02 | 205 | #define LMP_SNIFF_SUBR 0x02 |
206 | #define LMP_PAUSE_ENC 0x04 | ||
192 | #define LMP_EDR_ESCO_2M 0x20 | 207 | #define LMP_EDR_ESCO_2M 0x20 |
193 | #define LMP_EDR_ESCO_3M 0x40 | 208 | #define LMP_EDR_ESCO_3M 0x40 |
194 | #define LMP_EDR_3S_ESCO 0x80 | 209 | #define LMP_EDR_3S_ESCO 0x80 |
195 | 210 | ||
211 | #define LMP_EXT_INQ 0x01 | ||
196 | #define LMP_SIMPLE_PAIR 0x08 | 212 | #define LMP_SIMPLE_PAIR 0x08 |
213 | #define LMP_NO_FLUSH 0x40 | ||
214 | |||
215 | #define LMP_LSTO 0x01 | ||
216 | #define LMP_INQ_TX_PWR 0x02 | ||
197 | 217 | ||
198 | /* Connection modes */ | 218 | /* Connection modes */ |
199 | #define HCI_CM_ACTIVE 0x0000 | 219 | #define HCI_CM_ACTIVE 0x0000 |
@@ -225,6 +245,8 @@ enum { | |||
225 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | 245 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
226 | 246 | ||
227 | /* ----- HCI Commands ---- */ | 247 | /* ----- HCI Commands ---- */ |
248 | #define HCI_OP_NOP 0x0000 | ||
249 | |||
228 | #define HCI_OP_INQUIRY 0x0401 | 250 | #define HCI_OP_INQUIRY 0x0401 |
229 | struct hci_cp_inquiry { | 251 | struct hci_cp_inquiry { |
230 | __u8 lap[3]; | 252 | __u8 lap[3]; |
@@ -292,11 +314,19 @@ struct hci_cp_pin_code_reply { | |||
292 | __u8 pin_len; | 314 | __u8 pin_len; |
293 | __u8 pin_code[16]; | 315 | __u8 pin_code[16]; |
294 | } __packed; | 316 | } __packed; |
317 | struct hci_rp_pin_code_reply { | ||
318 | __u8 status; | ||
319 | bdaddr_t bdaddr; | ||
320 | } __packed; | ||
295 | 321 | ||
296 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e | 322 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e |
297 | struct hci_cp_pin_code_neg_reply { | 323 | struct hci_cp_pin_code_neg_reply { |
298 | bdaddr_t bdaddr; | 324 | bdaddr_t bdaddr; |
299 | } __packed; | 325 | } __packed; |
326 | struct hci_rp_pin_code_neg_reply { | ||
327 | __u8 status; | ||
328 | bdaddr_t bdaddr; | ||
329 | } __packed; | ||
300 | 330 | ||
301 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f | 331 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f |
302 | struct hci_cp_change_conn_ptype { | 332 | struct hci_cp_change_conn_ptype { |
@@ -377,6 +407,20 @@ struct hci_cp_reject_sync_conn_req { | |||
377 | __u8 reason; | 407 | __u8 reason; |
378 | } __packed; | 408 | } __packed; |
379 | 409 | ||
410 | #define HCI_OP_IO_CAPABILITY_REPLY 0x042b | ||
411 | struct hci_cp_io_capability_reply { | ||
412 | bdaddr_t bdaddr; | ||
413 | __u8 capability; | ||
414 | __u8 oob_data; | ||
415 | __u8 authentication; | ||
416 | } __packed; | ||
417 | |||
418 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 | ||
419 | struct hci_cp_io_capability_neg_reply { | ||
420 | bdaddr_t bdaddr; | ||
421 | __u8 reason; | ||
422 | } __packed; | ||
423 | |||
380 | #define HCI_OP_SNIFF_MODE 0x0803 | 424 | #define HCI_OP_SNIFF_MODE 0x0803 |
381 | struct hci_cp_sniff_mode { | 425 | struct hci_cp_sniff_mode { |
382 | __le16 handle; | 426 | __le16 handle; |
@@ -474,6 +518,12 @@ struct hci_cp_set_event_flt { | |||
474 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 | 518 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 |
475 | #define HCI_CONN_SETUP_AUTO_ON 0x02 | 519 | #define HCI_CONN_SETUP_AUTO_ON 0x02 |
476 | 520 | ||
521 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 | ||
522 | struct hci_cp_delete_stored_link_key { | ||
523 | bdaddr_t bdaddr; | ||
524 | __u8 delete_all; | ||
525 | } __packed; | ||
526 | |||
477 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 527 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
478 | struct hci_cp_write_local_name { | 528 | struct hci_cp_write_local_name { |
479 | __u8 name[248]; | 529 | __u8 name[248]; |
@@ -537,6 +587,8 @@ struct hci_cp_host_buffer_size { | |||
537 | __le16 sco_max_pkt; | 587 | __le16 sco_max_pkt; |
538 | } __packed; | 588 | } __packed; |
539 | 589 | ||
590 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | ||
591 | |||
540 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 592 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
541 | struct hci_rp_read_ssp_mode { | 593 | struct hci_rp_read_ssp_mode { |
542 | __u8 status; | 594 | __u8 status; |
@@ -548,6 +600,8 @@ struct hci_cp_write_ssp_mode { | |||
548 | __u8 mode; | 600 | __u8 mode; |
549 | } __packed; | 601 | } __packed; |
550 | 602 | ||
603 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | ||
604 | |||
551 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 605 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
552 | struct hci_rp_read_local_version { | 606 | struct hci_rp_read_local_version { |
553 | __u8 status; | 607 | __u8 status; |
@@ -593,6 +647,47 @@ struct hci_rp_read_bd_addr { | |||
593 | bdaddr_t bdaddr; | 647 | bdaddr_t bdaddr; |
594 | } __packed; | 648 | } __packed; |
595 | 649 | ||
650 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | ||
651 | struct hci_cp_le_set_event_mask { | ||
652 | __u8 mask[8]; | ||
653 | } __packed; | ||
654 | |||
655 | #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 | ||
656 | struct hci_rp_le_read_buffer_size { | ||
657 | __u8 status; | ||
658 | __le16 le_mtu; | ||
659 | __u8 le_max_pkt; | ||
660 | } __packed; | ||
661 | |||
662 | #define HCI_OP_LE_CREATE_CONN 0x200d | ||
663 | struct hci_cp_le_create_conn { | ||
664 | __le16 scan_interval; | ||
665 | __le16 scan_window; | ||
666 | __u8 filter_policy; | ||
667 | __u8 peer_addr_type; | ||
668 | bdaddr_t peer_addr; | ||
669 | __u8 own_address_type; | ||
670 | __le16 conn_interval_min; | ||
671 | __le16 conn_interval_max; | ||
672 | __le16 conn_latency; | ||
673 | __le16 supervision_timeout; | ||
674 | __le16 min_ce_len; | ||
675 | __le16 max_ce_len; | ||
676 | } __packed; | ||
677 | |||
678 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e | ||
679 | |||
680 | #define HCI_OP_LE_CONN_UPDATE 0x2013 | ||
681 | struct hci_cp_le_conn_update { | ||
682 | __le16 handle; | ||
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 | |||
596 | /* ---- HCI Events ---- */ | 691 | /* ---- HCI Events ---- */ |
597 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 692 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
598 | 693 | ||
@@ -833,6 +928,14 @@ struct hci_ev_io_capa_request { | |||
833 | bdaddr_t bdaddr; | 928 | bdaddr_t bdaddr; |
834 | } __packed; | 929 | } __packed; |
835 | 930 | ||
931 | #define HCI_EV_IO_CAPA_REPLY 0x32 | ||
932 | struct hci_ev_io_capa_reply { | ||
933 | bdaddr_t bdaddr; | ||
934 | __u8 capability; | ||
935 | __u8 oob_data; | ||
936 | __u8 authentication; | ||
937 | } __packed; | ||
938 | |||
836 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 939 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
837 | struct hci_ev_simple_pair_complete { | 940 | struct hci_ev_simple_pair_complete { |
838 | __u8 status; | 941 | __u8 status; |
@@ -845,6 +948,25 @@ struct hci_ev_remote_host_features { | |||
845 | __u8 features[8]; | 948 | __u8 features[8]; |
846 | } __packed; | 949 | } __packed; |
847 | 950 | ||
951 | #define HCI_EV_LE_META 0x3e | ||
952 | struct hci_ev_le_meta { | ||
953 | __u8 subevent; | ||
954 | } __packed; | ||
955 | |||
956 | /* Low energy meta events */ | ||
957 | #define HCI_EV_LE_CONN_COMPLETE 0x01 | ||
958 | struct hci_ev_le_conn_complete { | ||
959 | __u8 status; | ||
960 | __le16 handle; | ||
961 | __u8 role; | ||
962 | __u8 bdaddr_type; | ||
963 | bdaddr_t bdaddr; | ||
964 | __le16 interval; | ||
965 | __le16 latency; | ||
966 | __le16 supervision_timeout; | ||
967 | __u8 clk_accurancy; | ||
968 | } __packed; | ||
969 | |||
848 | /* Internal events generated by Bluetooth stack */ | 970 | /* Internal events generated by Bluetooth stack */ |
849 | #define HCI_EV_STACK_INTERNAL 0xfd | 971 | #define HCI_EV_STACK_INTERNAL 0xfd |
850 | struct hci_ev_stack_internal { | 972 | struct hci_ev_stack_internal { |