Lines Matching refs:ev

2571 	struct hci_ev_conn_complete *ev = (void *) skb->data;  in hci_conn_complete_evt()  local
2578 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_conn_complete_evt()
2589 if (ev->link_type == ACL_LINK && in hci_conn_complete_evt()
2591 &ev->bdaddr, in hci_conn_complete_evt()
2593 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, in hci_conn_complete_evt()
2600 if (ev->link_type != SCO_LINK) in hci_conn_complete_evt()
2604 &ev->bdaddr); in hci_conn_complete_evt()
2612 if (!ev->status) { in hci_conn_complete_evt()
2613 conn->handle = __le16_to_cpu(ev->handle); in hci_conn_complete_evt()
2620 !hci_find_link_key(hdev, &ev->bdaddr)) in hci_conn_complete_evt()
2639 cp.handle = ev->handle; in hci_conn_complete_evt()
2649 cp.handle = ev->handle; in hci_conn_complete_evt()
2658 conn->dst_type, ev->status); in hci_conn_complete_evt()
2662 hci_sco_setup(conn, ev->status); in hci_conn_complete_evt()
2664 if (ev->status) { in hci_conn_complete_evt()
2665 hci_connect_cfm(conn, ev->status); in hci_conn_complete_evt()
2667 } else if (ev->link_type == SCO_LINK) { in hci_conn_complete_evt()
2675 hci_connect_cfm(conn, ev->status); in hci_conn_complete_evt()
2695 struct hci_ev_conn_request *ev = (void *) skb->data; in hci_conn_request_evt() local
2701 BT_DBG("%s bdaddr %pMR type 0x%x", hdev->name, &ev->bdaddr, in hci_conn_request_evt()
2702 ev->link_type); in hci_conn_request_evt()
2704 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, in hci_conn_request_evt()
2708 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2712 if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr, in hci_conn_request_evt()
2714 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2724 !hci_bdaddr_list_lookup_with_flags(&hdev->whitelist, &ev->bdaddr, in hci_conn_request_evt()
2726 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
2734 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_conn_request_evt()
2736 memcpy(ie->data.dev_class, ev->dev_class, 3); in hci_conn_request_evt()
2738 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, in hci_conn_request_evt()
2739 &ev->bdaddr); in hci_conn_request_evt()
2741 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, in hci_conn_request_evt()
2750 memcpy(conn->dev_class, ev->dev_class, 3); in hci_conn_request_evt()
2754 if (ev->link_type == ACL_LINK || in hci_conn_request_evt()
2759 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
2771 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
2806 struct hci_ev_disconn_complete *ev = (void *) skb->data; in hci_disconn_complete_evt() local
2813 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_disconn_complete_evt()
2817 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_disconn_complete_evt()
2821 if (ev->status) { in hci_disconn_complete_evt()
2823 conn->dst_type, ev->status); in hci_disconn_complete_evt()
2834 reason = hci_to_mgmt_reason(ev->reason); in hci_disconn_complete_evt()
2850 if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT) in hci_disconn_complete_evt()
2868 hci_disconn_cfm(conn, ev->reason); in hci_disconn_complete_evt()
2898 struct hci_ev_auth_complete *ev = (void *) skb->data; in hci_auth_complete_evt() local
2901 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_auth_complete_evt()
2905 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_auth_complete_evt()
2909 if (!ev->status) { in hci_auth_complete_evt()
2920 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_auth_complete_evt()
2923 mgmt_auth_failed(conn, ev->status); in hci_auth_complete_evt()
2930 if (!ev->status && hci_conn_ssp_enabled(conn)) { in hci_auth_complete_evt()
2932 cp.handle = ev->handle; in hci_auth_complete_evt()
2938 hci_connect_cfm(conn, ev->status); in hci_auth_complete_evt()
2942 hci_auth_cfm(conn, ev->status); in hci_auth_complete_evt()
2950 if (!ev->status) { in hci_auth_complete_evt()
2952 cp.handle = ev->handle; in hci_auth_complete_evt()
2958 hci_encrypt_cfm(conn, ev->status); in hci_auth_complete_evt()
2968 struct hci_ev_remote_name *ev = (void *) skb->data; in hci_remote_name_evt() local
2977 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_name_evt()
2982 if (ev->status == 0) in hci_remote_name_evt()
2983 hci_check_pending_name(hdev, conn, &ev->bdaddr, ev->name, in hci_remote_name_evt()
2984 strnlen(ev->name, HCI_MAX_NAME_LENGTH)); in hci_remote_name_evt()
2986 hci_check_pending_name(hdev, conn, &ev->bdaddr, NULL, 0); in hci_remote_name_evt()
3051 struct hci_ev_encrypt_change *ev = (void *) skb->data; in hci_encrypt_change_evt() local
3054 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_encrypt_change_evt()
3058 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_encrypt_change_evt()
3062 if (!ev->status) { in hci_encrypt_change_evt()
3063 if (ev->encrypt) { in hci_encrypt_change_evt()
3073 if ((conn->type == ACL_LINK && ev->encrypt == 0x02) || in hci_encrypt_change_evt()
3085 if (ev->status && conn->type == LE_LINK) { in hci_encrypt_change_evt()
3094 ev->status = HCI_ERROR_AUTH_FAILURE; in hci_encrypt_change_evt()
3096 if (ev->status && conn->state == BT_CONNECTED) { in hci_encrypt_change_evt()
3097 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_encrypt_change_evt()
3103 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3110 if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { in hci_encrypt_change_evt()
3157 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3166 struct hci_ev_change_link_key_complete *ev = (void *) skb->data; in hci_change_link_key_complete_evt() local
3169 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_change_link_key_complete_evt()
3173 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_change_link_key_complete_evt()
3175 if (!ev->status) in hci_change_link_key_complete_evt()
3180 hci_key_change_cfm(conn, ev->status); in hci_change_link_key_complete_evt()
3189 struct hci_ev_remote_features *ev = (void *) skb->data; in hci_remote_features_evt() local
3192 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_remote_features_evt()
3196 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_features_evt()
3200 if (!ev->status) in hci_remote_features_evt()
3201 memcpy(conn->features[0], ev->features, 8); in hci_remote_features_evt()
3206 if (!ev->status && lmp_ext_feat_capable(hdev) && in hci_remote_features_evt()
3209 cp.handle = ev->handle; in hci_remote_features_evt()
3216 if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { in hci_remote_features_evt()
3227 hci_connect_cfm(conn, ev->status); in hci_remote_features_evt()
3240 struct hci_ev_cmd_complete *ev = (void *) skb->data; in hci_cmd_complete_evt() local
3242 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_complete_evt()
3243 *status = skb->data[sizeof(*ev)]; in hci_cmd_complete_evt()
3245 skb_pull(skb, sizeof(*ev)); in hci_cmd_complete_evt()
3592 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) in hci_cmd_complete_evt()
3613 struct hci_ev_cmd_status *ev = (void *) skb->data; in hci_cmd_status_evt() local
3615 skb_pull(skb, sizeof(*ev)); in hci_cmd_status_evt()
3617 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_status_evt()
3618 *status = ev->status; in hci_cmd_status_evt()
3622 hci_cs_inquiry(hdev, ev->status); in hci_cmd_status_evt()
3626 hci_cs_create_conn(hdev, ev->status); in hci_cmd_status_evt()
3630 hci_cs_disconnect(hdev, ev->status); in hci_cmd_status_evt()
3634 hci_cs_add_sco(hdev, ev->status); in hci_cmd_status_evt()
3638 hci_cs_auth_requested(hdev, ev->status); in hci_cmd_status_evt()
3642 hci_cs_set_conn_encrypt(hdev, ev->status); in hci_cmd_status_evt()
3646 hci_cs_remote_name_req(hdev, ev->status); in hci_cmd_status_evt()
3650 hci_cs_read_remote_features(hdev, ev->status); in hci_cmd_status_evt()
3654 hci_cs_read_remote_ext_features(hdev, ev->status); in hci_cmd_status_evt()
3658 hci_cs_setup_sync_conn(hdev, ev->status); in hci_cmd_status_evt()
3662 hci_cs_sniff_mode(hdev, ev->status); in hci_cmd_status_evt()
3666 hci_cs_exit_sniff_mode(hdev, ev->status); in hci_cmd_status_evt()
3670 hci_cs_switch_role(hdev, ev->status); in hci_cmd_status_evt()
3674 hci_cs_le_create_conn(hdev, ev->status); in hci_cmd_status_evt()
3678 hci_cs_le_read_remote_features(hdev, ev->status); in hci_cmd_status_evt()
3682 hci_cs_le_start_enc(hdev, ev->status); in hci_cmd_status_evt()
3686 hci_cs_le_ext_create_conn(hdev, ev->status); in hci_cmd_status_evt()
3697 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) in hci_cmd_status_evt()
3706 if (ev->status || in hci_cmd_status_evt()
3708 hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, in hci_cmd_status_evt()
3723 struct hci_ev_hardware_error *ev = (void *) skb->data; in hci_hardware_error_evt() local
3725 hdev->hw_error_code = ev->code; in hci_hardware_error_evt()
3732 struct hci_ev_role_change *ev = (void *) skb->data; in hci_role_change_evt() local
3735 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_role_change_evt()
3739 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_role_change_evt()
3741 if (!ev->status) in hci_role_change_evt()
3742 conn->role = ev->role; in hci_role_change_evt()
3746 hci_role_switch_cfm(conn, ev->status, ev->role); in hci_role_change_evt()
3754 struct hci_ev_num_comp_pkts *ev = (void *) skb->data; in hci_num_comp_pkts_evt() local
3762 if (skb->len < sizeof(*ev) || in hci_num_comp_pkts_evt()
3763 skb->len < struct_size(ev, handles, ev->num_hndl)) { in hci_num_comp_pkts_evt()
3768 BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl); in hci_num_comp_pkts_evt()
3770 for (i = 0; i < ev->num_hndl; i++) { in hci_num_comp_pkts_evt()
3771 struct hci_comp_pkts_info *info = &ev->handles[i]; in hci_num_comp_pkts_evt()
3842 struct hci_ev_num_comp_blocks *ev = (void *) skb->data; in hci_num_comp_blocks_evt() local
3850 if (skb->len < sizeof(*ev) || in hci_num_comp_blocks_evt()
3851 skb->len < struct_size(ev, handles, ev->num_hndl)) { in hci_num_comp_blocks_evt()
3856 BT_DBG("%s num_blocks %d num_hndl %d", hdev->name, ev->num_blocks, in hci_num_comp_blocks_evt()
3857 ev->num_hndl); in hci_num_comp_blocks_evt()
3859 for (i = 0; i < ev->num_hndl; i++) { in hci_num_comp_blocks_evt()
3860 struct hci_comp_blocks_info *info = &ev->handles[i]; in hci_num_comp_blocks_evt()
3893 struct hci_ev_mode_change *ev = (void *) skb->data; in hci_mode_change_evt() local
3896 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_mode_change_evt()
3900 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_mode_change_evt()
3902 conn->mode = ev->mode; in hci_mode_change_evt()
3913 hci_sco_setup(conn, ev->status); in hci_mode_change_evt()
3921 struct hci_ev_pin_code_req *ev = (void *) skb->data; in hci_pin_code_request_evt() local
3928 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_pin_code_request_evt()
3941 sizeof(ev->bdaddr), &ev->bdaddr); in hci_pin_code_request_evt()
3950 mgmt_pin_code_request(hdev, &ev->bdaddr, secure); in hci_pin_code_request_evt()
3991 struct hci_ev_link_key_req *ev = (void *) skb->data; in hci_link_key_request_evt() local
4003 key = hci_find_link_key(hdev, &ev->bdaddr); in hci_link_key_request_evt()
4006 &ev->bdaddr); in hci_link_key_request_evt()
4011 &ev->bdaddr); in hci_link_key_request_evt()
4013 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_request_evt()
4035 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_link_key_request_evt()
4045 hci_send_cmd(hdev, HCI_OP_LINK_KEY_NEG_REPLY, 6, &ev->bdaddr); in hci_link_key_request_evt()
4051 struct hci_ev_link_key_notify *ev = (void *) skb->data; in hci_link_key_notify_evt() local
4061 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_notify_evt()
4070 conn_set_key(conn, ev->key_type, conn->pin_length); in hci_link_key_notify_evt()
4075 key = hci_add_link_key(hdev, conn, &ev->bdaddr, ev->link_key, in hci_link_key_notify_evt()
4076 ev->key_type, pin_len, &persistent); in hci_link_key_notify_evt()
4083 if (ev->key_type == HCI_LK_CHANGED_COMBINATION) in hci_link_key_notify_evt()
4111 struct hci_ev_clock_offset *ev = (void *) skb->data; in hci_clock_offset_evt() local
4114 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_clock_offset_evt()
4118 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_clock_offset_evt()
4119 if (conn && !ev->status) { in hci_clock_offset_evt()
4124 ie->data.clock_offset = ev->clock_offset; in hci_clock_offset_evt()
4134 struct hci_ev_pkt_type_change *ev = (void *) skb->data; in hci_pkt_type_change_evt() local
4137 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_pkt_type_change_evt()
4141 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_pkt_type_change_evt()
4142 if (conn && !ev->status) in hci_pkt_type_change_evt()
4143 conn->pkt_type = __le16_to_cpu(ev->pkt_type); in hci_pkt_type_change_evt()
4150 struct hci_ev_pscan_rep_mode *ev = (void *) skb->data; in hci_pscan_rep_mode_evt() local
4157 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_pscan_rep_mode_evt()
4159 ie->data.pscan_rep_mode = ev->pscan_rep_mode; in hci_pscan_rep_mode_evt()
4240 struct hci_ev_remote_ext_features *ev = (void *) skb->data; in hci_remote_ext_features_evt() local
4247 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_ext_features_evt()
4251 if (ev->page < HCI_MAX_PAGES) in hci_remote_ext_features_evt()
4252 memcpy(conn->features[ev->page], ev->features, 8); in hci_remote_ext_features_evt()
4254 if (!ev->status && ev->page == 0x01) { in hci_remote_ext_features_evt()
4259 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_ext_features_evt()
4261 if (ev->features[0] & LMP_HOST_SSP) { in hci_remote_ext_features_evt()
4275 if (ev->features[0] & LMP_HOST_SC) in hci_remote_ext_features_evt()
4282 if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { in hci_remote_ext_features_evt()
4293 hci_connect_cfm(conn, ev->status); in hci_remote_ext_features_evt()
4304 struct hci_ev_sync_conn_complete *ev = (void *) skb->data; in hci_sync_conn_complete_evt() local
4307 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_sync_conn_complete_evt()
4311 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_sync_conn_complete_evt()
4313 if (ev->link_type == ESCO_LINK) in hci_sync_conn_complete_evt()
4325 conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); in hci_sync_conn_complete_evt()
4330 switch (ev->status) { in hci_sync_conn_complete_evt()
4347 conn->handle = __le16_to_cpu(ev->handle); in hci_sync_conn_complete_evt()
4349 conn->type = ev->link_type; in hci_sync_conn_complete_evt()
4376 bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode); in hci_sync_conn_complete_evt()
4378 switch (ev->air_mode) { in hci_sync_conn_complete_evt()
4389 hci_connect_cfm(conn, ev->status); in hci_sync_conn_complete_evt()
4390 if (ev->status) in hci_sync_conn_complete_evt()
4467 struct hci_ev_key_refresh_complete *ev = (void *) skb->data; in hci_key_refresh_complete_evt() local
4470 BT_DBG("%s status 0x%2.2x handle 0x%4.4x", hdev->name, ev->status, in hci_key_refresh_complete_evt()
4471 __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
4475 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
4485 if (!ev->status) in hci_key_refresh_complete_evt()
4490 if (ev->status && conn->state == BT_CONNECTED) { in hci_key_refresh_complete_evt()
4497 if (!ev->status) in hci_key_refresh_complete_evt()
4500 hci_connect_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
4503 hci_auth_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
4576 struct hci_ev_io_capa_request *ev = (void *) skb->data; in hci_io_capa_request_evt() local
4583 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_request_evt()
4600 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
4632 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
4645 struct hci_ev_io_capa_reply *ev = (void *) skb->data; in hci_io_capa_reply_evt() local
4652 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_reply_evt()
4656 conn->remote_cap = ev->capability; in hci_io_capa_reply_evt()
4657 conn->remote_auth = ev->authentication; in hci_io_capa_reply_evt()
4666 struct hci_ev_user_confirm_req *ev = (void *) skb->data; in hci_user_confirm_request_evt() local
4677 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_confirm_request_evt()
4693 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
4719 if (hci_find_link_key(hdev, &ev->bdaddr)) { in hci_user_confirm_request_evt()
4736 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
4741 mgmt_user_confirm_request(hdev, &ev->bdaddr, ACL_LINK, 0, in hci_user_confirm_request_evt()
4742 le32_to_cpu(ev->passkey), confirm_hint); in hci_user_confirm_request_evt()
4751 struct hci_ev_user_passkey_req *ev = (void *) skb->data; in hci_user_passkey_request_evt() local
4756 mgmt_user_passkey_request(hdev, &ev->bdaddr, ACL_LINK, 0); in hci_user_passkey_request_evt()
4762 struct hci_ev_user_passkey_notify *ev = (void *) skb->data; in hci_user_passkey_notify_evt() local
4767 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_passkey_notify_evt()
4771 conn->passkey_notify = __le32_to_cpu(ev->passkey); in hci_user_passkey_notify_evt()
4782 struct hci_ev_keypress_notify *ev = (void *) skb->data; in hci_keypress_notify_evt() local
4787 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_keypress_notify_evt()
4791 switch (ev->type) { in hci_keypress_notify_evt()
4821 struct hci_ev_simple_pair_complete *ev = (void *) skb->data; in hci_simple_pair_complete_evt() local
4828 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_simple_pair_complete_evt()
4840 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status) in hci_simple_pair_complete_evt()
4841 mgmt_auth_failed(conn, ev->status); in hci_simple_pair_complete_evt()
4852 struct hci_ev_remote_host_features *ev = (void *) skb->data; in hci_remote_host_features_evt() local
4860 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_host_features_evt()
4862 memcpy(conn->features[1], ev->features, 8); in hci_remote_host_features_evt()
4864 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_remote_host_features_evt()
4866 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_host_features_evt()
4874 struct hci_ev_remote_oob_data_request *ev = (void *) skb->data; in hci_remote_oob_data_request_evt() local
4884 data = hci_find_remote_oob_data(hdev, &ev->bdaddr, BDADDR_BREDR); in hci_remote_oob_data_request_evt()
4888 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4897 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4913 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4928 struct hci_ev_channel_selected *ev = (void *)skb->data; in hci_chan_selected_evt() local
4931 BT_DBG("%s handle 0x%2.2x", hdev->name, ev->phy_handle); in hci_chan_selected_evt()
4933 skb_pull(skb, sizeof(*ev)); in hci_chan_selected_evt()
4935 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_chan_selected_evt()
4945 struct hci_ev_phy_link_complete *ev = (void *) skb->data; in hci_phy_link_complete_evt() local
4948 BT_DBG("%s handle 0x%2.2x status 0x%2.2x", hdev->name, ev->phy_handle, in hci_phy_link_complete_evt()
4949 ev->status); in hci_phy_link_complete_evt()
4953 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_phy_link_complete_evt()
4964 if (ev->status) { in hci_phy_link_complete_evt()
4989 struct hci_ev_logical_link_complete *ev = (void *) skb->data; in hci_loglink_complete_evt() local
4995 hdev->name, le16_to_cpu(ev->handle), ev->phy_handle, in hci_loglink_complete_evt()
4996 ev->status); in hci_loglink_complete_evt()
4998 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_loglink_complete_evt()
5007 hchan->handle = le16_to_cpu(ev->handle); in hci_loglink_complete_evt()
5029 struct hci_ev_disconn_logical_link_complete *ev = (void *) skb->data; in hci_disconn_loglink_complete_evt() local
5033 le16_to_cpu(ev->handle), ev->status); in hci_disconn_loglink_complete_evt()
5035 if (ev->status) in hci_disconn_loglink_complete_evt()
5040 hchan = hci_chan_lookup_handle(hdev, le16_to_cpu(ev->handle)); in hci_disconn_loglink_complete_evt()
5044 amp_destroy_logical_link(hchan, ev->reason); in hci_disconn_loglink_complete_evt()
5053 struct hci_ev_disconn_phy_link_complete *ev = (void *) skb->data; in hci_disconn_phylink_complete_evt() local
5056 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_disconn_phylink_complete_evt()
5058 if (ev->status) in hci_disconn_phylink_complete_evt()
5063 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_disconn_phylink_complete_evt()
5066 hci_disconn_cfm(hcon, ev->reason); in hci_disconn_phylink_complete_evt()
5268 struct hci_ev_le_conn_complete *ev = (void *) skb->data; in hci_le_conn_complete_evt() local
5270 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_conn_complete_evt()
5272 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_conn_complete_evt()
5273 NULL, ev->role, le16_to_cpu(ev->handle), in hci_le_conn_complete_evt()
5274 le16_to_cpu(ev->interval), in hci_le_conn_complete_evt()
5275 le16_to_cpu(ev->latency), in hci_le_conn_complete_evt()
5276 le16_to_cpu(ev->supervision_timeout)); in hci_le_conn_complete_evt()
5282 struct hci_ev_le_enh_conn_complete *ev = (void *) skb->data; in hci_le_enh_conn_complete_evt() local
5284 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_enh_conn_complete_evt()
5286 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_enh_conn_complete_evt()
5287 &ev->local_rpa, ev->role, le16_to_cpu(ev->handle), in hci_le_enh_conn_complete_evt()
5288 le16_to_cpu(ev->interval), in hci_le_enh_conn_complete_evt()
5289 le16_to_cpu(ev->latency), in hci_le_enh_conn_complete_evt()
5290 le16_to_cpu(ev->supervision_timeout)); in hci_le_enh_conn_complete_evt()
5300 struct hci_evt_le_ext_adv_set_term *ev = (void *) skb->data; in hci_le_ext_adv_term_evt() local
5303 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_ext_adv_term_evt()
5305 if (ev->status) { in hci_le_ext_adv_term_evt()
5308 adv = hci_find_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
5313 hci_remove_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
5314 mgmt_advertising_removed(NULL, hdev, ev->handle); in hci_le_ext_adv_term_evt()
5319 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->conn_handle)); in hci_le_ext_adv_term_evt()
5341 struct hci_ev_le_conn_update_complete *ev = (void *) skb->data; in hci_le_conn_update_complete_evt() local
5344 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_conn_update_complete_evt()
5346 if (ev->status) in hci_le_conn_update_complete_evt()
5351 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_conn_update_complete_evt()
5353 conn->le_conn_interval = le16_to_cpu(ev->interval); in hci_le_conn_update_complete_evt()
5354 conn->le_conn_latency = le16_to_cpu(ev->latency); in hci_le_conn_update_complete_evt()
5355 conn->le_supv_timeout = le16_to_cpu(ev->supervision_timeout); in hci_le_conn_update_complete_evt()
5662 struct hci_ev_le_advertising_info *ev = ptr; in hci_le_adv_report_evt() local
5665 if (ptr > (void *)skb_tail_pointer(skb) - sizeof(*ev)) { in hci_le_adv_report_evt()
5670 if (ev->length <= HCI_MAX_AD_LENGTH && in hci_le_adv_report_evt()
5671 ev->data + ev->length <= skb_tail_pointer(skb)) { in hci_le_adv_report_evt()
5672 rssi = ev->data[ev->length]; in hci_le_adv_report_evt()
5673 process_adv_report(hdev, ev->evt_type, &ev->bdaddr, in hci_le_adv_report_evt()
5674 ev->bdaddr_type, NULL, 0, rssi, in hci_le_adv_report_evt()
5675 ev->data, ev->length, false); in hci_le_adv_report_evt()
5680 ptr += sizeof(*ev) + ev->length + 1; in hci_le_adv_report_evt()
5738 struct hci_ev_le_ext_adv_report *ev = ptr; in hci_le_ext_adv_report_evt() local
5742 evt_type = __le16_to_cpu(ev->evt_type); in hci_le_ext_adv_report_evt()
5745 process_adv_report(hdev, legacy_evt_type, &ev->bdaddr, in hci_le_ext_adv_report_evt()
5746 ev->bdaddr_type, NULL, 0, ev->rssi, in hci_le_ext_adv_report_evt()
5747 ev->data, ev->length, in hci_le_ext_adv_report_evt()
5751 ptr += sizeof(*ev) + ev->length; in hci_le_ext_adv_report_evt()
5760 struct hci_ev_le_remote_feat_complete *ev = (void *)skb->data; in hci_le_remote_feat_complete_evt() local
5763 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_remote_feat_complete_evt()
5767 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_remote_feat_complete_evt()
5769 if (!ev->status) in hci_le_remote_feat_complete_evt()
5770 memcpy(conn->features[0], ev->features, 8); in hci_le_remote_feat_complete_evt()
5785 !conn->out && ev->status == 0x1a) in hci_le_remote_feat_complete_evt()
5788 status = ev->status; in hci_le_remote_feat_complete_evt()
5801 struct hci_ev_le_ltk_req *ev = (void *) skb->data; in hci_le_ltk_request_evt() local
5807 BT_DBG("%s handle 0x%4.4x", hdev->name, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
5811 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
5821 if (ev->ediv || ev->rand) in hci_le_ltk_request_evt()
5825 if (ev->ediv != ltk->ediv || ev->rand != ltk->rand) in hci_le_ltk_request_evt()
5858 neg.handle = ev->handle; in hci_le_ltk_request_evt()
5878 struct hci_ev_le_remote_conn_param_req *ev = (void *) skb->data; in hci_le_remote_conn_param_req_evt() local
5883 handle = le16_to_cpu(ev->handle); in hci_le_remote_conn_param_req_evt()
5884 min = le16_to_cpu(ev->interval_min); in hci_le_remote_conn_param_req_evt()
5885 max = le16_to_cpu(ev->interval_max); in hci_le_remote_conn_param_req_evt()
5886 latency = le16_to_cpu(ev->latency); in hci_le_remote_conn_param_req_evt()
5887 timeout = le16_to_cpu(ev->timeout); in hci_le_remote_conn_param_req_evt()
5922 cp.handle = ev->handle; in hci_le_remote_conn_param_req_evt()
5923 cp.interval_min = ev->interval_min; in hci_le_remote_conn_param_req_evt()
5924 cp.interval_max = ev->interval_max; in hci_le_remote_conn_param_req_evt()
5925 cp.latency = ev->latency; in hci_le_remote_conn_param_req_evt()
5926 cp.timeout = ev->timeout; in hci_le_remote_conn_param_req_evt()
5937 struct hci_ev_le_direct_adv_info *ev = (void *)&skb->data[1]; in hci_le_direct_adv_report_evt() local
5939 if (!num_reports || skb->len < num_reports * sizeof(*ev) + 1) in hci_le_direct_adv_report_evt()
5944 for (; num_reports; num_reports--, ev++) in hci_le_direct_adv_report_evt()
5945 process_adv_report(hdev, ev->evt_type, &ev->bdaddr, in hci_le_direct_adv_report_evt()
5946 ev->bdaddr_type, &ev->direct_addr, in hci_le_direct_adv_report_evt()
5947 ev->direct_addr_type, ev->rssi, NULL, 0, in hci_le_direct_adv_report_evt()
5955 struct hci_ev_le_phy_update_complete *ev = (void *) skb->data; in hci_le_phy_update_evt() local
5958 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_phy_update_evt()
5960 if (ev->status) in hci_le_phy_update_evt()
5965 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_phy_update_evt()
5969 conn->le_tx_phy = ev->tx_phy; in hci_le_phy_update_evt()
5970 conn->le_rx_phy = ev->rx_phy; in hci_le_phy_update_evt()
6035 struct hci_ev_cmd_complete *ev; in hci_get_cmd_complete() local
6067 if (skb->len < sizeof(*ev)) { in hci_get_cmd_complete()
6072 ev = (void *) skb->data; in hci_get_cmd_complete()
6073 skb_pull(skb, sizeof(*ev)); in hci_get_cmd_complete()
6075 if (opcode != __le16_to_cpu(ev->opcode)) { in hci_get_cmd_complete()
6077 __le16_to_cpu(ev->opcode)); in hci_get_cmd_complete()