Lines Matching refs:ate_wra

47 	addr = fs->ate_wra;  in nvs_lookup_cache_rebuild()
65 if (addr == fs->ate_wra) { in nvs_lookup_cache_rebuild()
164 rc = nvs_flash_al_wrt(fs, fs->ate_wra, entry, in nvs_flash_ate_wrt()
169 fs->lookup_cache[nvs_lookup_cache_pos(entry->id)] = fs->ate_wra; in nvs_flash_ate_wrt()
172 fs->ate_wra -= nvs_al_size(fs, sizeof(struct nvs_ate)); in nvs_flash_ate_wrt()
550 *addr = fs->ate_wra; in nvs_prev_ate()
592 close_ate.offset = (uint16_t)((fs->ate_wra + ate_size) & ADDR_OFFS_MASK); in nvs_sector_close()
595 fs->ate_wra &= ADDR_SECT_MASK; in nvs_sector_close()
596 fs->ate_wra += (fs->sector_size - ate_size); in nvs_sector_close()
602 nvs_sector_advance(fs, &fs->ate_wra); in nvs_sector_close()
604 fs->data_wra = fs->ate_wra & ADDR_SECT_MASK; in nvs_sector_close()
613 LOG_DBG("Adding gc done ate at %x", fs->ate_wra & ADDR_OFFS_MASK); in nvs_add_gc_done_ate()
637 sec_addr = (fs->ate_wra & ADDR_SECT_MASK); in nvs_gc()
680 wlk_addr = fs->ate_wra; in nvs_gc()
683 wlk_addr = fs->ate_wra; in nvs_gc()
700 } while (wlk_addr != fs->ate_wra); in nvs_gc()
735 if (fs->ate_wra >= (fs->data_wra + ate_size)) { in nvs_gc()
830 fs->ate_wra = addr; in nvs_startup()
833 while (fs->ate_wra >= fs->data_wra) { in nvs_startup()
834 rc = nvs_flash_ate_rd(fs, fs->ate_wra, &last_ate); in nvs_startup()
860 if (fs->ate_wra == fs->data_wra && last_ate.len) { in nvs_startup()
867 fs->ate_wra -= ate_size; in nvs_startup()
876 addr = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
889 addr = fs->ate_wra + ate_size; in nvs_startup()
907 addr = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
913 rc = nvs_flash_erase_sector(fs, fs->ate_wra); in nvs_startup()
917 fs->ate_wra &= ADDR_SECT_MASK; in nvs_startup()
918 fs->ate_wra += (fs->sector_size - 2 * ate_size); in nvs_startup()
919 fs->data_wra = (fs->ate_wra & ADDR_SECT_MASK); in nvs_startup()
927 fs->lookup_cache[i] = fs->ate_wra; in nvs_startup()
935 while (fs->ate_wra > fs->data_wra) { in nvs_startup()
936 empty_len = fs->ate_wra - fs->data_wra; in nvs_startup()
954 if (((fs->ate_wra + 2 * ate_size) == fs->sector_size) && in nvs_startup()
955 (fs->data_wra != (fs->ate_wra & ADDR_SECT_MASK))) { in nvs_startup()
956 rc = nvs_flash_erase_sector(fs, fs->ate_wra); in nvs_startup()
960 fs->data_wra = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
973 if ((!rc) && ((fs->ate_wra & ADDR_OFFS_MASK) == in nvs_startup()
1055 (fs->ate_wra >> ADDR_SECT_SHIFT), in nvs_mount()
1056 (fs->ate_wra & ADDR_OFFS_MASK)); in nvs_mount()
1100 wlk_addr = fs->ate_wra; in nvs_write()
1114 if (wlk_addr == fs->ate_wra) { in nvs_write()
1169 if (fs->ate_wra >= (fs->data_wra + required_space)) { in nvs_write()
1234 wlk_addr = fs->ate_wra; in nvs_read_hist()
1247 if (wlk_addr == fs->ate_wra) { in nvs_read_hist()
1252 if (((wlk_addr == fs->ate_wra) && (wlk_ate.id != id)) || in nvs_read_hist()
1326 step_addr = fs->ate_wra; in nvs_calc_free_space()
1334 wlk_addr = fs->ate_wra; in nvs_calc_free_space()
1342 (wlk_addr == fs->ate_wra)) { in nvs_calc_free_space()
1360 if (step_addr == fs->ate_wra) { in nvs_calc_free_space()
1378 return fs->ate_wra - fs->data_wra - ate_size - NVS_DATA_CRC_SIZE; in nvs_sector_max_data_size()