Commit 9270fd61 authored by John W. Linville's avatar John W. Linville
parents 24b9c373 d13431ca
...@@ -100,6 +100,9 @@ static struct usb_device_id btusb_table[] = { ...@@ -100,6 +100,9 @@ static struct usb_device_id btusb_table[] = {
/* Canyon CN-BTU1 with HID interfaces */ /* Canyon CN-BTU1 with HID interfaces */
{ USB_DEVICE(0x0c10, 0x0000) }, { USB_DEVICE(0x0c10, 0x0000) },
/* Broadcom BCM20702A0 */
{ USB_DEVICE(0x413c, 0x8197) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
#define L2CAP_DEFAULT_ACK_TO 200 #define L2CAP_DEFAULT_ACK_TO 200
#define L2CAP_LE_DEFAULT_MTU 23 #define L2CAP_LE_DEFAULT_MTU 23
#define L2CAP_DISC_TIMEOUT (100)
#define L2CAP_DISC_REJ_TIMEOUT (5000) /* 5 seconds */
#define L2CAP_ENC_TIMEOUT (5000) /* 5 seconds */
#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
......
...@@ -673,7 +673,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) ...@@ -673,7 +673,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
goto encrypt; goto encrypt;
auth: auth:
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
return 0; return 0;
if (!hci_conn_auth(conn, sec_level, auth_type)) if (!hci_conn_auth(conn, sec_level, auth_type))
......
...@@ -251,7 +251,7 @@ static void l2cap_chan_timeout(unsigned long arg) ...@@ -251,7 +251,7 @@ static void l2cap_chan_timeout(unsigned long arg)
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
/* sk is owned by user. Try again later */ /* sk is owned by user. Try again later */
__set_chan_timer(chan, HZ / 5); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
bh_unlock_sock(sk); bh_unlock_sock(sk);
chan_put(chan); chan_put(chan);
return; return;
...@@ -2488,7 +2488,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd ...@@ -2488,7 +2488,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
l2cap_state_change(chan, BT_DISCONN); l2cap_state_change(chan, BT_DISCONN);
__clear_chan_timer(chan); __clear_chan_timer(chan);
__set_chan_timer(chan, HZ / 5); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
break; break;
} }
...@@ -2661,7 +2661,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr ...@@ -2661,7 +2661,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
default: default:
sk->sk_err = ECONNRESET; sk->sk_err = ECONNRESET;
__set_chan_timer(chan, HZ * 5); __set_chan_timer(chan, L2CAP_DISC_REJ_TIMEOUT);
l2cap_send_disconn_req(conn, chan, ECONNRESET); l2cap_send_disconn_req(conn, chan, ECONNRESET);
goto done; goto done;
} }
...@@ -2718,7 +2718,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd ...@@ -2718,7 +2718,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
l2cap_state_change(chan, BT_DISCONN); l2cap_state_change(chan, BT_DISCONN);
__clear_chan_timer(chan); __clear_chan_timer(chan);
__set_chan_timer(chan, HZ / 5); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
bh_unlock_sock(sk); bh_unlock_sock(sk);
return 0; return 0;
} }
...@@ -2752,7 +2752,7 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd ...@@ -2752,7 +2752,7 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
l2cap_state_change(chan,BT_DISCONN); l2cap_state_change(chan,BT_DISCONN);
__clear_chan_timer(chan); __clear_chan_timer(chan);
__set_chan_timer(chan, HZ / 5); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
bh_unlock_sock(sk); bh_unlock_sock(sk);
return 0; return 0;
} }
...@@ -3998,7 +3998,7 @@ static inline void l2cap_check_encryption(struct l2cap_chan *chan, u8 encrypt) ...@@ -3998,7 +3998,7 @@ static inline void l2cap_check_encryption(struct l2cap_chan *chan, u8 encrypt)
if (encrypt == 0x00) { if (encrypt == 0x00) {
if (chan->sec_level == BT_SECURITY_MEDIUM) { if (chan->sec_level == BT_SECURITY_MEDIUM) {
__clear_chan_timer(chan); __clear_chan_timer(chan);
__set_chan_timer(chan, HZ * 5); __set_chan_timer(chan, L2CAP_ENC_TIMEOUT);
} else if (chan->sec_level == BT_SECURITY_HIGH) } else if (chan->sec_level == BT_SECURITY_HIGH)
l2cap_chan_close(chan, ECONNREFUSED); l2cap_chan_close(chan, ECONNREFUSED);
} else { } else {
...@@ -4066,7 +4066,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) ...@@ -4066,7 +4066,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
L2CAP_CONN_REQ, sizeof(req), &req); L2CAP_CONN_REQ, sizeof(req), &req);
} else { } else {
__clear_chan_timer(chan); __clear_chan_timer(chan);
__set_chan_timer(chan, HZ / 10); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
} }
} else if (chan->state == BT_CONNECT2) { } else if (chan->state == BT_CONNECT2) {
struct l2cap_conn_rsp rsp; struct l2cap_conn_rsp rsp;
...@@ -4086,7 +4086,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) ...@@ -4086,7 +4086,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
} }
} else { } else {
l2cap_state_change(chan, BT_DISCONN); l2cap_state_change(chan, BT_DISCONN);
__set_chan_timer(chan, HZ / 10); __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
res = L2CAP_CR_SEC_BLOCK; res = L2CAP_CR_SEC_BLOCK;
stat = L2CAP_CS_NO_INFO; stat = L2CAP_CS_NO_INFO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment