if (params->auto_connect == auto_connect)
return 0;
- if (params->auto_connect == HCI_AUTO_CONN_REPORT &&
- auto_connect != HCI_AUTO_CONN_REPORT)
- list_del_init(¶ms->action);
+ list_del_init(¶ms->action);
switch (auto_connect) {
case HCI_AUTO_CONN_DISABLED:
case HCI_AUTO_CONN_LINK_LOSS:
- hci_pend_le_conn_del(hdev, params);
+ hci_update_background_scan(hdev);
break;
case HCI_AUTO_CONN_REPORT:
- if (params->auto_connect != HCI_AUTO_CONN_REPORT) {
- list_del_init(¶ms->action);
- list_add(¶ms->action,
- &hdev->pend_le_reports);
- }
- hci_pend_le_conn_del(hdev, params);
+ list_add(¶ms->action, &hdev->pend_le_reports);
+ hci_update_background_scan(hdev);
break;
case HCI_AUTO_CONN_ALWAYS:
- if (!is_connected(hdev, addr, addr_type))
- hci_pend_le_conn_add(hdev, params);
+ if (!is_connected(hdev, addr, addr_type)) {
+ list_add(¶ms->action, &hdev->pend_le_conns);
+ hci_update_background_scan(hdev);
+ }
break;
}
if (!params)
return;
- if (params->auto_connect == HCI_AUTO_CONN_REPORT)
- list_del_init(¶ms->action);
-
- hci_pend_le_conn_del(hdev, params);
-
+ list_del(¶ms->action);
list_del(¶ms->list);
kfree(params);
+ hci_update_background_scan(hdev);
+
BT_DBG("addr %pMR (type %u)", addr, addr_type);
}
hci_proto_connect_cfm(conn, ev->status);
params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
- if (params)
- hci_pend_le_conn_del(hdev, params);
+ if (params) {
+ list_del_init(¶ms->action);
+ hci_update_background_scan(hdev);
+ }
unlock:
hci_dev_unlock(hdev);
goto unlock;
}
- if (params->auto_connect == HCI_AUTO_CONN_REPORT)
- list_del_init(¶ms->action);
-
- hci_pend_le_conn_del(hdev, params);
+ list_del_init(¶ms->action);
list_del(¶ms->list);
kfree(params);
+ hci_update_background_scan(hdev);
device_removed(sk, hdev, &cp->addr.bdaddr, cp->addr.type);
} else {