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.h76
1 files changed, 59 insertions, 17 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 00596e816b4d..344b0f972828 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -77,14 +77,6 @@ enum {
77 77
78 HCI_RAW, 78 HCI_RAW,
79 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, 80 HCI_RESET,
89}; 81};
90 82
@@ -93,7 +85,22 @@ enum {
93 * states from the controller. 85 * states from the controller.
94 */ 86 */
95enum { 87enum {
88 HCI_SETUP,
89 HCI_AUTO_OFF,
90 HCI_MGMT,
91 HCI_PAIRABLE,
92 HCI_SERVICE_CACHE,
93 HCI_LINK_KEYS,
94 HCI_DEBUG_KEYS,
95
96 HCI_LE_SCAN, 96 HCI_LE_SCAN,
97 HCI_SSP_ENABLED,
98 HCI_HS_ENABLED,
99 HCI_LE_ENABLED,
100 HCI_CONNECTABLE,
101 HCI_DISCOVERABLE,
102 HCI_LINK_SECURITY,
103 HCI_PENDING_CLASS,
97}; 104};
98 105
99/* HCI ioctl defines */ 106/* HCI ioctl defines */
@@ -130,6 +137,7 @@ enum {
130#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ 137#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
131#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 138#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
132#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ 139#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */
140#define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */
133 141
134/* HCI data types */ 142/* HCI data types */
135#define HCI_COMMAND_PKT 0x01 143#define HCI_COMMAND_PKT 0x01
@@ -229,7 +237,9 @@ enum {
229#define LMP_EXTFEATURES 0x80 237#define LMP_EXTFEATURES 0x80
230 238
231/* Extended LMP features */ 239/* Extended LMP features */
232#define LMP_HOST_LE 0x02 240#define LMP_HOST_SSP 0x01
241#define LMP_HOST_LE 0x02
242#define LMP_HOST_LE_BREDR 0x04
233 243
234/* Connection modes */ 244/* Connection modes */
235#define HCI_CM_ACTIVE 0x0000 245#define HCI_CM_ACTIVE 0x0000
@@ -268,10 +278,11 @@ enum {
268#define HCI_LK_UNAUTH_COMBINATION 0x04 278#define HCI_LK_UNAUTH_COMBINATION 0x04
269#define HCI_LK_AUTH_COMBINATION 0x05 279#define HCI_LK_AUTH_COMBINATION 0x05
270#define HCI_LK_CHANGED_COMBINATION 0x06 280#define HCI_LK_CHANGED_COMBINATION 0x06
271/* The spec doesn't define types for SMP keys */ 281/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
272#define HCI_LK_SMP_LTK 0x81 282#define HCI_SMP_STK 0x80
273#define HCI_LK_SMP_IRK 0x82 283#define HCI_SMP_STK_SLAVE 0x81
274#define HCI_LK_SMP_CSRK 0x83 284#define HCI_SMP_LTK 0x82
285#define HCI_SMP_LTK_SLAVE 0x83
275 286
276/* ---- HCI Error Codes ---- */ 287/* ---- HCI Error Codes ---- */
277#define HCI_ERROR_AUTH_FAILURE 0x05 288#define HCI_ERROR_AUTH_FAILURE 0x05
@@ -284,6 +295,22 @@ enum {
284#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 295#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
285#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 296#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
286 297
298/* Extended Inquiry Response field types */
299#define EIR_FLAGS 0x01 /* flags */
300#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
301#define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */
302#define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */
303#define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */
304#define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */
305#define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */
306#define EIR_NAME_SHORT 0x08 /* shortened local name */
307#define EIR_NAME_COMPLETE 0x09 /* complete local name */
308#define EIR_TX_POWER 0x0A /* transmit power level */
309#define EIR_CLASS_OF_DEV 0x0D /* Class of Device */
310#define EIR_SSP_HASH_C 0x0E /* Simple Pairing Hash C */
311#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
312#define EIR_DEVICE_ID 0x10 /* device ID */
313
287/* ----- HCI Commands ---- */ 314/* ----- HCI Commands ---- */
288#define HCI_OP_NOP 0x0000 315#define HCI_OP_NOP 0x0000
289 316
@@ -666,8 +693,8 @@ struct hci_cp_host_buffer_size {
666 693
667#define HCI_OP_WRITE_EIR 0x0c52 694#define HCI_OP_WRITE_EIR 0x0c52
668struct hci_cp_write_eir { 695struct hci_cp_write_eir {
669 uint8_t fec; 696 __u8 fec;
670 uint8_t data[HCI_MAX_EIR_LENGTH]; 697 __u8 data[HCI_MAX_EIR_LENGTH];
671} __packed; 698} __packed;
672 699
673#define HCI_OP_READ_SSP_MODE 0x0c55 700#define HCI_OP_READ_SSP_MODE 0x0c55
@@ -698,8 +725,8 @@ struct hci_rp_read_flow_control_mode {
698 725
699#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 726#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
700struct hci_cp_write_le_host_supported { 727struct hci_cp_write_le_host_supported {
701 __u8 le; 728 __u8 le;
702 __u8 simul; 729 __u8 simul;
703} __packed; 730} __packed;
704 731
705#define HCI_OP_READ_LOCAL_VERSION 0x1001 732#define HCI_OP_READ_LOCAL_VERSION 0x1001
@@ -1155,6 +1182,19 @@ struct hci_ev_le_meta {
1155 __u8 subevent; 1182 __u8 subevent;
1156} __packed; 1183} __packed;
1157 1184
1185#define HCI_EV_NUM_COMP_BLOCKS 0x48
1186struct hci_comp_blocks_info {
1187 __le16 handle;
1188 __le16 pkts;
1189 __le16 blocks;
1190} __packed;
1191
1192struct hci_ev_num_comp_blocks {
1193 __le16 num_blocks;
1194 __u8 num_hndl;
1195 struct hci_comp_blocks_info handles[0];
1196} __packed;
1197
1158/* Low energy meta events */ 1198/* Low energy meta events */
1159#define HCI_EV_LE_CONN_COMPLETE 0x01 1199#define HCI_EV_LE_CONN_COMPLETE 0x01
1160struct hci_ev_le_conn_complete { 1200struct hci_ev_le_conn_complete {
@@ -1288,6 +1328,7 @@ struct sockaddr_hci {
1288 1328
1289#define HCI_CHANNEL_RAW 0 1329#define HCI_CHANNEL_RAW 0
1290#define HCI_CHANNEL_CONTROL 1 1330#define HCI_CHANNEL_CONTROL 1
1331#define HCI_CHANNEL_MONITOR 2
1291 1332
1292struct hci_filter { 1333struct hci_filter {
1293 unsigned long type_mask; 1334 unsigned long type_mask;
@@ -1389,5 +1430,6 @@ struct hci_inquiry_req {
1389#define IREQ_CACHE_FLUSH 0x0001 1430#define IREQ_CACHE_FLUSH 0x0001
1390 1431
1391extern bool enable_hs; 1432extern bool enable_hs;
1433extern bool enable_le;
1392 1434
1393#endif /* __HCI_H */ 1435#endif /* __HCI_H */