Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: Remove update_scan hci_request dependancy

This removes the remaining calls to HCI_OP_WRITE_SCAN_ENABLE from
hci_request call chains, and converts them to hci_sync calls.

Signed-off-by: Brian Gix <brian.gix@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Brian Gix and committed by
Luiz Augusto von Dentz
bb876725 ec2904c2

+17 -29
-1
include/net/bluetooth/hci_core.h
··· 517 517 struct work_struct cmd_work; 518 518 struct work_struct tx_work; 519 519 520 - struct work_struct scan_update; 521 520 struct delayed_work le_scan_disable; 522 521 struct delayed_work le_scan_restart; 523 522
+1
include/net/bluetooth/hci_sync.h
··· 78 78 79 79 int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable); 80 80 int hci_update_scan_sync(struct hci_dev *hdev); 81 + int hci_update_scan(struct hci_dev *hdev); 81 82 82 83 int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul); 83 84 int hci_remove_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance,
+2 -2
net/bluetooth/hci_event.c
··· 3173 3173 hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES, 3174 3174 sizeof(cp), &cp); 3175 3175 3176 - hci_req_update_scan(hdev); 3176 + hci_update_scan(hdev); 3177 3177 } 3178 3178 3179 3179 /* Set packet type for incoming connection */ ··· 3371 3371 if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags)) 3372 3372 hci_remove_link_key(hdev, &conn->dst); 3373 3373 3374 - hci_req_update_scan(hdev); 3374 + hci_update_scan(hdev); 3375 3375 } 3376 3376 3377 3377 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
-17
net/bluetooth/hci_request.c
··· 1835 1835 hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan); 1836 1836 } 1837 1837 1838 - static int update_scan(struct hci_request *req, unsigned long opt) 1839 - { 1840 - hci_dev_lock(req->hdev); 1841 - __hci_req_update_scan(req); 1842 - hci_dev_unlock(req->hdev); 1843 - return 0; 1844 - } 1845 - 1846 - static void scan_update_work(struct work_struct *work) 1847 - { 1848 - struct hci_dev *hdev = container_of(work, struct hci_dev, scan_update); 1849 - 1850 - hci_req_sync(hdev, update_scan, 0, HCI_CMD_TIMEOUT, NULL); 1851 - } 1852 - 1853 1838 static u8 get_service_classes(struct hci_dev *hdev) 1854 1839 { 1855 1840 struct bt_uuid *uuid; ··· 2333 2348 2334 2349 void hci_request_setup(struct hci_dev *hdev) 2335 2350 { 2336 - INIT_WORK(&hdev->scan_update, scan_update_work); 2337 2351 INIT_DELAYED_WORK(&hdev->discov_off, discov_off); 2338 2352 INIT_DELAYED_WORK(&hdev->le_scan_disable, le_scan_disable_work); 2339 2353 INIT_DELAYED_WORK(&hdev->le_scan_restart, le_scan_restart_work); ··· 2344 2360 { 2345 2361 __hci_cmd_sync_cancel(hdev, ENODEV); 2346 2362 2347 - cancel_work_sync(&hdev->scan_update); 2348 2363 cancel_delayed_work_sync(&hdev->discov_off); 2349 2364 cancel_delayed_work_sync(&hdev->le_scan_disable); 2350 2365 cancel_delayed_work_sync(&hdev->le_scan_restart);
-5
net/bluetooth/hci_request.h
··· 108 108 109 109 int hci_req_configure_datapath(struct hci_dev *hdev, struct bt_codec *codec); 110 110 111 - static inline void hci_req_update_scan(struct hci_dev *hdev) 112 - { 113 - queue_work(hdev->req_workqueue, &hdev->scan_update); 114 - } 115 - 116 111 void __hci_req_update_scan(struct hci_request *req); 117 112 118 113 int hci_update_random_address(struct hci_request *req, bool require_privacy,
+10
net/bluetooth/hci_sync.c
··· 2236 2236 return err; 2237 2237 } 2238 2238 2239 + static int update_scan_sync(struct hci_dev *hdev, void *data) 2240 + { 2241 + return hci_update_scan_sync(hdev); 2242 + } 2243 + 2244 + int hci_update_scan(struct hci_dev *hdev) 2245 + { 2246 + return hci_cmd_sync_queue(hdev, update_scan_sync, NULL, NULL); 2247 + } 2248 + 2239 2249 static int update_passive_scan_sync(struct hci_dev *hdev, void *data) 2240 2250 { 2241 2251 return hci_update_passive_scan_sync(hdev);
+4 -4
net/bluetooth/mgmt.c
··· 1611 1611 return err; 1612 1612 1613 1613 if (changed) { 1614 - hci_req_update_scan(hdev); 1614 + hci_update_scan(hdev); 1615 1615 hci_update_passive_scan(hdev); 1616 1616 return new_settings(hdev, sk); 1617 1617 } ··· 7081 7081 if (err) 7082 7082 goto unlock; 7083 7083 7084 - hci_req_update_scan(hdev); 7084 + hci_update_scan(hdev); 7085 7085 7086 7086 goto added; 7087 7087 } ··· 7193 7193 goto unlock; 7194 7194 } 7195 7195 7196 - hci_req_update_scan(hdev); 7196 + hci_update_scan(hdev); 7197 7197 7198 7198 device_removed(sk, hdev, &cp->addr.bdaddr, 7199 7199 cp->addr.type); ··· 7257 7257 kfree(b); 7258 7258 } 7259 7259 7260 - hci_req_update_scan(hdev); 7260 + hci_update_scan(hdev); 7261 7261 7262 7262 list_for_each_entry_safe(p, tmp, &hdev->le_conn_params, list) { 7263 7263 if (p->auto_connect == HCI_AUTO_CONN_DISABLED)