aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-12-16 10:00:37 +0200
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-08 01:40:04 -0200
commit5add6af8fcbce269cac2457584c0ebfda055474a (patch)
treef27f5eb78f8193f636c576c979391c63bfc50c29 /net/bluetooth/hci_core.c
parentab81cbf99c881ca2b9a83682a8722fc84b2483d2 (diff)
downloadkernel_samsung_smdk4412-5add6af8fcbce269cac2457584c0ebfda055474a.zip
kernel_samsung_smdk4412-5add6af8fcbce269cac2457584c0ebfda055474a.tar.gz
kernel_samsung_smdk4412-5add6af8fcbce269cac2457584c0ebfda055474a.tar.bz2
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/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b22ce9f..c5a78e7 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -535,6 +535,8 @@ int hci_dev_open(__u16 dev)
hci_dev_hold(hdev);
set_bit(HCI_UP, &hdev->flags);
hci_notify(hdev, HCI_DEV_UP);
+ if (!test_bit(HCI_SETUP, &hdev->flags))
+ mgmt_powered(hdev->id, 1);
} else {
/* Init failed, cleanup */
tasklet_kill(&hdev->rx_task);
@@ -616,6 +618,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
* and no tasks are scheduled. */
hdev->close(hdev);
+ mgmt_powered(hdev->id, 0);
+
/* Clear flags */
hdev->flags = 0;