diff options
author | Nagarjuna Kristam <nkristam@nvidia.com> | 2012-06-06 15:10:08 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:08:33 -0700 |
commit | 672720358e03dd6526ac00d01fb89b49b81f4523 (patch) | |
tree | dc4a66ac6010152bb414e9f56001be85253e540d /net/bluetooth | |
parent | 8998338eafb4db5d9f7da17cb91321c377593154 (diff) |
bluetooth: Re-add HCI notifier handling
Perform partial revert of 040030ef7d907107e6489b39da518bdf94136d68
(Bluetooth: Remove HCI notifier handling). HCI notifier is being used by
bluetooth power management driver(bluesleep).
Re-use atomic notifier chain to notify HCI events
bug 999221
Change-Id: Ifbd95f7e679d3cac577785cb7a9eda5736e1fa7b
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: http://git-master/r/106729
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Rebase-Id: R5cafbf20e3ed375c39045fd08e29cb8fd943e64d
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ace5e55fe5a3..d71a6b4ded82 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -45,13 +45,27 @@ DEFINE_RWLOCK(hci_dev_list_lock); LIST_HEAD(hci_cb_list); DEFINE_RWLOCK(hci_cb_list_lock); +/* HCI notifiers list */ +static ATOMIC_NOTIFIER_HEAD(hci_notifier); + /* HCI ID Numbering */ static DEFINE_IDA(hci_index_ida); /* ---- HCI notifications ---- */ +int hci_register_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&hci_notifier, nb); +} + +int hci_unregister_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&hci_notifier, nb); +} + static void hci_notify(struct hci_dev *hdev, int event) { + atomic_notifier_call_chain(&hci_notifier, event, hdev); hci_sock_dev_event(hdev, event); } |