aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci.h11
-rw-r--r--include/net/bluetooth/hci_core.h8
-rw-r--r--include/net/bluetooth/l2cap.h5
-rw-r--r--include/net/bluetooth/mgmt.h2
4 files changed, 19 insertions, 7 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 2a6b0b8b712..ccd723e0f78 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -139,11 +139,12 @@ enum {
139#define HCIINQUIRY _IOR('H', 240, int) 139#define HCIINQUIRY _IOR('H', 240, int)
140 140
141/* HCI timeouts */ 141/* HCI timeouts */
142#define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ 142#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
143#define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ 143#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
144#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 144#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
145#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ 145#define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */
146#define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ 146#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
147#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
147 148
148/* HCI data types */ 149/* HCI data types */
149#define HCI_COMMAND_PKT 0x01 150#define HCI_COMMAND_PKT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 20fd57367dd..475b8c04ba5 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -587,18 +587,24 @@ void hci_conn_put_device(struct hci_conn *conn);
587 587
588static inline void hci_conn_hold(struct hci_conn *conn) 588static inline void hci_conn_hold(struct hci_conn *conn)
589{ 589{
590 BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt),
591 atomic_read(&conn->refcnt) + 1);
592
590 atomic_inc(&conn->refcnt); 593 atomic_inc(&conn->refcnt);
591 cancel_delayed_work(&conn->disc_work); 594 cancel_delayed_work(&conn->disc_work);
592} 595}
593 596
594static inline void hci_conn_put(struct hci_conn *conn) 597static inline void hci_conn_put(struct hci_conn *conn)
595{ 598{
599 BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt),
600 atomic_read(&conn->refcnt) - 1);
601
596 if (atomic_dec_and_test(&conn->refcnt)) { 602 if (atomic_dec_and_test(&conn->refcnt)) {
597 unsigned long timeo; 603 unsigned long timeo;
598 if (conn->type == ACL_LINK || conn->type == LE_LINK) { 604 if (conn->type == ACL_LINK || conn->type == LE_LINK) {
599 del_timer(&conn->idle_timer); 605 del_timer(&conn->idle_timer);
600 if (conn->state == BT_CONNECTED) { 606 if (conn->state == BT_CONNECTED) {
601 timeo = msecs_to_jiffies(conn->disc_timeout); 607 timeo = conn->disc_timeout;
602 if (!conn->out) 608 if (!conn->out)
603 timeo *= 2; 609 timeo *= 2;
604 } else { 610 } else {
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d80e3f0691b..a7679f8913d 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -464,6 +464,7 @@ struct l2cap_chan {
464 464
465 __u16 tx_win; 465 __u16 tx_win;
466 __u16 tx_win_max; 466 __u16 tx_win_max;
467 __u16 ack_win;
467 __u8 max_tx; 468 __u8 max_tx;
468 __u16 retrans_timeout; 469 __u16 retrans_timeout;
469 __u16 monitor_timeout; 470 __u16 monitor_timeout;
@@ -672,11 +673,15 @@ enum {
672 673
673static inline void l2cap_chan_hold(struct l2cap_chan *c) 674static inline void l2cap_chan_hold(struct l2cap_chan *c)
674{ 675{
676 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
677
675 atomic_inc(&c->refcnt); 678 atomic_inc(&c->refcnt);
676} 679}
677 680
678static inline void l2cap_chan_put(struct l2cap_chan *c) 681static inline void l2cap_chan_put(struct l2cap_chan *c)
679{ 682{
683 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
684
680 if (atomic_dec_and_test(&c->refcnt)) 685 if (atomic_dec_and_test(&c->refcnt))
681 kfree(c); 686 kfree(c);
682} 687}
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 23fd0546fcc..4348ee8bda6 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -444,7 +444,7 @@ struct mgmt_ev_auth_failed {
444struct mgmt_ev_device_found { 444struct mgmt_ev_device_found {
445 struct mgmt_addr_info addr; 445 struct mgmt_addr_info addr;
446 __s8 rssi; 446 __s8 rssi;
447 __u8 flags[4]; 447 __le32 flags;
448 __le16 eir_len; 448 __le16 eir_len;
449 __u8 eir[0]; 449 __u8 eir[0];
450} __packed; 450} __packed;