summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann2015-10-04 23:34:00 +0200
committerJohan Hedberg2015-10-05 09:29:36 +0200
commit4a3f95b7b62e50a1e42e42ba6571ec9e747f4861 (patch)
tree389fe2e01e2c50619c7fa99bea5b0420702a1f59 /net/bluetooth/hci_core.c
parentBluetooth: Limit userspace exposure of stack internal events (diff)
downloadkernel-qcow2-linux-4a3f95b7b62e50a1e42e42ba6571ec9e747f4861.tar.gz
kernel-qcow2-linux-4a3f95b7b62e50a1e42e42ba6571ec9e747f4861.tar.xz
kernel-qcow2-linux-4a3f95b7b62e50a1e42e42ba6571ec9e747f4861.zip
Bluetooth: Introduce HCI_DEV_OPEN and HCI_DEV_CLOSE events
When opening the HCI transport via hdev->open send HCI_DEV_OPEN event and when closing the HCI transport via hdev->close send HCI_DEV_CLOSE. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
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 79356469c377..5af33c87cbba 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1385,6 +1385,8 @@ static int hci_dev_do_open(struct hci_dev *hdev)
goto done;
}
+ hci_notify(hdev, HCI_DEV_OPEN);
+
atomic_set(&hdev->cmd_cnt, 1);
set_bit(HCI_INIT, &hdev->flags);
@@ -1466,6 +1468,8 @@ static int hci_dev_do_open(struct hci_dev *hdev)
hdev->sent_cmd = NULL;
}
+ hci_notify(hdev, HCI_DEV_CLOSE);
+
hdev->close(hdev);
hdev->flags &= BIT(HCI_RAW);
}
@@ -1649,6 +1653,8 @@ int hci_dev_do_close(struct hci_dev *hdev)
hdev->sent_cmd = NULL;
}
+ hci_notify(hdev, HCI_DEV_CLOSE);
+
/* After this point our queues are empty
* and no tasks are scheduled. */
hdev->close(hdev);