X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Ffat.h;h=20ca3f3dca7df4476c5e94b9925815ba08bb6378;hb=114cc4290b2f24bb314edf2edd5d8738a0778c4b;hp=65da733aef36aa23132290ab0c61caec69fd6604;hpb=06118973ede291df8617c4089972cbf888bdc96b;p=u-boot diff --git a/include/fat.h b/include/fat.h index 65da733aef..20ca3f3dca 100644 --- a/include/fat.h +++ b/include/fat.h @@ -18,7 +18,11 @@ #define VFAT_MAXSEQ 9 /* Up to 9 of 13 2-byte UTF-16 entries */ #define PREFETCH_BLOCKS 2 -#define MAX_CLUSTSIZE 65536 +#ifndef CONFIG_FS_FAT_MAX_CLUSTSIZE +#define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536 +#endif +#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)) @@ -84,6 +88,9 @@ #define START(dent) (FAT2CPU16((dent)->start) \ + (mydata->fatsize != 32 ? 0 : \ (FAT2CPU16((dent)->starthi) << 16))) +#define IS_LAST_CLUST(x, fatsize) ((x) >= ((fatsize) != 32 ? \ + ((fatsize) != 16 ? 0xff8 : 0xfff8) : \ + 0xffffff8)) #define CHECK_CLUST(x, fatsize) ((x) <= 1 || \ (x) >= ((fatsize) != 32 ? \ ((fatsize) != 16 ? 0xff0 : 0xfff0) : \ @@ -191,6 +198,7 @@ int file_cd(const char *path); int file_fat_detectfs(void); int file_fat_ls(const char *dir); int fat_exists(const char *filename); +int fat_size(const char *filename); long file_fat_read_at(const char *filename, unsigned long pos, void *buffer, unsigned long maxsize); long file_fat_read(const char *filename, void *buffer, unsigned long maxsize);