Lines Matching refs:link_key
98 void bt_keys_link_key_clear(struct bt_keys_link_key *link_key) in bt_keys_link_key_clear() argument
104 bt_addr_copy(&le_addr.a, &link_key->addr); in bt_keys_link_key_clear()
109 LOG_DBG("%s", bt_addr_str(&link_key->addr)); in bt_keys_link_key_clear()
110 (void)memset(link_key, 0, sizeof(*link_key)); in bt_keys_link_key_clear()
132 void bt_keys_link_key_store(struct bt_keys_link_key *link_key) in bt_keys_link_key_store() argument
139 bt_addr_copy(&le_addr.a, &link_key->addr); in bt_keys_link_key_store()
141 err = bt_settings_store_link_key(&le_addr, link_key->storage_start, in bt_keys_link_key_store()
175 struct bt_keys_link_key *link_key; in link_key_set() local
197 link_key = bt_keys_get_link_key(&le_addr.a); in link_key_set()
199 if (link_key) { in link_key_set()
200 bt_keys_link_key_clear(link_key); in link_key_set()
209 memcpy(link_key->storage_start, val, len); in link_key_set()
212 if (aging_counter_val < link_key->aging_counter) { in link_key_set()
213 aging_counter_val = link_key->aging_counter; in link_key_set()
226 struct bt_keys_link_key *link_key = bt_keys_find_link_key(addr); in bt_keys_link_key_update_usage() local
228 if (!link_key) { in bt_keys_link_key_update_usage()
232 if (last_keys_updated == link_key) { in bt_keys_link_key_update_usage()
236 link_key->aging_counter = ++aging_counter_val; in bt_keys_link_key_update_usage()
237 last_keys_updated = link_key; in bt_keys_link_key_update_usage()
239 LOG_DBG("Aging counter for %s is set to %u", bt_addr_str(addr), link_key->aging_counter); in bt_keys_link_key_update_usage()
242 bt_keys_link_key_store(link_key); in bt_keys_link_key_update_usage()