Home | History | Annotate | Download | only in btm

Lines Matching refs:p_dev_rec

67   tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
68 if (!p_dev_rec) {
69 p_dev_rec = btm_sec_allocate_dev_rec();
71 memcpy(p_dev_rec->bd_addr, bd_addr, BD_ADDR_LEN);
72 p_dev_rec->hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_BR_EDR);
76 memset(&p_dev_rec->conn_params, 0xff, sizeof(tBTM_LE_CONN_PRAMS));
79 p_dev_rec->timestamp = btm_cb.dev_rec_count++;
87 p_dev_rec->bond_type = BOND_TYPE_UNKNOWN;
90 if (dev_class) memcpy(p_dev_rec->dev_class, dev_class, DEV_CLASS_LEN);
92 memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME));
95 p_dev_rec->sec_flags |= BTM_SEC_NAME_KNOWN;
96 strlcpy((char*)p_dev_rec->sec_bd_name, (char*)bd_name,
100 p_dev_rec->num_read_pages = 0;
103 memcpy(p_dev_rec->feature_pages, features,
104 sizeof(p_dev_rec->feature_pages));
107 if (p_dev_rec->feature_pages[i][j] != 0) {
109 p_dev_rec->num_read_pages = i + 1;
115 memset(p_dev_rec->feature_pages, 0, sizeof(p_dev_rec->feature_pages));
118 BTM_SEC_COPY_TRUSTED_DEVICE(trusted_mask, p_dev_rec->trusted_mask);
124 p_dev_rec->sec_flags |= BTM_SEC_LINK_KEY_KNOWN;
125 memcpy(p_dev_rec->link_key, link_key, LINK_KEY_LEN);
126 p_dev_rec->link_key_type = key_type;
127 p_dev_rec->pin_code_length = pin_length;
133 p_dev_rec->sec_flags |=
140 p_dev_rec->sm4 = BTM_SM4_KNOWN;
142 p_dev_rec->sm4 = BTM_SM4_TRUE;
145 p_dev_rec->rmt_io_caps = io_cap;
146 p_dev_rec->device_type |= BT_DEVICE_TYPE_BREDR;
170 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
171 if (p_dev_rec != NULL) {
172 btm_sec_free_dev(p_dev_rec);
174 BTM_DeleteStoredLinkKey(p_dev_rec->bd_addr, NULL);
189 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
190 if (p_dev_rec == NULL) return;
192 p_dev_rec->sec_flags = 0;
193 p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
194 p_dev_rec->sm4 = BTM_SM4_UNKNOWN;
218 tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data);
221 if (!memcmp(p_dev_rec->bd_addr, bd_addr, BD_ADDR_LEN)) return false;
240 tBTM_SEC_DEV_REC* p_dev_rec = btm_sec_allocate_dev_rec();
246 memcpy(p_dev_rec->dev_class, p_inq_info->results.dev_class, DEV_CLASS_LEN);
248 p_dev_rec->device_type = p_inq_info->results.device_type;
249 p_dev_rec->ble.ble_addr_type = p_inq_info->results.ble_addr_type;
251 memcpy(p_dev_rec->dev_class, btm_cb.connecting_dc, DEV_CLASS_LEN);
254 memset(&p_dev_rec->conn_params, 0xff, sizeof(tBTM_LE_CONN_PRAMS));
256 memcpy(p_dev_rec->bd_addr, bd_addr, BD_ADDR_LEN);
258 p_dev_rec->ble_hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_LE);
259 p_dev_rec->hci_handle = BTM_GetHCIConnHandle(bd_addr, BT_TRANSPORT_BR_EDR);
261 return (p_dev_rec);
271 void btm_sec_free_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
273 btm_sec_clear_ble_keys(p_dev_rec);
274 list_remove(btm_cb.sec_dev_rec, p_dev_rec);
290 tBTM_SEC_DEV_REC* p_dev_rec;
298 p_dev_rec = btm_find_dev(bd_addr);
299 if (p_dev_rec &&
301 if (HCI_SWITCH_SUPPORTED(p_dev_rec->feature_pages[0])) {
308 if (p_dev_rec->feature_pages[0][xx] != 0x00) {
326 tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data);
329 if (p_dev_rec->hci_handle == *handle || p_dev_rec->ble_hci_handle == *handle)
353 tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data);
356 if (!memcmp(p_dev_rec->bd_addr, *bd_addr, BD_ADDR_LEN)) return false;
358 if (!memcmp(p_dev_rec->ble.pseudo_addr, *bd_addr, BD_ADDR_LEN)) return false;
360 if (btm_ble_addr_resolvable(*bd_addr, p_dev_rec)) return false;
401 tBTM_SEC_DEV_REC* p_dev_rec =
404 if (p_target_rec == p_dev_rec) continue;
406 if (!memcmp(p_dev_rec->bd_addr, p_target_rec->bd_addr, BD_ADDR_LEN)) {
407 memcpy(p_target_rec, p_dev_rec, sizeof(tBTM_SEC_DEV_REC));
421 list_remove(btm_cb.sec_dev_rec, p_dev_rec);
426 if (btm_ble_addr_resolvable(p_dev_rec->bd_addr, p_target_rec)) {
427 if (memcmp(p_target_rec->ble.pseudo_addr, p_dev_rec->bd_addr,
429 p_target_rec->ble.ble_addr_type = p_dev_rec->ble.ble_addr_type;
430 p_target_rec->device_type |= p_dev_rec->device_type;
433 list_remove(btm_cb.sec_dev_rec, p_dev_rec);
451 tBTM_SEC_DEV_REC* p_dev_rec;
453 p_dev_rec = btm_find_dev(bd_addr);
454 if (p_dev_rec == NULL) {
456 p_dev_rec = btm_sec_alloc_dev(bd_addr);
458 return (p_dev_rec);
481 tBTM_SEC_DEV_REC* p_dev_rec =
484 if ((p_dev_rec->sec_flags &
487 if (p_dev_rec->timestamp < ts_oldest) {
488 p_oldest = p_dev_rec;
489 ts_oldest = p_dev_rec->timestamp;
493 if (p_dev_rec->timestamp < ts_oldest_paired) {
494 p_oldest_paired = p_dev_rec;
495 ts_oldest_paired = p_dev_rec->timestamp;
519 tBTM_SEC_DEV_REC* p_dev_rec = NULL;
522 p_dev_rec = btm_find_oldest_dev_rec();
523 list_remove(btm_cb.sec_dev_rec, p_dev_rec);
526 p_dev_rec =
528 list_append(btm_cb.sec_dev_rec, p_dev_rec);
531 p_dev_rec->sec_flags = BTM_SEC_IN_USE;
532 p_dev_rec->bond_type = BOND_TYPE_UNKNOWN;
533 p_dev_rec->timestamp = btm_cb.dev_rec_count++;
534 p_dev_rec->rmt_io_caps = BTM_IO_CAP_UNKNOWN;
536 return p_dev_rec;
550 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
552 if (p_dev_rec == NULL) return BOND_TYPE_UNKNOWN;
554 return p_dev_rec->bond_type;
568 tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
570 if (p_dev_rec == NULL) return false;
572 p_dev_rec->bond_type = bond_type;