summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-01-16 16:15:34 +0200
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-01-23 01:41:23 -0200
commitfe038884a83b85f2bb61c77609eacb5cf613d3fb (patch)
tree0b2ae591f9205b39844db60d4be14c84a711d07f /net/bluetooth
parent46818ed514102c8d251d4aff5c99ad3ff6805432 (diff)
downloadlinux-fe038884a83b85f2bb61c77609eacb5cf613d3fb.tar.gz
linux-fe038884a83b85f2bb61c77609eacb5cf613d3fb.tar.bz2
linux-fe038884a83b85f2bb61c77609eacb5cf613d3fb.zip
Bluetooth: Fix Class of Device indication when powering off
When a HCI device is powered off the Management interface specification dictates that the class of device value is indicated as zero. This patch fixes sending of the appropriate class of device changed event when a HCI device is powered off. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index fc171f222ba4..54f3ddba9139 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2987,7 +2987,13 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
}
} else {
u8 status = MGMT_STATUS_NOT_POWERED;
+ u8 zero_cod[] = { 0, 0, 0 };
+
mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
+
+ if (memcmp(hdev->dev_class, zero_cod, sizeof(zero_cod)) != 0)
+ mgmt_event(MGMT_EV_CLASS_OF_DEV_CHANGED, hdev,
+ zero_cod, sizeof(zero_cod), NULL);
}
err = new_settings(hdev, match.sk);