Skip to content

Commit 9270fd6

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
2 parents 24b9c37 + d13431c commit 9270fd6

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

‎drivers/bluetooth/btusb.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ static struct usb_device_id btusb_table[] = {
100100
/* Canyon CN-BTU1 with HID interfaces */
101101
{ USB_DEVICE(0x0c10, 0x0000) },
102102

103+
/* Broadcom BCM20702A0 */
104+
{ USB_DEVICE(0x413c, 0x8197) },
105+
103106
{ } /* Terminating entry */
104107
};
105108

‎include/net/bluetooth/l2cap.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939
#define L2CAP_DEFAULT_ACK_TO 200
4040
#define L2CAP_LE_DEFAULT_MTU 23
4141

42-
#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
43-
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
42+
#define L2CAP_DISC_TIMEOUT (100)
43+
#define L2CAP_DISC_REJ_TIMEOUT (5000) /* 5 seconds */
44+
#define L2CAP_ENC_TIMEOUT (5000) /* 5 seconds */
45+
#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
46+
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
4447

4548
/* L2CAP socket address */
4649
struct sockaddr_l2 {

‎net/bluetooth/hci_conn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
673673
goto encrypt;
674674

675675
auth:
676-
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
676+
if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
677677
return 0;
678678

679679
if (!hci_conn_auth(conn, sec_level, auth_type))

‎net/bluetooth/l2cap_core.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void l2cap_chan_timeout(unsigned long arg)
251251

252252
if (sock_owned_by_user(sk)) {
253253
/* sk is owned by user. Try again later */
254-
__set_chan_timer(chan, HZ / 5);
254+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
255255
bh_unlock_sock(sk);
256256
chan_put(chan);
257257
return;
@@ -2488,7 +2488,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
24882488
if (sock_owned_by_user(sk)) {
24892489
l2cap_state_change(chan, BT_DISCONN);
24902490
__clear_chan_timer(chan);
2491-
__set_chan_timer(chan, HZ / 5);
2491+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
24922492
break;
24932493
}
24942494

@@ -2661,7 +2661,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
26612661

26622662
default:
26632663
sk->sk_err = ECONNRESET;
2664-
__set_chan_timer(chan, HZ * 5);
2664+
__set_chan_timer(chan, L2CAP_DISC_REJ_TIMEOUT);
26652665
l2cap_send_disconn_req(conn, chan, ECONNRESET);
26662666
goto done;
26672667
}
@@ -2718,7 +2718,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
27182718
if (sock_owned_by_user(sk)) {
27192719
l2cap_state_change(chan, BT_DISCONN);
27202720
__clear_chan_timer(chan);
2721-
__set_chan_timer(chan, HZ / 5);
2721+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
27222722
bh_unlock_sock(sk);
27232723
return 0;
27242724
}
@@ -2752,7 +2752,7 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
27522752
if (sock_owned_by_user(sk)) {
27532753
l2cap_state_change(chan,BT_DISCONN);
27542754
__clear_chan_timer(chan);
2755-
__set_chan_timer(chan, HZ / 5);
2755+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
27562756
bh_unlock_sock(sk);
27572757
return 0;
27582758
}
@@ -3998,7 +3998,7 @@ static inline void l2cap_check_encryption(struct l2cap_chan *chan, u8 encrypt)
39983998
if (encrypt == 0x00) {
39993999
if (chan->sec_level == BT_SECURITY_MEDIUM) {
40004000
__clear_chan_timer(chan);
4001-
__set_chan_timer(chan, HZ * 5);
4001+
__set_chan_timer(chan, L2CAP_ENC_TIMEOUT);
40024002
} else if (chan->sec_level == BT_SECURITY_HIGH)
40034003
l2cap_chan_close(chan, ECONNREFUSED);
40044004
} else {
@@ -4066,7 +4066,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
40664066
L2CAP_CONN_REQ, sizeof(req), &req);
40674067
} else {
40684068
__clear_chan_timer(chan);
4069-
__set_chan_timer(chan, HZ / 10);
4069+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
40704070
}
40714071
} else if (chan->state == BT_CONNECT2) {
40724072
struct l2cap_conn_rsp rsp;
@@ -4086,7 +4086,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
40864086
}
40874087
} else {
40884088
l2cap_state_change(chan, BT_DISCONN);
4089-
__set_chan_timer(chan, HZ / 10);
4089+
__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
40904090
res = L2CAP_CR_SEC_BLOCK;
40914091
stat = L2CAP_CS_NO_INFO;
40924092
}

0 commit comments

Comments
 (0)