Lines Matching refs:bt_mesh_cdb

26 LOG_MODULE_REGISTER(bt_mesh_cdb);
84 struct bt_mesh_cdb bt_mesh_cdb = { variable
120 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes); i++) { in addr_is_free()
121 struct bt_mesh_cdb_node *node = &bt_mesh_cdb.nodes[i]; in addr_is_free()
153 uint16_t addr = bt_mesh_cdb.lowest_avail_addr; in find_lowest_free_addr()
162 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes) + 2; ++i) { in find_lowest_free_addr()
200 bt_mesh_cdb.iv_index = net.iv.index; in cdb_net_set()
203 atomic_set_bit(bt_mesh_cdb.flags, BT_MESH_CDB_IVU_IN_PROGRESS); in cdb_net_set()
206 bt_mesh_cdb.lowest_avail_addr = net.lowest_avail_addr; in cdb_net_set()
208 atomic_set_bit(bt_mesh_cdb.flags, BT_MESH_CDB_VALID); in cdb_net_set()
560 atomic_set_bit(bt_mesh_cdb.flags, flag); in schedule_cdb_store()
721 } else if (addr < bt_mesh_cdb.lowest_avail_addr) { in addr_assign()
737 if (atomic_test_and_set_bit(bt_mesh_cdb.flags, in bt_mesh_cdb_create()
752 bt_mesh_cdb.iv_index = 0; in bt_mesh_cdb_create()
753 bt_mesh_cdb.lowest_avail_addr = 1; in bt_mesh_cdb_create()
767 atomic_clear_bit(bt_mesh_cdb.flags, BT_MESH_CDB_VALID); in bt_mesh_cdb_clear()
769 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes); ++i) { in bt_mesh_cdb_clear()
770 if (bt_mesh_cdb.nodes[i].addr != BT_MESH_ADDR_UNASSIGNED) { in bt_mesh_cdb_clear()
771 bt_mesh_cdb_node_del(&bt_mesh_cdb.nodes[i], true); in bt_mesh_cdb_clear()
775 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.subnets); ++i) { in bt_mesh_cdb_clear()
776 if (bt_mesh_cdb.subnets[i].net_idx != BT_MESH_KEY_UNUSED) { in bt_mesh_cdb_clear()
777 bt_mesh_cdb_subnet_del(&bt_mesh_cdb.subnets[i], true); in bt_mesh_cdb_clear()
781 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.app_keys); ++i) { in bt_mesh_cdb_clear()
782 if (bt_mesh_cdb.app_keys[i].net_idx != BT_MESH_KEY_UNUSED) { in bt_mesh_cdb_clear()
783 bt_mesh_cdb_app_key_del(&bt_mesh_cdb.app_keys[i], true); in bt_mesh_cdb_clear()
798 if (!iv_update || iv_index > bt_mesh_cdb.iv_index + 1) { in bt_mesh_cdb_iv_update()
799 bt_mesh_cdb.lowest_avail_addr = 1; in bt_mesh_cdb_iv_update()
802 bt_mesh_cdb.iv_index = iv_index; in bt_mesh_cdb_iv_update()
804 atomic_set_bit_to(bt_mesh_cdb.flags, BT_MESH_CDB_IVU_IN_PROGRESS, in bt_mesh_cdb_iv_update()
821 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.subnets); ++i) { in bt_mesh_cdb_subnet_alloc()
822 sub = &bt_mesh_cdb.subnets[i]; in bt_mesh_cdb_subnet_alloc()
854 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.subnets); ++i) { in bt_mesh_cdb_subnet_get()
855 if (bt_mesh_cdb.subnets[i].net_idx == net_idx) { in bt_mesh_cdb_subnet_get()
856 return &bt_mesh_cdb.subnets[i]; in bt_mesh_cdb_subnet_get()
878 if (atomic_test_bit(bt_mesh_cdb.flags, BT_MESH_CDB_IVU_IN_PROGRESS)) { in bt_mesh_cdb_subnet_flags()
913 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes); i++) { in bt_mesh_cdb_node_alloc()
914 struct bt_mesh_cdb_node *node = &bt_mesh_cdb.nodes[i]; in bt_mesh_cdb_node_alloc()
942 if (store && node->addr + node->num_elem > bt_mesh_cdb.lowest_avail_addr) { in bt_mesh_cdb_node_del()
943 bt_mesh_cdb.lowest_avail_addr = node->addr + node->num_elem; in bt_mesh_cdb_node_del()
977 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes); i++) { in bt_mesh_cdb_node_get()
978 struct bt_mesh_cdb_node *node = &bt_mesh_cdb.nodes[i]; in bt_mesh_cdb_node_get()
1000 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.nodes); ++i) { in bt_mesh_cdb_node_foreach()
1001 if (bt_mesh_cdb.nodes[i].addr == BT_MESH_ADDR_UNASSIGNED) { in bt_mesh_cdb_node_foreach()
1005 if (func(&bt_mesh_cdb.nodes[i], user_data) == in bt_mesh_cdb_node_foreach()
1034 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.app_keys); ++i) { in bt_mesh_cdb_app_key_alloc()
1035 key = &bt_mesh_cdb.app_keys[i]; in bt_mesh_cdb_app_key_alloc()
1075 for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.app_keys); i++) { in bt_mesh_cdb_app_key_get()
1076 struct bt_mesh_cdb_app_key *key = &bt_mesh_cdb.app_keys[i]; in bt_mesh_cdb_app_key_get()
1129 net.iv.index = bt_mesh_cdb.iv_index; in store_cdb_pending_net()
1130 net.iv.update = atomic_test_bit(bt_mesh_cdb.flags, in store_cdb_pending_net()
1132 net.lowest_avail_addr = bt_mesh_cdb.lowest_avail_addr; in store_cdb_pending_net()
1219 if (atomic_test_and_clear_bit(bt_mesh_cdb.flags, in bt_mesh_cdb_pending_store()
1221 if (atomic_test_bit(bt_mesh_cdb.flags, in bt_mesh_cdb_pending_store()
1229 if (atomic_test_and_clear_bit(bt_mesh_cdb.flags, in bt_mesh_cdb_pending_store()
1234 if (atomic_test_and_clear_bit(bt_mesh_cdb.flags, in bt_mesh_cdb_pending_store()