aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.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/mgmt.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/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index bdb0e85f182e..7cf1968157d8 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1090,3 +1090,23 @@ int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type)
1090 1090
1091 return mgmt_event(MGMT_EV_NEW_KEY, &ev, sizeof(ev), NULL); 1091 return mgmt_event(MGMT_EV_NEW_KEY, &ev, sizeof(ev), NULL);
1092} 1092}
1093
1094int mgmt_connected(u16 index, bdaddr_t *bdaddr)
1095{
1096 struct mgmt_ev_connected ev;
1097
1098 put_unaligned_le16(index, &ev.index);
1099 bacpy(&ev.bdaddr, bdaddr);
1100
1101 return mgmt_event(MGMT_EV_CONNECTED, &ev, sizeof(ev), NULL);
1102}
1103
1104int mgmt_disconnected(u16 index, bdaddr_t *bdaddr)
1105{
1106 struct mgmt_ev_disconnected ev;
1107
1108 put_unaligned_le16(index, &ev.index);
1109 bacpy(&ev.bdaddr, bdaddr);
1110
1111 return mgmt_event(MGMT_EV_DISCONNECTED, &ev, sizeof(ev), NULL);
1112}