Clean-up stale/unused hci_request.c code
Subsystems (2)
cover Clean-up stale/unused hci_request.c code
Next in series of hci_request clean-up patches, on way towards elimination of hci_request.c in favor of hci_sync.c
Brian Gix (1):
Bluetooth: Convert le_scan_disable timeout to hci_sync
net/bluetooth/hci_request.c | 98 +------------------------------------ net/bluetooth/hci_sync.c | 73 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 97 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/1 Bluetooth: Convert le_scan_disable timeout to hci_sync
The le_scan_disable timeout was being performed on the deprecated hci_request.c mechanism. This timeout is performed in hci_sync.c
--- net/bluetooth/hci_request.c | 98 +------------------------------------ net/bluetooth/hci_sync.c | 73 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 97 deletions(-)
net/bluetooth/hci_request.c +1 -97
@@ -269,6 +269,7 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,void hci_req_add (struct hci_request *req,u16 opcode,u32 plen,const void *param) { +bt_dev_dbg (req->hdev,"HCI_REQ-0x%4.4x" , opcode);hci_req_add_ev (req, opcode, plen, param,0 ); }
@@ -1968,101 +1969,6 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason)return 0 ; } -static int le_scan_disable (struct hci_request *req,unsigned long opt) -{ -hci_req_add_le_scan_disable (req, false); -return 0 ; -} - -static int bredr_inquiry (struct hci_request *req,unsigned long opt) -{ -u8 length = opt; -const u8 giac[3 ] = {0x33 ,0x8b ,0x9e }; -const u8 liac[3 ] = {0x00 ,0x8b ,0x9e }; -struct hci_cp_inquiry cp; - -if (test_bit (HCI_INQUIRY , &req->hdev->flags)) -return 0 ; - -bt_dev_dbg (req->hdev,"" ); - -hci_dev_lock (req->hdev); -hci_inquiry_cache_flush (req->hdev); -hci_dev_unlock (req->hdev); - -memset (&cp,0 ,sizeof (cp)); - -if (req->hdev->discovery.limited) -memcpy (&cp.lap, liac,sizeof (cp.lap)); -else -memcpy (&cp.lap, giac,sizeof (cp.lap)); - - cp.length = length; - -hci_req_add (req,HCI_OP_INQUIRY ,sizeof (cp), &cp); - -return 0 ; -} - -static void le_scan_disable_work (struct work_struct *work) -{ - struct hci_dev *hdev = container_of(work, struct hci_dev, - le_scan_disable.work); -u8 status; - -bt_dev_dbg (hdev,"" ); - -if (!hci_dev_test_flag (hdev,HCI_LE_SCAN )) -return ; - -cancel_delayed_work (&hdev->le_scan_restart); - -hci_req_sync (hdev, le_scan_disable,0 ,HCI_CMD_TIMEOUT , &status); -if (status) { -bt_dev_err (hdev,"failed to disable LE scan: status 0x%02x" , - status); -return ; - } - - hdev->discovery.scan_start =0 ; - -/* If we were running LE only scan, change discovery state. If -* we were running both LE and BR/EDR inquiry simultaneously, -* and BR/EDR inquiry is already finished, stop discovery, -* otherwise BR/EDR inquiry will stop discovery when finished. -* If we will resolve remote device name, do not change -* discovery state. -*/ - -if (hdev->discovery.type ==DISCOV_TYPE_LE ) - goto discov_stopped; - -if (hdev->discovery.type !=DISCOV_TYPE_INTERLEAVED ) -return ; - -if (test_bit (HCI_QUIRK_SIMULTANEOUS_DISCOVERY , &hdev->quirks)) { -if (!test_bit (HCI_INQUIRY , &hdev->flags) && - hdev->discovery.state !=DISCOVERY_RESOLVING ) - goto discov_stopped; - -return ; - } - -hci_req_sync (hdev, bredr_inquiry,DISCOV_INTERLEAVED_INQUIRY_LEN , -HCI_CMD_TIMEOUT , &status); -if (status) { -bt_dev_err (hdev,"inquiry failed: status 0x%02x" , status); - goto discov_stopped; - } - -return ; - -discov_stopped: -hci_dev_lock (hdev); -hci_discovery_set_state (hdev,DISCOVERY_STOPPED ); -hci_dev_unlock (hdev); -} -static int le_scan_restart (struct hci_request *req,unsigned long opt) {struct hci_dev *hdev = req->hdev;
@@ -2246,7 +2152,6 @@ int hci_req_configure_datapath(struct hci_dev *hdev, struct bt_codec *codec)void hci_request_setup (struct hci_dev *hdev) { -INIT_DELAYED_WORK (&hdev->le_scan_disable, le_scan_disable_work);INIT_DELAYED_WORK (&hdev->le_scan_restart, le_scan_restart_work);INIT_DELAYED_WORK (&hdev->adv_instance_expire, adv_timeout_expire);INIT_DELAYED_WORK (&hdev->interleave_scan, interleave_scan_work);
@@ -2256,7 +2161,6 @@ void hci_request_cancel_all(struct hci_dev *hdev) {__hci_cmd_sync_cancel (hdev,ENODEV ); -cancel_delayed_work_sync (&hdev->le_scan_disable);cancel_delayed_work_sync (&hdev->le_scan_restart);if (hdev->adv_instance_timeout) {
net/bluetooth/hci_sync.c +73 -0
91 lines not on this page · raw message
Signature · 1 line
2.36.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=662383
---Test result---
Test Summary:
CheckPatch PASS 1.42 seconds GitLint PASS 0.56 seconds SubjectPrefix PASS 0.39 seconds BuildKernel PASS 36.19 seconds BuildKernel32 PASS 31.25 seconds Incremental Build with patchesPASS 50.10 seconds TestRunner: Setup PASS 536.57 seconds TestRunner: l2cap-tester PASS 16.84 seconds TestRunner: bnep-tester PASS 6.26 seconds TestRunner: mgmt-tester PASS 100.28 seconds TestRunner: rfcomm-tester PASS 9.42 seconds TestRunner: sco-tester PASS 9.22 seconds TestRunner: smp-tester PASS 9.23 seconds TestRunner: userchan-tester PASS 6.25 seconds
---
Regards,
Linux Bluetooth