Lines Matching refs:ev

53 			     u8 ev, size_t len)  in hci_ev_skb_pull()  argument
59 bt_dev_err(hdev, "Malformed Event: 0x%2.2x", ev); in hci_ev_skb_pull()
77 u8 ev, size_t len) in hci_le_ev_skb_pull() argument
83 bt_dev_err(hdev, "Malformed LE Event: 0x%2.2x", ev); in hci_le_ev_skb_pull()
3020 struct hci_ev_status *ev = data; in hci_inquiry_complete_evt() local
3024 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_inquiry_complete_evt()
3081 struct hci_ev_inquiry_result *ev = edata; in hci_inquiry_result_evt() local
3086 flex_array_size(ev, info, ev->num))) in hci_inquiry_result_evt()
3089 bt_dev_dbg(hdev, "num %d", ev->num); in hci_inquiry_result_evt()
3091 if (!ev->num) in hci_inquiry_result_evt()
3099 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_evt()
3100 struct inquiry_info *info = &ev->info[i]; in hci_inquiry_result_evt()
3125 struct hci_ev_conn_complete *ev = data; in hci_conn_complete_evt() local
3127 u8 status = ev->status; in hci_conn_complete_evt()
3133 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_conn_complete_evt()
3138 if (ev->status) in hci_conn_complete_evt()
3150 if (ev->link_type == ACL_LINK && in hci_conn_complete_evt()
3152 &ev->bdaddr, in hci_conn_complete_evt()
3154 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, in hci_conn_complete_evt()
3161 if (ev->link_type != SCO_LINK) in hci_conn_complete_evt()
3165 &ev->bdaddr); in hci_conn_complete_evt()
3185 status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); in hci_conn_complete_evt()
3194 !hci_find_link_key(hdev, &ev->bdaddr)) in hci_conn_complete_evt()
3213 cp.handle = ev->handle; in hci_conn_complete_evt()
3223 cp.handle = ev->handle; in hci_conn_complete_evt()
3231 hci_sco_setup(conn, ev->status); in hci_conn_complete_evt()
3236 } else if (ev->link_type == SCO_LINK) { in hci_conn_complete_evt()
3265 struct hci_ev_conn_request *ev = data; in hci_conn_request_evt() local
3271 bt_dev_dbg(hdev, "bdaddr %pMR type 0x%x", &ev->bdaddr, ev->link_type); in hci_conn_request_evt()
3276 if (hdev && !bacmp(&hdev->bdaddr, &ev->bdaddr)) { in hci_conn_request_evt()
3278 &ev->bdaddr); in hci_conn_request_evt()
3279 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3283 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, in hci_conn_request_evt()
3287 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3293 if (hci_bdaddr_list_lookup(&hdev->reject_list, &ev->bdaddr, in hci_conn_request_evt()
3295 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3305 !hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr, in hci_conn_request_evt()
3307 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3313 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_conn_request_evt()
3315 memcpy(ie->data.dev_class, ev->dev_class, 3); in hci_conn_request_evt()
3317 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, in hci_conn_request_evt()
3318 &ev->bdaddr); in hci_conn_request_evt()
3320 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, in hci_conn_request_evt()
3328 memcpy(conn->dev_class, ev->dev_class, 3); in hci_conn_request_evt()
3332 if (ev->link_type == ACL_LINK || in hci_conn_request_evt()
3337 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
3349 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
3389 struct hci_ev_disconn_complete *ev = data; in hci_disconn_complete_evt() local
3395 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_disconn_complete_evt()
3399 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_disconn_complete_evt()
3403 if (ev->status) { in hci_disconn_complete_evt()
3405 conn->dst_type, ev->status); in hci_disconn_complete_evt()
3416 reason = hci_to_mgmt_reason(ev->reason); in hci_disconn_complete_evt()
3432 if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT) in hci_disconn_complete_evt()
3448 hci_disconn_cfm(conn, ev->reason); in hci_disconn_complete_evt()
3474 struct hci_ev_auth_complete *ev = data; in hci_auth_complete_evt() local
3477 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_auth_complete_evt()
3481 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_auth_complete_evt()
3485 if (!ev->status) { in hci_auth_complete_evt()
3496 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_auth_complete_evt()
3499 mgmt_auth_failed(conn, ev->status); in hci_auth_complete_evt()
3506 if (!ev->status && hci_conn_ssp_enabled(conn)) { in hci_auth_complete_evt()
3508 cp.handle = ev->handle; in hci_auth_complete_evt()
3514 hci_connect_cfm(conn, ev->status); in hci_auth_complete_evt()
3518 hci_auth_cfm(conn, ev->status); in hci_auth_complete_evt()
3526 if (!ev->status) { in hci_auth_complete_evt()
3528 cp.handle = ev->handle; in hci_auth_complete_evt()
3534 hci_encrypt_cfm(conn, ev->status); in hci_auth_complete_evt()
3545 struct hci_ev_remote_name *ev = data; in hci_remote_name_evt() local
3548 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_name_evt()
3554 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_name_evt()
3559 if (ev->status == 0) in hci_remote_name_evt()
3560 hci_check_pending_name(hdev, conn, &ev->bdaddr, ev->name, in hci_remote_name_evt()
3561 strnlen(ev->name, HCI_MAX_NAME_LENGTH)); in hci_remote_name_evt()
3563 hci_check_pending_name(hdev, conn, &ev->bdaddr, NULL, 0); in hci_remote_name_evt()
3588 struct hci_ev_encrypt_change *ev = data; in hci_encrypt_change_evt() local
3591 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_encrypt_change_evt()
3595 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_encrypt_change_evt()
3599 if (!ev->status) { in hci_encrypt_change_evt()
3600 if (ev->encrypt) { in hci_encrypt_change_evt()
3610 if ((conn->type == ACL_LINK && ev->encrypt == 0x02) || in hci_encrypt_change_evt()
3622 if (ev->status && conn->type == LE_LINK) { in hci_encrypt_change_evt()
3631 ev->status = HCI_ERROR_AUTH_FAILURE; in hci_encrypt_change_evt()
3633 if (ev->status && conn->state == BT_CONNECTED) { in hci_encrypt_change_evt()
3634 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_encrypt_change_evt()
3640 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3647 if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { in hci_encrypt_change_evt()
3695 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3704 struct hci_ev_change_link_key_complete *ev = data; in hci_change_link_key_complete_evt() local
3707 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_change_link_key_complete_evt()
3711 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_change_link_key_complete_evt()
3713 if (!ev->status) in hci_change_link_key_complete_evt()
3718 hci_key_change_cfm(conn, ev->status); in hci_change_link_key_complete_evt()
3727 struct hci_ev_remote_features *ev = data; in hci_remote_features_evt() local
3730 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_features_evt()
3734 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_features_evt()
3738 if (!ev->status) in hci_remote_features_evt()
3739 memcpy(conn->features[0], ev->features, 8); in hci_remote_features_evt()
3744 if (!ev->status && lmp_ext_feat_capable(hdev) && in hci_remote_features_evt()
3747 cp.handle = ev->handle; in hci_remote_features_evt()
3754 if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { in hci_remote_features_evt()
3765 hci_connect_cfm(conn, ev->status); in hci_remote_features_evt()
4236 struct hci_ev_cmd_complete *ev = data; in hci_cmd_complete_evt() local
4239 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_complete_evt()
4261 handle_cmd_cnt_and_timer(hdev, ev->ncmd); in hci_cmd_complete_evt()
4356 struct hci_ev_cmd_status *ev = data; in hci_cmd_status_evt() local
4359 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_status_evt()
4360 *status = ev->status; in hci_cmd_status_evt()
4366 hci_cs_table[i].func(hdev, ev->status); in hci_cmd_status_evt()
4371 handle_cmd_cnt_and_timer(hdev, ev->ncmd); in hci_cmd_status_evt()
4379 if (ev->status || (hdev->sent_cmd && !hci_skb_event(hdev->sent_cmd))) { in hci_cmd_status_evt()
4380 hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, in hci_cmd_status_evt()
4396 struct hci_ev_hardware_error *ev = data; in hci_hardware_error_evt() local
4398 bt_dev_dbg(hdev, "code 0x%2.2x", ev->code); in hci_hardware_error_evt()
4400 hdev->hw_error_code = ev->code; in hci_hardware_error_evt()
4408 struct hci_ev_role_change *ev = data; in hci_role_change_evt() local
4411 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_role_change_evt()
4415 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_role_change_evt()
4417 if (!ev->status) in hci_role_change_evt()
4418 conn->role = ev->role; in hci_role_change_evt()
4422 hci_role_switch_cfm(conn, ev->status, ev->role); in hci_role_change_evt()
4431 struct hci_ev_num_comp_pkts *ev = data; in hci_num_comp_pkts_evt() local
4435 flex_array_size(ev, handles, ev->num))) in hci_num_comp_pkts_evt()
4443 bt_dev_dbg(hdev, "num %d", ev->num); in hci_num_comp_pkts_evt()
4445 for (i = 0; i < ev->num; i++) { in hci_num_comp_pkts_evt()
4446 struct hci_comp_pkts_info *info = &ev->handles[i]; in hci_num_comp_pkts_evt()
4534 struct hci_ev_num_comp_blocks *ev = data; in hci_num_comp_blocks_evt() local
4538 flex_array_size(ev, handles, ev->num_hndl))) in hci_num_comp_blocks_evt()
4547 bt_dev_dbg(hdev, "num_blocks %d num_hndl %d", ev->num_blocks, in hci_num_comp_blocks_evt()
4548 ev->num_hndl); in hci_num_comp_blocks_evt()
4550 for (i = 0; i < ev->num_hndl; i++) { in hci_num_comp_blocks_evt()
4551 struct hci_comp_blocks_info *info = &ev->handles[i]; in hci_num_comp_blocks_evt()
4585 struct hci_ev_mode_change *ev = data; in hci_mode_change_evt() local
4588 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_mode_change_evt()
4592 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_mode_change_evt()
4594 conn->mode = ev->mode; in hci_mode_change_evt()
4605 hci_sco_setup(conn, ev->status); in hci_mode_change_evt()
4614 struct hci_ev_pin_code_req *ev = data; in hci_pin_code_request_evt() local
4621 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_pin_code_request_evt()
4634 sizeof(ev->bdaddr), &ev->bdaddr); in hci_pin_code_request_evt()
4643 mgmt_pin_code_request(hdev, &ev->bdaddr, secure); in hci_pin_code_request_evt()
4685 struct hci_ev_link_key_req *ev = data; in hci_link_key_request_evt() local
4697 key = hci_find_link_key(hdev, &ev->bdaddr); in hci_link_key_request_evt()
4699 bt_dev_dbg(hdev, "link key not found for %pMR", &ev->bdaddr); in hci_link_key_request_evt()
4703 bt_dev_dbg(hdev, "found key type %u for %pMR", key->type, &ev->bdaddr); in hci_link_key_request_evt()
4705 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_request_evt()
4726 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_link_key_request_evt()
4736 hci_send_cmd(hdev, HCI_OP_LINK_KEY_NEG_REPLY, 6, &ev->bdaddr); in hci_link_key_request_evt()
4743 struct hci_ev_link_key_notify *ev = data; in hci_link_key_notify_evt() local
4753 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_notify_evt()
4758 if (!crypto_memneq(ev->link_key, ZERO_KEY, HCI_LINK_KEY_SIZE)) { in hci_link_key_notify_evt()
4760 &ev->bdaddr); in hci_link_key_notify_evt()
4771 conn_set_key(conn, ev->key_type, conn->pin_length); in hci_link_key_notify_evt()
4776 key = hci_add_link_key(hdev, conn, &ev->bdaddr, ev->link_key, in hci_link_key_notify_evt()
4777 ev->key_type, pin_len, &persistent); in hci_link_key_notify_evt()
4784 if (ev->key_type == HCI_LK_CHANGED_COMBINATION) in hci_link_key_notify_evt()
4813 struct hci_ev_clock_offset *ev = data; in hci_clock_offset_evt() local
4816 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_clock_offset_evt()
4820 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_clock_offset_evt()
4821 if (conn && !ev->status) { in hci_clock_offset_evt()
4826 ie->data.clock_offset = ev->clock_offset; in hci_clock_offset_evt()
4837 struct hci_ev_pkt_type_change *ev = data; in hci_pkt_type_change_evt() local
4840 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_pkt_type_change_evt()
4844 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_pkt_type_change_evt()
4845 if (conn && !ev->status) in hci_pkt_type_change_evt()
4846 conn->pkt_type = __le16_to_cpu(ev->pkt_type); in hci_pkt_type_change_evt()
4854 struct hci_ev_pscan_rep_mode *ev = data; in hci_pscan_rep_mode_evt() local
4861 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_pscan_rep_mode_evt()
4863 ie->data.pscan_rep_mode = ev->pscan_rep_mode; in hci_pscan_rep_mode_evt()
4873 struct hci_ev_inquiry_result_rssi *ev = edata; in hci_inquiry_result_with_rssi_evt() local
4877 bt_dev_dbg(hdev, "num_rsp %d", ev->num); in hci_inquiry_result_with_rssi_evt()
4879 if (!ev->num) in hci_inquiry_result_with_rssi_evt()
4887 if (skb->len == array_size(ev->num, in hci_inquiry_result_with_rssi_evt()
4891 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_with_rssi_evt()
4918 } else if (skb->len == array_size(ev->num, in hci_inquiry_result_with_rssi_evt()
4922 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_with_rssi_evt()
4960 struct hci_ev_remote_ext_features *ev = data; in hci_remote_ext_features_evt() local
4963 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_ext_features_evt()
4967 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_ext_features_evt()
4971 if (ev->page < HCI_MAX_PAGES) in hci_remote_ext_features_evt()
4972 memcpy(conn->features[ev->page], ev->features, 8); in hci_remote_ext_features_evt()
4974 if (!ev->status && ev->page == 0x01) { in hci_remote_ext_features_evt()
4979 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_ext_features_evt()
4981 if (ev->features[0] & LMP_HOST_SSP) { in hci_remote_ext_features_evt()
4995 if (ev->features[0] & LMP_HOST_SC) in hci_remote_ext_features_evt()
5002 if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { in hci_remote_ext_features_evt()
5013 hci_connect_cfm(conn, ev->status); in hci_remote_ext_features_evt()
5024 struct hci_ev_sync_conn_complete *ev = data; in hci_sync_conn_complete_evt() local
5026 u8 status = ev->status; in hci_sync_conn_complete_evt()
5028 switch (ev->link_type) { in hci_sync_conn_complete_evt()
5045 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_sync_conn_complete_evt()
5047 if (ev->link_type == ESCO_LINK) in hci_sync_conn_complete_evt()
5059 conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); in hci_sync_conn_complete_evt()
5077 status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); in hci_sync_conn_complete_evt()
5084 conn->type = ev->link_type; in hci_sync_conn_complete_evt()
5111 bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode); in hci_sync_conn_complete_evt()
5116 switch (ev->air_mode) { in hci_sync_conn_complete_evt()
5154 struct hci_ev_ext_inquiry_result *ev = edata; in hci_extended_inquiry_result_evt() local
5160 flex_array_size(ev, info, ev->num))) in hci_extended_inquiry_result_evt()
5163 bt_dev_dbg(hdev, "num %d", ev->num); in hci_extended_inquiry_result_evt()
5165 if (!ev->num) in hci_extended_inquiry_result_evt()
5173 for (i = 0; i < ev->num; i++) { in hci_extended_inquiry_result_evt()
5174 struct extended_inquiry_info *info = &ev->info[i]; in hci_extended_inquiry_result_evt()
5209 struct hci_ev_key_refresh_complete *ev = data; in hci_key_refresh_complete_evt() local
5212 bt_dev_dbg(hdev, "status 0x%2.2x handle 0x%4.4x", ev->status, in hci_key_refresh_complete_evt()
5213 __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
5217 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
5227 if (!ev->status) in hci_key_refresh_complete_evt()
5232 if (ev->status && conn->state == BT_CONNECTED) { in hci_key_refresh_complete_evt()
5239 if (!ev->status) in hci_key_refresh_complete_evt()
5242 hci_connect_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
5245 hci_auth_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
5319 struct hci_ev_io_capa_request *ev = data; in hci_io_capa_request_evt() local
5326 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_request_evt()
5343 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
5375 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
5389 struct hci_ev_io_capa_reply *ev = data; in hci_io_capa_reply_evt() local
5396 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_reply_evt()
5400 conn->remote_cap = ev->capability; in hci_io_capa_reply_evt()
5401 conn->remote_auth = ev->authentication; in hci_io_capa_reply_evt()
5410 struct hci_ev_user_confirm_req *ev = data; in hci_user_confirm_request_evt() local
5421 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_confirm_request_evt()
5437 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
5463 if (hci_find_link_key(hdev, &ev->bdaddr)) { in hci_user_confirm_request_evt()
5480 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
5485 mgmt_user_confirm_request(hdev, &ev->bdaddr, ACL_LINK, 0, in hci_user_confirm_request_evt()
5486 le32_to_cpu(ev->passkey), confirm_hint); in hci_user_confirm_request_evt()
5495 struct hci_ev_user_passkey_req *ev = data; in hci_user_passkey_request_evt() local
5500 mgmt_user_passkey_request(hdev, &ev->bdaddr, ACL_LINK, 0); in hci_user_passkey_request_evt()
5506 struct hci_ev_user_passkey_notify *ev = data; in hci_user_passkey_notify_evt() local
5511 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_passkey_notify_evt()
5515 conn->passkey_notify = __le32_to_cpu(ev->passkey); in hci_user_passkey_notify_evt()
5527 struct hci_ev_keypress_notify *ev = data; in hci_keypress_notify_evt() local
5532 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_keypress_notify_evt()
5536 switch (ev->type) { in hci_keypress_notify_evt()
5566 struct hci_ev_simple_pair_complete *ev = data; in hci_simple_pair_complete_evt() local
5573 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_simple_pair_complete_evt()
5585 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status) in hci_simple_pair_complete_evt()
5586 mgmt_auth_failed(conn, ev->status); in hci_simple_pair_complete_evt()
5597 struct hci_ev_remote_host_features *ev = data; in hci_remote_host_features_evt() local
5605 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_host_features_evt()
5607 memcpy(conn->features[1], ev->features, 8); in hci_remote_host_features_evt()
5609 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_remote_host_features_evt()
5611 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_host_features_evt()
5619 struct hci_ev_remote_oob_data_request *ev = edata; in hci_remote_oob_data_request_evt() local
5629 data = hci_find_remote_oob_data(hdev, &ev->bdaddr, BDADDR_BREDR); in hci_remote_oob_data_request_evt()
5633 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5642 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5658 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5674 struct hci_ev_channel_selected *ev = data; in hci_chan_selected_evt() local
5677 bt_dev_dbg(hdev, "handle 0x%2.2x", ev->phy_handle); in hci_chan_selected_evt()
5679 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_chan_selected_evt()
5689 struct hci_ev_phy_link_complete *ev = data; in hci_phy_link_complete_evt() local
5692 bt_dev_dbg(hdev, "handle 0x%2.2x status 0x%2.2x", ev->phy_handle, in hci_phy_link_complete_evt()
5693 ev->status); in hci_phy_link_complete_evt()
5697 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_phy_link_complete_evt()
5704 if (ev->status) { in hci_phy_link_complete_evt()
5730 struct hci_ev_logical_link_complete *ev = data; in hci_loglink_complete_evt() local
5736 le16_to_cpu(ev->handle), ev->phy_handle, ev->status); in hci_loglink_complete_evt()
5738 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_loglink_complete_evt()
5747 hchan->handle = le16_to_cpu(ev->handle); in hci_loglink_complete_evt()
5769 struct hci_ev_disconn_logical_link_complete *ev = data; in hci_disconn_loglink_complete_evt() local
5773 le16_to_cpu(ev->handle), ev->status); in hci_disconn_loglink_complete_evt()
5775 if (ev->status) in hci_disconn_loglink_complete_evt()
5780 hchan = hci_chan_lookup_handle(hdev, le16_to_cpu(ev->handle)); in hci_disconn_loglink_complete_evt()
5784 amp_destroy_logical_link(hchan, ev->reason); in hci_disconn_loglink_complete_evt()
5793 struct hci_ev_disconn_phy_link_complete *ev = data; in hci_disconn_phylink_complete_evt() local
5796 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_disconn_phylink_complete_evt()
5798 if (ev->status) in hci_disconn_phylink_complete_evt()
5803 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); in hci_disconn_phylink_complete_evt()
5806 hci_disconn_cfm(hcon, ev->reason); in hci_disconn_phylink_complete_evt()
6049 struct hci_ev_le_conn_complete *ev = data; in hci_le_conn_complete_evt() local
6051 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_conn_complete_evt()
6053 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_conn_complete_evt()
6054 NULL, ev->role, le16_to_cpu(ev->handle), in hci_le_conn_complete_evt()
6055 le16_to_cpu(ev->interval), in hci_le_conn_complete_evt()
6056 le16_to_cpu(ev->latency), in hci_le_conn_complete_evt()
6057 le16_to_cpu(ev->supervision_timeout)); in hci_le_conn_complete_evt()
6063 struct hci_ev_le_enh_conn_complete *ev = data; in hci_le_enh_conn_complete_evt() local
6065 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_enh_conn_complete_evt()
6067 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_enh_conn_complete_evt()
6068 &ev->local_rpa, ev->role, le16_to_cpu(ev->handle), in hci_le_enh_conn_complete_evt()
6069 le16_to_cpu(ev->interval), in hci_le_enh_conn_complete_evt()
6070 le16_to_cpu(ev->latency), in hci_le_enh_conn_complete_evt()
6071 le16_to_cpu(ev->supervision_timeout)); in hci_le_enh_conn_complete_evt()
6077 struct hci_evt_le_ext_adv_set_term *ev = data; in hci_le_ext_adv_term_evt() local
6081 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_ext_adv_term_evt()
6090 if (ev->status == HCI_ERROR_CANCELLED_BY_HOST) { in hci_le_ext_adv_term_evt()
6097 adv = hci_find_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
6099 if (ev->status) { in hci_le_ext_adv_term_evt()
6104 hci_remove_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
6105 mgmt_advertising_removed(NULL, hdev, ev->handle); in hci_le_ext_adv_term_evt()
6120 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->conn_handle)); in hci_le_ext_adv_term_evt()
6125 conn->adv_instance = ev->handle; in hci_le_ext_adv_term_evt()
6131 if (!ev->handle) { in hci_le_ext_adv_term_evt()
6147 struct hci_ev_le_conn_update_complete *ev = data; in hci_le_conn_update_complete_evt() local
6150 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_conn_update_complete_evt()
6152 if (ev->status) in hci_le_conn_update_complete_evt()
6157 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_conn_update_complete_evt()
6159 conn->le_conn_interval = le16_to_cpu(ev->interval); in hci_le_conn_update_complete_evt()
6160 conn->le_conn_latency = le16_to_cpu(ev->latency); in hci_le_conn_update_complete_evt()
6161 conn->le_supv_timeout = le16_to_cpu(ev->supervision_timeout); in hci_le_conn_update_complete_evt()
6471 struct hci_ev_le_advertising_report *ev = data; in hci_le_adv_report_evt() local
6474 if (!ev->num) in hci_le_adv_report_evt()
6479 while (ev->num--) { in hci_le_adv_report_evt()
6554 struct hci_ev_le_ext_adv_report *ev = data; in hci_le_ext_adv_report_evt() local
6557 if (!ev->num) in hci_le_ext_adv_report_evt()
6562 while (ev->num--) { in hci_le_ext_adv_report_evt()
6603 struct hci_ev_le_pa_sync_established *ev = data; in hci_le_pa_sync_estabilished_evt() local
6608 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_pa_sync_estabilished_evt()
6614 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ISO_LINK, &flags); in hci_le_pa_sync_estabilished_evt()
6616 hci_le_pa_term_sync(hdev, ev->handle); in hci_le_pa_sync_estabilished_evt()
6630 if (ev->status) in hci_le_pa_sync_estabilished_evt()
6636 hci_connect_cfm(bis, ev->status); in hci_le_pa_sync_estabilished_evt()
6645 struct hci_ev_le_per_adv_report *ev = data; in hci_le_per_adv_report_evt() local
6649 bt_dev_dbg(hdev, "sync_handle 0x%4.4x", le16_to_cpu(ev->sync_handle)); in hci_le_per_adv_report_evt()
6655 hci_le_pa_term_sync(hdev, ev->sync_handle); in hci_le_per_adv_report_evt()
6663 struct hci_ev_le_remote_feat_complete *ev = data; in hci_le_remote_feat_complete_evt() local
6666 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_remote_feat_complete_evt()
6670 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_remote_feat_complete_evt()
6672 if (!ev->status) in hci_le_remote_feat_complete_evt()
6673 memcpy(conn->features[0], ev->features, 8); in hci_le_remote_feat_complete_evt()
6687 if (!conn->out && ev->status == 0x1a && in hci_le_remote_feat_complete_evt()
6691 status = ev->status; in hci_le_remote_feat_complete_evt()
6705 struct hci_ev_le_ltk_req *ev = data; in hci_le_ltk_request_evt() local
6711 bt_dev_dbg(hdev, "handle 0x%4.4x", __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
6715 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
6725 if (ev->ediv || ev->rand) in hci_le_ltk_request_evt()
6729 if (ev->ediv != ltk->ediv || ev->rand != ltk->rand) in hci_le_ltk_request_evt()
6762 neg.handle = ev->handle; in hci_le_ltk_request_evt()
6782 struct hci_ev_le_remote_conn_param_req *ev = data; in hci_le_remote_conn_param_req_evt() local
6787 bt_dev_dbg(hdev, "handle 0x%4.4x", __le16_to_cpu(ev->handle)); in hci_le_remote_conn_param_req_evt()
6789 handle = le16_to_cpu(ev->handle); in hci_le_remote_conn_param_req_evt()
6790 min = le16_to_cpu(ev->interval_min); in hci_le_remote_conn_param_req_evt()
6791 max = le16_to_cpu(ev->interval_max); in hci_le_remote_conn_param_req_evt()
6792 latency = le16_to_cpu(ev->latency); in hci_le_remote_conn_param_req_evt()
6793 timeout = le16_to_cpu(ev->timeout); in hci_le_remote_conn_param_req_evt()
6828 cp.handle = ev->handle; in hci_le_remote_conn_param_req_evt()
6829 cp.interval_min = ev->interval_min; in hci_le_remote_conn_param_req_evt()
6830 cp.interval_max = ev->interval_max; in hci_le_remote_conn_param_req_evt()
6831 cp.latency = ev->latency; in hci_le_remote_conn_param_req_evt()
6832 cp.timeout = ev->timeout; in hci_le_remote_conn_param_req_evt()
6842 struct hci_ev_le_direct_adv_report *ev = data; in hci_le_direct_adv_report_evt() local
6847 flex_array_size(ev, info, ev->num))) in hci_le_direct_adv_report_evt()
6850 if (!ev->num) in hci_le_direct_adv_report_evt()
6855 for (i = 0; i < ev->num; i++) { in hci_le_direct_adv_report_evt()
6856 struct hci_ev_le_direct_adv_info *info = &ev->info[i]; in hci_le_direct_adv_report_evt()
6870 struct hci_ev_le_phy_update_complete *ev = data; in hci_le_phy_update_evt() local
6873 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_phy_update_evt()
6875 if (ev->status) in hci_le_phy_update_evt()
6880 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_phy_update_evt()
6884 conn->le_tx_phy = ev->tx_phy; in hci_le_phy_update_evt()
6885 conn->le_rx_phy = ev->rx_phy; in hci_le_phy_update_evt()
6894 struct hci_evt_le_cis_established *ev = data; in hci_le_cis_estabilished_evt() local
6898 u16 handle = __le16_to_cpu(ev->handle); in hci_le_cis_estabilished_evt()
6900 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_cis_estabilished_evt()
6924 qos->ucast.in.interval = le16_to_cpu(ev->interval) * 1250; in hci_le_cis_estabilished_evt()
6931 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency), in hci_le_cis_estabilished_evt()
6934 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency), in hci_le_cis_estabilished_evt()
6936 qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu); in hci_le_cis_estabilished_evt()
6937 qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu); in hci_le_cis_estabilished_evt()
6938 qos->ucast.in.phy = ev->c_phy; in hci_le_cis_estabilished_evt()
6939 qos->ucast.out.phy = ev->p_phy; in hci_le_cis_estabilished_evt()
6944 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency), in hci_le_cis_estabilished_evt()
6947 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency), in hci_le_cis_estabilished_evt()
6949 qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu); in hci_le_cis_estabilished_evt()
6950 qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu); in hci_le_cis_estabilished_evt()
6951 qos->ucast.out.phy = ev->c_phy; in hci_le_cis_estabilished_evt()
6952 qos->ucast.in.phy = ev->p_phy; in hci_le_cis_estabilished_evt()
6956 if (!ev->status) { in hci_le_cis_estabilished_evt()
6965 hci_connect_cfm(conn, ev->status); in hci_le_cis_estabilished_evt()
6997 struct hci_evt_le_cis_req *ev = data; in hci_le_cis_req_evt() local
7003 acl_handle = __le16_to_cpu(ev->acl_handle); in hci_le_cis_req_evt()
7004 cis_handle = __le16_to_cpu(ev->cis_handle); in hci_le_cis_req_evt()
7007 acl_handle, cis_handle, ev->cig_id, ev->cis_id); in hci_le_cis_req_evt()
7017 hci_le_reject_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
7025 hci_le_reject_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
7031 cis->iso_qos.ucast.cig = ev->cig_id; in hci_le_cis_req_evt()
7032 cis->iso_qos.ucast.cis = ev->cis_id; in hci_le_cis_req_evt()
7035 hci_le_accept_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
7056 struct hci_evt_le_create_big_complete *ev = data; in hci_le_create_big_complete_evt() local
7060 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_create_big_complete_evt()
7063 flex_array_size(ev, bis_handle, ev->num_bis))) in hci_le_create_big_complete_evt()
7073 conn->iso_qos.bcast.big != ev->handle) in hci_le_create_big_complete_evt()
7077 __le16_to_cpu(ev->bis_handle[i++]))) in hci_le_create_big_complete_evt()
7080 if (!ev->status) { in hci_le_create_big_complete_evt()
7091 hci_connect_cfm(conn, ev->status); in hci_le_create_big_complete_evt()
7099 if (!ev->status && !i) in hci_le_create_big_complete_evt()
7106 UINT_PTR(ev->handle), NULL); in hci_le_create_big_complete_evt()
7114 struct hci_evt_le_big_sync_estabilished *ev = data; in hci_le_big_sync_established_evt() local
7119 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_big_sync_established_evt()
7122 flex_array_size(ev, bis, ev->num_bis))) in hci_le_big_sync_established_evt()
7127 if (!ev->status) { in hci_le_big_sync_established_evt()
7128 pa_sync = hci_conn_hash_lookup_pa_sync(hdev, ev->handle); in hci_le_big_sync_established_evt()
7136 for (i = 0; i < ev->num_bis; i++) { in hci_le_big_sync_established_evt()
7137 u16 handle = le16_to_cpu(ev->bis[i]); in hci_le_big_sync_established_evt()
7149 if (ev->status != 0x42) in hci_le_big_sync_established_evt()
7153 bis->iso_qos.bcast.big = ev->handle; in hci_le_big_sync_established_evt()
7155 memcpy(&interval, ev->latency, sizeof(ev->latency)); in hci_le_big_sync_established_evt()
7158 bis->iso_qos.bcast.in.latency = le16_to_cpu(ev->interval) * 125 / 100; in hci_le_big_sync_established_evt()
7159 bis->iso_qos.bcast.in.sdu = le16_to_cpu(ev->max_pdu); in hci_le_big_sync_established_evt()
7161 if (!ev->status) { in hci_le_big_sync_established_evt()
7170 if (ev->status) in hci_le_big_sync_established_evt()
7171 for (i = 0; i < ev->num_bis; i++) { in hci_le_big_sync_established_evt()
7172 u16 handle = le16_to_cpu(ev->bis[i]); in hci_le_big_sync_established_evt()
7177 hci_connect_cfm(bis, ev->status); in hci_le_big_sync_established_evt()
7186 struct hci_evt_le_big_info_adv_report *ev = data; in hci_le_big_info_adv_report_evt() local
7190 bt_dev_dbg(hdev, "sync_handle 0x%4.4x", le16_to_cpu(ev->sync_handle)); in hci_le_big_info_adv_report_evt()
7196 hci_le_pa_term_sync(hdev, ev->sync_handle); in hci_le_big_info_adv_report_evt()
7301 struct hci_ev_le_meta *ev = data; in hci_le_meta_evt() local
7304 bt_dev_dbg(hdev, "subevent 0x%2.2x", ev->subevent); in hci_le_meta_evt()
7309 hci_skb_event(hdev->sent_cmd) == ev->subevent) { in hci_le_meta_evt()
7315 subev = &hci_le_ev_table[ev->subevent]; in hci_le_meta_evt()
7321 ev->subevent, skb->len, subev->min_len); in hci_le_meta_evt()
7331 ev->subevent, skb->len, subev->max_len); in hci_le_meta_evt()
7332 data = hci_le_ev_skb_pull(hdev, skb, ev->subevent, subev->min_len); in hci_le_meta_evt()
7342 struct hci_ev_cmd_complete *ev; in hci_get_cmd_complete() local
7370 ev = hci_cc_skb_pull(hdev, skb, opcode, sizeof(*ev)); in hci_get_cmd_complete()
7371 if (!ev) in hci_get_cmd_complete()
7374 if (opcode != __le16_to_cpu(ev->opcode)) { in hci_get_cmd_complete()
7376 __le16_to_cpu(ev->opcode)); in hci_get_cmd_complete()
7640 const struct hci_ev *ev = &hci_ev_table[event]; in hci_event_func() local
7643 if (!ev->func) in hci_event_func()
7646 if (skb->len < ev->min_len) { in hci_event_func()
7648 event, skb->len, ev->min_len); in hci_event_func()
7656 if (skb->len > ev->max_len) in hci_event_func()
7659 event, skb->len, ev->max_len); in hci_event_func()
7661 data = hci_ev_skb_pull(hdev, skb, event, ev->min_len); in hci_event_func()
7665 if (ev->req) in hci_event_func()
7666 ev->func_req(hdev, data, skb, opcode, status, req_complete, in hci_event_func()
7669 ev->func(hdev, data, skb); in hci_event_func()