if (params->auto_connect == HCI_AUTO_CONN_REPORT &&
auto_connect != HCI_AUTO_CONN_REPORT)
- hdev->pend_le_reports--;
+ list_del_init(¶ms->action);
switch (auto_connect) {
case HCI_AUTO_CONN_DISABLED:
hci_pend_le_conn_del(hdev, params);
break;
case HCI_AUTO_CONN_REPORT:
- if (params->auto_connect != HCI_AUTO_CONN_REPORT)
- hdev->pend_le_reports++;
+ 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);
break;
case HCI_AUTO_CONN_ALWAYS:
return;
if (params->auto_connect == HCI_AUTO_CONN_REPORT)
- hdev->pend_le_reports--;
+ list_del_init(¶ms->action);
hci_pend_le_conn_del(hdev, params);
if (params->auto_connect == HCI_AUTO_CONN_DISABLED)
continue;
if (params->auto_connect == HCI_AUTO_CONN_REPORT)
- hdev->pend_le_reports--;
+ list_del_init(¶ms->action);
list_del(¶ms->list);
kfree(params);
}
INIT_LIST_HEAD(&hdev->le_white_list);
INIT_LIST_HEAD(&hdev->le_conn_params);
INIT_LIST_HEAD(&hdev->pend_le_conns);
+ INIT_LIST_HEAD(&hdev->pend_le_reports);
INIT_LIST_HEAD(&hdev->conn_hash.list);
INIT_WORK(&hdev->rx_work, hci_rx_work);
hci_req_init(&req, hdev);
- if (list_empty(&hdev->pend_le_conns) && !hdev->pend_le_reports) {
+ if (list_empty(&hdev->pend_le_conns) &&
+ list_empty(&hdev->pend_le_reports)) {
/* If there is no pending LE connections or devices
* to be scanned for, we should stop the background
* scanning.
}
if (params->auto_connect == HCI_AUTO_CONN_REPORT)
- hdev->pend_le_reports--;
+ list_del_init(¶ms->action);
hci_pend_le_conn_del(hdev, params);
list_del(¶ms->list);
if (!hci_discovery_active(hdev)) {
if (link_type == ACL_LINK)
return;
- if (link_type == LE_LINK && !hdev->pend_le_reports)
+ if (link_type == LE_LINK && list_empty(&hdev->pend_le_reports))
return;
}