Lines Matching refs:net_idx
48 uint16_t net_idx; member
65 uint16_t net_idx; member
92 .net_idx = BT_MESH_KEY_UNUSED,
98 .net_idx = BT_MESH_KEY_UNUSED,
250 val.net_idx); in cdb_node_set()
281 uint16_t net_idx; in cdb_subnet_set() local
289 net_idx = strtol(name, NULL, 16); in cdb_subnet_set()
290 sub = bt_mesh_cdb_subnet_get(net_idx); in cdb_subnet_set()
295 LOG_ERR("No subnet with NetKeyIndex 0x%03x", net_idx); in cdb_subnet_set()
299 LOG_DBG("Deleting NetKeyIndex 0x%03x", net_idx); in cdb_subnet_set()
317 LOG_DBG("Updating existing NetKeyIndex 0x%03x", net_idx); in cdb_subnet_set()
326 sub = bt_mesh_cdb_subnet_alloc(net_idx); in cdb_subnet_set()
336 LOG_DBG("NetKeyIndex 0x%03x recovered from storage", net_idx); in cdb_subnet_set()
383 app = bt_mesh_cdb_app_key_alloc(key.net_idx, app_idx); in cdb_app_key_set()
446 val.net_idx = node->net_idx; in store_cdb_node()
489 LOG_DBG("NetKeyIndex 0x%03x NetKey %s", sub->net_idx, in store_cdb_subnet()
497 snprintk(path, sizeof(path), "bt/mesh/cdb/Subnet/%x", sub->net_idx); in store_cdb_subnet()
507 static void clear_cdb_subnet(uint16_t net_idx) in clear_cdb_subnet() argument
512 LOG_DBG("NetKeyIndex 0x%03x", net_idx); in clear_cdb_subnet()
514 snprintk(path, sizeof(path), "bt/mesh/cdb/Subnet/%x", net_idx); in clear_cdb_subnet()
517 LOG_ERR("Failed to clear NetKeyIndex 0x%03x", net_idx); in clear_cdb_subnet()
519 LOG_DBG("Cleared NetKeyIndex 0x%03x", net_idx); in clear_cdb_subnet()
529 key.net_idx = app->net_idx; in store_cdb_app_key()
658 LOG_DBG("NetKeyIndex 0x%03x", sub->net_idx); in update_cdb_subnet_settings()
660 update = cdb_key_update_find(false, sub->net_idx, &free_slot); in update_cdb_subnet_settings()
671 clear_cdb_subnet(sub->net_idx); in update_cdb_subnet_settings()
677 free_slot->key_idx = sub->net_idx; in update_cdb_subnet_settings()
776 if (bt_mesh_cdb.subnets[i].net_idx != BT_MESH_KEY_UNUSED) { in bt_mesh_cdb_clear()
782 if (bt_mesh_cdb.app_keys[i].net_idx != BT_MESH_KEY_UNUSED) { in bt_mesh_cdb_clear()
812 struct bt_mesh_cdb_subnet *bt_mesh_cdb_subnet_alloc(uint16_t net_idx) in bt_mesh_cdb_subnet_alloc() argument
817 if (bt_mesh_cdb_subnet_get(net_idx) != NULL) { in bt_mesh_cdb_subnet_alloc()
824 if (sub->net_idx != BT_MESH_KEY_UNUSED) { in bt_mesh_cdb_subnet_alloc()
828 sub->net_idx = net_idx; in bt_mesh_cdb_subnet_alloc()
838 LOG_DBG("NetIdx 0x%03x store %u", sub->net_idx, store); in bt_mesh_cdb_subnet_del()
844 sub->net_idx = BT_MESH_KEY_UNUSED; in bt_mesh_cdb_subnet_del()
850 struct bt_mesh_cdb_subnet *bt_mesh_cdb_subnet_get(uint16_t net_idx) in bt_mesh_cdb_subnet_get() argument
855 if (bt_mesh_cdb.subnets[i].net_idx == net_idx) { in bt_mesh_cdb_subnet_get()
904 uint8_t num_elem, uint16_t net_idx) in bt_mesh_cdb_node_alloc() argument
920 node->net_idx = net_idx; in bt_mesh_cdb_node_alloc()
1028 struct bt_mesh_cdb_app_key *bt_mesh_cdb_app_key_alloc(uint16_t net_idx, uint16_t app_idx) in bt_mesh_cdb_app_key_alloc() argument
1041 if (key->net_idx != BT_MESH_KEY_UNUSED || vacant_key) { in bt_mesh_cdb_app_key_alloc()
1049 vacant_key->net_idx = net_idx; in bt_mesh_cdb_app_key_alloc()
1064 key->net_idx = BT_MESH_KEY_UNUSED; in bt_mesh_cdb_app_key_del()
1078 if (key->net_idx != BT_MESH_KEY_UNUSED && in bt_mesh_cdb_app_key_get()