aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r--include/net/bluetooth/hci.h69
1 files changed, 67 insertions, 2 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 76b2b6bdcf36..45eee08157bb 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -33,6 +33,8 @@
33#define HCI_LINK_KEY_SIZE 16 33#define HCI_LINK_KEY_SIZE 16
34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE)
35 35
36#define HCI_MAX_AMP_ASSOC_SIZE 672
37
36/* HCI dev events */ 38/* HCI dev events */
37#define HCI_DEV_REG 1 39#define HCI_DEV_REG 1
38#define HCI_DEV_UNREG 2 40#define HCI_DEV_UNREG 2
@@ -113,6 +115,7 @@ enum {
113 HCI_SSP_ENABLED, 115 HCI_SSP_ENABLED,
114 HCI_HS_ENABLED, 116 HCI_HS_ENABLED,
115 HCI_LE_ENABLED, 117 HCI_LE_ENABLED,
118 HCI_LE_PERIPHERAL,
116 HCI_CONNECTABLE, 119 HCI_CONNECTABLE,
117 HCI_DISCOVERABLE, 120 HCI_DISCOVERABLE,
118 HCI_LINK_SECURITY, 121 HCI_LINK_SECURITY,
@@ -151,7 +154,7 @@ enum {
151#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 154#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
152#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 155#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
153#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 156#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
154#define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ 157#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
155#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 158#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
156#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 159#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
157 160
@@ -196,6 +199,7 @@ enum {
196#define ACL_START_NO_FLUSH 0x00 199#define ACL_START_NO_FLUSH 0x00
197#define ACL_CONT 0x01 200#define ACL_CONT 0x01
198#define ACL_START 0x02 201#define ACL_START 0x02
202#define ACL_COMPLETE 0x03
199#define ACL_ACTIVE_BCAST 0x04 203#define ACL_ACTIVE_BCAST 0x04
200#define ACL_PICO_BCAST 0x08 204#define ACL_PICO_BCAST 0x08
201 205
@@ -205,6 +209,7 @@ enum {
205#define ESCO_LINK 0x02 209#define ESCO_LINK 0x02
206/* Low Energy links do not have defined link type. Use invented one */ 210/* Low Energy links do not have defined link type. Use invented one */
207#define LE_LINK 0x80 211#define LE_LINK 0x80
212#define AMP_LINK 0x81
208 213
209/* LMP features */ 214/* LMP features */
210#define LMP_3SLOT 0x01 215#define LMP_3SLOT 0x01
@@ -314,6 +319,9 @@ enum {
314#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 319#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
315#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 320#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
316 321
322/* The core spec defines 127 as the "not available" value */
323#define HCI_TX_POWER_INVALID 127
324
317/* Extended Inquiry Response field types */ 325/* Extended Inquiry Response field types */
318#define EIR_FLAGS 0x01 /* flags */ 326#define EIR_FLAGS 0x01 /* flags */
319#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 327#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
@@ -330,6 +338,13 @@ enum {
330#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ 338#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
331#define EIR_DEVICE_ID 0x10 /* device ID */ 339#define EIR_DEVICE_ID 0x10 /* device ID */
332 340
341/* Low Energy Advertising Flags */
342#define LE_AD_LIMITED 0x01 /* Limited Discoverable */
343#define LE_AD_GENERAL 0x02 /* General Discoverable */
344#define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
345#define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */
346#define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */
347
333/* ----- HCI Commands ---- */ 348/* ----- HCI Commands ---- */
334#define HCI_OP_NOP 0x0000 349#define HCI_OP_NOP 0x0000
335 350
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link {
556 __u8 key[HCI_AMP_LINK_KEY_SIZE]; 571 __u8 key[HCI_AMP_LINK_KEY_SIZE];
557} __packed; 572} __packed;
558 573
559#define HCI_OP_DISCONN_PHY_LINK 0x0437 574#define HCI_OP_DISCONN_PHY_LINK 0x0437
560struct hci_cp_disconn_phy_link { 575struct hci_cp_disconn_phy_link {
561 __u8 phy_handle; 576 __u8 phy_handle;
562 __u8 reason; 577 __u8 reason;
563} __packed; 578} __packed;
564 579
580struct ext_flow_spec {
581 __u8 id;
582 __u8 stype;
583 __le16 msdu;
584 __le32 sdu_itime;
585 __le32 acc_lat;
586 __le32 flush_to;
587} __packed;
588
589#define HCI_OP_CREATE_LOGICAL_LINK 0x0438
590#define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439
591struct hci_cp_create_accept_logical_link {
592 __u8 phy_handle;
593 struct ext_flow_spec tx_flow_spec;
594 struct ext_flow_spec rx_flow_spec;
595} __packed;
596
597#define HCI_OP_DISCONN_LOGICAL_LINK 0x043a
598struct hci_cp_disconn_logical_link {
599 __le16 log_handle;
600} __packed;
601
602#define HCI_OP_LOGICAL_LINK_CANCEL 0x043b
603struct hci_cp_logical_link_cancel {
604 __u8 phy_handle;
605 __u8 flow_spec_id;
606} __packed;
607
608struct hci_rp_logical_link_cancel {
609 __u8 status;
610 __u8 phy_handle;
611 __u8 flow_spec_id;
612} __packed;
613
565#define HCI_OP_SNIFF_MODE 0x0803 614#define HCI_OP_SNIFF_MODE 0x0803
566struct hci_cp_sniff_mode { 615struct hci_cp_sniff_mode {
567 __le16 handle; 616 __le16 handle;
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size {
894 __u8 le_max_pkt; 943 __u8 le_max_pkt;
895} __packed; 944} __packed;
896 945
946#define HCI_OP_LE_READ_ADV_TX_POWER 0x2007
947struct hci_rp_le_read_adv_tx_power {
948 __u8 status;
949 __s8 tx_power;
950} __packed;
951
952#define HCI_MAX_AD_LENGTH 31
953
954#define HCI_OP_LE_SET_ADV_DATA 0x2008
955struct hci_cp_le_set_adv_data {
956 __u8 length;
957 __u8 data[HCI_MAX_AD_LENGTH];
958} __packed;
959
960#define HCI_OP_LE_SET_ADV_ENABLE 0x200a
961
897#define HCI_OP_LE_SET_SCAN_PARAM 0x200b 962#define HCI_OP_LE_SET_SCAN_PARAM 0x200b
898struct hci_cp_le_set_scan_param { 963struct hci_cp_le_set_scan_param {
899 __u8 type; 964 __u8 type;