X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Ffat.h;h=bd8e450b33a34216998d6ce492f52dc304e5bc2f;hb=6786ce1ce14feb4d02854a0c04bc0cce505be46e;hp=84573fd3fe90869c92fc11b2c8f8f3fa6d2f2170;hpb=0528979fa7ab7853faaf2ecf34b7721dd4c0b383;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/fat.h b/include/fat.h index 84573fd..bd8e450 100644 --- a/include/fat.h +++ b/include/fat.h @@ -9,8 +9,11 @@ #ifndef _FAT_H_ #define _FAT_H_ -#include #include +#include +#include + +struct disk_partition; /* Maximum Long File Name length supported here is 128 UTF-16 code units */ #define VFAT_MAXLEN_BYTES 256 /* Maximum LFN buffer in bytes */ @@ -19,7 +22,6 @@ #define MAX_CLUSTSIZE CONFIG_FS_FAT_MAX_CLUSTSIZE -#define DIRENTSPERBLOCK (mydata->sect_size / sizeof(dir_entry)) #define DIRENTSPERCLUST ((mydata->clust_size * mydata->sect_size) / \ sizeof(dir_entry)) @@ -130,8 +132,13 @@ typedef struct volume_info #define CASE_LOWER_BASE 8 /* base (name) is lower case */ #define CASE_LOWER_EXT 16 /* extension is lower case */ +struct nameext { + char name[8]; + char ext[3]; +}; + typedef struct dir_entry { - char name[8],ext[3]; /* Name and extension */ + struct nameext nameext; /* Name and extension */ __u8 attr; /* Attribute bits */ __u8 lcase; /* Case for name and ext (CASE_LOWER_x) */ __u8 ctime_ms; /* Creation time, milliseconds */ @@ -177,6 +184,9 @@ typedef struct { int fats; /* Number of FATs */ } fsdata; +struct fat_itr; +typedef struct fat_itr fat_itr; + static inline u32 clust_to_sect(fsdata *fsdata, u32 clust) { return fsdata->data_begin + clust * fsdata->clust_size; @@ -206,4 +216,17 @@ void fat_closedir(struct fs_dir_stream *dirs); int fat_unlink(const char *filename); int fat_mkdir(const char *dirname); void fat_close(void); +void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes); + +/** + * fat_uuid() - get FAT volume ID + * + * The FAT volume ID returned in @uuid_str as hexadecimal number in XXXX-XXXX + * format. + * + * @uuid_str: caller allocated buffer of at least 10 bytes for the volume ID + * Return: 0 on success + */ +int fat_uuid(char *uuid_str); + #endif /* _FAT_H_ */