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, 72 insertions, 4 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 66c1cd87bfe7..be150cf8cd43 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -117,11 +117,18 @@ enum {
117 HCI_SERVICE_CACHE, 117 HCI_SERVICE_CACHE,
118 HCI_DEBUG_KEYS, 118 HCI_DEBUG_KEYS,
119 HCI_DUT_MODE, 119 HCI_DUT_MODE,
120 HCI_FORCE_SC,
121 HCI_FORCE_STATIC_ADDR,
120 HCI_UNREGISTER, 122 HCI_UNREGISTER,
121 HCI_USER_CHANNEL, 123 HCI_USER_CHANNEL,
122 124
123 HCI_LE_SCAN, 125 HCI_LE_SCAN,
124 HCI_SSP_ENABLED, 126 HCI_SSP_ENABLED,
127 HCI_SC_ENABLED,
128 HCI_SC_ONLY,
129 HCI_PRIVACY,
130 HCI_RPA_EXPIRED,
131 HCI_RPA_RESOLVING,
125 HCI_HS_ENABLED, 132 HCI_HS_ENABLED,
126 HCI_LE_ENABLED, 133 HCI_LE_ENABLED,
127 HCI_ADVERTISING, 134 HCI_ADVERTISING,
@@ -133,6 +140,7 @@ enum {
133 HCI_FAST_CONNECTABLE, 140 HCI_FAST_CONNECTABLE,
134 HCI_BREDR_ENABLED, 141 HCI_BREDR_ENABLED,
135 HCI_6LOWPAN_ENABLED, 142 HCI_6LOWPAN_ENABLED,
143 HCI_LE_SCAN_INTERRUPTED,
136}; 144};
137 145
138/* A mask for the flags that are supposed to remain when a reset happens 146/* A mask for the flags that are supposed to remain when a reset happens
@@ -175,6 +183,8 @@ enum {
175#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 183#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
176#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 184#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
177#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 185#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
186#define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */
187#define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */
178 188
179/* HCI data types */ 189/* HCI data types */
180#define HCI_COMMAND_PKT 0x01 190#define HCI_COMMAND_PKT 0x01
@@ -282,10 +292,14 @@ enum {
282#define LMP_SYNC_TRAIN 0x04 292#define LMP_SYNC_TRAIN 0x04
283#define LMP_SYNC_SCAN 0x08 293#define LMP_SYNC_SCAN 0x08
284 294
295#define LMP_SC 0x01
296#define LMP_PING 0x02
297
285/* Host features */ 298/* Host features */
286#define LMP_HOST_SSP 0x01 299#define LMP_HOST_SSP 0x01
287#define LMP_HOST_LE 0x02 300#define LMP_HOST_LE 0x02
288#define LMP_HOST_LE_BREDR 0x04 301#define LMP_HOST_LE_BREDR 0x04
302#define LMP_HOST_SC 0x08
289 303
290/* Connection modes */ 304/* Connection modes */
291#define HCI_CM_ACTIVE 0x0000 305#define HCI_CM_ACTIVE 0x0000
@@ -307,6 +321,7 @@ enum {
307#define HCI_LM_TRUSTED 0x0008 321#define HCI_LM_TRUSTED 0x0008
308#define HCI_LM_RELIABLE 0x0010 322#define HCI_LM_RELIABLE 0x0010
309#define HCI_LM_SECURE 0x0020 323#define HCI_LM_SECURE 0x0020
324#define HCI_LM_FIPS 0x0040
310 325
311/* Authentication types */ 326/* Authentication types */
312#define HCI_AT_NO_BONDING 0x00 327#define HCI_AT_NO_BONDING 0x00
@@ -327,17 +342,24 @@ enum {
327#define HCI_LK_LOCAL_UNIT 0x01 342#define HCI_LK_LOCAL_UNIT 0x01
328#define HCI_LK_REMOTE_UNIT 0x02 343#define HCI_LK_REMOTE_UNIT 0x02
329#define HCI_LK_DEBUG_COMBINATION 0x03 344#define HCI_LK_DEBUG_COMBINATION 0x03
330#define HCI_LK_UNAUTH_COMBINATION 0x04 345#define HCI_LK_UNAUTH_COMBINATION_P192 0x04
331#define HCI_LK_AUTH_COMBINATION 0x05 346#define HCI_LK_AUTH_COMBINATION_P192 0x05
332#define HCI_LK_CHANGED_COMBINATION 0x06 347#define HCI_LK_CHANGED_COMBINATION 0x06
348#define HCI_LK_UNAUTH_COMBINATION_P256 0x07
349#define HCI_LK_AUTH_COMBINATION_P256 0x08
333/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ 350/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
334#define HCI_SMP_STK 0x80 351#define HCI_SMP_STK 0x80
335#define HCI_SMP_STK_SLAVE 0x81 352#define HCI_SMP_STK_SLAVE 0x81
336#define HCI_SMP_LTK 0x82 353#define HCI_SMP_LTK 0x82
337#define HCI_SMP_LTK_SLAVE 0x83 354#define HCI_SMP_LTK_SLAVE 0x83
338 355
356/* Long Term Key types */
357#define HCI_LTK_UNAUTH 0x00
358#define HCI_LTK_AUTH 0x01
359
339/* ---- HCI Error Codes ---- */ 360/* ---- HCI Error Codes ---- */
340#define HCI_ERROR_AUTH_FAILURE 0x05 361#define HCI_ERROR_AUTH_FAILURE 0x05
362#define HCI_ERROR_MEMORY_EXCEEDED 0x07
341#define HCI_ERROR_CONNECTION_TIMEOUT 0x08 363#define HCI_ERROR_CONNECTION_TIMEOUT 0x08
342#define HCI_ERROR_REJ_BAD_ADDR 0x0f 364#define HCI_ERROR_REJ_BAD_ADDR 0x0f
343#define HCI_ERROR_REMOTE_USER_TERM 0x13 365#define HCI_ERROR_REMOTE_USER_TERM 0x13
@@ -660,6 +682,15 @@ struct hci_rp_set_csb {
660 682
661#define HCI_OP_START_SYNC_TRAIN 0x0443 683#define HCI_OP_START_SYNC_TRAIN 0x0443
662 684
685#define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445
686struct hci_cp_remote_oob_ext_data_reply {
687 bdaddr_t bdaddr;
688 __u8 hash192[16];
689 __u8 randomizer192[16];
690 __u8 hash256[16];
691 __u8 randomizer256[16];
692} __packed;
693
663#define HCI_OP_SNIFF_MODE 0x0803 694#define HCI_OP_SNIFF_MODE 0x0803
664struct hci_cp_sniff_mode { 695struct hci_cp_sniff_mode {
665 __le16 handle; 696 __le16 handle;
@@ -933,6 +964,26 @@ struct hci_rp_write_sync_train_params {
933 __le16 sync_train_int; 964 __le16 sync_train_int;
934} __packed; 965} __packed;
935 966
967#define HCI_OP_READ_SC_SUPPORT 0x0c79
968struct hci_rp_read_sc_support {
969 __u8 status;
970 __u8 support;
971} __packed;
972
973#define HCI_OP_WRITE_SC_SUPPORT 0x0c7a
974struct hci_cp_write_sc_support {
975 __u8 support;
976} __packed;
977
978#define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d
979struct hci_rp_read_local_oob_ext_data {
980 __u8 status;
981 __u8 hash192[16];
982 __u8 randomizer192[16];
983 __u8 hash256[16];
984 __u8 randomizer256[16];
985} __packed;
986
936#define HCI_OP_READ_LOCAL_VERSION 0x1001 987#define HCI_OP_READ_LOCAL_VERSION 0x1001
937struct hci_rp_read_local_version { 988struct hci_rp_read_local_version {
938 __u8 status; 989 __u8 status;
@@ -1133,6 +1184,9 @@ struct hci_cp_le_set_scan_enable {
1133 __u8 filter_dup; 1184 __u8 filter_dup;
1134} __packed; 1185} __packed;
1135 1186
1187#define HCI_LE_USE_PEER_ADDR 0x00
1188#define HCI_LE_USE_WHITELIST 0x01
1189
1136#define HCI_OP_LE_CREATE_CONN 0x200d 1190#define HCI_OP_LE_CREATE_CONN 0x200d
1137struct hci_cp_le_create_conn { 1191struct hci_cp_le_create_conn {
1138 __le16 scan_interval; 1192 __le16 scan_interval;
@@ -1157,6 +1211,20 @@ struct hci_rp_le_read_white_list_size {
1157 __u8 size; 1211 __u8 size;
1158} __packed; 1212} __packed;
1159 1213
1214#define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010
1215
1216#define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011
1217struct hci_cp_le_add_to_white_list {
1218 __u8 bdaddr_type;
1219 bdaddr_t bdaddr;
1220} __packed;
1221
1222#define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012
1223struct hci_cp_le_del_from_white_list {
1224 __u8 bdaddr_type;
1225 bdaddr_t bdaddr;
1226} __packed;
1227
1160#define HCI_OP_LE_CONN_UPDATE 0x2013 1228#define HCI_OP_LE_CONN_UPDATE 0x2013
1161struct hci_cp_le_conn_update { 1229struct hci_cp_le_conn_update {
1162 __le16 handle; 1230 __le16 handle;
@@ -1171,7 +1239,7 @@ struct hci_cp_le_conn_update {
1171#define HCI_OP_LE_START_ENC 0x2019 1239#define HCI_OP_LE_START_ENC 0x2019
1172struct hci_cp_le_start_enc { 1240struct hci_cp_le_start_enc {
1173 __le16 handle; 1241 __le16 handle;
1174 __u8 rand[8]; 1242 __le64 rand;
1175 __le16 ediv; 1243 __le16 ediv;
1176 __u8 ltk[16]; 1244 __u8 ltk[16];
1177} __packed; 1245} __packed;
@@ -1583,7 +1651,7 @@ struct hci_ev_le_conn_complete {
1583#define HCI_EV_LE_LTK_REQ 0x05 1651#define HCI_EV_LE_LTK_REQ 0x05
1584struct hci_ev_le_ltk_req { 1652struct hci_ev_le_ltk_req {
1585 __le16 handle; 1653 __le16 handle;
1586 __u8 random[8]; 1654 __le64 rand;
1587 __le16 ediv; 1655 __le16 ediv;
1588} __packed; 1656} __packed;
1589 1657