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.h84
1 files changed, 68 insertions, 16 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index b06a2d2f63d..10a3eec191f 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -44,17 +44,19 @@
44#define HCI_NOTIFY_VOICE_SETTING 3 44#define HCI_NOTIFY_VOICE_SETTING 3
45 45
46/* HCI device types */ 46/* HCI device types */
47#define HCI_VHCI 0 47#define HCI_VIRTUAL 0
48#define HCI_USB 1 48#define HCI_USB 1
49#define HCI_PCCARD 2 49#define HCI_PCCARD 2
50#define HCI_UART 3 50#define HCI_UART 3
51#define HCI_RS232 4 51#define HCI_RS232 4
52#define HCI_PCI 5 52#define HCI_PCI 5
53#define HCI_SDIO 6
53 54
54/* HCI device quirks */ 55/* HCI device quirks */
55enum { 56enum {
56 HCI_QUIRK_RESET_ON_INIT, 57 HCI_QUIRK_RESET_ON_INIT,
57 HCI_QUIRK_RAW_DEVICE 58 HCI_QUIRK_RAW_DEVICE,
59 HCI_QUIRK_FIXUP_BUFFER_SIZE
58}; 60};
59 61
60/* HCI device flags */ 62/* HCI device flags */
@@ -100,9 +102,10 @@ enum {
100#define HCIINQUIRY _IOR('H', 240, int) 102#define HCIINQUIRY _IOR('H', 240, int)
101 103
102/* HCI timeouts */ 104/* HCI timeouts */
103#define HCI_CONN_TIMEOUT (HZ * 40) 105#define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */
104#define HCI_DISCONN_TIMEOUT (HZ * 2) 106#define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */
105#define HCI_CONN_IDLE_TIMEOUT (HZ * 60) 107#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
108#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
106 109
107/* HCI Packet types */ 110/* HCI Packet types */
108#define HCI_COMMAND_PKT 0x01 111#define HCI_COMMAND_PKT 0x01
@@ -144,7 +147,7 @@ enum {
144#define LMP_TACCURACY 0x10 147#define LMP_TACCURACY 0x10
145#define LMP_RSWITCH 0x20 148#define LMP_RSWITCH 0x20
146#define LMP_HOLD 0x40 149#define LMP_HOLD 0x40
147#define LMP_SNIF 0x80 150#define LMP_SNIFF 0x80
148 151
149#define LMP_PARK 0x01 152#define LMP_PARK 0x01
150#define LMP_RSSI 0x02 153#define LMP_RSSI 0x02
@@ -159,13 +162,21 @@ enum {
159#define LMP_PSCHEME 0x02 162#define LMP_PSCHEME 0x02
160#define LMP_PCONTROL 0x04 163#define LMP_PCONTROL 0x04
161 164
165#define LMP_SNIFF_SUBR 0x02
166
167/* Connection modes */
168#define HCI_CM_ACTIVE 0x0000
169#define HCI_CM_HOLD 0x0001
170#define HCI_CM_SNIFF 0x0002
171#define HCI_CM_PARK 0x0003
172
162/* Link policies */ 173/* Link policies */
163#define HCI_LP_RSWITCH 0x0001 174#define HCI_LP_RSWITCH 0x0001
164#define HCI_LP_HOLD 0x0002 175#define HCI_LP_HOLD 0x0002
165#define HCI_LP_SNIFF 0x0004 176#define HCI_LP_SNIFF 0x0004
166#define HCI_LP_PARK 0x0008 177#define HCI_LP_PARK 0x0008
167 178
168/* Link mode */ 179/* Link modes */
169#define HCI_LM_ACCEPT 0x8000 180#define HCI_LM_ACCEPT 0x8000
170#define HCI_LM_MASTER 0x0001 181#define HCI_LM_MASTER 0x0001
171#define HCI_LM_AUTH 0x0002 182#define HCI_LM_AUTH 0x0002
@@ -191,7 +202,7 @@ struct hci_rp_read_loc_version {
191} __attribute__ ((packed)); 202} __attribute__ ((packed));
192 203
193#define OCF_READ_LOCAL_FEATURES 0x0003 204#define OCF_READ_LOCAL_FEATURES 0x0003
194struct hci_rp_read_loc_features { 205struct hci_rp_read_local_features {
195 __u8 status; 206 __u8 status;
196 __u8 features[8]; 207 __u8 features[8];
197} __attribute__ ((packed)); 208} __attribute__ ((packed));
@@ -286,6 +297,7 @@ struct hci_cp_host_buffer_size {
286 297
287/* Link Control */ 298/* Link Control */
288#define OGF_LINK_CTL 0x01 299#define OGF_LINK_CTL 0x01
300
289#define OCF_CREATE_CONN 0x0005 301#define OCF_CREATE_CONN 0x0005
290struct hci_cp_create_conn { 302struct hci_cp_create_conn {
291 bdaddr_t bdaddr; 303 bdaddr_t bdaddr;
@@ -296,6 +308,11 @@ struct hci_cp_create_conn {
296 __u8 role_switch; 308 __u8 role_switch;
297} __attribute__ ((packed)); 309} __attribute__ ((packed));
298 310
311#define OCF_CREATE_CONN_CANCEL 0x0008
312struct hci_cp_create_conn_cancel {
313 bdaddr_t bdaddr;
314} __attribute__ ((packed));
315
299#define OCF_ACCEPT_CONN_REQ 0x0009 316#define OCF_ACCEPT_CONN_REQ 0x0009
300struct hci_cp_accept_conn_req { 317struct hci_cp_accept_conn_req {
301 bdaddr_t bdaddr; 318 bdaddr_t bdaddr;
@@ -329,6 +346,8 @@ struct hci_cp_inquiry {
329 346
330#define OCF_INQUIRY_CANCEL 0x0002 347#define OCF_INQUIRY_CANCEL 0x0002
331 348
349#define OCF_EXIT_PERIODIC_INQ 0x0004
350
332#define OCF_LINK_KEY_REPLY 0x000B 351#define OCF_LINK_KEY_REPLY 0x000B
333struct hci_cp_link_key_reply { 352struct hci_cp_link_key_reply {
334 bdaddr_t bdaddr; 353 bdaddr_t bdaddr;
@@ -375,17 +394,32 @@ struct hci_cp_change_conn_link_key {
375} __attribute__ ((packed)); 394} __attribute__ ((packed));
376 395
377#define OCF_READ_REMOTE_FEATURES 0x001B 396#define OCF_READ_REMOTE_FEATURES 0x001B
378struct hci_cp_read_rmt_features { 397struct hci_cp_read_remote_features {
379 __le16 handle; 398 __le16 handle;
380} __attribute__ ((packed)); 399} __attribute__ ((packed));
381 400
382#define OCF_READ_REMOTE_VERSION 0x001D 401#define OCF_READ_REMOTE_VERSION 0x001D
383struct hci_cp_read_rmt_version { 402struct hci_cp_read_remote_version {
384 __le16 handle; 403 __le16 handle;
385} __attribute__ ((packed)); 404} __attribute__ ((packed));
386 405
387/* Link Policy */ 406/* Link Policy */
388#define OGF_LINK_POLICY 0x02 407#define OGF_LINK_POLICY 0x02
408
409#define OCF_SNIFF_MODE 0x0003
410struct hci_cp_sniff_mode {
411 __le16 handle;
412 __le16 max_interval;
413 __le16 min_interval;
414 __le16 attempt;
415 __le16 timeout;
416} __attribute__ ((packed));
417
418#define OCF_EXIT_SNIFF_MODE 0x0004
419struct hci_cp_exit_sniff_mode {
420 __le16 handle;
421} __attribute__ ((packed));
422
389#define OCF_ROLE_DISCOVERY 0x0009 423#define OCF_ROLE_DISCOVERY 0x0009
390struct hci_cp_role_discovery { 424struct hci_cp_role_discovery {
391 __le16 handle; 425 __le16 handle;
@@ -406,7 +440,7 @@ struct hci_rp_read_link_policy {
406 __le16 policy; 440 __le16 policy;
407} __attribute__ ((packed)); 441} __attribute__ ((packed));
408 442
409#define OCF_SWITCH_ROLE 0x000B 443#define OCF_SWITCH_ROLE 0x000B
410struct hci_cp_switch_role { 444struct hci_cp_switch_role {
411 bdaddr_t bdaddr; 445 bdaddr_t bdaddr;
412 __u8 role; 446 __u8 role;
@@ -422,6 +456,14 @@ struct hci_rp_write_link_policy {
422 __le16 handle; 456 __le16 handle;
423} __attribute__ ((packed)); 457} __attribute__ ((packed));
424 458
459#define OCF_SNIFF_SUBRATE 0x0011
460struct hci_cp_sniff_subrate {
461 __le16 handle;
462 __le16 max_latency;
463 __le16 min_remote_timeout;
464 __le16 min_local_timeout;
465} __attribute__ ((packed));
466
425/* Status params */ 467/* Status params */
426#define OGF_STATUS_PARAM 0x05 468#define OGF_STATUS_PARAM 0x05
427 469
@@ -581,15 +623,15 @@ struct hci_ev_link_key_notify {
581 __u8 key_type; 623 __u8 key_type;
582} __attribute__ ((packed)); 624} __attribute__ ((packed));
583 625
584#define HCI_EV_RMT_FEATURES 0x0B 626#define HCI_EV_REMOTE_FEATURES 0x0B
585struct hci_ev_rmt_features { 627struct hci_ev_remote_features {
586 __u8 status; 628 __u8 status;
587 __le16 handle; 629 __le16 handle;
588 __u8 features[8]; 630 __u8 features[8];
589} __attribute__ ((packed)); 631} __attribute__ ((packed));
590 632
591#define HCI_EV_RMT_VERSION 0x0C 633#define HCI_EV_REMOTE_VERSION 0x0C
592struct hci_ev_rmt_version { 634struct hci_ev_remote_version {
593 __u8 status; 635 __u8 status;
594 __le16 handle; 636 __le16 handle;
595 __u8 lmp_ver; 637 __u8 lmp_ver;
@@ -610,6 +652,16 @@ struct hci_ev_pscan_rep_mode {
610 __u8 pscan_rep_mode; 652 __u8 pscan_rep_mode;
611} __attribute__ ((packed)); 653} __attribute__ ((packed));
612 654
655#define HCI_EV_SNIFF_SUBRATE 0x2E
656struct hci_ev_sniff_subrate {
657 __u8 status;
658 __le16 handle;
659 __le16 max_tx_latency;
660 __le16 max_rx_latency;
661 __le16 max_remote_timeout;
662 __le16 max_local_timeout;
663} __attribute__ ((packed));
664
613/* Internal events generated by Bluetooth stack */ 665/* Internal events generated by Bluetooth stack */
614#define HCI_EV_STACK_INTERNAL 0xFD 666#define HCI_EV_STACK_INTERNAL 0xFD
615struct hci_ev_stack_internal { 667struct hci_ev_stack_internal {