summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNagarjuna Kristam <nkristam@nvidia.com>2012-06-06 15:10:08 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-06-12 23:44:13 -0700
commitbd7a4f33e8f0cb5cb9b78471e635c59d0fad6570 (patch)
tree13193c77b92e51f8bd659cc60e50003308eb7ade /net
parentc9a598f40f303dd9ec61080f5bff7b74996f83f3 (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>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 70a398ed4011..a07800fdb16c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -40,6 +40,7 @@
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
+#include <linux/notifier.h>
#include <linux/rfkill.h>
#include <linux/timer.h>
#include <linux/crypto.h>
@@ -65,10 +66,23 @@ 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 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);
}