UbixOS
2.0
|
Go to the source code of this file.
Data Structures | |
struct | disk_if |
struct | fat_buffer |
struct | fatfs |
struct | fs_dir_ent |
struct | fs_dir_list_status |
Macros | |
#define | FAT_DIR_ENTRIES_PER_SECTOR (FAT_SECTOR_SIZE / FAT_DIR_ENTRY_SIZE) |
#define | FAT_INIT_ENDIAN_ERROR (-4) |
#define | FAT_INIT_INVALID_SECTOR_SIZE (-2) |
#define | FAT_INIT_INVALID_SIGNATURE (-3) |
#define | FAT_INIT_MEDIA_ACCESS_ERROR (-1) |
#define | FAT_INIT_OK 0 |
#define | FAT_INIT_STRUCT_PACKING (-7) |
#define | FAT_INIT_WRONG_FILESYS_TYPE (-5) |
#define | FAT_INIT_WRONG_PARTITION_TYPE (-6) |
Typedefs | |
typedef int(* | fn_diskio_read) (uint32 sector, uint8 *buffer, uint32 sector_count) |
typedef int(* | fn_diskio_write) (uint32 sector, uint8 *buffer, uint32 sector_count) |
typedef enum eFatType | tFatType |
Enumerations | |
enum | eFatType { FAT_TYPE_16, FAT_TYPE_32 } |
Functions | |
uint32 | fatfs_get_file_entry (struct fatfs *fs, uint32 Cluster, char *nametofind, struct fat_dir_entry *sfEntry) |
uint32 | fatfs_get_root_cluster (struct fatfs *fs) |
int | fatfs_init (struct fatfs *fs) |
uint32 | fatfs_lba_of_cluster (struct fatfs *fs, uint32 Cluster_Number) |
int | fatfs_list_directory_next (struct fatfs *fs, struct fs_dir_list_status *dirls, struct fs_dir_ent *entry) |
void | fatfs_list_directory_start (struct fatfs *fs, struct fs_dir_list_status *dirls, uint32 StartCluster) |
int | fatfs_mark_file_deleted (struct fatfs *fs, uint32 Cluster, char *shortname) |
int | fatfs_read_sector (struct fatfs *fs, uint32 cluster, uint32 sector, uint8 *target) |
int | fatfs_sector_read (struct fatfs *fs, uint32 lba, uint8 *target, uint32 count) |
int | fatfs_sector_reader (struct fatfs *fs, uint32 Startcluster, uint32 offset, uint8 *target) |
int | fatfs_sector_write (struct fatfs *fs, uint32 lba, uint8 *target, uint32 count) |
int | fatfs_sfn_exists (struct fatfs *fs, uint32 Cluster, char *shortname) |
void | fatfs_show_details (struct fatfs *fs) |
int | fatfs_update_file_length (struct fatfs *fs, uint32 Cluster, char *shortname, uint32 fileLength) |
int | fatfs_update_timestamps (struct fat_dir_entry *directoryEntry, int create, int modify, int access) |
int | fatfs_write_sector (struct fatfs *fs, uint32 cluster, uint32 sector, uint8 *target) |
#define FAT_DIR_ENTRIES_PER_SECTOR (FAT_SECTOR_SIZE / FAT_DIR_ENTRY_SIZE) |
Definition at line 19 of file fat_access.h.
#define FAT_INIT_ENDIAN_ERROR (-4) |
Definition at line 14 of file fat_access.h.
#define FAT_INIT_INVALID_SECTOR_SIZE (-2) |
Definition at line 12 of file fat_access.h.
#define FAT_INIT_INVALID_SIGNATURE (-3) |
Definition at line 13 of file fat_access.h.
#define FAT_INIT_MEDIA_ACCESS_ERROR (-1) |
Definition at line 11 of file fat_access.h.
#define FAT_INIT_OK 0 |
Definition at line 10 of file fat_access.h.
#define FAT_INIT_STRUCT_PACKING (-7) |
Definition at line 17 of file fat_access.h.
#define FAT_INIT_WRONG_FILESYS_TYPE (-5) |
Definition at line 15 of file fat_access.h.
#define FAT_INIT_WRONG_PARTITION_TYPE (-6) |
Definition at line 16 of file fat_access.h.
Definition at line 24 of file fat_access.h.
Definition at line 25 of file fat_access.h.
enum eFatType |
Enumerator | |
---|---|
FAT_TYPE_16 | |
FAT_TYPE_32 |
Definition at line 51 of file fat_access.h.
uint32 fatfs_get_file_entry | ( | struct fatfs * | fs, |
uint32 | Cluster, | ||
char * | nametofind, | ||
struct fat_dir_entry * | sfEntry | ||
) |
Definition at line 380 of file fat_access.c.
References FAT_DIR_ENTRIES_PER_SECTOR, FAT_DIR_ENTRY_SIZE, fatfs_compare_names(), fatfs_entry_lfn_exists(), fatfs_entry_lfn_invalid(), fatfs_entry_lfn_text(), fatfs_entry_sfn_only(), fatfs_lfn_cache_entry(), fatfs_lfn_cache_get(), fatfs_lfn_cache_init(), fatfs_sector_reader(), memcpy(), memset(), and NULL.
Definition at line 373 of file fat_access.c.
int fatfs_init | ( | struct fatfs * | fs | ) |
Definition at line 43 of file fat_access.c.
References BPB_BYTSPERSEC, BPB_FAT32_FATSZ32, BPB_FAT32_FSINFO, BPB_FAT32_ROOTCLUS, BPB_FATSZ16, BPB_NUMFATS, BPB_ROOTENTCNT, BPB_RSVDSECCNT, BPB_SECPERCLUS, BPB_TOTSEC16, BPB_TOTSEC32, FAT32_INVALID_CLUSTER, FAT_DIR_ENTRY_SIZE, FAT_INIT_ENDIAN_ERROR, FAT_INIT_INVALID_SECTOR_SIZE, FAT_INIT_INVALID_SIGNATURE, FAT_INIT_MEDIA_ACCESS_ERROR, FAT_INIT_OK, FAT_INIT_STRUCT_PACKING, FAT_INIT_WRONG_FILESYS_TYPE, FAT_SECTOR_SIZE, FAT_TYPE_16, FAT_TYPE_32, fatfs_fat_init(), GET_16BIT_WORD, GET_32BIT_WORD, PARTITION1_LBA_BEGIN_LOCATION, PARTITION1_TYPECODE_LOCATION, SIGNATURE_POSITION, and SIGNATURE_VALUE.
Definition at line 191 of file fat_access.c.
References FAT_SECTOR_SIZE, and FAT_TYPE_16.
Referenced by fatfs_read_sector(), fatfs_sector_reader(), and fatfs_write_sector().
int fatfs_list_directory_next | ( | struct fatfs * | fs, |
struct fs_dir_list_status * | dirls, | ||
struct fs_dir_ent * | entry | ||
) |
Definition at line 719 of file fat_access.c.
References fs_dir_list_status::cluster, fs_dir_ent::cluster, FAT_DIR_ENTRIES_PER_SECTOR, FAT_DIR_ENTRY_SIZE, FAT_HTONL, FAT_HTONS, fatfs_entry_is_dir(), fatfs_entry_lfn_exists(), fatfs_entry_lfn_invalid(), fatfs_entry_lfn_text(), fatfs_entry_sfn_only(), fatfs_get_sfn_display_name(), fatfs_lfn_cache_entry(), fatfs_lfn_cache_get(), fatfs_lfn_cache_init(), FATFS_MAX_LONG_FILENAME, fatfs_sector_reader(), fs_dir_ent::filename, fs_dir_ent::is_dir, memset(), NULL, fs_dir_list_status::offset, fs_dir_list_status::sector, fs_dir_ent::size, and strncpy().
void fatfs_list_directory_start | ( | struct fatfs * | fs, |
struct fs_dir_list_status * | dirls, | ||
uint32 | StartCluster | ||
) |
Definition at line 708 of file fat_access.c.
References fs_dir_list_status::cluster, fs_dir_list_status::offset, and fs_dir_list_status::sector.
Definition at line 643 of file fat_access.c.
References FAT_DIR_ENTRIES_PER_SECTOR, FAT_DIR_ENTRY_SIZE, fatfs_entry_lfn_invalid(), fatfs_entry_lfn_text(), fatfs_entry_sfn_only(), fatfs_sector_reader(), fatfs_update_timestamps(), FILE_HEADER_DELETED, memcpy(), and strncmp().
Definition at line 263 of file fat_access.c.
References FAT_TYPE_16, and fatfs_lba_of_cluster().
Definition at line 200 of file fat_access.c.
Definition at line 213 of file fat_access.c.
References FAT32_LAST_CLUSTER, FAT_TYPE_16, fatfs_find_next_cluster(), and fatfs_lba_of_cluster().
Referenced by fatfs_get_file_entry(), fatfs_list_directory_next(), fatfs_mark_file_deleted(), fatfs_sfn_exists(), and fatfs_update_file_length().
Definition at line 206 of file fat_access.c.
Definition at line 478 of file fat_access.c.
References FAT_DIR_ENTRIES_PER_SECTOR, FAT_DIR_ENTRY_SIZE, fatfs_entry_lfn_invalid(), fatfs_entry_lfn_text(), fatfs_entry_sfn_only(), fatfs_sector_reader(), and strncmp().
void fatfs_show_details | ( | struct fatfs * | fs | ) |
Definition at line 362 of file fat_access.c.
References FAT_PRINTF, and FAT_TYPE_32.
int fatfs_update_file_length | ( | struct fatfs * | fs, |
uint32 | Cluster, | ||
char * | shortname, | ||
uint32 | fileLength | ||
) |
Definition at line 578 of file fat_access.c.
References FAT_DIR_ENTRIES_PER_SECTOR, FAT_DIR_ENTRY_SIZE, FAT_HTONL, fatfs_entry_lfn_invalid(), fatfs_entry_lfn_text(), fatfs_entry_sfn_only(), fatfs_sector_reader(), fatfs_update_timestamps(), memcpy(), and strncmp().
int fatfs_update_timestamps | ( | struct fat_dir_entry * | directoryEntry, |
int | create, | ||
int | modify, | ||
int | access | ||
) |
Referenced by fatfs_mark_file_deleted(), and fatfs_update_file_length().
Definition at line 311 of file fat_access.c.
References FAT_TYPE_16, and fatfs_lba_of_cluster().