diff options
Diffstat (limited to 'include/net/bluetooth/hci.h')
| -rw-r--r-- | include/net/bluetooth/hci.h | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 29a7a8ca0438..ec6acf2f1c0b 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,31 @@ 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_USER_CONFIRM_REPLY 0x042c | ||
| 419 | struct hci_cp_user_confirm_reply { | ||
| 420 | bdaddr_t bdaddr; | ||
| 421 | } __packed; | ||
| 422 | struct hci_rp_user_confirm_reply { | ||
| 423 | __u8 status; | ||
| 424 | bdaddr_t bdaddr; | ||
| 425 | } __packed; | ||
| 426 | |||
| 427 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d | ||
| 428 | |||
| 429 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 | ||
| 430 | struct hci_cp_io_capability_neg_reply { | ||
| 431 | bdaddr_t bdaddr; | ||
| 432 | __u8 reason; | ||
| 433 | } __packed; | ||
| 434 | |||
| 380 | #define HCI_OP_SNIFF_MODE 0x0803 | 435 | #define HCI_OP_SNIFF_MODE 0x0803 |
| 381 | struct hci_cp_sniff_mode { | 436 | struct hci_cp_sniff_mode { |
| 382 | __le16 handle; | 437 | __le16 handle; |
| @@ -474,6 +529,12 @@ struct hci_cp_set_event_flt { | |||
| 474 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 | 529 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 |
| 475 | #define HCI_CONN_SETUP_AUTO_ON 0x02 | 530 | #define HCI_CONN_SETUP_AUTO_ON 0x02 |
| 476 | 531 | ||
| 532 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 | ||
| 533 | struct hci_cp_delete_stored_link_key { | ||
| 534 | bdaddr_t bdaddr; | ||
| 535 | __u8 delete_all; | ||
| 536 | } __packed; | ||
| 537 | |||
| 477 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 538 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
| 478 | struct hci_cp_write_local_name { | 539 | struct hci_cp_write_local_name { |
| 479 | __u8 name[248]; | 540 | __u8 name[248]; |
| @@ -537,6 +598,8 @@ struct hci_cp_host_buffer_size { | |||
| 537 | __le16 sco_max_pkt; | 598 | __le16 sco_max_pkt; |
| 538 | } __packed; | 599 | } __packed; |
| 539 | 600 | ||
| 601 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | ||
| 602 | |||
| 540 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 603 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
| 541 | struct hci_rp_read_ssp_mode { | 604 | struct hci_rp_read_ssp_mode { |
| 542 | __u8 status; | 605 | __u8 status; |
| @@ -548,6 +611,8 @@ struct hci_cp_write_ssp_mode { | |||
| 548 | __u8 mode; | 611 | __u8 mode; |
| 549 | } __packed; | 612 | } __packed; |
| 550 | 613 | ||
| 614 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | ||
| 615 | |||
| 551 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 616 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
| 552 | struct hci_rp_read_local_version { | 617 | struct hci_rp_read_local_version { |
| 553 | __u8 status; | 618 | __u8 status; |
| @@ -593,6 +658,47 @@ struct hci_rp_read_bd_addr { | |||
| 593 | bdaddr_t bdaddr; | 658 | bdaddr_t bdaddr; |
| 594 | } __packed; | 659 | } __packed; |
| 595 | 660 | ||
| 661 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | ||
| 662 | struct hci_cp_le_set_event_mask { | ||
| 663 | __u8 mask[8]; | ||
| 664 | } __packed; | ||
| 665 | |||
| 666 | #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 | ||
| 667 | struct hci_rp_le_read_buffer_size { | ||
| 668 | __u8 status; | ||
| 669 | __le16 le_mtu; | ||
| 670 | __u8 le_max_pkt; | ||
| 671 | } __packed; | ||
| 672 | |||
| 673 | #define HCI_OP_LE_CREATE_CONN 0x200d | ||
| 674 | struct hci_cp_le_create_conn { | ||
| 675 | __le16 scan_interval; | ||
| 676 | __le16 scan_window; | ||
| 677 | __u8 filter_policy; | ||
| 678 | __u8 peer_addr_type; | ||
| 679 | bdaddr_t peer_addr; | ||
| 680 | __u8 own_address_type; | ||
| 681 | __le16 conn_interval_min; | ||
| 682 | __le16 conn_interval_max; | ||
| 683 | __le16 conn_latency; | ||
| 684 | __le16 supervision_timeout; | ||
| 685 | __le16 min_ce_len; | ||
| 686 | __le16 max_ce_len; | ||
| 687 | } __packed; | ||
| 688 | |||
| 689 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e | ||
| 690 | |||
| 691 | #define HCI_OP_LE_CONN_UPDATE 0x2013 | ||
| 692 | struct hci_cp_le_conn_update { | ||
| 693 | __le16 handle; | ||
| 694 | __le16 conn_interval_min; | ||
| 695 | __le16 conn_interval_max; | ||
| 696 | __le16 conn_latency; | ||
| 697 | __le16 supervision_timeout; | ||
| 698 | __le16 min_ce_len; | ||
| 699 | __le16 max_ce_len; | ||
| 700 | } __packed; | ||
| 701 | |||
| 596 | /* ---- HCI Events ---- */ | 702 | /* ---- HCI Events ---- */ |
| 597 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 703 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
| 598 | 704 | ||
| @@ -833,6 +939,20 @@ struct hci_ev_io_capa_request { | |||
| 833 | bdaddr_t bdaddr; | 939 | bdaddr_t bdaddr; |
| 834 | } __packed; | 940 | } __packed; |
| 835 | 941 | ||
| 942 | #define HCI_EV_IO_CAPA_REPLY 0x32 | ||
| 943 | struct hci_ev_io_capa_reply { | ||
| 944 | bdaddr_t bdaddr; | ||
| 945 | __u8 capability; | ||
| 946 | __u8 oob_data; | ||
| 947 | __u8 authentication; | ||
| 948 | } __packed; | ||
| 949 | |||
| 950 | #define HCI_EV_USER_CONFIRM_REQUEST 0x33 | ||
| 951 | struct hci_ev_user_confirm_req { | ||
| 952 | bdaddr_t bdaddr; | ||
| 953 | __le32 passkey; | ||
| 954 | } __packed; | ||
| 955 | |||
| 836 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 956 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
| 837 | struct hci_ev_simple_pair_complete { | 957 | struct hci_ev_simple_pair_complete { |
| 838 | __u8 status; | 958 | __u8 status; |
| @@ -845,6 +965,25 @@ struct hci_ev_remote_host_features { | |||
| 845 | __u8 features[8]; | 965 | __u8 features[8]; |
| 846 | } __packed; | 966 | } __packed; |
| 847 | 967 | ||
| 968 | #define HCI_EV_LE_META 0x3e | ||
| 969 | struct hci_ev_le_meta { | ||
| 970 | __u8 subevent; | ||
| 971 | } __packed; | ||
| 972 | |||
| 973 | /* Low energy meta events */ | ||
| 974 | #define HCI_EV_LE_CONN_COMPLETE 0x01 | ||
| 975 | struct hci_ev_le_conn_complete { | ||
| 976 | __u8 status; | ||
| 977 | __le16 handle; | ||
| 978 | __u8 role; | ||
| 979 | __u8 bdaddr_type; | ||
| 980 | bdaddr_t bdaddr; | ||
| 981 | __le16 interval; | ||
| 982 | __le16 latency; | ||
| 983 | __le16 supervision_timeout; | ||
| 984 | __u8 clk_accurancy; | ||
| 985 | } __packed; | ||
| 986 | |||
| 848 | /* Internal events generated by Bluetooth stack */ | 987 | /* Internal events generated by Bluetooth stack */ |
| 849 | #define HCI_EV_STACK_INTERNAL 0xfd | 988 | #define HCI_EV_STACK_INTERNAL 0xfd |
| 850 | struct hci_ev_stack_internal { | 989 | struct hci_ev_stack_internal { |
