Bluetooth: Add support for disconnecting LE links via mgmt
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Fri, 6 May 2011 21:41:44 +0000 (18:41 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 11 May 2011 19:42:14 +0000 (16:42 -0300)
If we can't find a ACL link between the devices, we search
the connection list one second time looking for LE links.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/mgmt.c

index 2481d257ed98058c644f5553bf41132a5793dba7..dae382ce70201d5f4adbacde509c665c467d95ac 100644 (file)
@@ -1033,6 +1033,9 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len)
        }
 
        conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
+       if (!conn)
+               conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->bdaddr);
+
        if (!conn) {
                err = cmd_status(sk, index, MGMT_OP_DISCONNECT, ENOTCONN);
                goto failed;