int FATType = 0;
/* generic information about FAT fs */
-uint32_t FAT; /* Location of (first) FAT */
-uint32_t RootDirArea; /* Location of root directory area */
-uint32_t RootDir; /* Location of root directory proper */
-uint32_t DataArea; /* Location of data area */
+sector_t FAT; /* Location of (first) FAT */
+sector_t RootDirArea; /* Location of root directory area */
+sector_t RootDir; /* Location of root directory proper */
+sector_t DataArea; /* Location of data area */
uint32_t TotalSectors; /* Total number of sectors */
uint32_t ClustSize; /* Bytes/cluster */
uint32_t ClustMask; /* Sector/cluster - 1 */
/* used for long name entry */
char MangleBuf[12];
char entry_name[14];
+
+/* try with the biggest long name */
+char long_name[0x40 * 13];
char *NameStart;
int NameLen;
* check for a particular sector in the FAT cache.
*
*/
-struct cache_struct *getfatsector(struct fs_info *fs, uint32_t sector)
+struct cache_struct *getfatsector(struct fs_info *fs, sector_t sector)
{
return get_cache_block(fs->fs_dev, FAT + sector);
}
static uint32_t nextcluster(struct fs_info *fs, uint32_t clust_num)
{
uint32_t next_cluster;
- uint32_t fat_sector;
+ sector_t fat_sector;
uint32_t offset;
int lo, hi;
struct cache_struct *cs;
* cluster chain. Returns EOF.
*
*/
-static uint32_t nextsector(struct fs_info *fs, uint32_t sector)
+static sector_t nextsector(struct fs_info *fs, sector_t sector)
{
- uint32_t data_sector;
+ sector_t data_sector;
uint32_t cluster;
if ( sector < DataArea ) {
*/
static void __getfssec(struct fs_info *fs, char *buf, struct open_file_t *file, uint32_t sectors)
{
- uint32_t curr_sector = file->file_sector;
- uint32_t frag_start , next_sector;
+ sector_t curr_sector = file->file_sector;
+ sector_t frag_start , next_sector;
uint32_t con_sec_cnt;
while (sectors) {
return sum;
}
-static inline uint32_t first_sector(struct fat_dir_entry *dir)
+/* compute the first sector number of one dir where the data stores */
+static inline sector_t first_sector(struct fat_dir_entry *dir)
{
uint32_t first_clust, sector;
}
-/* try with the biggest long name */
-char long_name[0x40 * 13];
-
/**
* search_dos_dir:
*
*/
void vfat_searchdir(char *filename, struct file *file)
{
- uint32_t dir_sector;
+ sector_t dir_sector;
uint32_t file_len = 0;
uint8_t attr = 0;
char *p;