Bluetooth: Add support for sending connection events for LE links
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Fri, 6 May 2011 21:41:43 +0000 (18:41 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 11 May 2011 19:42:10 +0000 (16:42 -0300)
We need to be able for receive events notifying that the connection
was established, the connection attempt failed or that disconnection
happened.

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

index d5aa97ee6ffae4ef03e4abce779470d963a957b3..f13ddbf858ba4e90dd92b891d1b13d3fece1d496 100644 (file)
@@ -1440,7 +1440,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
 
        conn->state = BT_CLOSED;
 
-       if (conn->type == ACL_LINK)
+       if (conn->type == ACL_LINK || conn->type == LE_LINK)
                mgmt_disconnected(hdev->id, &conn->dst);
 
        hci_proto_disconn_cfm(conn, ev->reason);
@@ -2659,12 +2659,15 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
        }
 
        if (ev->status) {
+               mgmt_connect_failed(hdev->id, &ev->bdaddr, ev->status);
                hci_proto_connect_cfm(conn, ev->status);
                conn->state = BT_CLOSED;
                hci_conn_del(conn);
                goto unlock;
        }
 
+       mgmt_connected(hdev->id, &ev->bdaddr);
+
        conn->handle = __le16_to_cpu(ev->handle);
        conn->state = BT_CONNECTED;