diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2014-05-15 12:37:20 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:33 +0900 |
commit | 120d6061fcf39554c9a18fe6e7960ba7fc4c750d (patch) | |
tree | 0fea23bda1ecda2c0fcb134a1d08cd2508162bf2 /net | |
parent | 538d0c5ae18b3cb5f62ffcb6cecb3aed76caca84 (diff) | |
download | linux-3.10-120d6061fcf39554c9a18fe6e7960ba7fc4c750d.tar.gz linux-3.10-120d6061fcf39554c9a18fe6e7960ba7fc4c750d.tar.bz2 linux-3.10-120d6061fcf39554c9a18fe6e7960ba7fc4c750d.zip |
Bluetooth: add hci event notification
WORKAROUND: Temporary workaround for bluetooth enable.
For specific hci events, operations are needed. So this patch adds
event notification and its notifier registration.
Change-Id: I6f8fe0b3b90c12d7f4fe35823d25b9fbdcd98d06
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index fbc4a1a0bf2..d954ad9962b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -49,10 +49,25 @@ DEFINE_RWLOCK(hci_cb_list_lock); static DEFINE_IDA(hci_index_ida); /* ---- HCI notifications ---- */ +static ATOMIC_NOTIFIER_HEAD(hci_notifier); + +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) { hci_sock_dev_event(hdev, event); + + if (event == HCI_DEV_REG || event == HCI_DEV_UNREG + || event == HCI_DEV_WRITE) + atomic_notifier_call_chain(&hci_notifier, event, hdev); } /* ---- HCI requests ---- */ @@ -2592,6 +2607,8 @@ static int hci_send_frame(struct sk_buff *skb) /* Get rid of skb owner, prior to sending to the driver. */ skb_orphan(skb); + hci_notify(hdev, HCI_DEV_WRITE); + return hdev->send(skb); } |