diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-06-29 07:41:51 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 11:42:49 -0400 |
commit | 1c1697c0cad41fa468e3cb6061ce74debb4f3733 (patch) | |
tree | 88cd343359952437a313d3077d6effe7e30142cb /net | |
parent | 1089b67d8eb7fcdfae837a91aae9af94e329361c (diff) |
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: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8b206d0942aa..c566b57610c9 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -959,7 +959,6 @@ static ssize_t le_auto_conn_write(struct file *file, const char __user *data, | |||
959 | } else if (memcmp(buf, "clr", 3) == 0) { | 959 | } else if (memcmp(buf, "clr", 3) == 0) { |
960 | hci_dev_lock(hdev); | 960 | hci_dev_lock(hdev); |
961 | hci_conn_params_clear(hdev); | 961 | hci_conn_params_clear(hdev); |
962 | hci_update_background_scan(hdev); | ||
963 | hci_dev_unlock(hdev); | 962 | hci_dev_unlock(hdev); |
964 | } else { | 963 | } else { |
965 | err = -EINVAL; | 964 | err = -EINVAL; |
@@ -3483,6 +3482,8 @@ void hci_pend_le_conns_clear(struct hci_dev *hdev) | |||
3483 | } | 3482 | } |
3484 | 3483 | ||
3485 | BT_DBG("All LE pending connections cleared"); | 3484 | BT_DBG("All LE pending connections cleared"); |
3485 | |||
3486 | hci_update_background_scan(hdev); | ||
3486 | } | 3487 | } |
3487 | 3488 | ||
3488 | /* This function requires the caller holds hdev->lock */ | 3489 | /* This function requires the caller holds hdev->lock */ |
@@ -5293,6 +5294,9 @@ void hci_update_background_scan(struct hci_dev *hdev) | |||
5293 | struct hci_conn *conn; | 5294 | struct hci_conn *conn; |
5294 | int err; | 5295 | int err; |
5295 | 5296 | ||
5297 | if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) | ||
5298 | return; | ||
5299 | |||
5296 | hci_req_init(&req, hdev); | 5300 | hci_req_init(&req, hdev); |
5297 | 5301 | ||
5298 | if (list_empty(&hdev->pend_le_conns)) { | 5302 | if (list_empty(&hdev->pend_le_conns)) { |