• Home
  • Raw
  • Download

Lines Matching refs:p_dev_rec

68   tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);  in BTM_SecAddDevice()  local
69 if (!p_dev_rec) { in BTM_SecAddDevice()
70 p_dev_rec = btm_sec_allocate_dev_rec(); in BTM_SecAddDevice()
71 BTM_TRACE_API("%s: allocated p_dev_rec=%p, bd_addr=%s", __func__, p_dev_rec, in BTM_SecAddDevice()
74 p_dev_rec->bd_addr = bd_addr; in BTM_SecAddDevice()
75 p_dev_rec->hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_BR_EDR); in BTM_SecAddDevice()
79 memset(&p_dev_rec->conn_params, 0xff, sizeof(tBTM_LE_CONN_PRAMS)); in BTM_SecAddDevice()
82 p_dev_rec->timestamp = btm_cb.dev_rec_count++; in BTM_SecAddDevice()
90 p_dev_rec->bond_type = tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN; in BTM_SecAddDevice()
93 if (dev_class) memcpy(p_dev_rec->dev_class, dev_class, DEV_CLASS_LEN); in BTM_SecAddDevice()
95 memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME)); in BTM_SecAddDevice()
98 p_dev_rec->sec_flags |= BTM_SEC_NAME_KNOWN; in BTM_SecAddDevice()
99 strlcpy((char*)p_dev_rec->sec_bd_name, (char*)bd_name, in BTM_SecAddDevice()
105 p_dev_rec->sec_flags |= BTM_SEC_LINK_KEY_KNOWN; in BTM_SecAddDevice()
106 p_dev_rec->link_key = *p_link_key; in BTM_SecAddDevice()
107 p_dev_rec->link_key_type = key_type; in BTM_SecAddDevice()
108 p_dev_rec->pin_code_length = pin_length; in BTM_SecAddDevice()
114 p_dev_rec->sec_flags |= in BTM_SecAddDevice()
119 p_dev_rec->rmt_io_caps = BTM_IO_CAP_OUT; in BTM_SecAddDevice()
120 p_dev_rec->device_type |= BT_DEVICE_TYPE_BREDR; in BTM_SecAddDevice()
125 void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) { in wipe_secrets_and_remove() argument
126 p_dev_rec->link_key.fill(0); in wipe_secrets_and_remove()
127 memset(&p_dev_rec->ble.keys, 0, sizeof(tBTM_SEC_BLE_KEYS)); in wipe_secrets_and_remove()
128 list_remove(btm_cb.sec_dev_rec, p_dev_rec); in wipe_secrets_and_remove()
153 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_SecDeleteDevice() local
154 if (p_dev_rec != NULL) { in BTM_SecDeleteDevice()
155 RawAddress bda = p_dev_rec->bd_addr; in BTM_SecDeleteDevice()
158 btm_sec_clear_ble_keys(p_dev_rec); in BTM_SecDeleteDevice()
159 wipe_secrets_and_remove(p_dev_rec); in BTM_SecDeleteDevice()
176 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in BTM_SecClearSecurityFlags() local
177 if (p_dev_rec == NULL) return; in BTM_SecClearSecurityFlags()
179 p_dev_rec->sec_flags = 0; in BTM_SecClearSecurityFlags()
180 p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; in BTM_SecClearSecurityFlags()
181 p_dev_rec->sm4 = BTM_SM4_UNKNOWN; in BTM_SecClearSecurityFlags()
217 tBTM_SEC_DEV_REC* p_dev_rec = btm_sec_allocate_dev_rec(); in btm_sec_alloc_dev() local
225 memcpy(p_dev_rec->dev_class, p_inq_info->results.dev_class, DEV_CLASS_LEN); in btm_sec_alloc_dev()
227 p_dev_rec->device_type = p_inq_info->results.device_type; in btm_sec_alloc_dev()
228 p_dev_rec->ble.ble_addr_type = p_inq_info->results.ble_addr_type; in btm_sec_alloc_dev()
230 memcpy(p_dev_rec->dev_class, btm_cb.connecting_dc, DEV_CLASS_LEN); in btm_sec_alloc_dev()
233 memset(&p_dev_rec->conn_params, 0xff, sizeof(tBTM_LE_CONN_PRAMS)); in btm_sec_alloc_dev()
235 p_dev_rec->bd_addr = bd_addr; in btm_sec_alloc_dev()
237 p_dev_rec->ble_hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_LE); in btm_sec_alloc_dev()
238 p_dev_rec->hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_BR_EDR); in btm_sec_alloc_dev()
240 return (p_dev_rec); in btm_sec_alloc_dev()
262 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_dev_support_role_switch() local
263 if (p_dev_rec == nullptr) { in btm_dev_support_role_switch()
274 if (p_dev_rec->remote_supports_hci_role_switch) { in btm_dev_support_role_switch()
279 if (!p_dev_rec->remote_feature_received) { in btm_dev_support_role_switch()
291 tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data); in is_handle_equal() local
294 if (p_dev_rec->hci_handle == *handle || p_dev_rec->ble_hci_handle == *handle) in is_handle_equal()
318 tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data); in is_address_equal() local
321 if (p_dev_rec->bd_addr == *bd_addr) return false; in is_address_equal()
323 if (p_dev_rec->ble.pseudo_addr == *bd_addr) return false; in is_address_equal()
325 if (btm_ble_addr_resolvable(*bd_addr, p_dev_rec)) return false; in is_address_equal()
364 tBTM_SEC_DEV_REC* p_dev_rec = in btm_consolidate_dev() local
370 if (p_target_rec == p_dev_rec) continue; in btm_consolidate_dev()
372 if (p_dev_rec->bd_addr == p_target_rec->bd_addr) { in btm_consolidate_dev()
373 memcpy(p_target_rec, p_dev_rec, sizeof(tBTM_SEC_DEV_REC)); in btm_consolidate_dev()
386 wipe_secrets_and_remove(p_dev_rec); in btm_consolidate_dev()
392 if (btm_ble_addr_resolvable(p_dev_rec->bd_addr, p_target_rec)) { in btm_consolidate_dev()
393 if (p_target_rec->ble.pseudo_addr == p_dev_rec->bd_addr) { in btm_consolidate_dev()
394 p_target_rec->ble.ble_addr_type = p_dev_rec->ble.ble_addr_type; in btm_consolidate_dev()
395 p_target_rec->device_type |= p_dev_rec->device_type; in btm_consolidate_dev()
398 wipe_secrets_and_remove(p_dev_rec); in btm_consolidate_dev()
415 tBTM_SEC_DEV_REC* p_dev_rec; in btm_find_or_alloc_dev() local
417 p_dev_rec = btm_find_dev(bd_addr); in btm_find_or_alloc_dev()
418 if (p_dev_rec == NULL) { in btm_find_or_alloc_dev()
420 p_dev_rec = btm_sec_alloc_dev(bd_addr); in btm_find_or_alloc_dev()
422 return (p_dev_rec); in btm_find_or_alloc_dev()
445 tBTM_SEC_DEV_REC* p_dev_rec = in btm_find_oldest_dev_rec() local
448 if ((p_dev_rec->sec_flags & in btm_find_oldest_dev_rec()
451 if (p_dev_rec->timestamp < ts_oldest) { in btm_find_oldest_dev_rec()
452 p_oldest = p_dev_rec; in btm_find_oldest_dev_rec()
453 ts_oldest = p_dev_rec->timestamp; in btm_find_oldest_dev_rec()
457 if (p_dev_rec->timestamp < ts_oldest_paired) { in btm_find_oldest_dev_rec()
458 p_oldest_paired = p_dev_rec; in btm_find_oldest_dev_rec()
459 ts_oldest_paired = p_dev_rec->timestamp; in btm_find_oldest_dev_rec()
483 tBTM_SEC_DEV_REC* p_dev_rec = NULL; in btm_sec_allocate_dev_rec() local
486 p_dev_rec = btm_find_oldest_dev_rec(); in btm_sec_allocate_dev_rec()
487 wipe_secrets_and_remove(p_dev_rec); in btm_sec_allocate_dev_rec()
490 p_dev_rec = in btm_sec_allocate_dev_rec()
492 list_append(btm_cb.sec_dev_rec, p_dev_rec); in btm_sec_allocate_dev_rec()
495 p_dev_rec->sec_flags = BTM_SEC_IN_USE; in btm_sec_allocate_dev_rec()
496 p_dev_rec->bond_type = tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN; in btm_sec_allocate_dev_rec()
497 p_dev_rec->timestamp = btm_cb.dev_rec_count++; in btm_sec_allocate_dev_rec()
498 p_dev_rec->rmt_io_caps = BTM_IO_CAP_UNKNOWN; in btm_sec_allocate_dev_rec()
500 return p_dev_rec; in btm_sec_allocate_dev_rec()
515 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_get_bond_type_dev() local
517 if (p_dev_rec == NULL) return tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN; in btm_get_bond_type_dev()
519 return p_dev_rec->bond_type; in btm_get_bond_type_dev()
534 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); in btm_set_bond_type_dev() local
536 if (p_dev_rec == NULL) return false; in btm_set_bond_type_dev()
538 p_dev_rec->bond_type = bond_type; in btm_set_bond_type_dev()