Lines Matching refs:ev
48 u8 ev, size_t len) in hci_ev_skb_pull() argument
54 bt_dev_err(hdev, "Malformed Event: 0x%2.2x", ev); in hci_ev_skb_pull()
72 u8 ev, size_t len) in hci_le_ev_skb_pull() argument
78 bt_dev_err(hdev, "Malformed LE Event: 0x%2.2x", ev); in hci_le_ev_skb_pull()
2945 struct hci_ev_status *ev = data; in hci_inquiry_complete_evt() local
2949 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_inquiry_complete_evt()
3004 struct hci_ev_inquiry_result *ev = edata; in hci_inquiry_result_evt() local
3009 flex_array_size(ev, info, ev->num))) in hci_inquiry_result_evt()
3012 bt_dev_dbg(hdev, "num %d", ev->num); in hci_inquiry_result_evt()
3014 if (!ev->num) in hci_inquiry_result_evt()
3022 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_evt()
3023 struct inquiry_info *info = &ev->info[i]; in hci_inquiry_result_evt()
3076 struct hci_ev_conn_complete *ev = data; in hci_conn_complete_evt() local
3078 u8 status = ev->status; in hci_conn_complete_evt()
3084 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_conn_complete_evt()
3089 if (ev->status) in hci_conn_complete_evt()
3101 if (ev->link_type == ACL_LINK && in hci_conn_complete_evt()
3103 &ev->bdaddr, in hci_conn_complete_evt()
3105 conn = hci_conn_add_unset(hdev, ev->link_type, in hci_conn_complete_evt()
3106 &ev->bdaddr, HCI_ROLE_SLAVE); in hci_conn_complete_evt()
3112 if (ev->link_type != SCO_LINK) in hci_conn_complete_evt()
3116 &ev->bdaddr); in hci_conn_complete_evt()
3136 status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); in hci_conn_complete_evt()
3145 !hci_find_link_key(hdev, &ev->bdaddr)) in hci_conn_complete_evt()
3162 if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, &conn->flags) && in hci_conn_complete_evt()
3163 ev->link_type == ACL_LINK) { in hci_conn_complete_evt()
3166 key = hci_find_link_key(hdev, &ev->bdaddr); in hci_conn_complete_evt()
3170 hci_encrypt_cfm(conn, ev->status); in hci_conn_complete_evt()
3177 cp.handle = ev->handle; in hci_conn_complete_evt()
3187 cp.handle = ev->handle; in hci_conn_complete_evt()
3195 hci_sco_setup(conn, ev->status); in hci_conn_complete_evt()
3200 } else if (ev->link_type == SCO_LINK) { in hci_conn_complete_evt()
3227 struct hci_ev_conn_request *ev = data; in hci_conn_request_evt() local
3233 bt_dev_dbg(hdev, "bdaddr %pMR type 0x%x", &ev->bdaddr, ev->link_type); in hci_conn_request_evt()
3238 if (hdev && !bacmp(&hdev->bdaddr, &ev->bdaddr)) { in hci_conn_request_evt()
3240 &ev->bdaddr); in hci_conn_request_evt()
3241 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3245 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, in hci_conn_request_evt()
3249 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3255 if (hci_bdaddr_list_lookup(&hdev->reject_list, &ev->bdaddr, in hci_conn_request_evt()
3257 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3267 !hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr, in hci_conn_request_evt()
3269 hci_reject_conn(hdev, &ev->bdaddr); in hci_conn_request_evt()
3275 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_conn_request_evt()
3277 memcpy(ie->data.dev_class, ev->dev_class, 3); in hci_conn_request_evt()
3279 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, in hci_conn_request_evt()
3280 &ev->bdaddr); in hci_conn_request_evt()
3282 conn = hci_conn_add_unset(hdev, ev->link_type, &ev->bdaddr, in hci_conn_request_evt()
3290 memcpy(conn->dev_class, ev->dev_class, 3); in hci_conn_request_evt()
3294 if (ev->link_type == ACL_LINK || in hci_conn_request_evt()
3299 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
3311 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
3351 struct hci_ev_disconn_complete *ev = data; in hci_disconn_complete_evt() local
3357 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_disconn_complete_evt()
3361 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_disconn_complete_evt()
3365 if (ev->status) { in hci_disconn_complete_evt()
3367 conn->dst_type, ev->status); in hci_disconn_complete_evt()
3378 reason = hci_to_mgmt_reason(ev->reason); in hci_disconn_complete_evt()
3399 if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT) in hci_disconn_complete_evt()
3417 hci_disconn_cfm(conn, ev->reason); in hci_disconn_complete_evt()
3443 struct hci_ev_auth_complete *ev = data; in hci_auth_complete_evt() local
3446 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_auth_complete_evt()
3450 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_auth_complete_evt()
3454 if (!ev->status) { in hci_auth_complete_evt()
3459 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_auth_complete_evt()
3462 mgmt_auth_failed(conn, ev->status); in hci_auth_complete_evt()
3468 if (!ev->status && hci_conn_ssp_enabled(conn)) { in hci_auth_complete_evt()
3470 cp.handle = ev->handle; in hci_auth_complete_evt()
3476 hci_connect_cfm(conn, ev->status); in hci_auth_complete_evt()
3480 hci_auth_cfm(conn, ev->status); in hci_auth_complete_evt()
3488 if (!ev->status) { in hci_auth_complete_evt()
3490 cp.handle = ev->handle; in hci_auth_complete_evt()
3496 hci_encrypt_cfm(conn, ev->status); in hci_auth_complete_evt()
3507 struct hci_ev_remote_name *ev = data; in hci_remote_name_evt() local
3510 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_name_evt()
3514 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_name_evt()
3519 if (ev->status == 0) in hci_remote_name_evt()
3520 hci_check_pending_name(hdev, conn, &ev->bdaddr, ev->name, in hci_remote_name_evt()
3521 strnlen(ev->name, HCI_MAX_NAME_LENGTH)); in hci_remote_name_evt()
3523 hci_check_pending_name(hdev, conn, &ev->bdaddr, NULL, 0); in hci_remote_name_evt()
3548 struct hci_ev_encrypt_change *ev = data; in hci_encrypt_change_evt() local
3551 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_encrypt_change_evt()
3555 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_encrypt_change_evt()
3559 if (!ev->status) { in hci_encrypt_change_evt()
3560 if (ev->encrypt) { in hci_encrypt_change_evt()
3570 if ((conn->type == ACL_LINK && ev->encrypt == 0x02) || in hci_encrypt_change_evt()
3582 if (ev->status && conn->type == LE_LINK) { in hci_encrypt_change_evt()
3591 ev->status = HCI_ERROR_AUTH_FAILURE; in hci_encrypt_change_evt()
3593 if (ev->status && conn->state == BT_CONNECTED) { in hci_encrypt_change_evt()
3594 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) in hci_encrypt_change_evt()
3600 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3607 if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { in hci_encrypt_change_evt()
3641 hci_encrypt_cfm(conn, ev->status); in hci_encrypt_change_evt()
3650 struct hci_ev_change_link_key_complete *ev = data; in hci_change_link_key_complete_evt() local
3653 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_change_link_key_complete_evt()
3657 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_change_link_key_complete_evt()
3659 if (!ev->status) in hci_change_link_key_complete_evt()
3664 hci_key_change_cfm(conn, ev->status); in hci_change_link_key_complete_evt()
3673 struct hci_ev_remote_features *ev = data; in hci_remote_features_evt() local
3676 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_features_evt()
3680 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_features_evt()
3684 if (!ev->status) in hci_remote_features_evt()
3685 memcpy(conn->features[0], ev->features, 8); in hci_remote_features_evt()
3690 if (!ev->status && lmp_ext_feat_capable(hdev) && in hci_remote_features_evt()
3693 cp.handle = ev->handle; in hci_remote_features_evt()
3700 if (!ev->status) { in hci_remote_features_evt()
3712 hci_connect_cfm(conn, ev->status); in hci_remote_features_evt()
4183 struct hci_ev_cmd_complete *ev = data; in hci_cmd_complete_evt() local
4186 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_complete_evt()
4208 handle_cmd_cnt_and_timer(hdev, ev->ncmd); in hci_cmd_complete_evt()
4304 struct hci_ev_cmd_status *ev = data; in hci_cmd_status_evt() local
4307 *opcode = __le16_to_cpu(ev->opcode); in hci_cmd_status_evt()
4308 *status = ev->status; in hci_cmd_status_evt()
4314 hci_cs_table[i].func(hdev, ev->status); in hci_cmd_status_evt()
4319 handle_cmd_cnt_and_timer(hdev, ev->ncmd); in hci_cmd_status_evt()
4327 if (ev->status || (hdev->req_skb && !hci_skb_event(hdev->req_skb))) { in hci_cmd_status_evt()
4328 hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, in hci_cmd_status_evt()
4344 struct hci_ev_hardware_error *ev = data; in hci_hardware_error_evt() local
4346 bt_dev_dbg(hdev, "code 0x%2.2x", ev->code); in hci_hardware_error_evt()
4348 hdev->hw_error_code = ev->code; in hci_hardware_error_evt()
4356 struct hci_ev_role_change *ev = data; in hci_role_change_evt() local
4359 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_role_change_evt()
4363 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_role_change_evt()
4365 if (!ev->status) in hci_role_change_evt()
4366 conn->role = ev->role; in hci_role_change_evt()
4370 hci_role_switch_cfm(conn, ev->status, ev->role); in hci_role_change_evt()
4379 struct hci_ev_num_comp_pkts *ev = data; in hci_num_comp_pkts_evt() local
4383 flex_array_size(ev, handles, ev->num))) in hci_num_comp_pkts_evt()
4386 bt_dev_dbg(hdev, "num %d", ev->num); in hci_num_comp_pkts_evt()
4388 for (i = 0; i < ev->num; i++) { in hci_num_comp_pkts_evt()
4389 struct hci_comp_pkts_info *info = &ev->handles[i]; in hci_num_comp_pkts_evt()
4464 struct hci_ev_mode_change *ev = data; in hci_mode_change_evt() local
4467 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_mode_change_evt()
4471 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_mode_change_evt()
4473 conn->mode = ev->mode; in hci_mode_change_evt()
4484 hci_sco_setup(conn, ev->status); in hci_mode_change_evt()
4493 struct hci_ev_pin_code_req *ev = data; in hci_pin_code_request_evt() local
4500 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_pin_code_request_evt()
4513 sizeof(ev->bdaddr), &ev->bdaddr); in hci_pin_code_request_evt()
4522 mgmt_pin_code_request(hdev, &ev->bdaddr, secure); in hci_pin_code_request_evt()
4564 struct hci_ev_link_key_req *ev = data; in hci_link_key_request_evt() local
4576 key = hci_find_link_key(hdev, &ev->bdaddr); in hci_link_key_request_evt()
4578 bt_dev_dbg(hdev, "link key not found for %pMR", &ev->bdaddr); in hci_link_key_request_evt()
4582 bt_dev_dbg(hdev, "found key type %u for %pMR", key->type, &ev->bdaddr); in hci_link_key_request_evt()
4584 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_request_evt()
4605 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_link_key_request_evt()
4615 hci_send_cmd(hdev, HCI_OP_LINK_KEY_NEG_REPLY, 6, &ev->bdaddr); in hci_link_key_request_evt()
4622 struct hci_ev_link_key_notify *ev = data; in hci_link_key_notify_evt() local
4632 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_link_key_notify_evt()
4637 if (!crypto_memneq(ev->link_key, ZERO_KEY, HCI_LINK_KEY_SIZE)) { in hci_link_key_notify_evt()
4639 &ev->bdaddr); in hci_link_key_notify_evt()
4650 conn_set_key(conn, ev->key_type, conn->pin_length); in hci_link_key_notify_evt()
4655 key = hci_add_link_key(hdev, conn, &ev->bdaddr, ev->link_key, in hci_link_key_notify_evt()
4656 ev->key_type, pin_len, &persistent); in hci_link_key_notify_evt()
4663 if (ev->key_type == HCI_LK_CHANGED_COMBINATION) in hci_link_key_notify_evt()
4692 struct hci_ev_clock_offset *ev = data; in hci_clock_offset_evt() local
4695 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_clock_offset_evt()
4699 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_clock_offset_evt()
4700 if (conn && !ev->status) { in hci_clock_offset_evt()
4705 ie->data.clock_offset = ev->clock_offset; in hci_clock_offset_evt()
4716 struct hci_ev_pkt_type_change *ev = data; in hci_pkt_type_change_evt() local
4719 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_pkt_type_change_evt()
4723 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_pkt_type_change_evt()
4724 if (conn && !ev->status) in hci_pkt_type_change_evt()
4725 conn->pkt_type = __le16_to_cpu(ev->pkt_type); in hci_pkt_type_change_evt()
4733 struct hci_ev_pscan_rep_mode *ev = data; in hci_pscan_rep_mode_evt() local
4740 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_pscan_rep_mode_evt()
4742 ie->data.pscan_rep_mode = ev->pscan_rep_mode; in hci_pscan_rep_mode_evt()
4752 struct hci_ev_inquiry_result_rssi *ev = edata; in hci_inquiry_result_with_rssi_evt() local
4756 bt_dev_dbg(hdev, "num_rsp %d", ev->num); in hci_inquiry_result_with_rssi_evt()
4758 if (!ev->num) in hci_inquiry_result_with_rssi_evt()
4766 if (skb->len == array_size(ev->num, in hci_inquiry_result_with_rssi_evt()
4770 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_with_rssi_evt()
4797 } else if (skb->len == array_size(ev->num, in hci_inquiry_result_with_rssi_evt()
4801 for (i = 0; i < ev->num; i++) { in hci_inquiry_result_with_rssi_evt()
4839 struct hci_ev_remote_ext_features *ev = data; in hci_remote_ext_features_evt() local
4842 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_remote_ext_features_evt()
4846 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_remote_ext_features_evt()
4850 if (ev->page < HCI_MAX_PAGES) in hci_remote_ext_features_evt()
4851 memcpy(conn->features[ev->page], ev->features, 8); in hci_remote_ext_features_evt()
4853 if (!ev->status && ev->page == 0x01) { in hci_remote_ext_features_evt()
4858 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_ext_features_evt()
4860 if (ev->features[0] & LMP_HOST_SSP) { in hci_remote_ext_features_evt()
4874 if (ev->features[0] & LMP_HOST_SC) in hci_remote_ext_features_evt()
4881 if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { in hci_remote_ext_features_evt()
4893 hci_connect_cfm(conn, ev->status); in hci_remote_ext_features_evt()
4904 struct hci_ev_sync_conn_complete *ev = data; in hci_sync_conn_complete_evt() local
4906 u8 status = ev->status; in hci_sync_conn_complete_evt()
4908 switch (ev->link_type) { in hci_sync_conn_complete_evt()
4925 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); in hci_sync_conn_complete_evt()
4927 if (ev->link_type == ESCO_LINK) in hci_sync_conn_complete_evt()
4939 conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); in hci_sync_conn_complete_evt()
4957 status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); in hci_sync_conn_complete_evt()
4964 conn->type = ev->link_type; in hci_sync_conn_complete_evt()
4991 bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode); in hci_sync_conn_complete_evt()
4996 switch (ev->air_mode) { in hci_sync_conn_complete_evt()
5034 struct hci_ev_ext_inquiry_result *ev = edata; in hci_extended_inquiry_result_evt() local
5040 flex_array_size(ev, info, ev->num))) in hci_extended_inquiry_result_evt()
5043 bt_dev_dbg(hdev, "num %d", ev->num); in hci_extended_inquiry_result_evt()
5045 if (!ev->num) in hci_extended_inquiry_result_evt()
5053 for (i = 0; i < ev->num; i++) { in hci_extended_inquiry_result_evt()
5054 struct extended_inquiry_info *info = &ev->info[i]; in hci_extended_inquiry_result_evt()
5089 struct hci_ev_key_refresh_complete *ev = data; in hci_key_refresh_complete_evt() local
5092 bt_dev_dbg(hdev, "status 0x%2.2x handle 0x%4.4x", ev->status, in hci_key_refresh_complete_evt()
5093 __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
5097 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_key_refresh_complete_evt()
5107 if (!ev->status) in hci_key_refresh_complete_evt()
5112 if (ev->status && conn->state == BT_CONNECTED) { in hci_key_refresh_complete_evt()
5119 if (!ev->status) in hci_key_refresh_complete_evt()
5122 hci_connect_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
5125 hci_auth_cfm(conn, ev->status); in hci_key_refresh_complete_evt()
5199 struct hci_ev_io_capa_request *ev = data; in hci_io_capa_request_evt() local
5206 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_request_evt()
5226 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
5258 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
5272 struct hci_ev_io_capa_reply *ev = data; in hci_io_capa_reply_evt() local
5279 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_io_capa_reply_evt()
5283 conn->remote_cap = ev->capability; in hci_io_capa_reply_evt()
5284 conn->remote_auth = ev->authentication; in hci_io_capa_reply_evt()
5293 struct hci_ev_user_confirm_req *ev = data; in hci_user_confirm_request_evt() local
5304 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_confirm_request_evt()
5320 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
5343 if (hci_find_link_key(hdev, &ev->bdaddr)) { in hci_user_confirm_request_evt()
5360 sizeof(ev->bdaddr), &ev->bdaddr); in hci_user_confirm_request_evt()
5365 mgmt_user_confirm_request(hdev, &ev->bdaddr, ACL_LINK, 0, in hci_user_confirm_request_evt()
5366 le32_to_cpu(ev->passkey), confirm_hint); in hci_user_confirm_request_evt()
5375 struct hci_ev_user_passkey_req *ev = data; in hci_user_passkey_request_evt() local
5380 mgmt_user_passkey_request(hdev, &ev->bdaddr, ACL_LINK, 0); in hci_user_passkey_request_evt()
5386 struct hci_ev_user_passkey_notify *ev = data; in hci_user_passkey_notify_evt() local
5391 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_user_passkey_notify_evt()
5395 conn->passkey_notify = __le32_to_cpu(ev->passkey); in hci_user_passkey_notify_evt()
5407 struct hci_ev_keypress_notify *ev = data; in hci_keypress_notify_evt() local
5412 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_keypress_notify_evt()
5416 switch (ev->type) { in hci_keypress_notify_evt()
5446 struct hci_ev_simple_pair_complete *ev = data; in hci_simple_pair_complete_evt() local
5453 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_simple_pair_complete_evt()
5465 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status) in hci_simple_pair_complete_evt()
5466 mgmt_auth_failed(conn, ev->status); in hci_simple_pair_complete_evt()
5477 struct hci_ev_remote_host_features *ev = data; in hci_remote_host_features_evt() local
5485 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); in hci_remote_host_features_evt()
5487 memcpy(conn->features[1], ev->features, 8); in hci_remote_host_features_evt()
5489 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); in hci_remote_host_features_evt()
5491 ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP); in hci_remote_host_features_evt()
5499 struct hci_ev_remote_oob_data_request *ev = edata; in hci_remote_oob_data_request_evt() local
5509 data = hci_find_remote_oob_data(hdev, &ev->bdaddr, BDADDR_BREDR); in hci_remote_oob_data_request_evt()
5513 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5522 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5538 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
5777 struct hci_ev_le_conn_complete *ev = data; in hci_le_conn_complete_evt() local
5779 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_conn_complete_evt()
5781 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_conn_complete_evt()
5782 NULL, ev->role, le16_to_cpu(ev->handle), in hci_le_conn_complete_evt()
5783 le16_to_cpu(ev->interval), in hci_le_conn_complete_evt()
5784 le16_to_cpu(ev->latency), in hci_le_conn_complete_evt()
5785 le16_to_cpu(ev->supervision_timeout)); in hci_le_conn_complete_evt()
5791 struct hci_ev_le_enh_conn_complete *ev = data; in hci_le_enh_conn_complete_evt() local
5793 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_enh_conn_complete_evt()
5795 le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, in hci_le_enh_conn_complete_evt()
5796 &ev->local_rpa, ev->role, le16_to_cpu(ev->handle), in hci_le_enh_conn_complete_evt()
5797 le16_to_cpu(ev->interval), in hci_le_enh_conn_complete_evt()
5798 le16_to_cpu(ev->latency), in hci_le_enh_conn_complete_evt()
5799 le16_to_cpu(ev->supervision_timeout)); in hci_le_enh_conn_complete_evt()
5805 struct hci_evt_le_ext_adv_set_term *ev = data; in hci_le_ext_adv_term_evt() local
5809 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_ext_adv_term_evt()
5818 if (ev->status == HCI_ERROR_CANCELLED_BY_HOST) { in hci_le_ext_adv_term_evt()
5825 adv = hci_find_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
5827 if (ev->status) { in hci_le_ext_adv_term_evt()
5832 hci_remove_adv_instance(hdev, ev->handle); in hci_le_ext_adv_term_evt()
5833 mgmt_advertising_removed(NULL, hdev, ev->handle); in hci_le_ext_adv_term_evt()
5848 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->conn_handle)); in hci_le_ext_adv_term_evt()
5853 conn->adv_instance = ev->handle; in hci_le_ext_adv_term_evt()
5859 if (!ev->handle) { in hci_le_ext_adv_term_evt()
5875 struct hci_ev_le_conn_update_complete *ev = data; in hci_le_conn_update_complete_evt() local
5878 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_conn_update_complete_evt()
5880 if (ev->status) in hci_le_conn_update_complete_evt()
5885 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_conn_update_complete_evt()
5887 conn->le_conn_interval = le16_to_cpu(ev->interval); in hci_le_conn_update_complete_evt()
5888 conn->le_conn_latency = le16_to_cpu(ev->latency); in hci_le_conn_update_complete_evt()
5889 conn->le_supv_timeout = le16_to_cpu(ev->supervision_timeout); in hci_le_conn_update_complete_evt()
6204 struct hci_ev_le_advertising_report *ev = data; in hci_le_adv_report_evt() local
6207 if (!ev->num) in hci_le_adv_report_evt()
6212 while (ev->num--) { in hci_le_adv_report_evt()
6292 struct hci_ev_le_ext_adv_report *ev = data; in hci_le_ext_adv_report_evt() local
6295 if (!ev->num) in hci_le_ext_adv_report_evt()
6300 while (ev->num--) { in hci_le_ext_adv_report_evt()
6361 struct hci_ev_le_pa_sync_established *ev = data; in hci_le_pa_sync_established_evt() local
6366 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_pa_sync_established_evt()
6376 &ev->bdaddr, ev->sid); in hci_le_pa_sync_established_evt()
6382 conn->sync_handle = le16_to_cpu(ev->handle); in hci_le_pa_sync_established_evt()
6385 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, PA_LINK, in hci_le_pa_sync_established_evt()
6388 hci_le_pa_term_sync(hdev, ev->handle); in hci_le_pa_sync_established_evt()
6402 pa_sync->sync_handle = le16_to_cpu(ev->handle); in hci_le_pa_sync_established_evt()
6404 if (ev->status) { in hci_le_pa_sync_established_evt()
6408 hci_connect_cfm(pa_sync, ev->status); in hci_le_pa_sync_established_evt()
6418 struct hci_ev_le_per_adv_report *ev = data; in hci_le_per_adv_report_evt() local
6423 bt_dev_dbg(hdev, "sync_handle 0x%4.4x", le16_to_cpu(ev->sync_handle)); in hci_le_per_adv_report_evt()
6436 le16_to_cpu(ev->sync_handle)); in hci_le_per_adv_report_evt()
6441 if (ev->data_status == LE_PA_DATA_COMPLETE && in hci_le_per_adv_report_evt()
6457 struct hci_ev_le_remote_feat_complete *ev = data; in hci_le_remote_feat_complete_evt() local
6460 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_remote_feat_complete_evt()
6464 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_remote_feat_complete_evt()
6466 if (!ev->status) in hci_le_remote_feat_complete_evt()
6467 memcpy(conn->features[0], ev->features, 8); in hci_le_remote_feat_complete_evt()
6481 if (!conn->out && ev->status == HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE && in hci_le_remote_feat_complete_evt()
6485 status = ev->status; in hci_le_remote_feat_complete_evt()
6499 struct hci_ev_le_ltk_req *ev = data; in hci_le_ltk_request_evt() local
6505 bt_dev_dbg(hdev, "handle 0x%4.4x", __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
6509 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_ltk_request_evt()
6519 if (ev->ediv || ev->rand) in hci_le_ltk_request_evt()
6523 if (ev->ediv != ltk->ediv || ev->rand != ltk->rand) in hci_le_ltk_request_evt()
6556 neg.handle = ev->handle; in hci_le_ltk_request_evt()
6576 struct hci_ev_le_remote_conn_param_req *ev = data; in hci_le_remote_conn_param_req_evt() local
6581 bt_dev_dbg(hdev, "handle 0x%4.4x", __le16_to_cpu(ev->handle)); in hci_le_remote_conn_param_req_evt()
6583 handle = le16_to_cpu(ev->handle); in hci_le_remote_conn_param_req_evt()
6584 min = le16_to_cpu(ev->interval_min); in hci_le_remote_conn_param_req_evt()
6585 max = le16_to_cpu(ev->interval_max); in hci_le_remote_conn_param_req_evt()
6586 latency = le16_to_cpu(ev->latency); in hci_le_remote_conn_param_req_evt()
6587 timeout = le16_to_cpu(ev->timeout); in hci_le_remote_conn_param_req_evt()
6626 cp.handle = ev->handle; in hci_le_remote_conn_param_req_evt()
6627 cp.interval_min = ev->interval_min; in hci_le_remote_conn_param_req_evt()
6628 cp.interval_max = ev->interval_max; in hci_le_remote_conn_param_req_evt()
6629 cp.latency = ev->latency; in hci_le_remote_conn_param_req_evt()
6630 cp.timeout = ev->timeout; in hci_le_remote_conn_param_req_evt()
6640 struct hci_ev_le_direct_adv_report *ev = data; in hci_le_direct_adv_report_evt() local
6645 flex_array_size(ev, info, ev->num))) in hci_le_direct_adv_report_evt()
6648 if (!ev->num) in hci_le_direct_adv_report_evt()
6653 for (i = 0; i < ev->num; i++) { in hci_le_direct_adv_report_evt()
6654 struct hci_ev_le_direct_adv_info *info = &ev->info[i]; in hci_le_direct_adv_report_evt()
6668 struct hci_ev_le_phy_update_complete *ev = data; in hci_le_phy_update_evt() local
6671 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_phy_update_evt()
6673 if (ev->status) in hci_le_phy_update_evt()
6678 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); in hci_le_phy_update_evt()
6682 conn->le_tx_phy = ev->tx_phy; in hci_le_phy_update_evt()
6683 conn->le_rx_phy = ev->rx_phy; in hci_le_phy_update_evt()
6692 struct hci_evt_le_cis_established *ev = data; in hci_le_cis_established_evt() local
6696 u16 handle = __le16_to_cpu(ev->handle); in hci_le_cis_established_evt()
6699 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_cis_established_evt()
6730 c_sdu_interval = (get_unaligned_le24(ev->cig_sync_delay) + in hci_le_cis_established_evt()
6731 (ev->c_ft * le16_to_cpu(ev->interval) * 1250)) - in hci_le_cis_established_evt()
6732 get_unaligned_le24(ev->c_latency); in hci_le_cis_established_evt()
6733 p_sdu_interval = (get_unaligned_le24(ev->cig_sync_delay) + in hci_le_cis_established_evt()
6734 (ev->p_ft * le16_to_cpu(ev->interval) * 1250)) - in hci_le_cis_established_evt()
6735 get_unaligned_le24(ev->p_latency); in hci_le_cis_established_evt()
6743 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency), in hci_le_cis_established_evt()
6746 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency), in hci_le_cis_established_evt()
6748 qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu); in hci_le_cis_established_evt()
6749 qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu); in hci_le_cis_established_evt()
6750 qos->ucast.in.phy = ev->c_phy; in hci_le_cis_established_evt()
6751 qos->ucast.out.phy = ev->p_phy; in hci_le_cis_established_evt()
6758 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency), in hci_le_cis_established_evt()
6761 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency), in hci_le_cis_established_evt()
6763 qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu); in hci_le_cis_established_evt()
6764 qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu); in hci_le_cis_established_evt()
6765 qos->ucast.out.phy = ev->c_phy; in hci_le_cis_established_evt()
6766 qos->ucast.in.phy = ev->p_phy; in hci_le_cis_established_evt()
6770 if (!ev->status) { in hci_le_cis_established_evt()
6779 hci_connect_cfm(conn, ev->status); in hci_le_cis_established_evt()
6811 struct hci_evt_le_cis_req *ev = data; in hci_le_cis_req_evt() local
6817 acl_handle = __le16_to_cpu(ev->acl_handle); in hci_le_cis_req_evt()
6818 cis_handle = __le16_to_cpu(ev->cis_handle); in hci_le_cis_req_evt()
6821 acl_handle, cis_handle, ev->cig_id, ev->cis_id); in hci_le_cis_req_evt()
6831 hci_le_reject_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
6840 hci_le_reject_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
6845 cis->iso_qos.ucast.cig = ev->cig_id; in hci_le_cis_req_evt()
6846 cis->iso_qos.ucast.cis = ev->cis_id; in hci_le_cis_req_evt()
6849 hci_le_accept_cis(hdev, ev->cis_handle); in hci_le_cis_req_evt()
6870 struct hci_evt_le_create_big_complete *ev = data; in hci_le_create_big_complete_evt() local
6874 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); in hci_le_create_big_complete_evt()
6877 flex_array_size(ev, bis_handle, ev->num_bis))) in hci_le_create_big_complete_evt()
6883 while ((conn = hci_conn_hash_lookup_big_state(hdev, ev->handle, in hci_le_create_big_complete_evt()
6886 if (ev->status) { in hci_le_create_big_complete_evt()
6887 hci_connect_cfm(conn, ev->status); in hci_le_create_big_complete_evt()
6893 __le16_to_cpu(ev->bis_handle[i++]))) in hci_le_create_big_complete_evt()
6903 if (!ev->status && !i) in hci_le_create_big_complete_evt()
6910 UINT_PTR(ev->handle), NULL); in hci_le_create_big_complete_evt()
6918 struct hci_evt_le_big_sync_established *ev = data; in hci_le_big_sync_established_evt() local
6922 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); in hci_le_big_sync_established_evt()
6925 flex_array_size(ev, bis, ev->num_bis))) in hci_le_big_sync_established_evt()
6930 conn = hci_conn_hash_lookup_big_sync_pend(hdev, ev->handle, in hci_le_big_sync_established_evt()
6931 ev->num_bis); in hci_le_big_sync_established_evt()
6935 ev->handle); in hci_le_big_sync_established_evt()
6944 for (i = 0; i < ev->num_bis; i++) { in hci_le_big_sync_established_evt()
6945 u16 handle = le16_to_cpu(ev->bis[i]); in hci_le_big_sync_established_evt()
6960 if (ev->status != 0x42) in hci_le_big_sync_established_evt()
6965 bis->iso_qos.bcast.big = ev->handle; in hci_le_big_sync_established_evt()
6967 memcpy(&interval, ev->latency, sizeof(ev->latency)); in hci_le_big_sync_established_evt()
6970 bis->iso_qos.bcast.in.latency = le16_to_cpu(ev->interval) * 125 / 100; in hci_le_big_sync_established_evt()
6971 bis->iso_qos.bcast.in.sdu = le16_to_cpu(ev->max_pdu); in hci_le_big_sync_established_evt()
6973 if (!ev->status) { in hci_le_big_sync_established_evt()
6985 if (ev->status) in hci_le_big_sync_established_evt()
6986 for (i = 0; i < ev->num_bis; i++) { in hci_le_big_sync_established_evt()
6987 u16 handle = le16_to_cpu(ev->bis[i]); in hci_le_big_sync_established_evt()
6994 hci_connect_cfm(bis, ev->status); in hci_le_big_sync_established_evt()
7004 struct hci_evt_le_big_sync_lost *ev = data; in hci_le_big_sync_lost_evt() local
7007 bt_dev_dbg(hdev, "big handle 0x%2.2x", ev->handle); in hci_le_big_sync_lost_evt()
7012 bis = hci_conn_hash_lookup_pa_sync_big_handle(hdev, ev->handle); in hci_le_big_sync_lost_evt()
7021 while ((bis = hci_conn_hash_lookup_big_state(hdev, ev->handle, in hci_le_big_sync_lost_evt()
7025 hci_disconn_cfm(bis, ev->reason); in hci_le_big_sync_lost_evt()
7035 struct hci_evt_le_big_info_adv_report *ev = data; in hci_le_big_info_adv_report_evt() local
7040 bt_dev_dbg(hdev, "sync_handle 0x%4.4x", le16_to_cpu(ev->sync_handle)); in hci_le_big_info_adv_report_evt()
7053 le16_to_cpu(ev->sync_handle)); in hci_le_big_info_adv_report_evt()
7058 pa_sync->iso_qos.bcast.encryption = ev->encryption; in hci_le_big_info_adv_report_evt()
7172 struct hci_ev_le_meta *ev = data; in hci_le_meta_evt() local
7175 bt_dev_dbg(hdev, "subevent 0x%2.2x", ev->subevent); in hci_le_meta_evt()
7181 hci_skb_event(hdev->req_skb) == ev->subevent) { in hci_le_meta_evt()
7187 subev = &hci_le_ev_table[ev->subevent]; in hci_le_meta_evt()
7193 ev->subevent, skb->len, subev->min_len); in hci_le_meta_evt()
7203 ev->subevent, skb->len, subev->max_len); in hci_le_meta_evt()
7204 data = hci_le_ev_skb_pull(hdev, skb, ev->subevent, subev->min_len); in hci_le_meta_evt()
7214 struct hci_ev_cmd_complete *ev; in hci_get_cmd_complete() local
7242 ev = hci_cc_skb_pull(hdev, skb, opcode, sizeof(*ev)); in hci_get_cmd_complete()
7243 if (!ev) in hci_get_cmd_complete()
7246 if (opcode != __le16_to_cpu(ev->opcode)) { in hci_get_cmd_complete()
7248 __le16_to_cpu(ev->opcode)); in hci_get_cmd_complete()
7490 const struct hci_ev *ev = &hci_ev_table[event]; in hci_event_func() local
7493 if (!ev->func) in hci_event_func()
7496 if (skb->len < ev->min_len) { in hci_event_func()
7498 event, skb->len, ev->min_len); in hci_event_func()
7506 if (skb->len > ev->max_len) in hci_event_func()
7509 event, skb->len, ev->max_len); in hci_event_func()
7511 data = hci_ev_skb_pull(hdev, skb, event, ev->min_len); in hci_event_func()
7515 if (ev->req) in hci_event_func()
7516 ev->func_req(hdev, data, skb, opcode, status, req_complete, in hci_event_func()
7519 ev->func(hdev, data, skb); in hci_event_func()