int hci_le_pa_terminate_sync(struct hci_dev *hdev, u16 handle);
-int hci_acl_create_connection_sync(struct hci_dev *hdev,
- struct hci_conn *conn);
+int hci_connect_acl_sync(struct hci_dev *hdev, struct hci_conn *conn);
acl->auth_type = auth_type;
acl->conn_timeout = timeout;
- err = hci_acl_create_connection_sync(hdev, acl);
+ err = hci_connect_acl_sync(hdev, acl);
if (err) {
hci_conn_del(acl);
return ERR_PTR(err);
*/
if (conn->state == BT_CONNECT && hdev->req_status == HCI_REQ_PEND) {
switch (hci_skb_event(hdev->sent_cmd)) {
+ case HCI_EV_CONN_COMPLETE:
case HCI_EV_LE_CONN_COMPLETE:
case HCI_EV_LE_ENHANCED_CONN_COMPLETE:
case HCI_EVT_LE_CIS_ESTABLISHED:
UINT_PTR(instance), NULL);
}
-static int __hci_acl_create_connection_sync(struct hci_dev *hdev, void *data)
+static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
{
- struct hci_conn *conn = data;
+ struct hci_conn *conn;
+ u16 handle = PTR_UINT(data);
struct inquiry_entry *ie;
struct hci_cp_create_conn cp;
int err;
+ conn = hci_conn_hash_lookup_handle(hdev, handle);
+ if (!conn)
+ return 0;
+
/* Many controllers disallow HCI Create Connection while it is doing
* HCI Inquiry. So we cancel the Inquiry first before issuing HCI Create
* Connection. This may cause the MGMT discovering state to become false
return err;
}
-int hci_acl_create_connection_sync(struct hci_dev *hdev,
- struct hci_conn *conn)
+int hci_connect_acl_sync(struct hci_dev *hdev, struct hci_conn *conn)
{
- return hci_cmd_sync_queue(hdev, __hci_acl_create_connection_sync,
- conn, NULL);
+ return hci_cmd_sync_queue(hdev, hci_acl_create_conn_sync,
+ UINT_PTR(conn->handle), NULL);
}