aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-01-20 05:34:39 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:40:07 -0500
commitf7520543ab40341edbc2aeee7fef68218be19a0a (patch)
tree6f116b5215a134bab6b9615f97767eba040f0683 /net/bluetooth/hci_event.c
parent55ed8ca10f3530de8edbbf138acb50992bf5005b (diff)
Bluetooth: Add connected/disconnected management events
This patch adds connected and disconnected managment events to track the connection status to remote devices. The events map directly to successful connection complete and disconnection complete HCI events for ACL links. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 80ffd3a901fc..46ddb029912b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1137,6 +1137,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
1137 conn->state = BT_CONFIG; 1137 conn->state = BT_CONFIG;
1138 hci_conn_hold(conn); 1138 hci_conn_hold(conn);
1139 conn->disc_timeout = HCI_DISCONN_TIMEOUT; 1139 conn->disc_timeout = HCI_DISCONN_TIMEOUT;
1140 mgmt_connected(hdev->id, &ev->bdaddr);
1140 } else 1141 } else
1141 conn->state = BT_CONNECTED; 1142 conn->state = BT_CONNECTED;
1142 1143
@@ -1269,13 +1270,18 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
1269 hci_dev_lock(hdev); 1270 hci_dev_lock(hdev);
1270 1271
1271 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); 1272 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
1272 if (conn) { 1273 if (!conn)
1273 conn->state = BT_CLOSED; 1274 goto unlock;
1274 1275
1275 hci_proto_disconn_cfm(conn, ev->reason); 1276 conn->state = BT_CLOSED;
1276 hci_conn_del(conn); 1277
1277 } 1278 if (conn->type == ACL_LINK)
1279 mgmt_disconnected(hdev->id, &conn->dst);
1278 1280
1281 hci_proto_disconn_cfm(conn, ev->reason);
1282 hci_conn_del(conn);
1283
1284unlock:
1279 hci_dev_unlock(hdev); 1285 hci_dev_unlock(hdev);
1280} 1286}
1281 1287