From: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [RFCv0 2/3] Bluetooth: AMP: Initialize and free amp_pending
Date: Wed, 30 Nov 2011 15:54:31 +0200 [thread overview]
Message-ID: <1322661272-32027-3-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1322661272-32027-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
amp_pending is used as a callback when receiving HCI response event.
Idea is taken from mgmt interface (mgmt_pending).
---
net/bluetooth/hci_core.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index fa33b27..331061f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -60,6 +60,8 @@ static void hci_cmd_task(unsigned long arg);
static void hci_rx_task(unsigned long arg);
static void hci_tx_task(unsigned long arg);
+void amp_pending_remove_all(struct hci_dev *hdev);
+
static DEFINE_RWLOCK(hci_task_lock);
/* HCI device list */
@@ -1559,6 +1561,8 @@ int hci_register_dev(struct hci_dev *hdev)
INIT_LIST_HEAD(&hdev->mgmt_pending);
+ INIT_LIST_HEAD(&hdev->amp_pending);
+
INIT_LIST_HEAD(&hdev->blacklist);
INIT_LIST_HEAD(&hdev->uuids);
@@ -1640,6 +1644,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
!test_bit(HCI_SETUP, &hdev->flags)) {
hci_dev_lock_bh(hdev);
mgmt_index_removed(hdev);
+ amp_pending_remove_all(hdev);
hci_dev_unlock_bh(hdev);
}
@@ -1647,6 +1652,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
* pending list */
BUG_ON(!list_empty(&hdev->mgmt_pending));
+ BUG_ON(!list_empty(&hdev->amp_pending));
+
hci_notify(hdev, HCI_DEV_UNREG);
if (hdev->rfkill) {
--
1.7.4.1
next prev parent reply other threads:[~2011-11-30 13:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 13:54 [RFCv0 0/3] AMP HCI interface from A2MP Emeltchenko Andrei
2011-11-30 13:54 ` [RFCv0 1/3] Bluetooth: AMP: HCI infrastructure Emeltchenko Andrei
2011-11-30 13:54 ` Emeltchenko Andrei [this message]
2011-11-30 13:54 ` [RFCv0 3/3] Bluetooth: AMP: Read Local AMP Info Emeltchenko Andrei
2011-11-30 14:31 ` [RFCv0 0/3] AMP HCI interface from A2MP Marcel Holtmann
2011-11-30 15:18 ` Emeltchenko Andrei
2011-12-01 6:19 ` Peter Krystad
2011-12-01 11:21 ` Marcel Holtmann
2011-12-02 6:39 ` Peter Krystad
2011-12-08 14:07 ` 'Emeltchenko Andrei'
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1322661272-32027-3-git-send-email-Andrei.Emeltchenko.news@gmail.com \
--to=andrei.emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.