Commit 1c1697c0 authored by Marcel Holtmann's avatar Marcel Holtmann

Bluetooth: Update background scanning from hci_conn_params_clear

When calling hci_conn_params_clear function, it should update the
background scanning properly and not require a separate call to
update it.

For the case when the function is used during unregister of a
controller, an extra safe guard is but in place.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 1089b67d
...@@ -959,7 +959,6 @@ static ssize_t le_auto_conn_write(struct file *file, const char __user *data, ...@@ -959,7 +959,6 @@ static ssize_t le_auto_conn_write(struct file *file, const char __user *data,
} else if (memcmp(buf, "clr", 3) == 0) { } else if (memcmp(buf, "clr", 3) == 0) {
hci_dev_lock(hdev); hci_dev_lock(hdev);
hci_conn_params_clear(hdev); hci_conn_params_clear(hdev);
hci_update_background_scan(hdev);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
} else { } else {
err = -EINVAL; err = -EINVAL;
...@@ -3483,6 +3482,8 @@ void hci_pend_le_conns_clear(struct hci_dev *hdev) ...@@ -3483,6 +3482,8 @@ void hci_pend_le_conns_clear(struct hci_dev *hdev)
} }
BT_DBG("All LE pending connections cleared"); BT_DBG("All LE pending connections cleared");
hci_update_background_scan(hdev);
} }
/* This function requires the caller holds hdev->lock */ /* This function requires the caller holds hdev->lock */
...@@ -5293,6 +5294,9 @@ void hci_update_background_scan(struct hci_dev *hdev) ...@@ -5293,6 +5294,9 @@ void hci_update_background_scan(struct hci_dev *hdev)
struct hci_conn *conn; struct hci_conn *conn;
int err; int err;
if (test_bit(HCI_UNREGISTER, &hdev->dev_flags))
return;
hci_req_init(&req, hdev); hci_req_init(&req, hdev);
if (list_empty(&hdev->pend_le_conns)) { if (list_empty(&hdev->pend_le_conns)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment