/Zephyr-latest/subsys/fs/zms/ |
D | zms.c | 18 static int zms_prev_ate(struct zms_fs *fs, uint64_t *addr, struct zms_ate *ate); 19 static int zms_ate_valid(struct zms_fs *fs, const struct zms_ate *entry); 20 static int zms_get_sector_cycle(struct zms_fs *fs, uint64_t addr, uint8_t *cycle_cnt); 21 static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_ate *empty_ate, 23 static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_ate *entry, 43 static int zms_lookup_cache_rebuild(struct zms_fs *fs) in zms_lookup_cache_rebuild() argument 53 memset(fs->lookup_cache, 0xff, sizeof(fs->lookup_cache)); in zms_lookup_cache_rebuild() 54 addr = fs->ate_wra; in zms_lookup_cache_rebuild() 59 rc = zms_prev_ate(fs, &addr, &ate); in zms_lookup_cache_rebuild() 65 cache_entry = &fs->lookup_cache[zms_lookup_cache_pos(ate.id)]; in zms_lookup_cache_rebuild() [all …]
|
/Zephyr-latest/subsys/fs/nvs/ |
D | nvs.c | 19 static int nvs_prev_ate(struct nvs_fs *fs, uint32_t *addr, struct nvs_ate *ate); 20 static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); 39 static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) in nvs_lookup_cache_rebuild() argument 46 memset(fs->lookup_cache, 0xff, sizeof(fs->lookup_cache)); in nvs_lookup_cache_rebuild() 47 addr = fs->ate_wra; in nvs_lookup_cache_rebuild() 52 rc = nvs_prev_ate(fs, &addr, &ate); in nvs_lookup_cache_rebuild() 58 cache_entry = &fs->lookup_cache[nvs_lookup_cache_pos(ate.id)]; in nvs_lookup_cache_rebuild() 61 nvs_ate_valid(fs, &ate)) { in nvs_lookup_cache_rebuild() 65 if (addr == fs->ate_wra) { in nvs_lookup_cache_rebuild() 73 static void nvs_lookup_cache_invalidate(struct nvs_fs *fs, uint32_t sector) in nvs_lookup_cache_invalidate() argument [all …]
|
/Zephyr-latest/tests/subsys/fs/zms/src/ |
D | main.c | 39 struct zms_fs fs; member 56 fixture.fs.offset = TEST_ZMS_AREA_OFFSET; in setup() 57 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, &info); in setup() 60 fixture.fs.sector_size = info.size; in setup() 61 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup() 62 fixture.fs.flash_device = flash_area_get_device(fa); in setup() 87 if (fixture->fs.ready) { in after() 90 err = zms_clear(&fixture->fs); in after() 94 fixture->fs.sector_count = TEST_SECTOR_COUNT; in after() 103 err = zms_mount(&fixture->fs); in ZTEST_F() [all …]
|
/Zephyr-latest/tests/subsys/fs/nvs/src/ |
D | main.c | 41 struct nvs_fs fs; member 58 fixture.fs.offset = TEST_NVS_FLASH_AREA_OFFSET; in setup() 59 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, in setup() 63 fixture.fs.sector_size = info.size; in setup() 64 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup() 65 fixture.fs.flash_device = flash_area_get_device(fa); in setup() 90 if (fixture->fs.ready) { in after() 93 err = nvs_clear(&fixture->fs); in after() 97 fixture->fs.sector_count = TEST_SECTOR_COUNT; in after() 106 err = nvs_mount(&fixture->fs); in ZTEST_F() [all …]
|
/Zephyr-latest/samples/subsys/fs/zms/src/ |
D | main.c | 18 static struct zms_fs fs; variable 32 static int delete_and_verify_items(struct zms_fs *fs, uint32_t id) in delete_and_verify_items() argument 36 rc = zms_delete(fs, id); in delete_and_verify_items() 40 rc = zms_get_data_length(fs, id); in delete_and_verify_items() 54 static int delete_basic_items(struct zms_fs *fs) in delete_basic_items() argument 58 rc = delete_and_verify_items(fs, IP_ADDRESS_ID); in delete_basic_items() 63 rc = delete_and_verify_items(fs, KEY_VALUE_ID); in delete_basic_items() 68 rc = delete_and_verify_items(fs, CNT_ID); in delete_basic_items() 73 rc = delete_and_verify_items(fs, LONG_DATA_ID); in delete_basic_items() 101 fs.flash_device = ZMS_PARTITION_DEVICE; in main() [all …]
|
/Zephyr-latest/subsys/fs/ext2/ |
D | ext2_diskops.c | 25 static int get_level_offsets(struct ext2_data *fs, uint32_t block, uint32_t offsets[4]); 26 static inline uint32_t get_ngroups(struct ext2_data *fs); 201 int ext2_fetch_superblock(struct ext2_data *fs) in ext2_fetch_superblock() argument 206 if (fs->block_size == 1024) { in ext2_fetch_superblock() 208 b = ext2_get_block(fs, 1); in ext2_fetch_superblock() 211 b = ext2_get_block(fs, 0); in ext2_fetch_superblock() 220 fill_sblock(&fs->sblock, disk_sb); in ext2_fetch_superblock() 226 static inline uint32_t get_ngroups(struct ext2_data *fs) in get_ngroups() argument 229 fs->sblock.s_blocks_count / fs->sblock.s_blocks_per_group; in get_ngroups() 231 if (fs->sblock.s_blocks_count % fs->sblock.s_blocks_per_group != 0) { in get_ngroups() [all …]
|
D | ext2_disk_access.c | 22 static int64_t disk_access_device_size(struct ext2_data *fs) in disk_access_device_size() argument 24 struct disk_data *disk = fs->backend; in disk_access_device_size() 29 static int64_t disk_access_write_size(struct ext2_data *fs) in disk_access_write_size() argument 31 struct disk_data *disk = fs->backend; in disk_access_write_size() 89 static int disk_access_read_block(struct ext2_data *fs, void *buf, uint32_t block) in disk_access_read_block() argument 92 struct disk_data *disk = fs->backend; in disk_access_read_block() 95 rc = disk_prepare_range(disk, block * fs->block_size, fs->block_size, in disk_access_read_block() 103 static int disk_access_write_block(struct ext2_data *fs, const void *buf, uint32_t block) in disk_access_write_block() argument 106 struct disk_data *disk = fs->backend; in disk_access_write_block() 109 rc = disk_prepare_range(disk, block * fs->block_size, fs->block_size, in disk_access_write_block() [all …]
|
D | ext2_impl.h | 17 void error_behavior(struct ext2_data *fs, const char *msg); 24 int ext2_init_disk_access_backend(struct ext2_data *fs, const void *storage_dev, int flags); 29 struct ext2_block *ext2_get_block(struct ext2_data *fs, uint32_t block); 31 struct ext2_block *ext2_get_empty_block(struct ext2_data *fs); 44 int ext2_write_block(struct ext2_data *fs, struct ext2_block *b); 46 void ext2_init_blocks_slab(struct ext2_data *fs); 54 int ext2_write_block(struct ext2_data *fs, struct ext2_block *b); 56 int ext2_assign_block_num(struct ext2_data *fs, struct ext2_block *b); 90 int ext2_init_fs(struct ext2_data *fs); 96 int ext2_close_fs(struct ext2_data *fs); [all …]
|
D | ext2_ops.c | 29 struct ext2_data *fs = filp->mp->fs_data; in ext2_open() local 31 if (fs->open_files >= CONFIG_MAX_FILES) { in ext2_open() 54 rc = ext2_lookup_inode(fs, &args); in ext2_open() 72 rc = ext2_inode_get(fs, 0, &new_inode); in ext2_open() 244 struct ext2_data *fs = mountp->fs_data; in ext2_mkdir() local 255 rc = ext2_lookup_inode(fs, &args); in ext2_mkdir() 271 rc = ext2_inode_get(fs, 0, &found_inode); in ext2_mkdir() 293 struct ext2_data *fs = dirp->mp->fs_data; in ext2_opendir() local 300 rc = ext2_lookup_inode(fs, &args); in ext2_opendir() 371 struct ext2_data *fs = NULL; in ext2_mount() local [all …]
|
D | ext2_diskops.h | 19 int ext2_fetch_superblock(struct ext2_data *fs); 31 int ext2_fetch_inode(struct ext2_data *fs, uint32_t ino, struct ext2_inode *inode); 55 int ext2_fetch_block_group(struct ext2_data *fs, uint32_t group); 107 int ext2_clear_inode(struct ext2_data *fs, uint32_t ino); 146 int ext2_commit_superblock(struct ext2_data *fs); 159 int ext2_commit_bg(struct ext2_data *fs); 177 int64_t ext2_alloc_block(struct ext2_data *fs); 190 int32_t ext2_alloc_inode(struct ext2_data *fs); 200 int ext2_free_block(struct ext2_data *fs, uint32_t block); 212 int ext2_free_inode(struct ext2_data *fs, uint32_t ino, bool directory);
|
D | ext2_impl.c | 39 void error_behavior(struct ext2_data *fs, const char *msg) in error_behavior() argument 49 switch (fs->sblock.s_errors) { in error_behavior() 55 fs->flags |= EXT2_DATA_FLAGS_RO; in error_behavior() 89 struct ext2_block *ext2_get_block(struct ext2_data *fs, uint32_t block) in ext2_get_block() argument 99 ret = fs->backend_ops->read_block(fs, b->data, block); in ext2_get_block() 108 struct ext2_block *ext2_get_empty_block(struct ext2_data *fs) in ext2_get_empty_block() argument 117 memset(b->data, 0, fs->block_size); in ext2_get_empty_block() 121 int ext2_write_block(struct ext2_data *fs, struct ext2_block *b) in ext2_write_block() argument 129 ret = fs->backend_ops->write_block(fs, b->data, b->num); in ext2_write_block() 148 void ext2_init_blocks_slab(struct ext2_data *fs) in ext2_init_blocks_slab() argument [all …]
|
D | ext2_format.c | 96 int ext2_format(struct ext2_data *fs, struct ext2_cfg *cfg) in ext2_format() argument 105 uint32_t fs_memory = cfg->fs_size ? MIN(cfg->fs_size, fs->device_size) : fs->device_size; in ext2_format() 113 LOG_INF("[Memory] available:%lld requested:%d", fs->device_size, fs_memory); in ext2_format() 115 if (fs_memory > fs->device_size) { in ext2_format() 121 fs_memory -= CONFIG_EXT2_DISK_STARTING_SECTOR * fs->write_size; in ext2_format() 195 struct ext2_block *sb_block = ext2_get_block(fs, first_data_block); in ext2_format() 196 struct ext2_block *bg_block = ext2_get_block(fs, bg_block_num); in ext2_format() 197 struct ext2_block *bbitmap_block = ext2_get_block(fs, bbitmap_block_num); in ext2_format() 198 struct ext2_block *ibitmap_block = ext2_get_block(fs, ibitmap_block_num); in ext2_format() 254 if (ext2_write_block(fs, sb_block) < 0) { in ext2_format() [all …]
|
/Zephyr-latest/subsys/net/l2/ieee802154/ |
D | ieee802154_frame.c | 26 #define dbg_print_fs(fs) \ argument 27 NET_DBG("fs(1): %u/%u/%u/%u/%u/%u", fs->fc.frame_type, fs->fc.security_enabled, \ 28 fs->fc.frame_pending, fs->fc.ar, fs->fc.pan_id_comp, fs->fc.reserved); \ 29 NET_DBG("fs(2): %u/%u/%u/%u/%u - %u", fs->fc.seq_num_suppr, fs->fc.ie_list, \ 30 fs->fc.dst_addr_mode, fs->fc.frame_version, fs->fc.src_addr_mode, fs->sequence) 43 struct ieee802154_fcf_seq *fs = (struct ieee802154_fcf_seq *)buf; in ieee802154_validate_fc_seq() local 45 dbg_print_fs(fs); in ieee802154_validate_fc_seq() 48 if (fs->fc.frame_type == IEEE802154_FRAME_TYPE_RESERVED || in ieee802154_validate_fc_seq() 49 fs->fc.frame_version >= IEEE802154_VERSION_RESERVED) { in ieee802154_validate_fc_seq() 53 if (fs->fc.frame_type == IEEE802154_FRAME_TYPE_MULTIPURPOSE) { in ieee802154_validate_fc_seq() [all …]
|
D | ieee802154.c | 79 if (!mpdu->mhr.fs->fc.ar) { in ieee802154_acknowledge() 89 if (ieee802154_create_ack_frame(iface, pkt, mpdu->mhr.fs->sequence)) { in ieee802154_acknowledge() 109 struct ieee802154_fcf_seq *fs = (struct ieee802154_fcf_seq *)frag->data; in ieee802154_prepare_for_ack() local 112 ctx->ack_seq = fs->sequence; in ieee802154_prepare_for_ack() 135 struct ieee802154_fcf_seq *fs; in ieee802154_handle_ack() local 137 fs = ieee802154_validate_fc_seq(net_pkt_data(pkt), NULL, &len); in ieee802154_handle_ack() 138 if (!fs || fs->fc.frame_type != IEEE802154_FRAME_TYPE_ACK || in ieee802154_handle_ack() 139 fs->sequence != ctx->ack_seq) { in ieee802154_handle_ack() 299 if (mhr->fs->fc.dst_addr_mode == IEEE802154_ADDR_MODE_NONE) { in ieee802154_check_dst_addr() 300 if (mhr->fs->fc.frame_version < IEEE802154_VERSION_802154 && in ieee802154_check_dst_addr() [all …]
|
/Zephyr-latest/samples/subsys/nvs/src/ |
D | main.c | 49 static struct nvs_fs fs; variable 81 fs.flash_device = NVS_PARTITION_DEVICE; in main() 82 if (!device_is_ready(fs.flash_device)) { in main() 83 printk("Flash device %s is not ready\n", fs.flash_device->name); in main() 86 fs.offset = NVS_PARTITION_OFFSET; in main() 87 rc = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &info); in main() 92 fs.sector_size = info.size; in main() 93 fs.sector_count = 3U; in main() 95 rc = nvs_mount(&fs); in main() 105 rc = nvs_read(&fs, ADDRESS_ID, &buf, sizeof(buf)); in main() [all …]
|
/Zephyr-latest/subsys/fs/ |
D | littlefs_fs.c | 91 static inline void fs_lock(struct fs_littlefs *fs) in fs_lock() argument 93 k_mutex_lock(&fs->mutex, K_FOREVER); in fs_lock() 96 static inline void fs_unlock(struct fs_littlefs *fs) in fs_unlock() argument 98 k_mutex_unlock(&fs->mutex); in fs_unlock() 292 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_open() local 293 struct lfs *lfs = &fs->lfs; in littlefs_open() 314 fs_lock(fs); in littlefs_open() 316 ret = lfs_file_opencfg(&fs->lfs, &fdp->file, in littlefs_open() 319 fs_unlock(fs); in littlefs_open() 330 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_close() local [all …]
|
D | fs.c | 22 LOG_MODULE_REGISTER(fs); 160 CHECKIF(mp->fs->open == NULL) { in fs_open() 170 CHECKIF(mp->fs->truncate == NULL) { in fs_open() 178 rc = mp->fs->open(zfp, file_name, flags); in fs_open() 190 rc = mp->fs->truncate(zfp, 0); in fs_open() 209 CHECKIF(zfp->mp->fs->close == NULL) { in fs_close() 213 rc = zfp->mp->fs->close(zfp); in fs_close() 232 CHECKIF(zfp->mp->fs->read == NULL) { in fs_read() 236 rc = zfp->mp->fs->read(zfp, ptr, size); in fs_read() 252 CHECKIF(zfp->mp->fs->write == NULL) { in fs_write() [all …]
|
/Zephyr-latest/include/zephyr/fs/ |
D | zms.h | 86 int zms_mount(struct zms_fs *fs); 95 int zms_clear(struct zms_fs *fs); 114 ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); 124 int zms_delete(struct zms_fs *fs, uint32_t id); 138 ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); 154 ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt); 165 ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id); 177 ssize_t zms_calc_free_space(struct zms_fs *fs); 186 size_t zms_active_sector_free_space(struct zms_fs *fs); 201 int zms_sector_use_next(struct zms_fs *fs);
|
D | nvs.h | 85 int nvs_mount(struct nvs_fs *fs); 94 int nvs_clear(struct nvs_fs *fs); 113 ssize_t nvs_write(struct nvs_fs *fs, uint16_t id, const void *data, size_t len); 123 int nvs_delete(struct nvs_fs *fs, uint16_t id); 138 ssize_t nvs_read(struct nvs_fs *fs, uint16_t id, void *data, size_t len); 154 ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, uint16_t cnt); 165 ssize_t nvs_calc_free_space(struct nvs_fs *fs); 174 size_t nvs_sector_max_data_size(struct nvs_fs *fs); 189 int nvs_sector_use_next(struct nvs_fs *fs);
|
/Zephyr-latest/tests/subsys/fs/fat_fs_api/src/ |
D | test_fat_rd_only_mount.c | 19 struct fs_file_t fs; in test_prepare() local 21 fs_file_t_init(&fs); in test_prepare() 23 zassert_equal(fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_CREATE), in test_prepare() 25 zassert_equal(fs_close(&fs), 0); in test_prepare() 36 struct fs_file_t fs; in test_ops_on_rd() local 39 fs_file_t_init(&fs); in test_ops_on_rd() 47 ret = fs_open(&fs, FATFS_MNTP"/nosome", FS_O_CREATE); in test_ops_on_rd() 55 ret = fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_RDWR); in test_ops_on_rd() 57 ret = fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_READ); in test_ops_on_rd() 59 fs_close(&fs); in test_ops_on_rd()
|
/Zephyr-latest/tests/subsys/fs/common/ |
D | test_fs_mount_flags.c | 19 struct fs_file_t fs; in test_fs_mount_flags() local 22 fs_file_t_init(&fs); in test_fs_mount_flags() 42 ret = fs_open(&fs, "/sml/some", FS_O_CREATE); in test_fs_mount_flags() 44 fs_close(&fs); in test_fs_mount_flags() 59 ret = fs_open(&fs, "/sml/nosome", FS_O_CREATE); in test_fs_mount_flags() 67 ret = fs_open(&fs, "/sml/other", FS_O_CREATE); in test_fs_mount_flags() 69 ret = fs_open(&fs, "/sml/some", FS_O_RDWR); in test_fs_mount_flags() 71 ret = fs_open(&fs, "/sml/some", FS_O_READ); in test_fs_mount_flags() 73 fs_close(&fs); in test_fs_mount_flags()
|
/Zephyr-latest/tests/subsys/fs/fs_api/src/ |
D | test_fs_mount_flags.c | 21 struct fs_file_t fs; in test_mount_flags() local 23 fs_file_t_init(&fs); in test_mount_flags() 31 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_CREATE); in test_mount_flags() 34 ret = fs_close(&fs); in test_mount_flags() 49 ret = fs_open(&fs, TEST_FS_MNTP"/nosome", FS_O_CREATE); in test_mount_flags() 57 ret = fs_open(&fs, TEST_FS_MNTP"/other", FS_O_CREATE); in test_mount_flags() 59 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_RDWR); in test_mount_flags() 61 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_READ); in test_mount_flags() 63 ret = fs_close(&fs); in test_mount_flags()
|
/Zephyr-latest/drivers/sensor/st/lis2de12/ |
D | lis2de12.c | 42 uint16_t fs; member 58 if (range == lis2de12_accel_fs_map[i].fs) { in lis2de12_accel_range_to_fs_val() 66 static int lis2de12_accel_set_fs_raw(const struct device *dev, uint8_t fs) in lis2de12_accel_set_fs_raw() argument 72 if (lis2de12_full_scale_set(ctx, fs) < 0) { in lis2de12_accel_set_fs_raw() 76 data->accel_fs = fs; in lis2de12_accel_set_fs_raw() 115 int fs; in lis2de12_accel_range_set() local 118 fs = lis2de12_accel_range_to_fs_val(range); in lis2de12_accel_range_set() 119 if (fs < 0) { in lis2de12_accel_range_set() 120 return fs; in lis2de12_accel_range_set() 123 if (lis2de12_accel_set_fs_raw(dev, fs) < 0) { in lis2de12_accel_range_set() [all …]
|
/Zephyr-latest/drivers/sensor/st/lis2du12/ |
D | lis2du12.c | 88 static int lis2du12_accel_set_fs_raw(const struct device *dev, uint8_t fs) in lis2du12_accel_set_fs_raw() argument 99 mode.fs = fs; in lis2du12_accel_set_fs_raw() 104 data->accel_fs = fs; in lis2du12_accel_set_fs_raw() 149 int fs; in lis2du12_accel_range_set() local 152 fs = lis2du12_accel_range_to_fs_val(range); in lis2du12_accel_range_set() 153 if (fs < 0) { in lis2du12_accel_range_set() 154 return fs; in lis2du12_accel_range_set() 157 if (lis2du12_accel_set_fs_raw(dev, fs) < 0) { in lis2du12_accel_range_set() 162 data->acc_gain = lis2du12_accel_fs_map[fs] * GAIN_UNIT_XL / 2; in lis2du12_accel_range_set() 208 md.fs = cfg->accel_range; in lis2du12_sample_fetch_accel() [all …]
|
/Zephyr-latest/drivers/sensor/st/lsm9ds1/ |
D | lsm9ds1.c | 94 static int lsm9ds1_accel_fs_val_to_gain(int fs) in lsm9ds1_accel_fs_val_to_gain() argument 96 return lsm9ds1_accel_fs_sens[fs]; in lsm9ds1_accel_fs_val_to_gain() 273 int fs; in lsm9ds1_accel_range_set() local 279 fs = lsm9ds1_accel_range_to_fs_val(range); in lsm9ds1_accel_range_set() 280 if (fs < 0) { in lsm9ds1_accel_range_set() 282 return fs; in lsm9ds1_accel_range_set() 285 ret = lsm9ds1_xl_full_scale_set(ctx, fs); in lsm9ds1_accel_range_set() 291 data->acc_gain = lsm9ds1_accel_fs_val_to_gain(fs); in lsm9ds1_accel_range_set() 297 int fs; in lsm9ds1_gyro_range_set() local 303 fs = lsm9ds1_gyro_range_to_fs_val(range); in lsm9ds1_gyro_range_set() [all …]
|