diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-05-09 15:04:08 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-05-09 21:09:45 -0400 |
commit | 1b0336bb36f88976f1210a65b62f6a3e9578ee7b (patch) | |
tree | bcf2a8413090c43ab6513b55e145bddf8fe87da6 /net | |
parent | 384943ec1bb462e410390ad8f108ff1474cd882d (diff) |
Bluetooth: Don't use hci_acl_connect_cancel() for incoming connections
The connection setup phase takes around 2 seconds or longer and in
that time it is possible that the need for an ACL connection is no
longer present. If that happens then, the connection attempt will
be canceled.
This only applies to outgoing connections, but currently it can also
be triggered by incoming connection. Don't call hci_acl_connect_cancel()
on incoming connection since these have to be either accepted or rejected
in this state. Once they are successfully connected they need to be
fully disconnected anyway.
Also remove the wrong hci_acl_disconn() call for SCO and eSCO links
since at this stage they can't be disconnected either, because the
connection handle is still unknown.
Based on a report by Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Tested-by: Johan Hedberg <johan.hedberg@nokia.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 85a1c6be2db9..fa47d5d84f5c 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -171,10 +171,8 @@ static void hci_conn_timeout(unsigned long arg) | |||
171 | switch (conn->state) { | 171 | switch (conn->state) { |
172 | case BT_CONNECT: | 172 | case BT_CONNECT: |
173 | case BT_CONNECT2: | 173 | case BT_CONNECT2: |
174 | if (conn->type == ACL_LINK) | 174 | if (conn->type == ACL_LINK && conn->out) |
175 | hci_acl_connect_cancel(conn); | 175 | hci_acl_connect_cancel(conn); |
176 | else | ||
177 | hci_acl_disconn(conn, 0x13); | ||
178 | break; | 176 | break; |
179 | case BT_CONFIG: | 177 | case BT_CONFIG: |
180 | case BT_CONNECTED: | 178 | case BT_CONNECTED: |