if (!params)
return -EIO;
- params->auto_connect = auto_connect;
+ if (params->auto_connect == HCI_AUTO_CONN_REPORT &&
+ auto_connect != HCI_AUTO_CONN_REPORT)
+ hdev->pend_le_reports--;
switch (auto_connect) {
case HCI_AUTO_CONN_DISABLED:
- case HCI_AUTO_CONN_REPORT:
case HCI_AUTO_CONN_LINK_LOSS:
hci_pend_le_conn_del(hdev, addr, addr_type);
break;
+ case HCI_AUTO_CONN_REPORT:
+ if (params->auto_connect != HCI_AUTO_CONN_REPORT)
+ hdev->pend_le_reports++;
+ hci_pend_le_conn_del(hdev, addr, addr_type);
+ break;
case HCI_AUTO_CONN_ALWAYS:
if (!is_connected(hdev, addr, addr_type))
hci_pend_le_conn_add(hdev, addr, addr_type);
break;
}
+ params->auto_connect = auto_connect;
+
BT_DBG("addr %pMR (type %u) auto_connect %u", addr, addr_type,
auto_connect);
if (!params)
return;
+ if (params->auto_connect == HCI_AUTO_CONN_REPORT)
+ hdev->pend_le_reports--;
+
hci_pend_le_conn_del(hdev, addr, addr_type);
list_del(¶ms->list);
list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) {
if (params->auto_connect == HCI_AUTO_CONN_DISABLED)
continue;
+ if (params->auto_connect == HCI_AUTO_CONN_REPORT)
+ hdev->pend_le_reports--;
list_del(¶ms->list);
kfree(params);
}