summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-04 12:37:23 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-04 11:58:09 +0200
commitd7347f3cc2b63be0ea35b3239faf4b32fde2fb44 (patch)
treed7a58adfad32d8de4d8907f33f2041a89f37c5f7 /net/bluetooth/hci_core.c
parentae44e5d19e870385d1e73ce248c19ea4761bb40c (diff)
downloadop-kernel-dev-d7347f3cc2b63be0ea35b3239faf4b32fde2fb44.zip
op-kernel-dev-d7347f3cc2b63be0ea35b3239faf4b32fde2fb44.tar.gz
Bluetooth: Fix clearing and restarting all LE actions on power cycle
When powering off (hci_dev_do_close) we should clear both the pend_le_reports and pend_le_conns types of entries. When powering on respectively we should populate both lists. This patch converts the hci_pend_le_conns_clear() function into hci_pend_le_actions_clear() (which can now be static) and converts the restart_le_auto_conns() function into restart_le_actions(). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6eadde8..3a1a25d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2354,6 +2354,17 @@ done:
return err;
}
+/* This function requires the caller holds hdev->lock */
+static void hci_pend_le_actions_clear(struct hci_dev *hdev)
+{
+ struct hci_conn_params *p;
+
+ list_for_each_entry(p, &hdev->le_conn_params, list)
+ list_del_init(&p->action);
+
+ BT_DBG("All LE pending actions cleared");
+}
+
static int hci_dev_do_close(struct hci_dev *hdev)
{
BT_DBG("%s %p", hdev->name, hdev);
@@ -2391,7 +2402,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hci_dev_lock(hdev);
hci_inquiry_cache_flush(hdev);
hci_conn_hash_flush(hdev);
- hci_pend_le_conns_clear(hdev);
+ hci_pend_le_actions_clear(hdev);
hci_dev_unlock(hdev);
hci_notify(hdev, HCI_DEV_DOWN);
@@ -3460,16 +3471,6 @@ void hci_pend_le_conn_add(struct hci_dev *hdev, struct hci_conn_params *params)
hci_update_background_scan(hdev);
}
-/* This function requires the caller holds hdev->lock */
-void hci_pend_le_conns_clear(struct hci_dev *hdev)
-{
- while (!list_empty(&hdev->pend_le_conns))
- list_del_init(hdev->pend_le_conns.next);
-
- BT_DBG("All LE pending connections cleared");
-}
-
-/* This function requires the caller holds hdev->lock */
struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
bdaddr_t *addr, u8 addr_type)
{
OpenPOWER on IntegriCloud