summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorTedd Ho-Jeong An <tedd.an@intel.com>2015-02-13 09:20:50 -0800
committerMarcel Holtmann <marcel@holtmann.org>2015-02-15 00:37:52 +0100
commita44fecbd52a4d9c36f07eb2161c153047d8765d4 (patch)
treee03e5cbcc55e42fea5bb811cd40933e56d90e406 /net/bluetooth/hci_core.c
parent3e544ef9357493422909064de35f3e289d92f1fe (diff)
downloadop-kernel-dev-a44fecbd52a4d9c36f07eb2161c153047d8765d4.zip
op-kernel-dev-a44fecbd52a4d9c36f07eb2161c153047d8765d4.tar.gz
Bluetooth: Add shutdown callback before closing the device
This callback allows a vendor to send the vendor specific commands before cloing the hci interface. Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3322d3f..4135a440 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1591,6 +1591,12 @@ static int hci_dev_do_close(struct hci_dev *hdev)
{
BT_DBG("%s %p", hdev->name, hdev);
+ if (!test_bit(HCI_UNREGISTER, &hdev->dev_flags)) {
+ /* Execute vendor specific shutdown routine */
+ if (hdev->shutdown)
+ hdev->shutdown(hdev);
+ }
+
cancel_delayed_work(&hdev->power_off);
hci_req_cancel(hdev, ENODEV);
OpenPOWER on IntegriCloud