Lines Matching refs:hdev

37 void hci_req_init(struct hci_request *req, struct hci_dev *hdev)  in hci_req_init()  argument
40 req->hdev = hdev; in hci_req_init()
52 struct hci_dev *hdev = req->hdev; in req_run() local
78 spin_lock_irqsave(&hdev->cmd_q.lock, flags); in req_run()
79 skb_queue_splice_tail(&req->cmd_q, &hdev->cmd_q); in req_run()
80 spin_unlock_irqrestore(&hdev->cmd_q.lock, flags); in req_run()
82 queue_work(hdev->workqueue, &hdev->cmd_work); in req_run()
97 static void hci_req_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode, in hci_req_sync_complete() argument
100 BT_DBG("%s result 0x%2.2x", hdev->name, result); in hci_req_sync_complete()
102 if (hdev->req_status == HCI_REQ_PEND) { in hci_req_sync_complete()
103 hdev->req_result = result; in hci_req_sync_complete()
104 hdev->req_status = HCI_REQ_DONE; in hci_req_sync_complete()
106 hdev->req_skb = skb_get(skb); in hci_req_sync_complete()
107 wake_up_interruptible(&hdev->req_wait_q); in hci_req_sync_complete()
111 void hci_req_sync_cancel(struct hci_dev *hdev, int err) in hci_req_sync_cancel() argument
113 BT_DBG("%s err 0x%2.2x", hdev->name, err); in hci_req_sync_cancel()
115 if (hdev->req_status == HCI_REQ_PEND) { in hci_req_sync_cancel()
116 hdev->req_result = err; in hci_req_sync_cancel()
117 hdev->req_status = HCI_REQ_CANCELED; in hci_req_sync_cancel()
118 wake_up_interruptible(&hdev->req_wait_q); in hci_req_sync_cancel()
122 struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, in __hci_cmd_sync_ev() argument
129 BT_DBG("%s", hdev->name); in __hci_cmd_sync_ev()
131 hci_req_init(&req, hdev); in __hci_cmd_sync_ev()
135 hdev->req_status = HCI_REQ_PEND; in __hci_cmd_sync_ev()
141 err = wait_event_interruptible_timeout(hdev->req_wait_q, in __hci_cmd_sync_ev()
142 hdev->req_status != HCI_REQ_PEND, timeout); in __hci_cmd_sync_ev()
147 switch (hdev->req_status) { in __hci_cmd_sync_ev()
149 err = -bt_to_errno(hdev->req_result); in __hci_cmd_sync_ev()
153 err = -hdev->req_result; in __hci_cmd_sync_ev()
161 hdev->req_status = hdev->req_result = 0; in __hci_cmd_sync_ev()
162 skb = hdev->req_skb; in __hci_cmd_sync_ev()
163 hdev->req_skb = NULL; in __hci_cmd_sync_ev()
165 BT_DBG("%s end: err %d", hdev->name, err); in __hci_cmd_sync_ev()
179 struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, in __hci_cmd_sync() argument
182 return __hci_cmd_sync_ev(hdev, opcode, plen, param, 0, timeout); in __hci_cmd_sync()
187 int __hci_req_sync(struct hci_dev *hdev, int (*func)(struct hci_request *req, in __hci_req_sync() argument
194 BT_DBG("%s start", hdev->name); in __hci_req_sync()
196 hci_req_init(&req, hdev); in __hci_req_sync()
198 hdev->req_status = HCI_REQ_PEND; in __hci_req_sync()
209 hdev->req_status = 0; in __hci_req_sync()
228 err = wait_event_interruptible_timeout(hdev->req_wait_q, in __hci_req_sync()
229 hdev->req_status != HCI_REQ_PEND, timeout); in __hci_req_sync()
234 switch (hdev->req_status) { in __hci_req_sync()
236 err = -bt_to_errno(hdev->req_result); in __hci_req_sync()
238 *hci_status = hdev->req_result; in __hci_req_sync()
242 err = -hdev->req_result; in __hci_req_sync()
254 kfree_skb(hdev->req_skb); in __hci_req_sync()
255 hdev->req_skb = NULL; in __hci_req_sync()
256 hdev->req_status = hdev->req_result = 0; in __hci_req_sync()
258 BT_DBG("%s end: err %d", hdev->name, err); in __hci_req_sync()
263 int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req, in hci_req_sync() argument
269 if (!test_bit(HCI_UP, &hdev->flags)) in hci_req_sync()
273 hci_req_sync_lock(hdev); in hci_req_sync()
274 ret = __hci_req_sync(hdev, req, opt, timeout, hci_status); in hci_req_sync()
275 hci_req_sync_unlock(hdev); in hci_req_sync()
280 struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen, in hci_prepare_cmd() argument
310 struct hci_dev *hdev = req->hdev; in hci_req_add_ev() local
313 BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen); in hci_req_add_ev()
321 skb = hci_prepare_cmd(hdev, opcode, plen, param); in hci_req_add_ev()
323 bt_dev_err(hdev, "no memory for command (opcode 0x%4.4x)", in hci_req_add_ev()
345 struct hci_dev *hdev = req->hdev; in __hci_req_write_fast_connectable() local
349 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) in __hci_req_write_fast_connectable()
352 if (hdev->hci_ver < BLUETOOTH_VER_1_2) in __hci_req_write_fast_connectable()
369 if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval || in __hci_req_write_fast_connectable()
370 __cpu_to_le16(hdev->page_scan_window) != acp.window) in __hci_req_write_fast_connectable()
374 if (hdev->page_scan_type != type) in __hci_req_write_fast_connectable()
386 struct hci_dev *hdev = req->hdev; in __hci_update_background_scan() local
388 if (!test_bit(HCI_UP, &hdev->flags) || in __hci_update_background_scan()
389 test_bit(HCI_INIT, &hdev->flags) || in __hci_update_background_scan()
390 hci_dev_test_flag(hdev, HCI_SETUP) || in __hci_update_background_scan()
391 hci_dev_test_flag(hdev, HCI_CONFIG) || in __hci_update_background_scan()
392 hci_dev_test_flag(hdev, HCI_AUTO_OFF) || in __hci_update_background_scan()
393 hci_dev_test_flag(hdev, HCI_UNREGISTER)) in __hci_update_background_scan()
397 if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) in __hci_update_background_scan()
401 if (hdev->discovery.state != DISCOVERY_STOPPED) in __hci_update_background_scan()
411 hci_discovery_filter_clear(hdev); in __hci_update_background_scan()
413 if (list_empty(&hdev->pend_le_conns) && in __hci_update_background_scan()
414 list_empty(&hdev->pend_le_reports)) { in __hci_update_background_scan()
421 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) in __hci_update_background_scan()
426 BT_DBG("%s stopping background scanning", hdev->name); in __hci_update_background_scan()
436 if (hci_lookup_le_connect(hdev)) in __hci_update_background_scan()
442 if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) in __hci_update_background_scan()
447 BT_DBG("%s starting background scanning", hdev->name); in __hci_update_background_scan()
453 struct hci_dev *hdev = req->hdev; in __hci_req_update_name() local
456 memcpy(cp.name, hdev->dev_name, sizeof(cp.name)); in __hci_req_update_name()
463 static u8 *create_uuid16_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) in create_uuid16_list() argument
471 list_for_each_entry(uuid, &hdev->uuids, list) { in create_uuid16_list()
505 static u8 *create_uuid32_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) in create_uuid32_list() argument
513 list_for_each_entry(uuid, &hdev->uuids, list) { in create_uuid32_list()
538 static u8 *create_uuid128_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) in create_uuid128_list() argument
546 list_for_each_entry(uuid, &hdev->uuids, list) { in create_uuid128_list()
571 static void create_eir(struct hci_dev *hdev, u8 *data) in create_eir() argument
576 name_len = strlen(hdev->dev_name); in create_eir()
589 memcpy(ptr + 2, hdev->dev_name, name_len); in create_eir()
594 if (hdev->inq_tx_power != HCI_TX_POWER_INVALID) { in create_eir()
597 ptr[2] = (u8) hdev->inq_tx_power; in create_eir()
602 if (hdev->devid_source > 0) { in create_eir()
606 put_unaligned_le16(hdev->devid_source, ptr + 2); in create_eir()
607 put_unaligned_le16(hdev->devid_vendor, ptr + 4); in create_eir()
608 put_unaligned_le16(hdev->devid_product, ptr + 6); in create_eir()
609 put_unaligned_le16(hdev->devid_version, ptr + 8); in create_eir()
614 ptr = create_uuid16_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in create_eir()
615 ptr = create_uuid32_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in create_eir()
616 ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in create_eir()
621 struct hci_dev *hdev = req->hdev; in __hci_req_update_eir() local
624 if (!hdev_is_powered(hdev)) in __hci_req_update_eir()
627 if (!lmp_ext_inq_capable(hdev)) in __hci_req_update_eir()
630 if (!hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) in __hci_req_update_eir()
633 if (hci_dev_test_flag(hdev, HCI_SERVICE_CACHE)) in __hci_req_update_eir()
638 create_eir(hdev, cp.data); in __hci_req_update_eir()
640 if (memcmp(cp.data, hdev->eir, sizeof(cp.data)) == 0) in __hci_req_update_eir()
643 memcpy(hdev->eir, cp.data, sizeof(cp.data)); in __hci_req_update_eir()
650 struct hci_dev *hdev = req->hdev; in hci_req_add_le_scan_disable() local
652 if (use_ext_scan(hdev)) { in hci_req_add_le_scan_disable()
681 struct hci_dev *hdev = req->hdev; in update_white_list() local
692 list_for_each_entry(b, &hdev->le_white_list, list) { in update_white_list()
696 if (!hci_pend_le_action_lookup(&hdev->pend_le_conns, in update_white_list()
698 !hci_pend_le_action_lookup(&hdev->pend_le_reports, in update_white_list()
710 if (hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { in update_white_list()
728 list_for_each_entry(params, &hdev->pend_le_conns, action) { in update_white_list()
729 if (hci_bdaddr_list_lookup(&hdev->le_white_list, in update_white_list()
733 if (white_list_entries >= hdev->le_white_list_size) { in update_white_list()
738 if (hci_find_irk_by_addr(hdev, &params->addr, in update_white_list()
752 list_for_each_entry(params, &hdev->pend_le_reports, action) { in update_white_list()
753 if (hci_bdaddr_list_lookup(&hdev->le_white_list, in update_white_list()
757 if (white_list_entries >= hdev->le_white_list_size) { in update_white_list()
762 if (hci_find_irk_by_addr(hdev, &params->addr, in update_white_list()
776 static bool scan_use_rpa(struct hci_dev *hdev) in scan_use_rpa() argument
778 return hci_dev_test_flag(hdev, HCI_PRIVACY); in scan_use_rpa()
784 struct hci_dev *hdev = req->hdev; in hci_req_start_scan() local
789 if (use_ext_scan(hdev)) { in hci_req_start_scan()
805 if (scan_1m(hdev) || scan_2m(hdev)) { in hci_req_start_scan()
817 if (scan_coded(hdev)) { in hci_req_start_scan()
861 struct hci_dev *hdev = req->hdev; in hci_req_add_le_passive_scan() local
871 if (hci_update_random_address(req, false, scan_use_rpa(hdev), in hci_req_add_le_passive_scan()
890 if (hci_dev_test_flag(hdev, HCI_PRIVACY) && in hci_req_add_le_passive_scan()
891 (hdev->le_features[0] & HCI_LE_EXT_SCAN_POLICY)) in hci_req_add_le_passive_scan()
894 hci_req_start_scan(req, LE_SCAN_PASSIVE, hdev->le_scan_interval, in hci_req_add_le_passive_scan()
895 hdev->le_scan_window, own_addr_type, filter_policy); in hci_req_add_le_passive_scan()
898 static u8 get_adv_instance_scan_rsp_len(struct hci_dev *hdev, u8 instance) in get_adv_instance_scan_rsp_len() argument
906 adv_instance = hci_find_adv_instance(hdev, instance); in get_adv_instance_scan_rsp_len()
916 static u8 get_cur_adv_instance_scan_rsp_len(struct hci_dev *hdev) in get_cur_adv_instance_scan_rsp_len() argument
918 u8 instance = hdev->cur_adv_instance; in get_cur_adv_instance_scan_rsp_len()
925 adv_instance = hci_find_adv_instance(hdev, instance); in get_cur_adv_instance_scan_rsp_len()
937 if (ext_adv_capable(req->hdev)) { in __hci_req_disable_advertising()
952 static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance) in get_adv_instance_flags() argument
966 if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE)) in get_adv_instance_flags()
969 if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) in get_adv_instance_flags()
971 else if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) in get_adv_instance_flags()
977 adv_instance = hci_find_adv_instance(hdev, instance); in get_adv_instance_flags()
986 static bool adv_use_rpa(struct hci_dev *hdev, uint32_t flags) in adv_use_rpa() argument
989 if (!hci_dev_test_flag(hdev, HCI_PRIVACY)) in adv_use_rpa()
993 if (!hci_dev_test_flag(hdev, HCI_LIMITED_PRIVACY)) in adv_use_rpa()
1000 hci_dev_test_flag(hdev, HCI_BONDABLE)) in adv_use_rpa()
1009 static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable) in is_advertising_allowed() argument
1012 if (hci_conn_num(hdev, LE_LINK) == 0) in is_advertising_allowed()
1016 if (hdev->conn_hash.le_num_slave > 0) { in is_advertising_allowed()
1018 if (!connectable && !(hdev->le_states[2] & 0x10)) in is_advertising_allowed()
1024 if (connectable && (!(hdev->le_states[4] & 0x40) || in is_advertising_allowed()
1025 !(hdev->le_states[2] & 0x20))) in is_advertising_allowed()
1030 if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_slave) { in is_advertising_allowed()
1032 if (!connectable && !(hdev->le_states[2] & 0x02)) in is_advertising_allowed()
1038 if (connectable && (!(hdev->le_states[4] & 0x08) || in is_advertising_allowed()
1039 !(hdev->le_states[2] & 0x08))) in is_advertising_allowed()
1048 struct hci_dev *hdev = req->hdev; in __hci_req_enable_advertising() local
1054 flags = get_adv_instance_flags(hdev, hdev->cur_adv_instance); in __hci_req_enable_advertising()
1060 mgmt_get_connectable(hdev); in __hci_req_enable_advertising()
1062 if (!is_advertising_allowed(hdev, connectable)) in __hci_req_enable_advertising()
1065 if (hci_dev_test_flag(hdev, HCI_LE_ADV)) in __hci_req_enable_advertising()
1073 hci_dev_clear_flag(hdev, HCI_LE_ADV); in __hci_req_enable_advertising()
1080 adv_use_rpa(hdev, flags), in __hci_req_enable_advertising()
1085 cp.min_interval = cpu_to_le16(hdev->le_adv_min_interval); in __hci_req_enable_advertising()
1086 cp.max_interval = cpu_to_le16(hdev->le_adv_max_interval); in __hci_req_enable_advertising()
1090 else if (get_cur_adv_instance_scan_rsp_len(hdev)) in __hci_req_enable_advertising()
1096 cp.channel_map = hdev->le_adv_channel_map; in __hci_req_enable_advertising()
1103 u8 append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len) in append_local_name() argument
1113 complete_len = strlen(hdev->dev_name); in append_local_name()
1116 hdev->dev_name, complete_len + 1); in append_local_name()
1119 short_len = strlen(hdev->short_name); in append_local_name()
1122 hdev->short_name, short_len + 1); in append_local_name()
1130 memcpy(name, hdev->dev_name, HCI_MAX_SHORT_NAME_LENGTH); in append_local_name()
1140 static u8 append_appearance(struct hci_dev *hdev, u8 *ptr, u8 ad_len) in append_appearance() argument
1142 return eir_append_le16(ptr, ad_len, EIR_APPEARANCE, hdev->appearance); in append_appearance()
1145 static u8 create_default_scan_rsp_data(struct hci_dev *hdev, u8 *ptr) in create_default_scan_rsp_data() argument
1149 if (hdev->appearance) { in create_default_scan_rsp_data()
1150 scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len); in create_default_scan_rsp_data()
1153 return append_local_name(hdev, ptr, scan_rsp_len); in create_default_scan_rsp_data()
1156 static u8 create_instance_scan_rsp_data(struct hci_dev *hdev, u8 instance, in create_instance_scan_rsp_data() argument
1163 adv_instance = hci_find_adv_instance(hdev, instance); in create_instance_scan_rsp_data()
1169 if ((instance_flags & MGMT_ADV_FLAG_APPEARANCE) && hdev->appearance) { in create_instance_scan_rsp_data()
1170 scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len); in create_instance_scan_rsp_data()
1179 scan_rsp_len = append_local_name(hdev, ptr, scan_rsp_len); in create_instance_scan_rsp_data()
1186 struct hci_dev *hdev = req->hdev; in __hci_req_update_scan_rsp_data() local
1189 if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) in __hci_req_update_scan_rsp_data()
1192 if (ext_adv_capable(hdev)) { in __hci_req_update_scan_rsp_data()
1198 len = create_instance_scan_rsp_data(hdev, instance, in __hci_req_update_scan_rsp_data()
1201 len = create_default_scan_rsp_data(hdev, cp.data); in __hci_req_update_scan_rsp_data()
1203 if (hdev->scan_rsp_data_len == len && in __hci_req_update_scan_rsp_data()
1204 !memcmp(cp.data, hdev->scan_rsp_data, len)) in __hci_req_update_scan_rsp_data()
1207 memcpy(hdev->scan_rsp_data, cp.data, sizeof(cp.data)); in __hci_req_update_scan_rsp_data()
1208 hdev->scan_rsp_data_len = len; in __hci_req_update_scan_rsp_data()
1223 len = create_instance_scan_rsp_data(hdev, instance, in __hci_req_update_scan_rsp_data()
1226 len = create_default_scan_rsp_data(hdev, cp.data); in __hci_req_update_scan_rsp_data()
1228 if (hdev->scan_rsp_data_len == len && in __hci_req_update_scan_rsp_data()
1229 !memcmp(cp.data, hdev->scan_rsp_data, len)) in __hci_req_update_scan_rsp_data()
1232 memcpy(hdev->scan_rsp_data, cp.data, sizeof(cp.data)); in __hci_req_update_scan_rsp_data()
1233 hdev->scan_rsp_data_len = len; in __hci_req_update_scan_rsp_data()
1241 static u8 create_instance_adv_data(struct hci_dev *hdev, u8 instance, u8 *ptr) in create_instance_adv_data() argument
1249 adv_instance = hci_find_adv_instance(hdev, instance); in create_instance_adv_data()
1254 instance_flags = get_adv_instance_flags(hdev, instance); in create_instance_adv_data()
1265 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) in create_instance_adv_data()
1273 flags |= mgmt_get_adv_discov_flags(hdev); in create_instance_adv_data()
1298 if (ext_adv_capable(hdev)) { in create_instance_adv_data()
1302 adv_tx_power = hdev->adv_tx_power; in create_instance_adv_data()
1304 adv_tx_power = hdev->adv_tx_power; in create_instance_adv_data()
1323 struct hci_dev *hdev = req->hdev; in __hci_req_update_adv_data() local
1326 if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) in __hci_req_update_adv_data()
1329 if (ext_adv_capable(hdev)) { in __hci_req_update_adv_data()
1334 len = create_instance_adv_data(hdev, instance, cp.data); in __hci_req_update_adv_data()
1337 if (hdev->adv_data_len == len && in __hci_req_update_adv_data()
1338 memcmp(cp.data, hdev->adv_data, len) == 0) in __hci_req_update_adv_data()
1341 memcpy(hdev->adv_data, cp.data, sizeof(cp.data)); in __hci_req_update_adv_data()
1342 hdev->adv_data_len = len; in __hci_req_update_adv_data()
1355 len = create_instance_adv_data(hdev, instance, cp.data); in __hci_req_update_adv_data()
1358 if (hdev->adv_data_len == len && in __hci_req_update_adv_data()
1359 memcmp(cp.data, hdev->adv_data, len) == 0) in __hci_req_update_adv_data()
1362 memcpy(hdev->adv_data, cp.data, sizeof(cp.data)); in __hci_req_update_adv_data()
1363 hdev->adv_data_len = len; in __hci_req_update_adv_data()
1371 int hci_req_update_adv_data(struct hci_dev *hdev, u8 instance) in hci_req_update_adv_data() argument
1375 hci_req_init(&req, hdev); in hci_req_update_adv_data()
1381 static void adv_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode) in adv_enable_complete() argument
1383 BT_DBG("%s status %u", hdev->name, status); in adv_enable_complete()
1386 void hci_req_reenable_advertising(struct hci_dev *hdev) in hci_req_reenable_advertising() argument
1390 if (!hci_dev_test_flag(hdev, HCI_ADVERTISING) && in hci_req_reenable_advertising()
1391 list_empty(&hdev->adv_instances)) in hci_req_reenable_advertising()
1394 hci_req_init(&req, hdev); in hci_req_reenable_advertising()
1396 if (hdev->cur_adv_instance) { in hci_req_reenable_advertising()
1397 __hci_req_schedule_adv_instance(&req, hdev->cur_adv_instance, in hci_req_reenable_advertising()
1400 if (ext_adv_capable(hdev)) { in hci_req_reenable_advertising()
1414 struct hci_dev *hdev = container_of(work, struct hci_dev, in adv_timeout_expire() local
1420 BT_DBG("%s", hdev->name); in adv_timeout_expire()
1422 hci_dev_lock(hdev); in adv_timeout_expire()
1424 hdev->adv_instance_timeout = 0; in adv_timeout_expire()
1426 instance = hdev->cur_adv_instance; in adv_timeout_expire()
1430 hci_req_init(&req, hdev); in adv_timeout_expire()
1432 hci_req_clear_adv_instance(hdev, NULL, &req, instance, false); in adv_timeout_expire()
1434 if (list_empty(&hdev->adv_instances)) in adv_timeout_expire()
1440 hci_dev_unlock(hdev); in adv_timeout_expire()
1443 int hci_get_random_address(struct hci_dev *hdev, bool require_privacy, in hci_get_random_address() argument
1461 !bacmp(&adv_instance->random_addr, &hdev->rpa)) in hci_get_random_address()
1466 if (!hci_dev_test_and_clear_flag(hdev, HCI_RPA_EXPIRED) && in hci_get_random_address()
1467 !bacmp(&hdev->random_addr, &hdev->rpa)) in hci_get_random_address()
1471 err = smp_generate_rpa(hdev, hdev->irk, &hdev->rpa); in hci_get_random_address()
1473 BT_ERR("%s failed to generate new RPA", hdev->name); in hci_get_random_address()
1477 bacpy(rand_addr, &hdev->rpa); in hci_get_random_address()
1479 to = msecs_to_jiffies(hdev->rpa_timeout * 1000); in hci_get_random_address()
1481 queue_delayed_work(hdev->workqueue, in hci_get_random_address()
1484 queue_delayed_work(hdev->workqueue, in hci_get_random_address()
1485 &hdev->rpa_expired, to); in hci_get_random_address()
1508 if (bacmp(&hdev->bdaddr, &nrpa)) in hci_get_random_address()
1532 struct hci_dev *hdev = req->hdev; in __hci_req_setup_ext_adv_instance() local
1544 adv_instance = hci_find_adv_instance(hdev, instance); in __hci_req_setup_ext_adv_instance()
1551 flags = get_adv_instance_flags(hdev, instance); in __hci_req_setup_ext_adv_instance()
1557 mgmt_get_connectable(hdev); in __hci_req_setup_ext_adv_instance()
1559 if (!is_advertising_allowed(hdev, connectable)) in __hci_req_setup_ext_adv_instance()
1566 err = hci_get_random_address(hdev, !connectable, in __hci_req_setup_ext_adv_instance()
1567 adv_use_rpa(hdev, flags), adv_instance, in __hci_req_setup_ext_adv_instance()
1584 } else if (get_adv_instance_scan_rsp_len(hdev, instance)) { in __hci_req_setup_ext_adv_instance()
1597 cp.channel_map = hdev->le_adv_channel_map; in __hci_req_setup_ext_adv_instance()
1624 if (!bacmp(&random_addr, &hdev->random_addr)) in __hci_req_setup_ext_adv_instance()
1666 struct hci_dev *hdev = req->hdev; in __hci_req_start_ext_adv() local
1669 if (hci_dev_test_flag(hdev, HCI_LE_ADV)) in __hci_req_start_ext_adv()
1685 struct hci_dev *hdev = req->hdev; in __hci_req_schedule_adv_instance() local
1689 if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || in __hci_req_schedule_adv_instance()
1690 list_empty(&hdev->adv_instances)) in __hci_req_schedule_adv_instance()
1693 if (hdev->adv_instance_timeout) in __hci_req_schedule_adv_instance()
1696 adv_instance = hci_find_adv_instance(hdev, instance); in __hci_req_schedule_adv_instance()
1721 hdev->adv_instance_timeout = timeout; in __hci_req_schedule_adv_instance()
1722 queue_delayed_work(hdev->req_workqueue, in __hci_req_schedule_adv_instance()
1723 &hdev->adv_instance_expire, in __hci_req_schedule_adv_instance()
1730 if (!force && hdev->cur_adv_instance == instance && in __hci_req_schedule_adv_instance()
1731 hci_dev_test_flag(hdev, HCI_LE_ADV)) in __hci_req_schedule_adv_instance()
1734 hdev->cur_adv_instance = instance; in __hci_req_schedule_adv_instance()
1735 if (ext_adv_capable(hdev)) { in __hci_req_schedule_adv_instance()
1746 static void cancel_adv_timeout(struct hci_dev *hdev) in cancel_adv_timeout() argument
1748 if (hdev->adv_instance_timeout) { in cancel_adv_timeout()
1749 hdev->adv_instance_timeout = 0; in cancel_adv_timeout()
1750 cancel_delayed_work(&hdev->adv_instance_expire); in cancel_adv_timeout()
1765 void hci_req_clear_adv_instance(struct hci_dev *hdev, struct sock *sk, in hci_req_clear_adv_instance() argument
1774 if (!instance || hdev->cur_adv_instance == instance) in hci_req_clear_adv_instance()
1775 cancel_adv_timeout(hdev); in hci_req_clear_adv_instance()
1781 if (instance && hdev->cur_adv_instance == instance) in hci_req_clear_adv_instance()
1782 next_instance = hci_get_next_instance(hdev, instance); in hci_req_clear_adv_instance()
1785 list_for_each_entry_safe(adv_instance, n, &hdev->adv_instances, in hci_req_clear_adv_instance()
1791 err = hci_remove_adv_instance(hdev, rem_inst); in hci_req_clear_adv_instance()
1793 mgmt_advertising_removed(sk, hdev, rem_inst); in hci_req_clear_adv_instance()
1796 adv_instance = hci_find_adv_instance(hdev, instance); in hci_req_clear_adv_instance()
1805 err = hci_remove_adv_instance(hdev, instance); in hci_req_clear_adv_instance()
1807 mgmt_advertising_removed(sk, hdev, instance); in hci_req_clear_adv_instance()
1811 if (!req || !hdev_is_powered(hdev) || in hci_req_clear_adv_instance()
1812 hci_dev_test_flag(hdev, HCI_ADVERTISING)) in hci_req_clear_adv_instance()
1822 struct hci_dev *hdev = req->hdev; in set_random_addr() local
1834 if (hci_dev_test_flag(hdev, HCI_LE_ADV) || in set_random_addr()
1835 hci_lookup_le_connect(hdev)) { in set_random_addr()
1837 hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); in set_random_addr()
1847 struct hci_dev *hdev = req->hdev; in hci_update_random_address() local
1859 if (!hci_dev_test_and_clear_flag(hdev, HCI_RPA_EXPIRED) && in hci_update_random_address()
1860 !bacmp(&hdev->random_addr, &hdev->rpa)) in hci_update_random_address()
1863 err = smp_generate_rpa(hdev, hdev->irk, &hdev->rpa); in hci_update_random_address()
1865 bt_dev_err(hdev, "failed to generate new RPA"); in hci_update_random_address()
1869 set_random_addr(req, &hdev->rpa); in hci_update_random_address()
1871 to = msecs_to_jiffies(hdev->rpa_timeout * 1000); in hci_update_random_address()
1872 queue_delayed_work(hdev->workqueue, &hdev->rpa_expired, to); in hci_update_random_address()
1895 if (bacmp(&hdev->bdaddr, &nrpa)) in hci_update_random_address()
1913 if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) || in hci_update_random_address()
1914 !bacmp(&hdev->bdaddr, BDADDR_ANY) || in hci_update_random_address()
1915 (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && in hci_update_random_address()
1916 bacmp(&hdev->static_addr, BDADDR_ANY))) { in hci_update_random_address()
1918 if (bacmp(&hdev->static_addr, &hdev->random_addr)) in hci_update_random_address()
1920 &hdev->static_addr); in hci_update_random_address()
1932 static bool disconnected_whitelist_entries(struct hci_dev *hdev) in disconnected_whitelist_entries() argument
1936 list_for_each_entry(b, &hdev->whitelist, list) { in disconnected_whitelist_entries()
1939 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &b->bdaddr); in disconnected_whitelist_entries()
1952 struct hci_dev *hdev = req->hdev; in __hci_req_update_scan() local
1955 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) in __hci_req_update_scan()
1958 if (!hdev_is_powered(hdev)) in __hci_req_update_scan()
1961 if (mgmt_powering_down(hdev)) in __hci_req_update_scan()
1964 if (hci_dev_test_flag(hdev, HCI_CONNECTABLE) || in __hci_req_update_scan()
1965 disconnected_whitelist_entries(hdev)) in __hci_req_update_scan()
1970 if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) in __hci_req_update_scan()
1973 if (test_bit(HCI_PSCAN, &hdev->flags) == !!(scan & SCAN_PAGE) && in __hci_req_update_scan()
1974 test_bit(HCI_ISCAN, &hdev->flags) == !!(scan & SCAN_INQUIRY)) in __hci_req_update_scan()
1982 hci_dev_lock(req->hdev); in update_scan()
1984 hci_dev_unlock(req->hdev); in update_scan()
1990 struct hci_dev *hdev = container_of(work, struct hci_dev, scan_update); in scan_update_work() local
1992 hci_req_sync(hdev, update_scan, 0, HCI_CMD_TIMEOUT, NULL); in scan_update_work()
1997 struct hci_dev *hdev = req->hdev; in connectable_update() local
1999 hci_dev_lock(hdev); in connectable_update()
2007 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) in connectable_update()
2008 __hci_req_update_adv_data(req, hdev->cur_adv_instance); in connectable_update()
2011 if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || in connectable_update()
2012 !list_empty(&hdev->adv_instances)) { in connectable_update()
2013 if (ext_adv_capable(hdev)) in connectable_update()
2014 __hci_req_start_ext_adv(req, hdev->cur_adv_instance); in connectable_update()
2021 hci_dev_unlock(hdev); in connectable_update()
2028 struct hci_dev *hdev = container_of(work, struct hci_dev, in connectable_update_work() local
2032 hci_req_sync(hdev, connectable_update, 0, HCI_CMD_TIMEOUT, &status); in connectable_update_work()
2033 mgmt_set_connectable_complete(hdev, status); in connectable_update_work()
2036 static u8 get_service_classes(struct hci_dev *hdev) in get_service_classes() argument
2041 list_for_each_entry(uuid, &hdev->uuids, list) in get_service_classes()
2049 struct hci_dev *hdev = req->hdev; in __hci_req_update_class() local
2052 BT_DBG("%s", hdev->name); in __hci_req_update_class()
2054 if (!hdev_is_powered(hdev)) in __hci_req_update_class()
2057 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) in __hci_req_update_class()
2060 if (hci_dev_test_flag(hdev, HCI_SERVICE_CACHE)) in __hci_req_update_class()
2063 cod[0] = hdev->minor_class; in __hci_req_update_class()
2064 cod[1] = hdev->major_class; in __hci_req_update_class()
2065 cod[2] = get_service_classes(hdev); in __hci_req_update_class()
2067 if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) in __hci_req_update_class()
2070 if (memcmp(cod, hdev->dev_class, 3) == 0) in __hci_req_update_class()
2078 struct hci_dev *hdev = req->hdev; in write_iac() local
2081 if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) in write_iac()
2084 if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) { in write_iac()
2086 cp.num_iac = min_t(u8, hdev->num_iac, 2); in write_iac()
2107 struct hci_dev *hdev = req->hdev; in discoverable_update() local
2109 hci_dev_lock(hdev); in discoverable_update()
2111 if (hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { in discoverable_update()
2120 if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) { in discoverable_update()
2126 if (hci_dev_test_flag(hdev, HCI_LIMITED_PRIVACY)) { in discoverable_update()
2127 if (ext_adv_capable(hdev)) in discoverable_update()
2134 hci_dev_unlock(hdev); in discoverable_update()
2141 struct hci_dev *hdev = container_of(work, struct hci_dev, in discoverable_update_work() local
2145 hci_req_sync(hdev, discoverable_update, 0, HCI_CMD_TIMEOUT, &status); in discoverable_update_work()
2146 mgmt_set_discoverable_complete(hdev, status); in discoverable_update_work()
2180 if (req->hdev->hci_ver < BLUETOOTH_VER_1_2) in __hci_abort_conn()
2218 static void abort_conn_complete(struct hci_dev *hdev, u8 status, u16 opcode) in abort_conn_complete() argument
2229 hci_req_init(&req, conn->hdev); in hci_abort_conn()
2235 bt_dev_err(conn->hdev, "failed to run HCI request: err %d", err); in hci_abort_conn()
2244 hci_dev_lock(req->hdev); in update_bg_scan()
2246 hci_dev_unlock(req->hdev); in update_bg_scan()
2252 struct hci_dev *hdev = container_of(work, struct hci_dev, in bg_scan_update() local
2258 err = hci_req_sync(hdev, update_bg_scan, 0, HCI_CMD_TIMEOUT, &status); in bg_scan_update()
2262 hci_dev_lock(hdev); in bg_scan_update()
2264 conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); in bg_scan_update()
2268 hci_dev_unlock(hdev); in bg_scan_update()
2284 BT_DBG("%s", req->hdev->name); in bredr_inquiry()
2286 hci_dev_lock(req->hdev); in bredr_inquiry()
2287 hci_inquiry_cache_flush(req->hdev); in bredr_inquiry()
2288 hci_dev_unlock(req->hdev); in bredr_inquiry()
2292 if (req->hdev->discovery.limited) in bredr_inquiry()
2306 struct hci_dev *hdev = container_of(work, struct hci_dev, in le_scan_disable_work() local
2310 BT_DBG("%s", hdev->name); in le_scan_disable_work()
2312 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) in le_scan_disable_work()
2315 cancel_delayed_work(&hdev->le_scan_restart); in le_scan_disable_work()
2317 hci_req_sync(hdev, le_scan_disable, 0, HCI_CMD_TIMEOUT, &status); in le_scan_disable_work()
2319 bt_dev_err(hdev, "failed to disable LE scan: status 0x%02x", in le_scan_disable_work()
2324 hdev->discovery.scan_start = 0; in le_scan_disable_work()
2334 if (hdev->discovery.type == DISCOV_TYPE_LE) in le_scan_disable_work()
2337 if (hdev->discovery.type != DISCOV_TYPE_INTERLEAVED) in le_scan_disable_work()
2340 if (test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) { in le_scan_disable_work()
2341 if (!test_bit(HCI_INQUIRY, &hdev->flags) && in le_scan_disable_work()
2342 hdev->discovery.state != DISCOVERY_RESOLVING) in le_scan_disable_work()
2348 hci_req_sync(hdev, bredr_inquiry, DISCOV_INTERLEAVED_INQUIRY_LEN, in le_scan_disable_work()
2351 bt_dev_err(hdev, "inquiry failed: status 0x%02x", status); in le_scan_disable_work()
2358 hci_dev_lock(hdev); in le_scan_disable_work()
2359 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in le_scan_disable_work()
2360 hci_dev_unlock(hdev); in le_scan_disable_work()
2365 struct hci_dev *hdev = req->hdev; in le_scan_restart() local
2368 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) in le_scan_restart()
2373 if (use_ext_scan(hdev)) { in le_scan_restart()
2396 struct hci_dev *hdev = container_of(work, struct hci_dev, in le_scan_restart_work() local
2401 BT_DBG("%s", hdev->name); in le_scan_restart_work()
2403 hci_req_sync(hdev, le_scan_restart, 0, HCI_CMD_TIMEOUT, &status); in le_scan_restart_work()
2405 bt_dev_err(hdev, "failed to restart LE scan: status %d", in le_scan_restart_work()
2410 hci_dev_lock(hdev); in le_scan_restart_work()
2412 if (!test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) || in le_scan_restart_work()
2413 !hdev->discovery.scan_start) in le_scan_restart_work()
2421 duration = hdev->discovery.scan_duration; in le_scan_restart_work()
2422 scan_start = hdev->discovery.scan_start; in le_scan_restart_work()
2437 queue_delayed_work(hdev->req_workqueue, in le_scan_restart_work()
2438 &hdev->le_scan_disable, timeout); in le_scan_restart_work()
2441 hci_dev_unlock(hdev); in le_scan_restart_work()
2447 struct hci_dev *hdev = req->hdev; in active_scan() local
2451 BT_DBG("%s", hdev->name); in active_scan()
2453 if (hci_dev_test_flag(hdev, HCI_LE_ADV)) { in active_scan()
2454 hci_dev_lock(hdev); in active_scan()
2459 if (hci_lookup_le_connect(hdev)) { in active_scan()
2460 hci_dev_unlock(hdev); in active_scan()
2464 cancel_adv_timeout(hdev); in active_scan()
2465 hci_dev_unlock(hdev); in active_scan()
2474 if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) in active_scan()
2481 err = hci_update_random_address(req, true, scan_use_rpa(hdev), in active_scan()
2495 BT_DBG("%s", req->hdev->name); in interleaved_discov()
2504 static void start_discovery(struct hci_dev *hdev, u8 *status) in start_discovery() argument
2508 BT_DBG("%s type %u", hdev->name, hdev->discovery.type); in start_discovery()
2510 switch (hdev->discovery.type) { in start_discovery()
2512 if (!hci_dev_test_flag(hdev, HCI_INQUIRY)) in start_discovery()
2513 hci_req_sync(hdev, bredr_inquiry, in start_discovery()
2527 &hdev->quirks)) { in start_discovery()
2533 hci_req_sync(hdev, interleaved_discov, in start_discovery()
2539 timeout = msecs_to_jiffies(hdev->discov_interleaved_timeout); in start_discovery()
2540 hci_req_sync(hdev, active_scan, DISCOV_LE_SCAN_INT, in start_discovery()
2545 hci_req_sync(hdev, active_scan, DISCOV_LE_SCAN_INT, in start_discovery()
2556 BT_DBG("%s timeout %u ms", hdev->name, jiffies_to_msecs(timeout)); in start_discovery()
2563 if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) && in start_discovery()
2564 hdev->discovery.result_filtering) { in start_discovery()
2565 hdev->discovery.scan_start = jiffies; in start_discovery()
2566 hdev->discovery.scan_duration = timeout; in start_discovery()
2569 queue_delayed_work(hdev->req_workqueue, &hdev->le_scan_disable, in start_discovery()
2575 struct hci_dev *hdev = req->hdev; in hci_req_stop_discovery() local
2576 struct discovery_state *d = &hdev->discovery; in hci_req_stop_discovery()
2581 BT_DBG("%s state %u", hdev->name, hdev->discovery.state); in hci_req_stop_discovery()
2584 if (test_bit(HCI_INQUIRY, &hdev->flags)) in hci_req_stop_discovery()
2587 if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { in hci_req_stop_discovery()
2588 cancel_delayed_work(&hdev->le_scan_disable); in hci_req_stop_discovery()
2595 if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { in hci_req_stop_discovery()
2606 e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, in hci_req_stop_discovery()
2622 hci_dev_lock(req->hdev); in stop_discovery()
2624 hci_dev_unlock(req->hdev); in stop_discovery()
2631 struct hci_dev *hdev = container_of(work, struct hci_dev, in discov_update() local
2635 switch (hdev->discovery.state) { in discov_update()
2637 start_discovery(hdev, &status); in discov_update()
2638 mgmt_start_discovery_complete(hdev, status); in discov_update()
2640 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in discov_update()
2642 hci_discovery_set_state(hdev, DISCOVERY_FINDING); in discov_update()
2645 hci_req_sync(hdev, stop_discovery, 0, HCI_CMD_TIMEOUT, &status); in discov_update()
2646 mgmt_stop_discovery_complete(hdev, status); in discov_update()
2648 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in discov_update()
2658 struct hci_dev *hdev = container_of(work, struct hci_dev, in discov_off() local
2661 BT_DBG("%s", hdev->name); in discov_off()
2663 hci_dev_lock(hdev); in discov_off()
2670 hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); in discov_off()
2671 hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); in discov_off()
2672 hdev->discov_timeout = 0; in discov_off()
2674 hci_dev_unlock(hdev); in discov_off()
2676 hci_req_sync(hdev, discoverable_update, 0, HCI_CMD_TIMEOUT, NULL); in discov_off()
2677 mgmt_new_settings(hdev); in discov_off()
2682 struct hci_dev *hdev = req->hdev; in powered_update_hci() local
2685 hci_dev_lock(hdev); in powered_update_hci()
2687 if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED) && in powered_update_hci()
2688 !lmp_host_ssp_capable(hdev)) { in powered_update_hci()
2693 if (bredr_sc_enabled(hdev) && !lmp_host_sc_capable(hdev)) { in powered_update_hci()
2701 if (hci_dev_test_flag(hdev, HCI_LE_ENABLED) && in powered_update_hci()
2702 lmp_bredr_capable(hdev)) { in powered_update_hci()
2711 if (cp.le != lmp_host_le_capable(hdev) || in powered_update_hci()
2712 cp.simul != lmp_host_le_br_capable(hdev)) in powered_update_hci()
2717 if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { in powered_update_hci()
2722 if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || in powered_update_hci()
2723 list_empty(&hdev->adv_instances)) { in powered_update_hci()
2726 if (ext_adv_capable(hdev)) { in powered_update_hci()
2738 if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) { in powered_update_hci()
2739 if (!ext_adv_capable(hdev)) in powered_update_hci()
2744 } else if (!list_empty(&hdev->adv_instances)) { in powered_update_hci()
2747 adv_instance = list_first_entry(&hdev->adv_instances, in powered_update_hci()
2755 link_sec = hci_dev_test_flag(hdev, HCI_LINK_SECURITY); in powered_update_hci()
2756 if (link_sec != test_bit(HCI_AUTH, &hdev->flags)) in powered_update_hci()
2760 if (lmp_bredr_capable(hdev)) { in powered_update_hci()
2761 if (hci_dev_test_flag(hdev, HCI_FAST_CONNECTABLE)) in powered_update_hci()
2771 hci_dev_unlock(hdev); in powered_update_hci()
2775 int __hci_req_hci_power_on(struct hci_dev *hdev) in __hci_req_hci_power_on() argument
2782 smp_register(hdev); in __hci_req_hci_power_on()
2784 return __hci_req_sync(hdev, powered_update_hci, 0, HCI_CMD_TIMEOUT, in __hci_req_hci_power_on()
2788 void hci_request_setup(struct hci_dev *hdev) in hci_request_setup() argument
2790 INIT_WORK(&hdev->discov_update, discov_update); in hci_request_setup()
2791 INIT_WORK(&hdev->bg_scan_update, bg_scan_update); in hci_request_setup()
2792 INIT_WORK(&hdev->scan_update, scan_update_work); in hci_request_setup()
2793 INIT_WORK(&hdev->connectable_update, connectable_update_work); in hci_request_setup()
2794 INIT_WORK(&hdev->discoverable_update, discoverable_update_work); in hci_request_setup()
2795 INIT_DELAYED_WORK(&hdev->discov_off, discov_off); in hci_request_setup()
2796 INIT_DELAYED_WORK(&hdev->le_scan_disable, le_scan_disable_work); in hci_request_setup()
2797 INIT_DELAYED_WORK(&hdev->le_scan_restart, le_scan_restart_work); in hci_request_setup()
2798 INIT_DELAYED_WORK(&hdev->adv_instance_expire, adv_timeout_expire); in hci_request_setup()
2801 void hci_request_cancel_all(struct hci_dev *hdev) in hci_request_cancel_all() argument
2803 hci_req_sync_cancel(hdev, ENODEV); in hci_request_cancel_all()
2805 cancel_work_sync(&hdev->discov_update); in hci_request_cancel_all()
2806 cancel_work_sync(&hdev->bg_scan_update); in hci_request_cancel_all()
2807 cancel_work_sync(&hdev->scan_update); in hci_request_cancel_all()
2808 cancel_work_sync(&hdev->connectable_update); in hci_request_cancel_all()
2809 cancel_work_sync(&hdev->discoverable_update); in hci_request_cancel_all()
2810 cancel_delayed_work_sync(&hdev->discov_off); in hci_request_cancel_all()
2811 cancel_delayed_work_sync(&hdev->le_scan_disable); in hci_request_cancel_all()
2812 cancel_delayed_work_sync(&hdev->le_scan_restart); in hci_request_cancel_all()
2814 if (hdev->adv_instance_timeout) { in hci_request_cancel_all()
2815 cancel_delayed_work_sync(&hdev->adv_instance_expire); in hci_request_cancel_all()
2816 hdev->adv_instance_timeout = 0; in hci_request_cancel_all()