Lines Matching refs:va

51 	struct bt_mesh_va *va = NULL;  in bt_mesh_va_add()  local
56 if (!va) { in bt_mesh_va_add()
57 va = &virtual_addrs[i]; in bt_mesh_va_add()
74 if (!va) { in bt_mesh_va_add()
78 memcpy(va->uuid, uuid, ARRAY_SIZE(va->uuid)); in bt_mesh_va_add()
79 err = bt_mesh_virtual_addr(uuid, &va->addr); in bt_mesh_va_add()
81 va->addr = BT_MESH_ADDR_UNASSIGNED; in bt_mesh_va_add()
85 va->ref = 1; in bt_mesh_va_add()
86 va_store(va); in bt_mesh_va_add()
89 *entry = va; in bt_mesh_va_add()
97 struct bt_mesh_va *va; in bt_mesh_va_del() local
103 va = CONTAINER_OF(uuid, struct bt_mesh_va, uuid[0]); in bt_mesh_va_del()
105 if (!PART_OF_ARRAY(virtual_addrs, va) || va->ref == 0) { in bt_mesh_va_del()
109 va->ref--; in bt_mesh_va_del()
110 va_store(va); in bt_mesh_va_del()
124 struct bt_mesh_va *va; in bt_mesh_va_uuid_get() local
126 va = CONTAINER_OF(uuid, struct bt_mesh_va, uuid[0]); in bt_mesh_va_uuid_get()
127 i = ARRAY_INDEX(virtual_addrs, va); in bt_mesh_va_uuid_get()
189 struct bt_mesh_va *va; in bt_mesh_va_get_uuid_by_idx() local
191 va = va_get_by_idx(idx); in bt_mesh_va_get_uuid_by_idx()
192 return (va && va->ref > 0) ? va->uuid : NULL; in bt_mesh_va_get_uuid_by_idx()
197 struct bt_mesh_va *va; in bt_mesh_va_get_idx_by_uuid() local
203 va = CONTAINER_OF(uuid, struct bt_mesh_va, uuid[0]); in bt_mesh_va_get_idx_by_uuid()
205 if (!PART_OF_ARRAY(virtual_addrs, va) || va->ref == 0) { in bt_mesh_va_get_idx_by_uuid()
209 *uuidx = ARRAY_INDEX(virtual_addrs, va); in bt_mesh_va_get_idx_by_uuid()
217 struct va_val va; in va_set() local
234 err = bt_mesh_settings_set(read_cb, cb_arg, &va, sizeof(va)); in va_set()
240 if (va.ref == 0) { in va_set()
251 memcpy(lab->uuid, va.uuid, 16); in va_set()
252 lab->addr = va.addr; in va_set()
253 lab->ref = va.ref; in va_set()
260 BT_MESH_SETTINGS_DEFINE(va, "Va", va_set);
266 struct va_val va; in bt_mesh_va_pending_store() local
283 va.ref = lab->ref; in bt_mesh_va_pending_store()
284 va.addr = lab->addr; in bt_mesh_va_pending_store()
285 memcpy(va.uuid, lab->uuid, 16); in bt_mesh_va_pending_store()
287 err = settings_save_one(path, &va, sizeof(va)); in bt_mesh_va_pending_store()