aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 336a2311bdca..408468c07a8a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -5283,11 +5283,27 @@ void mgmt_index_removed(struct hci_dev *hdev)
5283static void restart_le_auto_conns(struct hci_dev *hdev) 5283static void restart_le_auto_conns(struct hci_dev *hdev)
5284{ 5284{
5285 struct hci_conn_params *p; 5285 struct hci_conn_params *p;
5286 bool added = false;
5286 5287
5287 list_for_each_entry(p, &hdev->le_conn_params, list) { 5288 list_for_each_entry(p, &hdev->le_conn_params, list) {
5288 if (p->auto_connect == HCI_AUTO_CONN_ALWAYS) 5289 if (p->auto_connect == HCI_AUTO_CONN_ALWAYS) {
5289 hci_pend_le_conn_add(hdev, &p->addr, p->addr_type); 5290 hci_pend_le_conn_add(hdev, &p->addr, p->addr_type);
5291 added = true;
5292 }
5290 } 5293 }
5294
5295 /* Calling hci_pend_le_conn_add will actually already trigger
5296 * background scanning when needed. So no need to trigger it
5297 * just another time.
5298 *
5299 * This check is here to avoid an unneeded restart of the
5300 * passive scanning. Since this is during the controller
5301 * power up phase the duplicate filtering is not an issue.
5302 */
5303 if (added)
5304 return;
5305
5306 hci_update_background_scan(hdev);
5291} 5307}
5292 5308
5293static void powered_complete(struct hci_dev *hdev, u8 status) 5309static void powered_complete(struct hci_dev *hdev, u8 status)