Lines Matching refs:hdev
44 static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_inquiry_cancel() argument
48 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_inquiry_cancel()
53 clear_bit(HCI_INQUIRY, &hdev->flags); in hci_cc_inquiry_cancel()
55 wake_up_bit(&hdev->flags, HCI_INQUIRY); in hci_cc_inquiry_cancel()
57 hci_dev_lock(hdev); in hci_cc_inquiry_cancel()
58 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_cc_inquiry_cancel()
59 hci_dev_unlock(hdev); in hci_cc_inquiry_cancel()
61 hci_conn_check_pending(hdev); in hci_cc_inquiry_cancel()
64 static void hci_cc_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_periodic_inq() argument
68 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_periodic_inq()
73 hci_dev_set_flag(hdev, HCI_PERIODIC_INQ); in hci_cc_periodic_inq()
76 static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_exit_periodic_inq() argument
80 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_exit_periodic_inq()
85 hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); in hci_cc_exit_periodic_inq()
87 hci_conn_check_pending(hdev); in hci_cc_exit_periodic_inq()
90 static void hci_cc_remote_name_req_cancel(struct hci_dev *hdev, in hci_cc_remote_name_req_cancel() argument
93 BT_DBG("%s", hdev->name); in hci_cc_remote_name_req_cancel()
96 static void hci_cc_role_discovery(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_role_discovery() argument
101 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_role_discovery()
106 hci_dev_lock(hdev); in hci_cc_role_discovery()
108 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_role_discovery()
112 hci_dev_unlock(hdev); in hci_cc_role_discovery()
115 static void hci_cc_read_link_policy(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_link_policy() argument
120 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_link_policy()
125 hci_dev_lock(hdev); in hci_cc_read_link_policy()
127 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_read_link_policy()
131 hci_dev_unlock(hdev); in hci_cc_read_link_policy()
134 static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_link_policy() argument
140 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_write_link_policy()
145 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LINK_POLICY); in hci_cc_write_link_policy()
149 hci_dev_lock(hdev); in hci_cc_write_link_policy()
151 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_write_link_policy()
155 hci_dev_unlock(hdev); in hci_cc_write_link_policy()
158 static void hci_cc_read_def_link_policy(struct hci_dev *hdev, in hci_cc_read_def_link_policy() argument
163 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_def_link_policy()
168 hdev->link_policy = __le16_to_cpu(rp->policy); in hci_cc_read_def_link_policy()
171 static void hci_cc_write_def_link_policy(struct hci_dev *hdev, in hci_cc_write_def_link_policy() argument
177 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_def_link_policy()
182 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_DEF_LINK_POLICY); in hci_cc_write_def_link_policy()
186 hdev->link_policy = get_unaligned_le16(sent); in hci_cc_write_def_link_policy()
189 static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_reset() argument
193 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_reset()
195 clear_bit(HCI_RESET, &hdev->flags); in hci_cc_reset()
201 hci_dev_clear_volatile_flags(hdev); in hci_cc_reset()
203 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_cc_reset()
205 hdev->inq_tx_power = HCI_TX_POWER_INVALID; in hci_cc_reset()
206 hdev->adv_tx_power = HCI_TX_POWER_INVALID; in hci_cc_reset()
208 memset(hdev->adv_data, 0, sizeof(hdev->adv_data)); in hci_cc_reset()
209 hdev->adv_data_len = 0; in hci_cc_reset()
211 memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data)); in hci_cc_reset()
212 hdev->scan_rsp_data_len = 0; in hci_cc_reset()
214 hdev->le_scan_type = LE_SCAN_PASSIVE; in hci_cc_reset()
216 hdev->ssp_debug_mode = 0; in hci_cc_reset()
218 hci_bdaddr_list_clear(&hdev->le_white_list); in hci_cc_reset()
221 static void hci_cc_read_stored_link_key(struct hci_dev *hdev, in hci_cc_read_stored_link_key() argument
227 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_stored_link_key()
229 sent = hci_sent_cmd_data(hdev, HCI_OP_READ_STORED_LINK_KEY); in hci_cc_read_stored_link_key()
234 hdev->stored_max_keys = rp->max_keys; in hci_cc_read_stored_link_key()
235 hdev->stored_num_keys = rp->num_keys; in hci_cc_read_stored_link_key()
239 static void hci_cc_delete_stored_link_key(struct hci_dev *hdev, in hci_cc_delete_stored_link_key() argument
244 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_delete_stored_link_key()
249 if (rp->num_keys <= hdev->stored_num_keys) in hci_cc_delete_stored_link_key()
250 hdev->stored_num_keys -= rp->num_keys; in hci_cc_delete_stored_link_key()
252 hdev->stored_num_keys = 0; in hci_cc_delete_stored_link_key()
255 static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_local_name() argument
260 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_local_name()
262 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME); in hci_cc_write_local_name()
266 hci_dev_lock(hdev); in hci_cc_write_local_name()
268 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_write_local_name()
269 mgmt_set_local_name_complete(hdev, sent, status); in hci_cc_write_local_name()
271 memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH); in hci_cc_write_local_name()
273 hci_dev_unlock(hdev); in hci_cc_write_local_name()
276 static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_local_name() argument
280 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_name()
285 if (hci_dev_test_flag(hdev, HCI_SETUP) || in hci_cc_read_local_name()
286 hci_dev_test_flag(hdev, HCI_CONFIG)) in hci_cc_read_local_name()
287 memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH); in hci_cc_read_local_name()
290 static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_auth_enable() argument
295 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_auth_enable()
297 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_AUTH_ENABLE); in hci_cc_write_auth_enable()
301 hci_dev_lock(hdev); in hci_cc_write_auth_enable()
307 set_bit(HCI_AUTH, &hdev->flags); in hci_cc_write_auth_enable()
309 clear_bit(HCI_AUTH, &hdev->flags); in hci_cc_write_auth_enable()
312 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_write_auth_enable()
313 mgmt_auth_enable_complete(hdev, status); in hci_cc_write_auth_enable()
315 hci_dev_unlock(hdev); in hci_cc_write_auth_enable()
318 static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_encrypt_mode() argument
324 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_encrypt_mode()
329 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_ENCRYPT_MODE); in hci_cc_write_encrypt_mode()
336 set_bit(HCI_ENCRYPT, &hdev->flags); in hci_cc_write_encrypt_mode()
338 clear_bit(HCI_ENCRYPT, &hdev->flags); in hci_cc_write_encrypt_mode()
341 static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_scan_enable() argument
347 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_scan_enable()
349 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SCAN_ENABLE); in hci_cc_write_scan_enable()
355 hci_dev_lock(hdev); in hci_cc_write_scan_enable()
358 hdev->discov_timeout = 0; in hci_cc_write_scan_enable()
363 set_bit(HCI_ISCAN, &hdev->flags); in hci_cc_write_scan_enable()
365 clear_bit(HCI_ISCAN, &hdev->flags); in hci_cc_write_scan_enable()
368 set_bit(HCI_PSCAN, &hdev->flags); in hci_cc_write_scan_enable()
370 clear_bit(HCI_PSCAN, &hdev->flags); in hci_cc_write_scan_enable()
373 hci_dev_unlock(hdev); in hci_cc_write_scan_enable()
376 static void hci_cc_read_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_class_of_dev() argument
380 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_class_of_dev()
385 memcpy(hdev->dev_class, rp->dev_class, 3); in hci_cc_read_class_of_dev()
387 BT_DBG("%s class 0x%.2x%.2x%.2x", hdev->name, in hci_cc_read_class_of_dev()
388 hdev->dev_class[2], hdev->dev_class[1], hdev->dev_class[0]); in hci_cc_read_class_of_dev()
391 static void hci_cc_write_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_class_of_dev() argument
396 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_class_of_dev()
398 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_CLASS_OF_DEV); in hci_cc_write_class_of_dev()
402 hci_dev_lock(hdev); in hci_cc_write_class_of_dev()
405 memcpy(hdev->dev_class, sent, 3); in hci_cc_write_class_of_dev()
407 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_write_class_of_dev()
408 mgmt_set_class_of_dev_complete(hdev, sent, status); in hci_cc_write_class_of_dev()
410 hci_dev_unlock(hdev); in hci_cc_write_class_of_dev()
413 static void hci_cc_read_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_voice_setting() argument
418 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_voice_setting()
425 if (hdev->voice_setting == setting) in hci_cc_read_voice_setting()
428 hdev->voice_setting = setting; in hci_cc_read_voice_setting()
430 BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); in hci_cc_read_voice_setting()
432 if (hdev->notify) in hci_cc_read_voice_setting()
433 hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); in hci_cc_read_voice_setting()
436 static void hci_cc_write_voice_setting(struct hci_dev *hdev, in hci_cc_write_voice_setting() argument
443 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_voice_setting()
448 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_VOICE_SETTING); in hci_cc_write_voice_setting()
454 if (hdev->voice_setting == setting) in hci_cc_write_voice_setting()
457 hdev->voice_setting = setting; in hci_cc_write_voice_setting()
459 BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); in hci_cc_write_voice_setting()
461 if (hdev->notify) in hci_cc_write_voice_setting()
462 hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); in hci_cc_write_voice_setting()
465 static void hci_cc_read_num_supported_iac(struct hci_dev *hdev, in hci_cc_read_num_supported_iac() argument
470 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_num_supported_iac()
475 hdev->num_iac = rp->num_iac; in hci_cc_read_num_supported_iac()
477 BT_DBG("%s num iac %d", hdev->name, hdev->num_iac); in hci_cc_read_num_supported_iac()
480 static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_ssp_mode() argument
485 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_ssp_mode()
487 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_MODE); in hci_cc_write_ssp_mode()
491 hci_dev_lock(hdev); in hci_cc_write_ssp_mode()
495 hdev->features[1][0] |= LMP_HOST_SSP; in hci_cc_write_ssp_mode()
497 hdev->features[1][0] &= ~LMP_HOST_SSP; in hci_cc_write_ssp_mode()
500 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_write_ssp_mode()
501 mgmt_ssp_enable_complete(hdev, sent->mode, status); in hci_cc_write_ssp_mode()
504 hci_dev_set_flag(hdev, HCI_SSP_ENABLED); in hci_cc_write_ssp_mode()
506 hci_dev_clear_flag(hdev, HCI_SSP_ENABLED); in hci_cc_write_ssp_mode()
509 hci_dev_unlock(hdev); in hci_cc_write_ssp_mode()
512 static void hci_cc_write_sc_support(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_sc_support() argument
517 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_sc_support()
519 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SC_SUPPORT); in hci_cc_write_sc_support()
523 hci_dev_lock(hdev); in hci_cc_write_sc_support()
527 hdev->features[1][0] |= LMP_HOST_SC; in hci_cc_write_sc_support()
529 hdev->features[1][0] &= ~LMP_HOST_SC; in hci_cc_write_sc_support()
532 if (!hci_dev_test_flag(hdev, HCI_MGMT) && !status) { in hci_cc_write_sc_support()
534 hci_dev_set_flag(hdev, HCI_SC_ENABLED); in hci_cc_write_sc_support()
536 hci_dev_clear_flag(hdev, HCI_SC_ENABLED); in hci_cc_write_sc_support()
539 hci_dev_unlock(hdev); in hci_cc_write_sc_support()
542 static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_local_version() argument
546 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_version()
551 if (hci_dev_test_flag(hdev, HCI_SETUP) || in hci_cc_read_local_version()
552 hci_dev_test_flag(hdev, HCI_CONFIG)) { in hci_cc_read_local_version()
553 hdev->hci_ver = rp->hci_ver; in hci_cc_read_local_version()
554 hdev->hci_rev = __le16_to_cpu(rp->hci_rev); in hci_cc_read_local_version()
555 hdev->lmp_ver = rp->lmp_ver; in hci_cc_read_local_version()
556 hdev->manufacturer = __le16_to_cpu(rp->manufacturer); in hci_cc_read_local_version()
557 hdev->lmp_subver = __le16_to_cpu(rp->lmp_subver); in hci_cc_read_local_version()
561 static void hci_cc_read_local_commands(struct hci_dev *hdev, in hci_cc_read_local_commands() argument
566 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_commands()
571 if (hci_dev_test_flag(hdev, HCI_SETUP) || in hci_cc_read_local_commands()
572 hci_dev_test_flag(hdev, HCI_CONFIG)) in hci_cc_read_local_commands()
573 memcpy(hdev->commands, rp->commands, sizeof(hdev->commands)); in hci_cc_read_local_commands()
576 static void hci_cc_read_local_features(struct hci_dev *hdev, in hci_cc_read_local_features() argument
581 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_features()
586 memcpy(hdev->features, rp->features, 8); in hci_cc_read_local_features()
591 if (hdev->features[0][0] & LMP_3SLOT) in hci_cc_read_local_features()
592 hdev->pkt_type |= (HCI_DM3 | HCI_DH3); in hci_cc_read_local_features()
594 if (hdev->features[0][0] & LMP_5SLOT) in hci_cc_read_local_features()
595 hdev->pkt_type |= (HCI_DM5 | HCI_DH5); in hci_cc_read_local_features()
597 if (hdev->features[0][1] & LMP_HV2) { in hci_cc_read_local_features()
598 hdev->pkt_type |= (HCI_HV2); in hci_cc_read_local_features()
599 hdev->esco_type |= (ESCO_HV2); in hci_cc_read_local_features()
602 if (hdev->features[0][1] & LMP_HV3) { in hci_cc_read_local_features()
603 hdev->pkt_type |= (HCI_HV3); in hci_cc_read_local_features()
604 hdev->esco_type |= (ESCO_HV3); in hci_cc_read_local_features()
607 if (lmp_esco_capable(hdev)) in hci_cc_read_local_features()
608 hdev->esco_type |= (ESCO_EV3); in hci_cc_read_local_features()
610 if (hdev->features[0][4] & LMP_EV4) in hci_cc_read_local_features()
611 hdev->esco_type |= (ESCO_EV4); in hci_cc_read_local_features()
613 if (hdev->features[0][4] & LMP_EV5) in hci_cc_read_local_features()
614 hdev->esco_type |= (ESCO_EV5); in hci_cc_read_local_features()
616 if (hdev->features[0][5] & LMP_EDR_ESCO_2M) in hci_cc_read_local_features()
617 hdev->esco_type |= (ESCO_2EV3); in hci_cc_read_local_features()
619 if (hdev->features[0][5] & LMP_EDR_ESCO_3M) in hci_cc_read_local_features()
620 hdev->esco_type |= (ESCO_3EV3); in hci_cc_read_local_features()
622 if (hdev->features[0][5] & LMP_EDR_3S_ESCO) in hci_cc_read_local_features()
623 hdev->esco_type |= (ESCO_2EV5 | ESCO_3EV5); in hci_cc_read_local_features()
626 static void hci_cc_read_local_ext_features(struct hci_dev *hdev, in hci_cc_read_local_ext_features() argument
631 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_ext_features()
636 if (hdev->max_page < rp->max_page) in hci_cc_read_local_ext_features()
637 hdev->max_page = rp->max_page; in hci_cc_read_local_ext_features()
640 memcpy(hdev->features[rp->page], rp->features, 8); in hci_cc_read_local_ext_features()
643 static void hci_cc_read_flow_control_mode(struct hci_dev *hdev, in hci_cc_read_flow_control_mode() argument
648 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_flow_control_mode()
653 hdev->flow_ctl_mode = rp->mode; in hci_cc_read_flow_control_mode()
656 static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_buffer_size() argument
660 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_buffer_size()
665 hdev->acl_mtu = __le16_to_cpu(rp->acl_mtu); in hci_cc_read_buffer_size()
666 hdev->sco_mtu = rp->sco_mtu; in hci_cc_read_buffer_size()
667 hdev->acl_pkts = __le16_to_cpu(rp->acl_max_pkt); in hci_cc_read_buffer_size()
668 hdev->sco_pkts = __le16_to_cpu(rp->sco_max_pkt); in hci_cc_read_buffer_size()
670 if (test_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks)) { in hci_cc_read_buffer_size()
671 hdev->sco_mtu = 64; in hci_cc_read_buffer_size()
672 hdev->sco_pkts = 8; in hci_cc_read_buffer_size()
675 hdev->acl_cnt = hdev->acl_pkts; in hci_cc_read_buffer_size()
676 hdev->sco_cnt = hdev->sco_pkts; in hci_cc_read_buffer_size()
678 BT_DBG("%s acl mtu %d:%d sco mtu %d:%d", hdev->name, hdev->acl_mtu, in hci_cc_read_buffer_size()
679 hdev->acl_pkts, hdev->sco_mtu, hdev->sco_pkts); in hci_cc_read_buffer_size()
682 static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_bd_addr() argument
686 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_bd_addr()
691 if (test_bit(HCI_INIT, &hdev->flags)) in hci_cc_read_bd_addr()
692 bacpy(&hdev->bdaddr, &rp->bdaddr); in hci_cc_read_bd_addr()
694 if (hci_dev_test_flag(hdev, HCI_SETUP)) in hci_cc_read_bd_addr()
695 bacpy(&hdev->setup_addr, &rp->bdaddr); in hci_cc_read_bd_addr()
698 static void hci_cc_read_page_scan_activity(struct hci_dev *hdev, in hci_cc_read_page_scan_activity() argument
703 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_page_scan_activity()
708 if (test_bit(HCI_INIT, &hdev->flags)) { in hci_cc_read_page_scan_activity()
709 hdev->page_scan_interval = __le16_to_cpu(rp->interval); in hci_cc_read_page_scan_activity()
710 hdev->page_scan_window = __le16_to_cpu(rp->window); in hci_cc_read_page_scan_activity()
714 static void hci_cc_write_page_scan_activity(struct hci_dev *hdev, in hci_cc_write_page_scan_activity() argument
720 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_page_scan_activity()
725 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY); in hci_cc_write_page_scan_activity()
729 hdev->page_scan_interval = __le16_to_cpu(sent->interval); in hci_cc_write_page_scan_activity()
730 hdev->page_scan_window = __le16_to_cpu(sent->window); in hci_cc_write_page_scan_activity()
733 static void hci_cc_read_page_scan_type(struct hci_dev *hdev, in hci_cc_read_page_scan_type() argument
738 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_page_scan_type()
743 if (test_bit(HCI_INIT, &hdev->flags)) in hci_cc_read_page_scan_type()
744 hdev->page_scan_type = rp->type; in hci_cc_read_page_scan_type()
747 static void hci_cc_write_page_scan_type(struct hci_dev *hdev, in hci_cc_write_page_scan_type() argument
753 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_page_scan_type()
758 type = hci_sent_cmd_data(hdev, HCI_OP_WRITE_PAGE_SCAN_TYPE); in hci_cc_write_page_scan_type()
760 hdev->page_scan_type = *type; in hci_cc_write_page_scan_type()
763 static void hci_cc_read_data_block_size(struct hci_dev *hdev, in hci_cc_read_data_block_size() argument
768 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_data_block_size()
773 hdev->block_mtu = __le16_to_cpu(rp->max_acl_len); in hci_cc_read_data_block_size()
774 hdev->block_len = __le16_to_cpu(rp->block_len); in hci_cc_read_data_block_size()
775 hdev->num_blocks = __le16_to_cpu(rp->num_blocks); in hci_cc_read_data_block_size()
777 hdev->block_cnt = hdev->num_blocks; in hci_cc_read_data_block_size()
779 BT_DBG("%s blk mtu %d cnt %d len %d", hdev->name, hdev->block_mtu, in hci_cc_read_data_block_size()
780 hdev->block_cnt, hdev->block_len); in hci_cc_read_data_block_size()
783 static void hci_cc_read_clock(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_clock() argument
789 BT_DBG("%s", hdev->name); in hci_cc_read_clock()
797 hci_dev_lock(hdev); in hci_cc_read_clock()
799 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_CLOCK); in hci_cc_read_clock()
804 hdev->clock = le32_to_cpu(rp->clock); in hci_cc_read_clock()
808 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_read_clock()
815 hci_dev_unlock(hdev); in hci_cc_read_clock()
818 static void hci_cc_read_local_amp_info(struct hci_dev *hdev, in hci_cc_read_local_amp_info() argument
823 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_amp_info()
828 hdev->amp_status = rp->amp_status; in hci_cc_read_local_amp_info()
829 hdev->amp_total_bw = __le32_to_cpu(rp->total_bw); in hci_cc_read_local_amp_info()
830 hdev->amp_max_bw = __le32_to_cpu(rp->max_bw); in hci_cc_read_local_amp_info()
831 hdev->amp_min_latency = __le32_to_cpu(rp->min_latency); in hci_cc_read_local_amp_info()
832 hdev->amp_max_pdu = __le32_to_cpu(rp->max_pdu); in hci_cc_read_local_amp_info()
833 hdev->amp_type = rp->amp_type; in hci_cc_read_local_amp_info()
834 hdev->amp_pal_cap = __le16_to_cpu(rp->pal_cap); in hci_cc_read_local_amp_info()
835 hdev->amp_assoc_size = __le16_to_cpu(rp->max_assoc_size); in hci_cc_read_local_amp_info()
836 hdev->amp_be_flush_to = __le32_to_cpu(rp->be_flush_to); in hci_cc_read_local_amp_info()
837 hdev->amp_max_flush_to = __le32_to_cpu(rp->max_flush_to); in hci_cc_read_local_amp_info()
840 a2mp_send_getinfo_rsp(hdev); in hci_cc_read_local_amp_info()
843 static void hci_cc_read_local_amp_assoc(struct hci_dev *hdev, in hci_cc_read_local_amp_assoc() argument
847 struct amp_assoc *assoc = &hdev->loc_assoc; in hci_cc_read_local_amp_assoc()
850 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_amp_assoc()
865 amp_read_loc_assoc_frag(hdev, rp->phy_handle); in hci_cc_read_local_amp_assoc()
876 a2mp_send_getampassoc_rsp(hdev, rp->status); in hci_cc_read_local_amp_assoc()
877 a2mp_send_create_phy_link_req(hdev, rp->status); in hci_cc_read_local_amp_assoc()
880 static void hci_cc_read_inq_rsp_tx_power(struct hci_dev *hdev, in hci_cc_read_inq_rsp_tx_power() argument
885 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_inq_rsp_tx_power()
890 hdev->inq_tx_power = rp->tx_power; in hci_cc_read_inq_rsp_tx_power()
893 static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_pin_code_reply() argument
899 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_pin_code_reply()
901 hci_dev_lock(hdev); in hci_cc_pin_code_reply()
903 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_pin_code_reply()
904 mgmt_pin_code_reply_complete(hdev, &rp->bdaddr, rp->status); in hci_cc_pin_code_reply()
909 cp = hci_sent_cmd_data(hdev, HCI_OP_PIN_CODE_REPLY); in hci_cc_pin_code_reply()
913 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cc_pin_code_reply()
918 hci_dev_unlock(hdev); in hci_cc_pin_code_reply()
921 static void hci_cc_pin_code_neg_reply(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_pin_code_neg_reply() argument
925 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_pin_code_neg_reply()
927 hci_dev_lock(hdev); in hci_cc_pin_code_neg_reply()
929 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_pin_code_neg_reply()
930 mgmt_pin_code_neg_reply_complete(hdev, &rp->bdaddr, in hci_cc_pin_code_neg_reply()
933 hci_dev_unlock(hdev); in hci_cc_pin_code_neg_reply()
936 static void hci_cc_le_read_buffer_size(struct hci_dev *hdev, in hci_cc_le_read_buffer_size() argument
941 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_buffer_size()
946 hdev->le_mtu = __le16_to_cpu(rp->le_mtu); in hci_cc_le_read_buffer_size()
947 hdev->le_pkts = rp->le_max_pkt; in hci_cc_le_read_buffer_size()
949 hdev->le_cnt = hdev->le_pkts; in hci_cc_le_read_buffer_size()
951 BT_DBG("%s le mtu %d:%d", hdev->name, hdev->le_mtu, hdev->le_pkts); in hci_cc_le_read_buffer_size()
954 static void hci_cc_le_read_local_features(struct hci_dev *hdev, in hci_cc_le_read_local_features() argument
959 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_local_features()
964 memcpy(hdev->le_features, rp->features, 8); in hci_cc_le_read_local_features()
967 static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev, in hci_cc_le_read_adv_tx_power() argument
972 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_adv_tx_power()
977 hdev->adv_tx_power = rp->tx_power; in hci_cc_le_read_adv_tx_power()
980 static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_user_confirm_reply() argument
984 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_user_confirm_reply()
986 hci_dev_lock(hdev); in hci_cc_user_confirm_reply()
988 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_user_confirm_reply()
989 mgmt_user_confirm_reply_complete(hdev, &rp->bdaddr, ACL_LINK, 0, in hci_cc_user_confirm_reply()
992 hci_dev_unlock(hdev); in hci_cc_user_confirm_reply()
995 static void hci_cc_user_confirm_neg_reply(struct hci_dev *hdev, in hci_cc_user_confirm_neg_reply() argument
1000 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_user_confirm_neg_reply()
1002 hci_dev_lock(hdev); in hci_cc_user_confirm_neg_reply()
1004 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_user_confirm_neg_reply()
1005 mgmt_user_confirm_neg_reply_complete(hdev, &rp->bdaddr, in hci_cc_user_confirm_neg_reply()
1008 hci_dev_unlock(hdev); in hci_cc_user_confirm_neg_reply()
1011 static void hci_cc_user_passkey_reply(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_user_passkey_reply() argument
1015 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_user_passkey_reply()
1017 hci_dev_lock(hdev); in hci_cc_user_passkey_reply()
1019 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_user_passkey_reply()
1020 mgmt_user_passkey_reply_complete(hdev, &rp->bdaddr, ACL_LINK, in hci_cc_user_passkey_reply()
1023 hci_dev_unlock(hdev); in hci_cc_user_passkey_reply()
1026 static void hci_cc_user_passkey_neg_reply(struct hci_dev *hdev, in hci_cc_user_passkey_neg_reply() argument
1031 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_user_passkey_neg_reply()
1033 hci_dev_lock(hdev); in hci_cc_user_passkey_neg_reply()
1035 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cc_user_passkey_neg_reply()
1036 mgmt_user_passkey_neg_reply_complete(hdev, &rp->bdaddr, in hci_cc_user_passkey_neg_reply()
1039 hci_dev_unlock(hdev); in hci_cc_user_passkey_neg_reply()
1042 static void hci_cc_read_local_oob_data(struct hci_dev *hdev, in hci_cc_read_local_oob_data() argument
1047 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_oob_data()
1050 static void hci_cc_read_local_oob_ext_data(struct hci_dev *hdev, in hci_cc_read_local_oob_ext_data() argument
1055 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_local_oob_ext_data()
1058 static void hci_cc_le_set_random_addr(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_le_set_random_addr() argument
1063 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_set_random_addr()
1068 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_RANDOM_ADDR); in hci_cc_le_set_random_addr()
1072 hci_dev_lock(hdev); in hci_cc_le_set_random_addr()
1074 bacpy(&hdev->random_addr, sent); in hci_cc_le_set_random_addr()
1076 hci_dev_unlock(hdev); in hci_cc_le_set_random_addr()
1079 static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_le_set_adv_enable() argument
1083 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_set_adv_enable()
1088 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_ENABLE); in hci_cc_le_set_adv_enable()
1092 hci_dev_lock(hdev); in hci_cc_le_set_adv_enable()
1100 hci_dev_set_flag(hdev, HCI_LE_ADV); in hci_cc_le_set_adv_enable()
1102 conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); in hci_cc_le_set_adv_enable()
1104 queue_delayed_work(hdev->workqueue, in hci_cc_le_set_adv_enable()
1108 hci_dev_clear_flag(hdev, HCI_LE_ADV); in hci_cc_le_set_adv_enable()
1111 hci_dev_unlock(hdev); in hci_cc_le_set_adv_enable()
1114 static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_le_set_scan_param() argument
1119 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_set_scan_param()
1124 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_PARAM); in hci_cc_le_set_scan_param()
1128 hci_dev_lock(hdev); in hci_cc_le_set_scan_param()
1130 hdev->le_scan_type = cp->type; in hci_cc_le_set_scan_param()
1132 hci_dev_unlock(hdev); in hci_cc_le_set_scan_param()
1135 static bool has_pending_adv_report(struct hci_dev *hdev) in has_pending_adv_report() argument
1137 struct discovery_state *d = &hdev->discovery; in has_pending_adv_report()
1142 static void clear_pending_adv_report(struct hci_dev *hdev) in clear_pending_adv_report() argument
1144 struct discovery_state *d = &hdev->discovery; in clear_pending_adv_report()
1150 static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr, in store_pending_adv_report() argument
1154 struct discovery_state *d = &hdev->discovery; in store_pending_adv_report()
1164 static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, in hci_cc_le_set_scan_enable() argument
1170 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_set_scan_enable()
1175 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_ENABLE); in hci_cc_le_set_scan_enable()
1179 hci_dev_lock(hdev); in hci_cc_le_set_scan_enable()
1183 hci_dev_set_flag(hdev, HCI_LE_SCAN); in hci_cc_le_set_scan_enable()
1184 if (hdev->le_scan_type == LE_SCAN_ACTIVE) in hci_cc_le_set_scan_enable()
1185 clear_pending_adv_report(hdev); in hci_cc_le_set_scan_enable()
1193 if (has_pending_adv_report(hdev)) { in hci_cc_le_set_scan_enable()
1194 struct discovery_state *d = &hdev->discovery; in hci_cc_le_set_scan_enable()
1196 mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, in hci_cc_le_set_scan_enable()
1206 cancel_delayed_work(&hdev->le_scan_disable); in hci_cc_le_set_scan_enable()
1208 hci_dev_clear_flag(hdev, HCI_LE_SCAN); in hci_cc_le_set_scan_enable()
1217 if (hci_dev_test_and_clear_flag(hdev, HCI_LE_SCAN_INTERRUPTED)) in hci_cc_le_set_scan_enable()
1218 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_cc_le_set_scan_enable()
1219 else if (!hci_dev_test_flag(hdev, HCI_LE_ADV) && in hci_cc_le_set_scan_enable()
1220 hdev->discovery.state == DISCOVERY_FINDING) in hci_cc_le_set_scan_enable()
1221 mgmt_reenable_advertising(hdev); in hci_cc_le_set_scan_enable()
1230 hci_dev_unlock(hdev); in hci_cc_le_set_scan_enable()
1233 static void hci_cc_le_read_white_list_size(struct hci_dev *hdev, in hci_cc_le_read_white_list_size() argument
1238 BT_DBG("%s status 0x%2.2x size %u", hdev->name, rp->status, rp->size); in hci_cc_le_read_white_list_size()
1243 hdev->le_white_list_size = rp->size; in hci_cc_le_read_white_list_size()
1246 static void hci_cc_le_clear_white_list(struct hci_dev *hdev, in hci_cc_le_clear_white_list() argument
1251 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_clear_white_list()
1256 hci_bdaddr_list_clear(&hdev->le_white_list); in hci_cc_le_clear_white_list()
1259 static void hci_cc_le_add_to_white_list(struct hci_dev *hdev, in hci_cc_le_add_to_white_list() argument
1265 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_add_to_white_list()
1270 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_ADD_TO_WHITE_LIST); in hci_cc_le_add_to_white_list()
1274 hci_bdaddr_list_add(&hdev->le_white_list, &sent->bdaddr, in hci_cc_le_add_to_white_list()
1278 static void hci_cc_le_del_from_white_list(struct hci_dev *hdev, in hci_cc_le_del_from_white_list() argument
1284 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_del_from_white_list()
1289 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_DEL_FROM_WHITE_LIST); in hci_cc_le_del_from_white_list()
1293 hci_bdaddr_list_del(&hdev->le_white_list, &sent->bdaddr, in hci_cc_le_del_from_white_list()
1297 static void hci_cc_le_read_supported_states(struct hci_dev *hdev, in hci_cc_le_read_supported_states() argument
1302 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_supported_states()
1307 memcpy(hdev->le_states, rp->le_states, 8); in hci_cc_le_read_supported_states()
1310 static void hci_cc_le_read_def_data_len(struct hci_dev *hdev, in hci_cc_le_read_def_data_len() argument
1315 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_def_data_len()
1320 hdev->le_def_tx_len = le16_to_cpu(rp->tx_len); in hci_cc_le_read_def_data_len()
1321 hdev->le_def_tx_time = le16_to_cpu(rp->tx_time); in hci_cc_le_read_def_data_len()
1324 static void hci_cc_le_write_def_data_len(struct hci_dev *hdev, in hci_cc_le_write_def_data_len() argument
1330 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_le_write_def_data_len()
1335 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_WRITE_DEF_DATA_LEN); in hci_cc_le_write_def_data_len()
1339 hdev->le_def_tx_len = le16_to_cpu(sent->tx_len); in hci_cc_le_write_def_data_len()
1340 hdev->le_def_tx_time = le16_to_cpu(sent->tx_time); in hci_cc_le_write_def_data_len()
1343 static void hci_cc_le_read_max_data_len(struct hci_dev *hdev, in hci_cc_le_read_max_data_len() argument
1348 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_le_read_max_data_len()
1353 hdev->le_max_tx_len = le16_to_cpu(rp->tx_len); in hci_cc_le_read_max_data_len()
1354 hdev->le_max_tx_time = le16_to_cpu(rp->tx_time); in hci_cc_le_read_max_data_len()
1355 hdev->le_max_rx_len = le16_to_cpu(rp->rx_len); in hci_cc_le_read_max_data_len()
1356 hdev->le_max_rx_time = le16_to_cpu(rp->rx_time); in hci_cc_le_read_max_data_len()
1359 static void hci_cc_write_le_host_supported(struct hci_dev *hdev, in hci_cc_write_le_host_supported() argument
1365 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_le_host_supported()
1370 sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED); in hci_cc_write_le_host_supported()
1374 hci_dev_lock(hdev); in hci_cc_write_le_host_supported()
1377 hdev->features[1][0] |= LMP_HOST_LE; in hci_cc_write_le_host_supported()
1378 hci_dev_set_flag(hdev, HCI_LE_ENABLED); in hci_cc_write_le_host_supported()
1380 hdev->features[1][0] &= ~LMP_HOST_LE; in hci_cc_write_le_host_supported()
1381 hci_dev_clear_flag(hdev, HCI_LE_ENABLED); in hci_cc_write_le_host_supported()
1382 hci_dev_clear_flag(hdev, HCI_ADVERTISING); in hci_cc_write_le_host_supported()
1386 hdev->features[1][0] |= LMP_HOST_LE_BREDR; in hci_cc_write_le_host_supported()
1388 hdev->features[1][0] &= ~LMP_HOST_LE_BREDR; in hci_cc_write_le_host_supported()
1390 hci_dev_unlock(hdev); in hci_cc_write_le_host_supported()
1393 static void hci_cc_set_adv_param(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_set_adv_param() argument
1398 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_set_adv_param()
1403 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_PARAM); in hci_cc_set_adv_param()
1407 hci_dev_lock(hdev); in hci_cc_set_adv_param()
1408 hdev->adv_addr_type = cp->own_address_type; in hci_cc_set_adv_param()
1409 hci_dev_unlock(hdev); in hci_cc_set_adv_param()
1412 static void hci_cc_write_remote_amp_assoc(struct hci_dev *hdev, in hci_cc_write_remote_amp_assoc() argument
1418 hdev->name, rp->status, rp->phy_handle); in hci_cc_write_remote_amp_assoc()
1423 amp_write_rem_assoc_continue(hdev, rp->phy_handle); in hci_cc_write_remote_amp_assoc()
1426 static void hci_cc_read_rssi(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_rssi() argument
1431 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_rssi()
1436 hci_dev_lock(hdev); in hci_cc_read_rssi()
1438 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_read_rssi()
1442 hci_dev_unlock(hdev); in hci_cc_read_rssi()
1445 static void hci_cc_read_tx_power(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_read_tx_power() argument
1451 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); in hci_cc_read_tx_power()
1456 sent = hci_sent_cmd_data(hdev, HCI_OP_READ_TX_POWER); in hci_cc_read_tx_power()
1460 hci_dev_lock(hdev); in hci_cc_read_tx_power()
1462 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); in hci_cc_read_tx_power()
1476 hci_dev_unlock(hdev); in hci_cc_read_tx_power()
1479 static void hci_cc_write_ssp_debug_mode(struct hci_dev *hdev, struct sk_buff *skb) in hci_cc_write_ssp_debug_mode() argument
1484 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cc_write_ssp_debug_mode()
1489 mode = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_DEBUG_MODE); in hci_cc_write_ssp_debug_mode()
1491 hdev->ssp_debug_mode = *mode; in hci_cc_write_ssp_debug_mode()
1494 static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) in hci_cs_inquiry() argument
1496 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_inquiry()
1499 hci_conn_check_pending(hdev); in hci_cs_inquiry()
1503 set_bit(HCI_INQUIRY, &hdev->flags); in hci_cs_inquiry()
1506 static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status) in hci_cs_create_conn() argument
1511 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_create_conn()
1513 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_CONN); in hci_cs_create_conn()
1517 hci_dev_lock(hdev); in hci_cs_create_conn()
1519 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_create_conn()
1521 BT_DBG("%s bdaddr %pMR hcon %p", hdev->name, &cp->bdaddr, conn); in hci_cs_create_conn()
1534 conn = hci_conn_add(hdev, ACL_LINK, &cp->bdaddr, in hci_cs_create_conn()
1541 hci_dev_unlock(hdev); in hci_cs_create_conn()
1544 static void hci_cs_add_sco(struct hci_dev *hdev, __u8 status) in hci_cs_add_sco() argument
1550 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_add_sco()
1555 cp = hci_sent_cmd_data(hdev, HCI_OP_ADD_SCO); in hci_cs_add_sco()
1561 BT_DBG("%s handle 0x%4.4x", hdev->name, handle); in hci_cs_add_sco()
1563 hci_dev_lock(hdev); in hci_cs_add_sco()
1565 acl = hci_conn_hash_lookup_handle(hdev, handle); in hci_cs_add_sco()
1576 hci_dev_unlock(hdev); in hci_cs_add_sco()
1579 static void hci_cs_auth_requested(struct hci_dev *hdev, __u8 status) in hci_cs_auth_requested() argument
1584 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_auth_requested()
1589 cp = hci_sent_cmd_data(hdev, HCI_OP_AUTH_REQUESTED); in hci_cs_auth_requested()
1593 hci_dev_lock(hdev); in hci_cs_auth_requested()
1595 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_auth_requested()
1603 hci_dev_unlock(hdev); in hci_cs_auth_requested()
1606 static void hci_cs_set_conn_encrypt(struct hci_dev *hdev, __u8 status) in hci_cs_set_conn_encrypt() argument
1611 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_set_conn_encrypt()
1616 cp = hci_sent_cmd_data(hdev, HCI_OP_SET_CONN_ENCRYPT); in hci_cs_set_conn_encrypt()
1620 hci_dev_lock(hdev); in hci_cs_set_conn_encrypt()
1622 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_set_conn_encrypt()
1630 hci_dev_unlock(hdev); in hci_cs_set_conn_encrypt()
1633 static int hci_outgoing_auth_needed(struct hci_dev *hdev, in hci_outgoing_auth_needed() argument
1655 static int hci_resolve_name(struct hci_dev *hdev, in hci_resolve_name() argument
1667 return hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_resolve_name()
1670 static bool hci_resolve_next_name(struct hci_dev *hdev) in hci_resolve_next_name() argument
1672 struct discovery_state *discov = &hdev->discovery; in hci_resolve_next_name()
1678 e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED); in hci_resolve_next_name()
1682 if (hci_resolve_name(hdev, e) == 0) { in hci_resolve_next_name()
1690 static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn, in hci_check_pending_name() argument
1693 struct discovery_state *discov = &hdev->discovery; in hci_check_pending_name()
1704 mgmt_device_connected(hdev, conn, 0, name, name_len); in hci_check_pending_name()
1715 e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING); in hci_check_pending_name()
1726 mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00, in hci_check_pending_name()
1732 if (hci_resolve_next_name(hdev)) in hci_check_pending_name()
1736 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_check_pending_name()
1739 static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status) in hci_cs_remote_name_req() argument
1744 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_remote_name_req()
1751 cp = hci_sent_cmd_data(hdev, HCI_OP_REMOTE_NAME_REQ); in hci_cs_remote_name_req()
1755 hci_dev_lock(hdev); in hci_cs_remote_name_req()
1757 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_remote_name_req()
1759 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_cs_remote_name_req()
1760 hci_check_pending_name(hdev, conn, &cp->bdaddr, NULL, 0); in hci_cs_remote_name_req()
1765 if (!hci_outgoing_auth_needed(hdev, conn)) in hci_cs_remote_name_req()
1774 hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, in hci_cs_remote_name_req()
1779 hci_dev_unlock(hdev); in hci_cs_remote_name_req()
1782 static void hci_cs_read_remote_features(struct hci_dev *hdev, __u8 status) in hci_cs_read_remote_features() argument
1787 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_read_remote_features()
1792 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_FEATURES); in hci_cs_read_remote_features()
1796 hci_dev_lock(hdev); in hci_cs_read_remote_features()
1798 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_read_remote_features()
1806 hci_dev_unlock(hdev); in hci_cs_read_remote_features()
1809 static void hci_cs_read_remote_ext_features(struct hci_dev *hdev, __u8 status) in hci_cs_read_remote_ext_features() argument
1814 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_read_remote_ext_features()
1819 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES); in hci_cs_read_remote_ext_features()
1823 hci_dev_lock(hdev); in hci_cs_read_remote_ext_features()
1825 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_read_remote_ext_features()
1833 hci_dev_unlock(hdev); in hci_cs_read_remote_ext_features()
1836 static void hci_cs_setup_sync_conn(struct hci_dev *hdev, __u8 status) in hci_cs_setup_sync_conn() argument
1842 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_setup_sync_conn()
1847 cp = hci_sent_cmd_data(hdev, HCI_OP_SETUP_SYNC_CONN); in hci_cs_setup_sync_conn()
1853 BT_DBG("%s handle 0x%4.4x", hdev->name, handle); in hci_cs_setup_sync_conn()
1855 hci_dev_lock(hdev); in hci_cs_setup_sync_conn()
1857 acl = hci_conn_hash_lookup_handle(hdev, handle); in hci_cs_setup_sync_conn()
1868 hci_dev_unlock(hdev); in hci_cs_setup_sync_conn()
1871 static void hci_cs_sniff_mode(struct hci_dev *hdev, __u8 status) in hci_cs_sniff_mode() argument
1876 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_sniff_mode()
1881 cp = hci_sent_cmd_data(hdev, HCI_OP_SNIFF_MODE); in hci_cs_sniff_mode()
1885 hci_dev_lock(hdev); in hci_cs_sniff_mode()
1887 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_sniff_mode()
1895 hci_dev_unlock(hdev); in hci_cs_sniff_mode()
1898 static void hci_cs_exit_sniff_mode(struct hci_dev *hdev, __u8 status) in hci_cs_exit_sniff_mode() argument
1903 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_exit_sniff_mode()
1908 cp = hci_sent_cmd_data(hdev, HCI_OP_EXIT_SNIFF_MODE); in hci_cs_exit_sniff_mode()
1912 hci_dev_lock(hdev); in hci_cs_exit_sniff_mode()
1914 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_exit_sniff_mode()
1922 hci_dev_unlock(hdev); in hci_cs_exit_sniff_mode()
1925 static void hci_cs_disconnect(struct hci_dev *hdev, u8 status) in hci_cs_disconnect() argument
1933 cp = hci_sent_cmd_data(hdev, HCI_OP_DISCONNECT); in hci_cs_disconnect()
1937 hci_dev_lock(hdev); in hci_cs_disconnect()
1939 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_disconnect()
1941 mgmt_disconnect_failed(hdev, &conn->dst, conn->type, in hci_cs_disconnect()
1944 hci_dev_unlock(hdev); in hci_cs_disconnect()
1947 static void hci_cs_create_phylink(struct hci_dev *hdev, u8 status) in hci_cs_create_phylink() argument
1951 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_create_phylink()
1953 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK); in hci_cs_create_phylink()
1957 hci_dev_lock(hdev); in hci_cs_create_phylink()
1962 hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle); in hci_cs_create_phylink()
1966 amp_write_remote_assoc(hdev, cp->phy_handle); in hci_cs_create_phylink()
1969 hci_dev_unlock(hdev); in hci_cs_create_phylink()
1972 static void hci_cs_accept_phylink(struct hci_dev *hdev, u8 status) in hci_cs_accept_phylink() argument
1976 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_accept_phylink()
1981 cp = hci_sent_cmd_data(hdev, HCI_OP_ACCEPT_PHY_LINK); in hci_cs_accept_phylink()
1985 amp_write_remote_assoc(hdev, cp->phy_handle); in hci_cs_accept_phylink()
1988 static void hci_cs_le_create_conn(struct hci_dev *hdev, u8 status) in hci_cs_le_create_conn() argument
1993 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_le_create_conn()
2002 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CONN); in hci_cs_le_create_conn()
2006 hci_dev_lock(hdev); in hci_cs_le_create_conn()
2008 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->peer_addr); in hci_cs_le_create_conn()
2018 bacpy(&conn->init_addr, &hdev->random_addr); in hci_cs_le_create_conn()
2020 bacpy(&conn->init_addr, &hdev->bdaddr); in hci_cs_le_create_conn()
2031 queue_delayed_work(conn->hdev->workqueue, in hci_cs_le_create_conn()
2036 hci_dev_unlock(hdev); in hci_cs_le_create_conn()
2039 static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status) in hci_cs_le_read_remote_features() argument
2044 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_le_read_remote_features()
2049 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_READ_REMOTE_FEATURES); in hci_cs_le_read_remote_features()
2053 hci_dev_lock(hdev); in hci_cs_le_read_remote_features()
2055 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_le_read_remote_features()
2063 hci_dev_unlock(hdev); in hci_cs_le_read_remote_features()
2066 static void hci_cs_le_start_enc(struct hci_dev *hdev, u8 status) in hci_cs_le_start_enc() argument
2071 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_le_start_enc()
2076 hci_dev_lock(hdev); in hci_cs_le_start_enc()
2078 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_START_ENC); in hci_cs_le_start_enc()
2082 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_le_start_enc()
2093 hci_dev_unlock(hdev); in hci_cs_le_start_enc()
2096 static void hci_cs_switch_role(struct hci_dev *hdev, u8 status) in hci_cs_switch_role() argument
2101 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_cs_switch_role()
2106 cp = hci_sent_cmd_data(hdev, HCI_OP_SWITCH_ROLE); in hci_cs_switch_role()
2110 hci_dev_lock(hdev); in hci_cs_switch_role()
2112 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_switch_role()
2116 hci_dev_unlock(hdev); in hci_cs_switch_role()
2119 static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_inquiry_complete_evt() argument
2122 struct discovery_state *discov = &hdev->discovery; in hci_inquiry_complete_evt()
2125 BT_DBG("%s status 0x%2.2x", hdev->name, status); in hci_inquiry_complete_evt()
2127 hci_conn_check_pending(hdev); in hci_inquiry_complete_evt()
2129 if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) in hci_inquiry_complete_evt()
2133 wake_up_bit(&hdev->flags, HCI_INQUIRY); in hci_inquiry_complete_evt()
2135 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_inquiry_complete_evt()
2138 hci_dev_lock(hdev); in hci_inquiry_complete_evt()
2151 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || in hci_inquiry_complete_evt()
2152 !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) in hci_inquiry_complete_evt()
2153 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_inquiry_complete_evt()
2157 e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED); in hci_inquiry_complete_evt()
2158 if (e && hci_resolve_name(hdev, e) == 0) { in hci_inquiry_complete_evt()
2160 hci_discovery_set_state(hdev, DISCOVERY_RESOLVING); in hci_inquiry_complete_evt()
2169 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || in hci_inquiry_complete_evt()
2170 !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) in hci_inquiry_complete_evt()
2171 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); in hci_inquiry_complete_evt()
2175 hci_dev_unlock(hdev); in hci_inquiry_complete_evt()
2178 static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_inquiry_result_evt() argument
2184 BT_DBG("%s num_rsp %d", hdev->name, num_rsp); in hci_inquiry_result_evt()
2189 if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) in hci_inquiry_result_evt()
2192 hci_dev_lock(hdev); in hci_inquiry_result_evt()
2206 flags = hci_inquiry_cache_update(hdev, &data, false); in hci_inquiry_result_evt()
2208 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, in hci_inquiry_result_evt()
2213 hci_dev_unlock(hdev); in hci_inquiry_result_evt()
2216 static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_conn_complete_evt() argument
2221 BT_DBG("%s", hdev->name); in hci_conn_complete_evt()
2223 hci_dev_lock(hdev); in hci_conn_complete_evt()
2225 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_conn_complete_evt()
2230 conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); in hci_conn_complete_evt()
2245 !hci_find_link_key(hdev, &ev->bdaddr)) in hci_conn_complete_evt()
2255 if (test_bit(HCI_AUTH, &hdev->flags)) in hci_conn_complete_evt()
2258 if (test_bit(HCI_ENCRYPT, &hdev->flags)) in hci_conn_complete_evt()
2265 hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES, in hci_conn_complete_evt()
2268 hci_update_page_scan(hdev); in hci_conn_complete_evt()
2272 if (!conn->out && hdev->hci_ver < BLUETOOTH_VER_2_0) { in hci_conn_complete_evt()
2276 hci_send_cmd(hdev, HCI_OP_CHANGE_CONN_PTYPE, sizeof(cp), in hci_conn_complete_evt()
2282 mgmt_connect_failed(hdev, &conn->dst, conn->type, in hci_conn_complete_evt()
2296 hci_dev_unlock(hdev); in hci_conn_complete_evt()
2298 hci_conn_check_pending(hdev); in hci_conn_complete_evt()
2301 static void hci_reject_conn(struct hci_dev *hdev, bdaddr_t *bdaddr) in hci_reject_conn() argument
2307 hci_send_cmd(hdev, HCI_OP_REJECT_CONN_REQ, sizeof(cp), &cp); in hci_reject_conn()
2310 static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_conn_request_evt() argument
2313 int mask = hdev->link_mode; in hci_conn_request_evt()
2318 BT_DBG("%s bdaddr %pMR type 0x%x", hdev->name, &ev->bdaddr, in hci_conn_request_evt()
2321 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, in hci_conn_request_evt()
2325 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2329 if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr, in hci_conn_request_evt()
2331 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2339 if (hci_dev_test_flag(hdev, HCI_MGMT) && in hci_conn_request_evt()
2340 !hci_dev_test_flag(hdev, HCI_CONNECTABLE) && in hci_conn_request_evt()
2341 !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr, in hci_conn_request_evt()
2343 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2349 hci_dev_lock(hdev); in hci_conn_request_evt()
2351 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_conn_request_evt()
2355 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, in hci_conn_request_evt()
2358 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, in hci_conn_request_evt()
2362 hci_dev_unlock(hdev); in hci_conn_request_evt()
2369 hci_dev_unlock(hdev); in hci_conn_request_evt()
2372 (!(flags & HCI_PROTO_DEFER) && !lmp_esco_capable(hdev))) { in hci_conn_request_evt()
2378 if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER)) in hci_conn_request_evt()
2383 hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp); in hci_conn_request_evt()
2394 cp.content_format = cpu_to_le16(hdev->voice_setting); in hci_conn_request_evt()
2397 hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, sizeof(cp), in hci_conn_request_evt()
2421 static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_disconn_complete_evt() argument
2430 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_disconn_complete_evt()
2432 hci_dev_lock(hdev); in hci_disconn_complete_evt()
2434 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_disconn_complete_evt()
2439 mgmt_disconnect_failed(hdev, &conn->dst, conn->type, in hci_disconn_complete_evt()
2447 mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type, in hci_disconn_complete_evt()
2452 hci_remove_link_key(hdev, &conn->dst); in hci_disconn_complete_evt()
2454 hci_update_page_scan(hdev); in hci_disconn_complete_evt()
2457 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); in hci_disconn_complete_evt()
2468 list_add(¶ms->action, &hdev->pend_le_conns); in hci_disconn_complete_evt()
2469 hci_update_background_scan(hdev); in hci_disconn_complete_evt()
2493 mgmt_reenable_advertising(hdev); in hci_disconn_complete_evt()
2496 hci_dev_unlock(hdev); in hci_disconn_complete_evt()
2499 static void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_auth_complete_evt() argument
2504 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_auth_complete_evt()
2506 hci_dev_lock(hdev); in hci_auth_complete_evt()
2508 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_auth_complete_evt()
2532 hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), in hci_auth_complete_evt()
2552 hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), in hci_auth_complete_evt()
2561 hci_dev_unlock(hdev); in hci_auth_complete_evt()
2564 static void hci_remote_name_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_remote_name_evt() argument
2569 BT_DBG("%s", hdev->name); in hci_remote_name_evt()
2571 hci_conn_check_pending(hdev); in hci_remote_name_evt()
2573 hci_dev_lock(hdev); in hci_remote_name_evt()
2575 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_name_evt()
2577 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_remote_name_evt()
2581 hci_check_pending_name(hdev, conn, &ev->bdaddr, ev->name, in hci_remote_name_evt()
2584 hci_check_pending_name(hdev, conn, &ev->bdaddr, NULL, 0); in hci_remote_name_evt()
2590 if (!hci_outgoing_auth_needed(hdev, conn)) in hci_remote_name_evt()
2599 hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, sizeof(cp), &cp); in hci_remote_name_evt()
2603 hci_dev_unlock(hdev); in hci_remote_name_evt()
2606 static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_encrypt_change_evt() argument
2611 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_encrypt_change_evt()
2613 hci_dev_lock(hdev); in hci_encrypt_change_evt()
2615 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_encrypt_change_evt()
2643 hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); in hci_encrypt_change_evt()
2661 if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && in hci_encrypt_change_evt()
2675 hci_dev_unlock(hdev); in hci_encrypt_change_evt()
2678 static void hci_change_link_key_complete_evt(struct hci_dev *hdev, in hci_change_link_key_complete_evt() argument
2684 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_change_link_key_complete_evt()
2686 hci_dev_lock(hdev); in hci_change_link_key_complete_evt()
2688 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_change_link_key_complete_evt()
2698 hci_dev_unlock(hdev); in hci_change_link_key_complete_evt()
2701 static void hci_remote_features_evt(struct hci_dev *hdev, in hci_remote_features_evt() argument
2707 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_remote_features_evt()
2709 hci_dev_lock(hdev); in hci_remote_features_evt()
2711 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_features_evt()
2721 if (!ev->status && lmp_ext_feat_capable(hdev) && in hci_remote_features_evt()
2726 hci_send_cmd(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES, in hci_remote_features_evt()
2736 hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_remote_features_evt()
2738 mgmt_device_connected(hdev, conn, 0, NULL, 0); in hci_remote_features_evt()
2740 if (!hci_outgoing_auth_needed(hdev, conn)) { in hci_remote_features_evt()
2747 hci_dev_unlock(hdev); in hci_remote_features_evt()
2750 static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb, in hci_cmd_complete_evt() argument
2764 hci_cc_inquiry_cancel(hdev, skb); in hci_cmd_complete_evt()
2768 hci_cc_periodic_inq(hdev, skb); in hci_cmd_complete_evt()
2772 hci_cc_exit_periodic_inq(hdev, skb); in hci_cmd_complete_evt()
2776 hci_cc_remote_name_req_cancel(hdev, skb); in hci_cmd_complete_evt()
2780 hci_cc_role_discovery(hdev, skb); in hci_cmd_complete_evt()
2784 hci_cc_read_link_policy(hdev, skb); in hci_cmd_complete_evt()
2788 hci_cc_write_link_policy(hdev, skb); in hci_cmd_complete_evt()
2792 hci_cc_read_def_link_policy(hdev, skb); in hci_cmd_complete_evt()
2796 hci_cc_write_def_link_policy(hdev, skb); in hci_cmd_complete_evt()
2800 hci_cc_reset(hdev, skb); in hci_cmd_complete_evt()
2804 hci_cc_read_stored_link_key(hdev, skb); in hci_cmd_complete_evt()
2808 hci_cc_delete_stored_link_key(hdev, skb); in hci_cmd_complete_evt()
2812 hci_cc_write_local_name(hdev, skb); in hci_cmd_complete_evt()
2816 hci_cc_read_local_name(hdev, skb); in hci_cmd_complete_evt()
2820 hci_cc_write_auth_enable(hdev, skb); in hci_cmd_complete_evt()
2824 hci_cc_write_encrypt_mode(hdev, skb); in hci_cmd_complete_evt()
2828 hci_cc_write_scan_enable(hdev, skb); in hci_cmd_complete_evt()
2832 hci_cc_read_class_of_dev(hdev, skb); in hci_cmd_complete_evt()
2836 hci_cc_write_class_of_dev(hdev, skb); in hci_cmd_complete_evt()
2840 hci_cc_read_voice_setting(hdev, skb); in hci_cmd_complete_evt()
2844 hci_cc_write_voice_setting(hdev, skb); in hci_cmd_complete_evt()
2848 hci_cc_read_num_supported_iac(hdev, skb); in hci_cmd_complete_evt()
2852 hci_cc_write_ssp_mode(hdev, skb); in hci_cmd_complete_evt()
2856 hci_cc_write_sc_support(hdev, skb); in hci_cmd_complete_evt()
2860 hci_cc_read_local_version(hdev, skb); in hci_cmd_complete_evt()
2864 hci_cc_read_local_commands(hdev, skb); in hci_cmd_complete_evt()
2868 hci_cc_read_local_features(hdev, skb); in hci_cmd_complete_evt()
2872 hci_cc_read_local_ext_features(hdev, skb); in hci_cmd_complete_evt()
2876 hci_cc_read_buffer_size(hdev, skb); in hci_cmd_complete_evt()
2880 hci_cc_read_bd_addr(hdev, skb); in hci_cmd_complete_evt()
2884 hci_cc_read_page_scan_activity(hdev, skb); in hci_cmd_complete_evt()
2888 hci_cc_write_page_scan_activity(hdev, skb); in hci_cmd_complete_evt()
2892 hci_cc_read_page_scan_type(hdev, skb); in hci_cmd_complete_evt()
2896 hci_cc_write_page_scan_type(hdev, skb); in hci_cmd_complete_evt()
2900 hci_cc_read_data_block_size(hdev, skb); in hci_cmd_complete_evt()
2904 hci_cc_read_flow_control_mode(hdev, skb); in hci_cmd_complete_evt()
2908 hci_cc_read_local_amp_info(hdev, skb); in hci_cmd_complete_evt()
2912 hci_cc_read_clock(hdev, skb); in hci_cmd_complete_evt()
2916 hci_cc_read_local_amp_assoc(hdev, skb); in hci_cmd_complete_evt()
2920 hci_cc_read_inq_rsp_tx_power(hdev, skb); in hci_cmd_complete_evt()
2924 hci_cc_pin_code_reply(hdev, skb); in hci_cmd_complete_evt()
2928 hci_cc_pin_code_neg_reply(hdev, skb); in hci_cmd_complete_evt()
2932 hci_cc_read_local_oob_data(hdev, skb); in hci_cmd_complete_evt()
2936 hci_cc_read_local_oob_ext_data(hdev, skb); in hci_cmd_complete_evt()
2940 hci_cc_le_read_buffer_size(hdev, skb); in hci_cmd_complete_evt()
2944 hci_cc_le_read_local_features(hdev, skb); in hci_cmd_complete_evt()
2948 hci_cc_le_read_adv_tx_power(hdev, skb); in hci_cmd_complete_evt()
2952 hci_cc_user_confirm_reply(hdev, skb); in hci_cmd_complete_evt()
2956 hci_cc_user_confirm_neg_reply(hdev, skb); in hci_cmd_complete_evt()
2960 hci_cc_user_passkey_reply(hdev, skb); in hci_cmd_complete_evt()
2964 hci_cc_user_passkey_neg_reply(hdev, skb); in hci_cmd_complete_evt()
2968 hci_cc_le_set_random_addr(hdev, skb); in hci_cmd_complete_evt()
2972 hci_cc_le_set_adv_enable(hdev, skb); in hci_cmd_complete_evt()
2976 hci_cc_le_set_scan_param(hdev, skb); in hci_cmd_complete_evt()
2980 hci_cc_le_set_scan_enable(hdev, skb); in hci_cmd_complete_evt()
2984 hci_cc_le_read_white_list_size(hdev, skb); in hci_cmd_complete_evt()
2988 hci_cc_le_clear_white_list(hdev, skb); in hci_cmd_complete_evt()
2992 hci_cc_le_add_to_white_list(hdev, skb); in hci_cmd_complete_evt()
2996 hci_cc_le_del_from_white_list(hdev, skb); in hci_cmd_complete_evt()
3000 hci_cc_le_read_supported_states(hdev, skb); in hci_cmd_complete_evt()
3004 hci_cc_le_read_def_data_len(hdev, skb); in hci_cmd_complete_evt()
3008 hci_cc_le_write_def_data_len(hdev, skb); in hci_cmd_complete_evt()
3012 hci_cc_le_read_max_data_len(hdev, skb); in hci_cmd_complete_evt()
3016 hci_cc_write_le_host_supported(hdev, skb); in hci_cmd_complete_evt()
3020 hci_cc_set_adv_param(hdev, skb); in hci_cmd_complete_evt()
3024 hci_cc_write_remote_amp_assoc(hdev, skb); in hci_cmd_complete_evt()
3028 hci_cc_read_rssi(hdev, skb); in hci_cmd_complete_evt()
3032 hci_cc_read_tx_power(hdev, skb); in hci_cmd_complete_evt()
3036 hci_cc_write_ssp_debug_mode(hdev, skb); in hci_cmd_complete_evt()
3040 BT_DBG("%s opcode 0x%4.4x", hdev->name, *opcode); in hci_cmd_complete_evt()
3045 cancel_delayed_work(&hdev->cmd_timer); in hci_cmd_complete_evt()
3047 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) in hci_cmd_complete_evt()
3048 atomic_set(&hdev->cmd_cnt, 1); in hci_cmd_complete_evt()
3050 hci_req_cmd_complete(hdev, *opcode, *status, req_complete, in hci_cmd_complete_evt()
3053 if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q)) in hci_cmd_complete_evt()
3054 queue_work(hdev->workqueue, &hdev->cmd_work); in hci_cmd_complete_evt()
3057 static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb, in hci_cmd_status_evt() argument
3071 hci_cs_inquiry(hdev, ev->status); in hci_cmd_status_evt()
3075 hci_cs_create_conn(hdev, ev->status); in hci_cmd_status_evt()
3079 hci_cs_disconnect(hdev, ev->status); in hci_cmd_status_evt()
3083 hci_cs_add_sco(hdev, ev->status); in hci_cmd_status_evt()
3087 hci_cs_auth_requested(hdev, ev->status); in hci_cmd_status_evt()
3091 hci_cs_set_conn_encrypt(hdev, ev->status); in hci_cmd_status_evt()
3095 hci_cs_remote_name_req(hdev, ev->status); in hci_cmd_status_evt()
3099 hci_cs_read_remote_features(hdev, ev->status); in hci_cmd_status_evt()
3103 hci_cs_read_remote_ext_features(hdev, ev->status); in hci_cmd_status_evt()
3107 hci_cs_setup_sync_conn(hdev, ev->status); in hci_cmd_status_evt()
3111 hci_cs_create_phylink(hdev, ev->status); in hci_cmd_status_evt()
3115 hci_cs_accept_phylink(hdev, ev->status); in hci_cmd_status_evt()
3119 hci_cs_sniff_mode(hdev, ev->status); in hci_cmd_status_evt()
3123 hci_cs_exit_sniff_mode(hdev, ev->status); in hci_cmd_status_evt()
3127 hci_cs_switch_role(hdev, ev->status); in hci_cmd_status_evt()
3131 hci_cs_le_create_conn(hdev, ev->status); in hci_cmd_status_evt()
3135 hci_cs_le_read_remote_features(hdev, ev->status); in hci_cmd_status_evt()
3139 hci_cs_le_start_enc(hdev, ev->status); in hci_cmd_status_evt()
3143 BT_DBG("%s opcode 0x%4.4x", hdev->name, *opcode); in hci_cmd_status_evt()
3148 cancel_delayed_work(&hdev->cmd_timer); in hci_cmd_status_evt()
3150 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) in hci_cmd_status_evt()
3151 atomic_set(&hdev->cmd_cnt, 1); in hci_cmd_status_evt()
3160 (hdev->sent_cmd && !bt_cb(hdev->sent_cmd)->req.event)) in hci_cmd_status_evt()
3161 hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, in hci_cmd_status_evt()
3164 if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q)) in hci_cmd_status_evt()
3165 queue_work(hdev->workqueue, &hdev->cmd_work); in hci_cmd_status_evt()
3168 static void hci_hardware_error_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_hardware_error_evt() argument
3172 hdev->hw_error_code = ev->code; in hci_hardware_error_evt()
3174 queue_work(hdev->req_workqueue, &hdev->error_reset); in hci_hardware_error_evt()
3177 static void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_role_change_evt() argument
3182 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_role_change_evt()
3184 hci_dev_lock(hdev); in hci_role_change_evt()
3186 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_role_change_evt()
3196 hci_dev_unlock(hdev); in hci_role_change_evt()
3199 static void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_num_comp_pkts_evt() argument
3204 if (hdev->flow_ctl_mode != HCI_FLOW_CTL_MODE_PACKET_BASED) { in hci_num_comp_pkts_evt()
3205 BT_ERR("Wrong event for mode %d", hdev->flow_ctl_mode); in hci_num_comp_pkts_evt()
3211 BT_DBG("%s bad parameters", hdev->name); in hci_num_comp_pkts_evt()
3215 BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl); in hci_num_comp_pkts_evt()
3225 conn = hci_conn_hash_lookup_handle(hdev, handle); in hci_num_comp_pkts_evt()
3233 hdev->acl_cnt += count; in hci_num_comp_pkts_evt()
3234 if (hdev->acl_cnt > hdev->acl_pkts) in hci_num_comp_pkts_evt()
3235 hdev->acl_cnt = hdev->acl_pkts; in hci_num_comp_pkts_evt()
3239 if (hdev->le_pkts) { in hci_num_comp_pkts_evt()
3240 hdev->le_cnt += count; in hci_num_comp_pkts_evt()
3241 if (hdev->le_cnt > hdev->le_pkts) in hci_num_comp_pkts_evt()
3242 hdev->le_cnt = hdev->le_pkts; in hci_num_comp_pkts_evt()
3244 hdev->acl_cnt += count; in hci_num_comp_pkts_evt()
3245 if (hdev->acl_cnt > hdev->acl_pkts) in hci_num_comp_pkts_evt()
3246 hdev->acl_cnt = hdev->acl_pkts; in hci_num_comp_pkts_evt()
3251 hdev->sco_cnt += count; in hci_num_comp_pkts_evt()
3252 if (hdev->sco_cnt > hdev->sco_pkts) in hci_num_comp_pkts_evt()
3253 hdev->sco_cnt = hdev->sco_pkts; in hci_num_comp_pkts_evt()
3262 queue_work(hdev->workqueue, &hdev->tx_work); in hci_num_comp_pkts_evt()
3265 static struct hci_conn *__hci_conn_lookup_handle(struct hci_dev *hdev, in __hci_conn_lookup_handle() argument
3270 switch (hdev->dev_type) { in __hci_conn_lookup_handle()
3272 return hci_conn_hash_lookup_handle(hdev, handle); in __hci_conn_lookup_handle()
3274 chan = hci_chan_lookup_handle(hdev, handle); in __hci_conn_lookup_handle()
3279 BT_ERR("%s unknown dev_type %d", hdev->name, hdev->dev_type); in __hci_conn_lookup_handle()
3286 static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_num_comp_blocks_evt() argument
3291 if (hdev->flow_ctl_mode != HCI_FLOW_CTL_MODE_BLOCK_BASED) { in hci_num_comp_blocks_evt()
3292 BT_ERR("Wrong event for mode %d", hdev->flow_ctl_mode); in hci_num_comp_blocks_evt()
3298 BT_DBG("%s bad parameters", hdev->name); in hci_num_comp_blocks_evt()
3302 BT_DBG("%s num_blocks %d num_hndl %d", hdev->name, ev->num_blocks, in hci_num_comp_blocks_evt()
3313 conn = __hci_conn_lookup_handle(hdev, handle); in hci_num_comp_blocks_evt()
3322 hdev->block_cnt += block_count; in hci_num_comp_blocks_evt()
3323 if (hdev->block_cnt > hdev->num_blocks) in hci_num_comp_blocks_evt()
3324 hdev->block_cnt = hdev->num_blocks; in hci_num_comp_blocks_evt()
3333 queue_work(hdev->workqueue, &hdev->tx_work); in hci_num_comp_blocks_evt()
3336 static void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_mode_change_evt() argument
3341 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_mode_change_evt()
3343 hci_dev_lock(hdev); in hci_mode_change_evt()
3345 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_mode_change_evt()
3361 hci_dev_unlock(hdev); in hci_mode_change_evt()
3364 static void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_pin_code_request_evt() argument
3369 BT_DBG("%s", hdev->name); in hci_pin_code_request_evt()
3371 hci_dev_lock(hdev); in hci_pin_code_request_evt()
3373 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_pin_code_request_evt()
3383 if (!hci_dev_test_flag(hdev, HCI_BONDABLE) && in hci_pin_code_request_evt()
3385 hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, in hci_pin_code_request_evt()
3387 } else if (hci_dev_test_flag(hdev, HCI_MGMT)) { in hci_pin_code_request_evt()
3395 mgmt_pin_code_request(hdev, &ev->bdaddr, secure); in hci_pin_code_request_evt()
3399 hci_dev_unlock(hdev); in hci_pin_code_request_evt()
3434 static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_link_key_request_evt() argument
3441 BT_DBG("%s", hdev->name); in hci_link_key_request_evt()
3443 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_link_key_request_evt()
3446 hci_dev_lock(hdev); in hci_link_key_request_evt()
3448 key = hci_find_link_key(hdev, &ev->bdaddr); in hci_link_key_request_evt()
3450 BT_DBG("%s link key not found for %pMR", hdev->name, in hci_link_key_request_evt()
3455 BT_DBG("%s found key type %u for %pMR", hdev->name, key->type, in hci_link_key_request_evt()
3458 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_request_evt()
3465 BT_DBG("%s ignoring unauthenticated key", hdev->name); in hci_link_key_request_evt()
3473 hdev->name); in hci_link_key_request_evt()
3483 hci_send_cmd(hdev, HCI_OP_LINK_KEY_REPLY, sizeof(cp), &cp); in hci_link_key_request_evt()
3485 hci_dev_unlock(hdev); in hci_link_key_request_evt()
3490 hci_send_cmd(hdev, HCI_OP_LINK_KEY_NEG_REPLY, 6, &ev->bdaddr); in hci_link_key_request_evt()
3491 hci_dev_unlock(hdev); in hci_link_key_request_evt()
3494 static void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_link_key_notify_evt() argument
3502 BT_DBG("%s", hdev->name); in hci_link_key_notify_evt()
3504 hci_dev_lock(hdev); in hci_link_key_notify_evt()
3506 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_notify_evt()
3517 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_link_key_notify_evt()
3520 key = hci_add_link_key(hdev, conn, &ev->bdaddr, ev->link_key, in hci_link_key_notify_evt()
3531 mgmt_new_link_key(hdev, key, persistent); in hci_link_key_notify_evt()
3539 !hci_dev_test_flag(hdev, HCI_KEEP_DEBUG_KEYS)) { in hci_link_key_notify_evt()
3551 hci_dev_unlock(hdev); in hci_link_key_notify_evt()
3554 static void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_clock_offset_evt() argument
3559 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_clock_offset_evt()
3561 hci_dev_lock(hdev); in hci_clock_offset_evt()
3563 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_clock_offset_evt()
3567 ie = hci_inquiry_cache_lookup(hdev, &conn->dst); in hci_clock_offset_evt()
3574 hci_dev_unlock(hdev); in hci_clock_offset_evt()
3577 static void hci_pkt_type_change_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_pkt_type_change_evt() argument
3582 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_pkt_type_change_evt()
3584 hci_dev_lock(hdev); in hci_pkt_type_change_evt()
3586 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_pkt_type_change_evt()
3590 hci_dev_unlock(hdev); in hci_pkt_type_change_evt()
3593 static void hci_pscan_rep_mode_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_pscan_rep_mode_evt() argument
3598 BT_DBG("%s", hdev->name); in hci_pscan_rep_mode_evt()
3600 hci_dev_lock(hdev); in hci_pscan_rep_mode_evt()
3602 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_pscan_rep_mode_evt()
3608 hci_dev_unlock(hdev); in hci_pscan_rep_mode_evt()
3611 static void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, in hci_inquiry_result_with_rssi_evt() argument
3617 BT_DBG("%s num_rsp %d", hdev->name, num_rsp); in hci_inquiry_result_with_rssi_evt()
3622 if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) in hci_inquiry_result_with_rssi_evt()
3625 hci_dev_lock(hdev); in hci_inquiry_result_with_rssi_evt()
3643 flags = hci_inquiry_cache_update(hdev, &data, false); in hci_inquiry_result_with_rssi_evt()
3645 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, in hci_inquiry_result_with_rssi_evt()
3664 flags = hci_inquiry_cache_update(hdev, &data, false); in hci_inquiry_result_with_rssi_evt()
3666 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, in hci_inquiry_result_with_rssi_evt()
3672 hci_dev_unlock(hdev); in hci_inquiry_result_with_rssi_evt()
3675 static void hci_remote_ext_features_evt(struct hci_dev *hdev, in hci_remote_ext_features_evt() argument
3681 BT_DBG("%s", hdev->name); in hci_remote_ext_features_evt()
3683 hci_dev_lock(hdev); in hci_remote_ext_features_evt()
3685 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_ext_features_evt()
3695 ie = hci_inquiry_cache_lookup(hdev, &conn->dst); in hci_remote_ext_features_evt()
3725 hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_remote_ext_features_evt()
3727 mgmt_device_connected(hdev, conn, 0, NULL, 0); in hci_remote_ext_features_evt()
3729 if (!hci_outgoing_auth_needed(hdev, conn)) { in hci_remote_ext_features_evt()
3736 hci_dev_unlock(hdev); in hci_remote_ext_features_evt()
3739 static void hci_sync_conn_complete_evt(struct hci_dev *hdev, in hci_sync_conn_complete_evt() argument
3745 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_sync_conn_complete_evt()
3747 hci_dev_lock(hdev); in hci_sync_conn_complete_evt()
3749 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_sync_conn_complete_evt()
3754 conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); in hci_sync_conn_complete_evt()
3778 conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | in hci_sync_conn_complete_evt()
3779 (hdev->esco_type & EDR_ESCO_MASK); in hci_sync_conn_complete_evt()
3795 hci_dev_unlock(hdev); in hci_sync_conn_complete_evt()
3815 static void hci_extended_inquiry_result_evt(struct hci_dev *hdev, in hci_extended_inquiry_result_evt() argument
3823 BT_DBG("%s num_rsp %d", hdev->name, num_rsp); in hci_extended_inquiry_result_evt()
3828 if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) in hci_extended_inquiry_result_evt()
3831 hci_dev_lock(hdev); in hci_extended_inquiry_result_evt()
3846 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_extended_inquiry_result_evt()
3853 flags = hci_inquiry_cache_update(hdev, &data, name_known); in hci_extended_inquiry_result_evt()
3857 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, in hci_extended_inquiry_result_evt()
3862 hci_dev_unlock(hdev); in hci_extended_inquiry_result_evt()
3865 static void hci_key_refresh_complete_evt(struct hci_dev *hdev, in hci_key_refresh_complete_evt() argument
3871 BT_DBG("%s status 0x%2.2x handle 0x%4.4x", hdev->name, ev->status, in hci_key_refresh_complete_evt()
3874 hci_dev_lock(hdev); in hci_key_refresh_complete_evt()
3876 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
3912 hci_dev_unlock(hdev); in hci_key_refresh_complete_evt()
3935 struct hci_dev *hdev = conn->hdev; in bredr_oob_data_present() local
3938 data = hci_find_remote_oob_data(hdev, &conn->dst, BDADDR_BREDR); in bredr_oob_data_present()
3942 if (bredr_sc_enabled(hdev)) { in bredr_oob_data_present()
3949 if (!hci_dev_test_flag(hdev, HCI_SC_ONLY)) in bredr_oob_data_present()
3975 static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_io_capa_request_evt() argument
3980 BT_DBG("%s", hdev->name); in hci_io_capa_request_evt()
3982 hci_dev_lock(hdev); in hci_io_capa_request_evt()
3984 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_request_evt()
3990 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_io_capa_request_evt()
3996 if (hci_dev_test_flag(hdev, HCI_BONDABLE) || in hci_io_capa_request_evt()
4022 if (!hci_dev_test_flag(hdev, HCI_BONDABLE)) in hci_io_capa_request_evt()
4028 hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_REPLY, in hci_io_capa_request_evt()
4036 hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_NEG_REPLY, in hci_io_capa_request_evt()
4041 hci_dev_unlock(hdev); in hci_io_capa_request_evt()
4044 static void hci_io_capa_reply_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_io_capa_reply_evt() argument
4049 BT_DBG("%s", hdev->name); in hci_io_capa_reply_evt()
4051 hci_dev_lock(hdev); in hci_io_capa_reply_evt()
4053 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_reply_evt()
4061 hci_dev_unlock(hdev); in hci_io_capa_reply_evt()
4064 static void hci_user_confirm_request_evt(struct hci_dev *hdev, in hci_user_confirm_request_evt() argument
4071 BT_DBG("%s", hdev->name); in hci_user_confirm_request_evt()
4073 hci_dev_lock(hdev); in hci_user_confirm_request_evt()
4075 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_user_confirm_request_evt()
4078 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_confirm_request_evt()
4093 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_NEG_REPLY, in hci_user_confirm_request_evt()
4117 hdev->auto_accept_delay); in hci_user_confirm_request_evt()
4119 if (hdev->auto_accept_delay > 0) { in hci_user_confirm_request_evt()
4120 int delay = msecs_to_jiffies(hdev->auto_accept_delay); in hci_user_confirm_request_evt()
4121 queue_delayed_work(conn->hdev->workqueue, in hci_user_confirm_request_evt()
4126 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY, in hci_user_confirm_request_evt()
4132 mgmt_user_confirm_request(hdev, &ev->bdaddr, ACL_LINK, 0, in hci_user_confirm_request_evt()
4136 hci_dev_unlock(hdev); in hci_user_confirm_request_evt()
4139 static void hci_user_passkey_request_evt(struct hci_dev *hdev, in hci_user_passkey_request_evt() argument
4144 BT_DBG("%s", hdev->name); in hci_user_passkey_request_evt()
4146 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_user_passkey_request_evt()
4147 mgmt_user_passkey_request(hdev, &ev->bdaddr, ACL_LINK, 0); in hci_user_passkey_request_evt()
4150 static void hci_user_passkey_notify_evt(struct hci_dev *hdev, in hci_user_passkey_notify_evt() argument
4156 BT_DBG("%s", hdev->name); in hci_user_passkey_notify_evt()
4158 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_passkey_notify_evt()
4165 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_user_passkey_notify_evt()
4166 mgmt_user_passkey_notify(hdev, &conn->dst, conn->type, in hci_user_passkey_notify_evt()
4171 static void hci_keypress_notify_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_keypress_notify_evt() argument
4176 BT_DBG("%s", hdev->name); in hci_keypress_notify_evt()
4178 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_keypress_notify_evt()
4203 if (hci_dev_test_flag(hdev, HCI_MGMT)) in hci_keypress_notify_evt()
4204 mgmt_user_passkey_notify(hdev, &conn->dst, conn->type, in hci_keypress_notify_evt()
4209 static void hci_simple_pair_complete_evt(struct hci_dev *hdev, in hci_simple_pair_complete_evt() argument
4215 BT_DBG("%s", hdev->name); in hci_simple_pair_complete_evt()
4217 hci_dev_lock(hdev); in hci_simple_pair_complete_evt()
4219 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_simple_pair_complete_evt()
4237 hci_dev_unlock(hdev); in hci_simple_pair_complete_evt()
4240 static void hci_remote_host_features_evt(struct hci_dev *hdev, in hci_remote_host_features_evt() argument
4247 BT_DBG("%s", hdev->name); in hci_remote_host_features_evt()
4249 hci_dev_lock(hdev); in hci_remote_host_features_evt()
4251 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_host_features_evt()
4255 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_remote_host_features_evt()
4259 hci_dev_unlock(hdev); in hci_remote_host_features_evt()
4262 static void hci_remote_oob_data_request_evt(struct hci_dev *hdev, in hci_remote_oob_data_request_evt() argument
4268 BT_DBG("%s", hdev->name); in hci_remote_oob_data_request_evt()
4270 hci_dev_lock(hdev); in hci_remote_oob_data_request_evt()
4272 if (!hci_dev_test_flag(hdev, HCI_MGMT)) in hci_remote_oob_data_request_evt()
4275 data = hci_find_remote_oob_data(hdev, &ev->bdaddr, BDADDR_BREDR); in hci_remote_oob_data_request_evt()
4280 hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_NEG_REPLY, in hci_remote_oob_data_request_evt()
4285 if (bredr_sc_enabled(hdev)) { in hci_remote_oob_data_request_evt()
4289 if (hci_dev_test_flag(hdev, HCI_SC_ONLY)) { in hci_remote_oob_data_request_evt()
4299 hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_EXT_DATA_REPLY, in hci_remote_oob_data_request_evt()
4308 hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY, in hci_remote_oob_data_request_evt()
4313 hci_dev_unlock(hdev); in hci_remote_oob_data_request_evt()
4316 static void hci_phy_link_complete_evt(struct hci_dev *hdev, in hci_phy_link_complete_evt() argument
4322 BT_DBG("%s handle 0x%2.2x status 0x%2.2x", hdev->name, ev->phy_handle, in hci_phy_link_complete_evt()
4325 hci_dev_lock(hdev); in hci_phy_link_complete_evt()
4327 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_phy_link_complete_evt()
4329 hci_dev_unlock(hdev); in hci_phy_link_complete_evt()
4335 hci_dev_unlock(hdev); in hci_phy_link_complete_evt()
4353 hci_dev_unlock(hdev); in hci_phy_link_complete_evt()
4356 static void hci_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_loglink_complete_evt() argument
4364 hdev->name, le16_to_cpu(ev->handle), ev->phy_handle, in hci_loglink_complete_evt()
4367 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_loglink_complete_evt()
4386 bredr_chan->conn->mtu = hdev->block_mtu; in hci_loglink_complete_evt()
4394 static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev, in hci_disconn_loglink_complete_evt() argument
4400 BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name, in hci_disconn_loglink_complete_evt()
4406 hci_dev_lock(hdev); in hci_disconn_loglink_complete_evt()
4408 hchan = hci_chan_lookup_handle(hdev, le16_to_cpu(ev->handle)); in hci_disconn_loglink_complete_evt()
4415 hci_dev_unlock(hdev); in hci_disconn_loglink_complete_evt()
4418 static void hci_disconn_phylink_complete_evt(struct hci_dev *hdev, in hci_disconn_phylink_complete_evt() argument
4424 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_disconn_phylink_complete_evt()
4429 hci_dev_lock(hdev); in hci_disconn_phylink_complete_evt()
4431 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_disconn_phylink_complete_evt()
4437 hci_dev_unlock(hdev); in hci_disconn_phylink_complete_evt()
4440 static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_le_conn_complete_evt() argument
4448 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_conn_complete_evt()
4450 hci_dev_lock(hdev); in hci_le_conn_complete_evt()
4455 hci_dev_clear_flag(hdev, HCI_LE_ADV); in hci_le_conn_complete_evt()
4457 conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); in hci_le_conn_complete_evt()
4459 conn = hci_conn_add(hdev, LE_LINK, &ev->bdaddr, ev->role); in hci_le_conn_complete_evt()
4478 if (hci_dev_test_flag(hdev, HCI_PRIVACY)) { in hci_le_conn_complete_evt()
4480 bacpy(&conn->init_addr, &hdev->rpa); in hci_le_conn_complete_evt()
4482 hci_copy_identity_address(hdev, in hci_le_conn_complete_evt()
4495 conn->resp_addr_type = hdev->adv_addr_type; in hci_le_conn_complete_evt()
4496 if (hdev->adv_addr_type == ADDR_LE_DEV_RANDOM) in hci_le_conn_complete_evt()
4497 bacpy(&conn->resp_addr, &hdev->random_addr); in hci_le_conn_complete_evt()
4499 bacpy(&conn->resp_addr, &hdev->bdaddr); in hci_le_conn_complete_evt()
4509 conn->le_conn_min_interval = hdev->le_conn_min_interval; in hci_le_conn_complete_evt()
4510 conn->le_conn_max_interval = hdev->le_conn_max_interval; in hci_le_conn_complete_evt()
4522 irk = hci_get_irk(hdev, &conn->dst, conn->dst_type); in hci_le_conn_complete_evt()
4539 if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) { in hci_le_conn_complete_evt()
4545 mgmt_device_connected(hdev, conn, 0, NULL, 0); in hci_le_conn_complete_evt()
4569 (hdev->le_features[0] & HCI_LE_SLAVE_FEATURES)) { in hci_le_conn_complete_evt()
4574 hci_send_cmd(hdev, HCI_OP_LE_READ_REMOTE_FEATURES, in hci_le_conn_complete_evt()
4586 params = hci_pend_le_action_lookup(&hdev->pend_le_conns, &conn->dst, in hci_le_conn_complete_evt()
4598 hci_update_background_scan(hdev); in hci_le_conn_complete_evt()
4599 hci_dev_unlock(hdev); in hci_le_conn_complete_evt()
4602 static void hci_le_conn_update_complete_evt(struct hci_dev *hdev, in hci_le_conn_update_complete_evt() argument
4608 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_conn_update_complete_evt()
4613 hci_dev_lock(hdev); in hci_le_conn_update_complete_evt()
4615 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_conn_update_complete_evt()
4622 hci_dev_unlock(hdev); in hci_le_conn_update_complete_evt()
4626 static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev, in check_pending_le_conn() argument
4638 if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type)) in check_pending_le_conn()
4644 if (hdev->conn_hash.le_num_slave > 0) in check_pending_le_conn()
4650 params = hci_pend_le_action_lookup(&hdev->pend_le_conns, in check_pending_le_conn()
4676 conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW, in check_pending_le_conn()
4705 static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr, in process_adv_report() argument
4709 struct discovery_state *d = &hdev->discovery; in process_adv_report()
4730 if (!hci_dev_test_flag(hdev, HCI_PRIVACY)) in process_adv_report()
4737 if (!smp_irk_matches(hdev, hdev->irk, direct_addr)) in process_adv_report()
4742 irk = hci_get_irk(hdev, bdaddr, bdaddr_type); in process_adv_report()
4749 conn = check_pending_le_conn(hdev, bdaddr, bdaddr_type, type); in process_adv_report()
4762 if (hdev->le_scan_type == LE_SCAN_PASSIVE) { in process_adv_report()
4766 if (!hci_pend_le_action_lookup(&hdev->pend_le_reports, in process_adv_report()
4774 mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, in process_adv_report()
4804 if (!has_pending_adv_report(hdev)) { in process_adv_report()
4809 store_pending_adv_report(hdev, bdaddr, bdaddr_type, in process_adv_report()
4814 mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, in process_adv_report()
4830 mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, in process_adv_report()
4840 store_pending_adv_report(hdev, bdaddr, bdaddr_type, in process_adv_report()
4848 clear_pending_adv_report(hdev); in process_adv_report()
4849 mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, in process_adv_report()
4858 mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, in process_adv_report()
4861 clear_pending_adv_report(hdev); in process_adv_report()
4864 static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_le_adv_report_evt() argument
4869 hci_dev_lock(hdev); in hci_le_adv_report_evt()
4876 process_adv_report(hdev, ev->evt_type, &ev->bdaddr, in hci_le_adv_report_evt()
4883 hci_dev_unlock(hdev); in hci_le_adv_report_evt()
4886 static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, in hci_le_remote_feat_complete_evt() argument
4892 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_remote_feat_complete_evt()
4894 hci_dev_lock(hdev); in hci_le_remote_feat_complete_evt()
4896 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_remote_feat_complete_evt()
4913 if ((hdev->le_features[0] & HCI_LE_SLAVE_FEATURES) && in hci_le_remote_feat_complete_evt()
4925 hci_dev_unlock(hdev); in hci_le_remote_feat_complete_evt()
4928 static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_le_ltk_request_evt() argument
4936 BT_DBG("%s handle 0x%4.4x", hdev->name, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
4938 hci_dev_lock(hdev); in hci_le_ltk_request_evt()
4940 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
4944 ltk = hci_find_ltk(hdev, &conn->dst, conn->dst_type, conn->role); in hci_le_ltk_request_evt()
4965 hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); in hci_le_ltk_request_evt()
4981 hci_dev_unlock(hdev); in hci_le_ltk_request_evt()
4987 hci_send_cmd(hdev, HCI_OP_LE_LTK_NEG_REPLY, sizeof(neg), &neg); in hci_le_ltk_request_evt()
4988 hci_dev_unlock(hdev); in hci_le_ltk_request_evt()
4991 static void send_conn_param_neg_reply(struct hci_dev *hdev, u16 handle, in send_conn_param_neg_reply() argument
4999 hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY, sizeof(cp), in send_conn_param_neg_reply()
5003 static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, in hci_le_remote_conn_param_req_evt() argument
5017 hcon = hci_conn_hash_lookup_handle(hdev, handle); in hci_le_remote_conn_param_req_evt()
5019 return send_conn_param_neg_reply(hdev, handle, in hci_le_remote_conn_param_req_evt()
5023 return send_conn_param_neg_reply(hdev, handle, in hci_le_remote_conn_param_req_evt()
5030 hci_dev_lock(hdev); in hci_le_remote_conn_param_req_evt()
5032 params = hci_conn_params_lookup(hdev, &hcon->dst, in hci_le_remote_conn_param_req_evt()
5044 hci_dev_unlock(hdev); in hci_le_remote_conn_param_req_evt()
5046 mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, in hci_le_remote_conn_param_req_evt()
5058 hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_REPLY, sizeof(cp), &cp); in hci_le_remote_conn_param_req_evt()
5061 static void hci_le_direct_adv_report_evt(struct hci_dev *hdev, in hci_le_direct_adv_report_evt() argument
5067 hci_dev_lock(hdev); in hci_le_direct_adv_report_evt()
5072 process_adv_report(hdev, ev->evt_type, &ev->bdaddr, in hci_le_direct_adv_report_evt()
5079 hci_dev_unlock(hdev); in hci_le_direct_adv_report_evt()
5082 static void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_le_meta_evt() argument
5090 hci_le_conn_complete_evt(hdev, skb); in hci_le_meta_evt()
5094 hci_le_conn_update_complete_evt(hdev, skb); in hci_le_meta_evt()
5098 hci_le_adv_report_evt(hdev, skb); in hci_le_meta_evt()
5102 hci_le_remote_feat_complete_evt(hdev, skb); in hci_le_meta_evt()
5106 hci_le_ltk_request_evt(hdev, skb); in hci_le_meta_evt()
5110 hci_le_remote_conn_param_req_evt(hdev, skb); in hci_le_meta_evt()
5114 hci_le_direct_adv_report_evt(hdev, skb); in hci_le_meta_evt()
5122 static void hci_chan_selected_evt(struct hci_dev *hdev, struct sk_buff *skb) in hci_chan_selected_evt() argument
5127 BT_DBG("%s handle 0x%2.2x", hdev->name, ev->phy_handle); in hci_chan_selected_evt()
5131 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_chan_selected_evt()
5135 amp_read_loc_assoc_final_data(hdev, hcon); in hci_chan_selected_evt()
5138 static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, in hci_get_cmd_complete() argument
5183 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) in hci_event_packet() argument
5192 if (hdev->sent_cmd && bt_cb(hdev->sent_cmd)->req.event == event) { in hci_event_packet()
5193 struct hci_command_hdr *cmd_hdr = (void *) hdev->sent_cmd->data; in hci_event_packet()
5195 hci_req_cmd_complete(hdev, opcode, status, &req_complete, in hci_event_packet()
5213 hci_inquiry_complete_evt(hdev, skb); in hci_event_packet()
5217 hci_inquiry_result_evt(hdev, skb); in hci_event_packet()
5221 hci_conn_complete_evt(hdev, skb); in hci_event_packet()
5225 hci_conn_request_evt(hdev, skb); in hci_event_packet()
5229 hci_disconn_complete_evt(hdev, skb); in hci_event_packet()
5233 hci_auth_complete_evt(hdev, skb); in hci_event_packet()
5237 hci_remote_name_evt(hdev, skb); in hci_event_packet()
5241 hci_encrypt_change_evt(hdev, skb); in hci_event_packet()
5245 hci_change_link_key_complete_evt(hdev, skb); in hci_event_packet()
5249 hci_remote_features_evt(hdev, skb); in hci_event_packet()
5253 hci_cmd_complete_evt(hdev, skb, &opcode, &status, in hci_event_packet()
5258 hci_cmd_status_evt(hdev, skb, &opcode, &status, &req_complete, in hci_event_packet()
5263 hci_hardware_error_evt(hdev, skb); in hci_event_packet()
5267 hci_role_change_evt(hdev, skb); in hci_event_packet()
5271 hci_num_comp_pkts_evt(hdev, skb); in hci_event_packet()
5275 hci_mode_change_evt(hdev, skb); in hci_event_packet()
5279 hci_pin_code_request_evt(hdev, skb); in hci_event_packet()
5283 hci_link_key_request_evt(hdev, skb); in hci_event_packet()
5287 hci_link_key_notify_evt(hdev, skb); in hci_event_packet()
5291 hci_clock_offset_evt(hdev, skb); in hci_event_packet()
5295 hci_pkt_type_change_evt(hdev, skb); in hci_event_packet()
5299 hci_pscan_rep_mode_evt(hdev, skb); in hci_event_packet()
5303 hci_inquiry_result_with_rssi_evt(hdev, skb); in hci_event_packet()
5307 hci_remote_ext_features_evt(hdev, skb); in hci_event_packet()
5311 hci_sync_conn_complete_evt(hdev, skb); in hci_event_packet()
5315 hci_extended_inquiry_result_evt(hdev, skb); in hci_event_packet()
5319 hci_key_refresh_complete_evt(hdev, skb); in hci_event_packet()
5323 hci_io_capa_request_evt(hdev, skb); in hci_event_packet()
5327 hci_io_capa_reply_evt(hdev, skb); in hci_event_packet()
5331 hci_user_confirm_request_evt(hdev, skb); in hci_event_packet()
5335 hci_user_passkey_request_evt(hdev, skb); in hci_event_packet()
5339 hci_user_passkey_notify_evt(hdev, skb); in hci_event_packet()
5343 hci_keypress_notify_evt(hdev, skb); in hci_event_packet()
5347 hci_simple_pair_complete_evt(hdev, skb); in hci_event_packet()
5351 hci_remote_host_features_evt(hdev, skb); in hci_event_packet()
5355 hci_le_meta_evt(hdev, skb); in hci_event_packet()
5359 hci_chan_selected_evt(hdev, skb); in hci_event_packet()
5363 hci_remote_oob_data_request_evt(hdev, skb); in hci_event_packet()
5367 hci_phy_link_complete_evt(hdev, skb); in hci_event_packet()
5371 hci_loglink_complete_evt(hdev, skb); in hci_event_packet()
5375 hci_disconn_loglink_complete_evt(hdev, skb); in hci_event_packet()
5379 hci_disconn_phylink_complete_evt(hdev, skb); in hci_event_packet()
5383 hci_num_comp_blocks_evt(hdev, skb); in hci_event_packet()
5387 BT_DBG("%s event 0x%2.2x", hdev->name, event); in hci_event_packet()
5392 req_complete(hdev, status, opcode); in hci_event_packet()
5394 if (!hci_get_cmd_complete(hdev, opcode, req_evt, orig_skb)) { in hci_event_packet()
5398 req_complete_skb(hdev, status, opcode, orig_skb); in hci_event_packet()
5403 hdev->stat.evt_rx++; in hci_event_packet()