diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2010-12-16 03:00:37 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:40:04 -0500 |
commit | 5add6af8fcbce269cac2457584c0ebfda055474a (patch) | |
tree | f27f5eb78f8193f636c576c979391c63bfc50c29 /net/bluetooth/mgmt.c | |
parent | ab81cbf99c881ca2b9a83682a8722fc84b2483d2 (diff) |
Bluetooth: Add support for management powered event
This patch adds support for the powered event that's used to indicate to
userspace when the powered state of a local adapter changes.
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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d479e241a9de..f746e19ebec0 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -316,3 +316,13 @@ int mgmt_index_removed(u16 index) | |||
316 | 316 | ||
317 | return mgmt_event(MGMT_EV_INDEX_REMOVED, &ev, sizeof(ev)); | 317 | return mgmt_event(MGMT_EV_INDEX_REMOVED, &ev, sizeof(ev)); |
318 | } | 318 | } |
319 | |||
320 | int mgmt_powered(u16 index, u8 powered) | ||
321 | { | ||
322 | struct mgmt_ev_powered ev; | ||
323 | |||
324 | put_unaligned_le16(index, &ev.index); | ||
325 | ev.powered = powered; | ||
326 | |||
327 | return mgmt_event(MGMT_EV_POWERED, &ev, sizeof(ev)); | ||
328 | } | ||