Skip to contentSkip to conversation

Bluetooth: hci_sync: Add hci_le_create_conn_sync

PATCH New Luiz Augusto von Dentz 1 participant 1 message Dec 10, 2021

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/3 Bluetooth: hci_sync: Add hci_le_create_conn_sync

From: Luiz Augusto von Dentz <[email protected]>

This adds hci_le_create_conn_sync and make hci_le_connect use it instead of queueing multiple commands which may conflict with the likes of hci_update_passive_scan which uses hci_cmd_sync_queue.

---
 include/net/bluetooth/hci_core.h |   1 +
 include/net/bluetooth/hci_sync.h |   4 +
 net/bluetooth/hci_conn.c         | 304 ++-----------------------------
 net/bluetooth/hci_request.c      |  50 -----
 net/bluetooth/hci_request.h      |   2 -
 net/bluetooth/hci_sync.c         | 295 ++++++++++++++++++++++++++++++
 6 files changed, 315 insertions(+), 341 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
index 4d69dcfebd63..c41ad7847d9d 100644
@@ -646,6 +646,7 @@ struct hci_conn {
 	__u8		init_addr_type;
 	bdaddr_t	resp_addr;
 	__u8		resp_addr_type;
+	bdaddr_t	direct_rpa;
 	__u8		adv_instance;
 	__u16		handle;
 	__u16		state;
include/net/bluetooth/hci_sync.h +4 -0
index f4034bf8f1ce..0d2a75d88e7c 100644
@@ -101,3 +101,7 @@ int hci_stop_discovery_sync(struct hci_dev *hdev);
 
 int hci_suspend_sync(struct hci_dev *hdev);
 int hci_resume_sync(struct hci_dev *hdev);
+
+struct hci_conn;
+
+int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn);
net/bluetooth/hci_conn.c +15 -289

350 lines not on this page · raw message

net/bluetooth/hci_request.c +0 -50

56 lines not on this page · raw message

net/bluetooth/hci_request.h +0 -2
index 8d39e9416861..7f8df258e295 100644
@@ -80,8 +80,6 @@ void hci_req_add_le_passive_scan(struct hci_request *req);
 void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next);
 
 void hci_req_disable_address_resolution(struct hci_dev *hdev);
-void __hci_req_pause_adv_instances(struct hci_request *req);
-int hci_req_resume_adv_instances(struct hci_dev *hdev);
 void hci_req_reenable_advertising(struct hci_dev *hdev);
 void __hci_req_enable_advertising(struct hci_request *req);
 void __hci_req_disable_advertising(struct hci_request *req);
net/bluetooth/hci_sync.c +295 -0

298 lines not on this page · raw message

Signature · 1 line
2.33.1