• Home
  • Raw
  • Download

Lines Matching refs:p_dev_rec

50 extern bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
66 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_SecAddBleDevice() local
67 if (!p_dev_rec) { in BTM_SecAddBleDevice()
68 p_dev_rec = btm_sec_allocate_dev_rec(); in BTM_SecAddBleDevice()
70 p_dev_rec->bd_addr = bd_addr; in BTM_SecAddBleDevice()
71 p_dev_rec->hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_BR_EDR); in BTM_SecAddBleDevice()
72 p_dev_rec->ble_hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_LE); in BTM_SecAddBleDevice()
75 p_dev_rec->conn_params.min_conn_int = BTM_BLE_CONN_PARAM_UNDEF; in BTM_SecAddBleDevice()
76 p_dev_rec->conn_params.max_conn_int = BTM_BLE_CONN_PARAM_UNDEF; in BTM_SecAddBleDevice()
77 p_dev_rec->conn_params.supervision_tout = BTM_BLE_CONN_PARAM_UNDEF; in BTM_SecAddBleDevice()
78 p_dev_rec->conn_params.peripheral_latency = BTM_BLE_CONN_PARAM_UNDEF; in BTM_SecAddBleDevice()
81 __func__, p_dev_rec->ble_hci_handle, p_dev_rec, in BTM_SecAddBleDevice()
85 memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME)); in BTM_SecAddBleDevice()
87 p_dev_rec->device_type |= dev_type; in BTM_SecAddBleDevice()
88 p_dev_rec->ble.ble_addr_type = addr_type; in BTM_SecAddBleDevice()
90 p_dev_rec->ble.pseudo_addr = bd_addr; in BTM_SecAddBleDevice()
94 p_info->results.ble_addr_type = p_dev_rec->ble.ble_addr_type; in BTM_SecAddBleDevice()
95 p_info->results.device_type = p_dev_rec->device_type; in BTM_SecAddBleDevice()
122 tBTM_SEC_DEV_REC* p_dev_rec; in BTM_SecAddBleKey() local
124 p_dev_rec = btm_find_dev(bd_addr); in BTM_SecAddBleKey()
125 if (!p_dev_rec || !p_le_key || in BTM_SecAddBleKey()
140 btm_ble_resolving_list_load_dev(p_dev_rec); in BTM_SecAddBleKey()
251 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_BlePasskeyReply() local
255 if (p_dev_rec == NULL) { in BTM_BlePasskeyReply()
260 p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED; in BTM_BlePasskeyReply()
281 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_BleConfirmReply() local
285 if (p_dev_rec == NULL) { in BTM_BleConfirmReply()
290 p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED; in BTM_BleConfirmReply()
316 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_BleOobDataReply() local
320 if (p_dev_rec == NULL) { in BTM_BleOobDataReply()
325 p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED; in BTM_BleOobDataReply()
348 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_BleSecureConnectionOobDataReply() local
352 if (p_dev_rec == NULL) { in BTM_BleSecureConnectionOobDataReply()
357 p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED; in BTM_BleSecureConnectionOobDataReply()
365 oob.peer_oob_data.addr_rcvd_from.type = p_dev_rec->ble.ble_addr_type; in BTM_BleSecureConnectionOobDataReply()
397 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_BleSetPrefConnParams() local
412 if (p_dev_rec) { in BTM_BleSetPrefConnParams()
419 p_dev_rec->conn_params.min_conn_int = min_conn_int; in BTM_BleSetPrefConnParams()
421 p_dev_rec->conn_params.min_conn_int = max_conn_int; in BTM_BleSetPrefConnParams()
424 p_dev_rec->conn_params.max_conn_int = max_conn_int; in BTM_BleSetPrefConnParams()
426 p_dev_rec->conn_params.max_conn_int = min_conn_int; in BTM_BleSetPrefConnParams()
429 p_dev_rec->conn_params.peripheral_latency = peripheral_latency; in BTM_BleSetPrefConnParams()
431 p_dev_rec->conn_params.peripheral_latency = in BTM_BleSetPrefConnParams()
435 p_dev_rec->conn_params.supervision_tout = supervision_tout; in BTM_BleSetPrefConnParams()
437 p_dev_rec->conn_params.supervision_tout = BTM_BLE_CONN_TIMEOUT_DEF; in BTM_BleSetPrefConnParams()
462 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(remote_bda); in BTM_ReadDevInfo() local
467 if (!p_dev_rec) { in BTM_ReadDevInfo()
481 p_dev_rec->device_type = p_inq_info->results.device_type; in BTM_ReadDevInfo()
482 p_dev_rec->ble.ble_addr_type = p_inq_info->results.ble_addr_type; in BTM_ReadDevInfo()
484 if (p_dev_rec->bd_addr == remote_bda && in BTM_ReadDevInfo()
485 p_dev_rec->ble.pseudo_addr == remote_bda) { in BTM_ReadDevInfo()
486 *p_dev_type = p_dev_rec->device_type; in BTM_ReadDevInfo()
487 *p_addr_type = p_dev_rec->ble.ble_addr_type; in BTM_ReadDevInfo()
488 } else if (p_dev_rec->ble.pseudo_addr == remote_bda) { in BTM_ReadDevInfo()
490 *p_addr_type = p_dev_rec->ble.ble_addr_type; in BTM_ReadDevInfo()
522 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(*remote_bda); in BTM_ReadConnectedTransportAddress() local
525 if (p_dev_rec == NULL) return false; in BTM_ReadConnectedTransportAddress()
528 if (BTM_IsAclConnectionUp(p_dev_rec->bd_addr, transport)) { in BTM_ReadConnectedTransportAddress()
529 *remote_bda = p_dev_rec->bd_addr; in BTM_ReadConnectedTransportAddress()
531 } else if (p_dev_rec->device_type & BT_DEVICE_TYPE_BREDR) { in BTM_ReadConnectedTransportAddress()
532 *remote_bda = p_dev_rec->bd_addr; in BTM_ReadConnectedTransportAddress()
539 *remote_bda = p_dev_rec->ble.pseudo_addr; in BTM_ReadConnectedTransportAddress()
540 if (BTM_IsAclConnectionUp(p_dev_rec->ble.pseudo_addr, transport)) in BTM_ReadConnectedTransportAddress()
1032 tBTM_SEC_DEV_REC* p_dev_rec; in btm_ble_increment_sign_ctr() local
1036 p_dev_rec = btm_find_dev(bd_addr); in btm_ble_increment_sign_ctr()
1037 if (p_dev_rec != NULL) { in btm_ble_increment_sign_ctr()
1039 p_dev_rec->ble.keys.local_counter++; in btm_ble_increment_sign_ctr()
1041 p_dev_rec->ble.keys.counter++; in btm_ble_increment_sign_ctr()
1043 is_local, p_dev_rec->ble.keys.local_counter, in btm_ble_increment_sign_ctr()
1044 p_dev_rec->ble.keys.counter); in btm_ble_increment_sign_ctr()
1059 tBTM_SEC_DEV_REC* p_dev_rec; in btm_ble_get_enc_key_type() local
1063 p_dev_rec = btm_find_dev(bd_addr); in btm_ble_get_enc_key_type()
1064 if (p_dev_rec != NULL) { in btm_ble_get_enc_key_type()
1065 *p_key_types = p_dev_rec->ble.key_type; in btm_ble_get_enc_key_type()
1080 tBTM_SEC_DEV_REC* p_dev_rec; in btm_get_local_div() local
1085 p_dev_rec = btm_find_dev(bd_addr); in btm_get_local_div()
1087 if (p_dev_rec && p_dev_rec->ble.keys.div) { in btm_get_local_div()
1089 *p_div = p_dev_rec->ble.keys.div; in btm_get_local_div()
1293 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_ble_link_sec_check() local
1298 if (p_dev_rec == NULL) { in btm_ble_link_sec_check()
1303 if (p_dev_rec->sec_state == BTM_SEC_STATE_ENCRYPTING || in btm_ble_link_sec_check()
1304 p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING) { in btm_ble_link_sec_check()
1314 BTM_TRACE_DEBUG("dev_rec sec_flags=0x%x", p_dev_rec->sec_flags); in btm_ble_link_sec_check()
1317 if (p_dev_rec->sec_flags & BTM_SEC_LE_ENCRYPTED) { in btm_ble_link_sec_check()
1318 if (p_dev_rec->sec_flags & BTM_SEC_LE_AUTHENTICATED) in btm_ble_link_sec_check()
1325 if (p_dev_rec->ble.key_type & BTM_LE_KEY_PENC) in btm_ble_link_sec_check()
1326 cur_sec_level = p_dev_rec->ble.keys.sec_level; in btm_ble_link_sec_check()
1434 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev_by_handle(handle); in btm_ble_ltk_request() local
1442 if (p_dev_rec != NULL) { in btm_ble_ltk_request()
1443 if (!smp_proc_ltk_request(p_dev_rec->bd_addr)) { in btm_ble_ltk_request()
1444 btm_ble_ltk_request_reply(p_dev_rec->bd_addr, false, Octet16{0}); in btm_ble_ltk_request()
1499 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_ble_link_encrypted() local
1502 if (!p_dev_rec) { in btm_ble_link_encrypted()
1511 enc_cback = (p_dev_rec->sec_state == BTM_SEC_STATE_ENCRYPTING); in btm_ble_link_encrypted()
1515 BTM_TRACE_DEBUG(" p_dev_rec->sec_flags=0x%x", p_dev_rec->sec_flags); in btm_ble_link_encrypted()
1517 if (encr_enable && p_dev_rec->enc_key_size == 0) in btm_ble_link_encrypted()
1518 p_dev_rec->enc_key_size = p_dev_rec->ble.keys.key_size; in btm_ble_link_encrypted()
1520 p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; in btm_ble_link_encrypted()
1521 if (p_dev_rec->p_callback && enc_cback) { in btm_ble_link_encrypted()
1523 btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); in btm_ble_link_encrypted()
1524 else if (p_dev_rec->sec_flags & ~BTM_SEC_LE_LINK_KEY_KNOWN) { in btm_ble_link_encrypted()
1525 btm_sec_dev_rec_cback_event(p_dev_rec, BTM_FAILED_ON_SECURITY, true); in btm_ble_link_encrypted()
1526 } else if (p_dev_rec->role_central) in btm_ble_link_encrypted()
1527 btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_PROCESSING, true); in btm_ble_link_encrypted()
1530 gatt_notify_enc_cmpl(p_dev_rec->ble.pseudo_addr); in btm_ble_link_encrypted()
1580 uint8_t btm_ble_io_capabilities_req(tBTM_SEC_DEV_REC* p_dev_rec, in btm_ble_io_capabilities_req() argument
1587 BTM_LE_IO_REQ_EVT, p_dev_rec->bd_addr, (tBTM_LE_EVT_DATA*)p_data); in btm_ble_io_capabilities_req()
1606 p_dev_rec->security_required, p_data->auth_req); in btm_ble_io_capabilities_req()
1613 if (p_dev_rec->security_required & BTM_SEC_IN_MITM) in btm_ble_io_capabilities_req()
1664 uint8_t btm_ble_br_keys_req(tBTM_SEC_DEV_REC* p_dev_rec, in btm_ble_br_keys_req() argument
1671 BTM_LE_IO_REQ_EVT, p_dev_rec->bd_addr, (tBTM_LE_EVT_DATA*)p_data); in btm_ble_br_keys_req()
1690 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda); in btm_ble_connected() local
1691 if (!p_dev_rec) { in btm_ble_connected()
1693 p_dev_rec = btm_sec_alloc_dev(bda); in btm_ble_connected()
1694 if (p_dev_rec == nullptr) { in btm_ble_connected()
1701 p_dev_rec->timestamp = btm_cb.dev_rec_count++; in btm_ble_connected()
1704 p_dev_rec->ble.ble_addr_type = addr_type; in btm_ble_connected()
1705 p_dev_rec->ble.pseudo_addr = bda; in btm_ble_connected()
1706 p_dev_rec->ble_hci_handle = handle; in btm_ble_connected()
1707 p_dev_rec->device_type |= BT_DEVICE_TYPE_BLE; in btm_ble_connected()
1708 p_dev_rec->role_central = (role == HCI_ROLE_CENTRAL) ? true : false; in btm_ble_connected()
1711 p_dev_rec->ble.active_addr_type = tBTM_SEC_BLE::BTM_BLE_ADDR_PSEUDO; in btm_ble_connected()
1712 if (p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) { in btm_ble_connected()
1713 p_dev_rec->ble.cur_rand_addr = bda; in btm_ble_connected()
1734 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_proc_smp_cback() local
1739 if (p_dev_rec != NULL) { in btm_proc_smp_cback()
1742 btm_ble_io_capabilities_req(p_dev_rec, in btm_proc_smp_cback()
1747 btm_ble_br_keys_req(p_dev_rec, (tBTM_LE_IO_REQ*)&p_data->io_req); in btm_proc_smp_cback()
1755 p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED; in btm_proc_smp_cback()
1767 p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING; in btm_proc_smp_cback()
1783 p_dev_rec = btm_find_dev(bd_addr); in btm_proc_smp_cback()
1784 if (p_dev_rec == NULL) { in btm_proc_smp_cback()
1791 p_data->cmplt.sec_level, p_dev_rec->sec_flags); in btm_proc_smp_cback()
1798 p_data->cmplt.sec_level, p_dev_rec->sec_flags); in btm_proc_smp_cback()
1810 l2cu_start_post_bond_timer(p_dev_rec->ble_hci_handle); in btm_proc_smp_cback()
1813 p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; in btm_proc_smp_cback()
1819 l2cu_start_post_bond_timer(p_dev_rec->ble_hci_handle); in btm_proc_smp_cback()
1837 p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; in btm_proc_smp_cback()
1839 btm_ble_resolving_list_load_dev(p_dev_rec); in btm_proc_smp_cback()
1842 btm_sec_dev_rec_cback_event(p_dev_rec, res, true); in btm_proc_smp_cback()
2102 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev_by_handle(hci_handle); in btm_ble_get_acl_remote_addr() local
2103 if (p_dev_rec == nullptr) { in btm_ble_get_acl_remote_addr()
2112 switch (p_dev_rec->ble.active_addr_type) { in btm_ble_get_acl_remote_addr()
2114 conn_addr = p_dev_rec->bd_addr; in btm_ble_get_acl_remote_addr()
2115 *p_addr_type = p_dev_rec->ble.ble_addr_type; in btm_ble_get_acl_remote_addr()
2119 conn_addr = p_dev_rec->ble.cur_rand_addr; in btm_ble_get_acl_remote_addr()
2124 conn_addr = p_dev_rec->ble.identity_address_with_type.bda; in btm_ble_get_acl_remote_addr()
2125 *p_addr_type = p_dev_rec->ble.identity_address_with_type.type; in btm_ble_get_acl_remote_addr()
2130 p_dev_rec->ble.active_addr_type); in btm_ble_get_acl_remote_addr()