}
}
+#ifdef CONFIG_FAT_WRITE
static void uppercase (char *str, int len)
{
int i;
str++;
}
}
+#endif
static block_dev_desc_t *cur_dev = NULL;
return -1;
}
+#ifdef CONFIG_FAT_WRITE
static int total_sector;
static int disk_write (__u32 startblock, __u32 getsize, __u8 * bufptr)
{
}
return -1;
}
+#endif
int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
{
downcase(s_name);
}
+#ifdef CONFIG_FAT_WRITE
/*
* Set short name in directory entry
*/
return 0;
}
+#endif
/*
* Get the entry at index 'entry' in a FAT (12/16/32) table.
if (getsize > fatlength)
getsize = fatlength;
+#ifdef CONFIG_FAT_WRITE
if (mydata->fatbufnum != -1) {
if (flush_fat_buffer(mydata) < 0)
return -1;
}
+#endif
if (disk_read(startblock, getsize, bufptr) < 0) {
debug("Error reading FAT blocks\n");
return 0;
}
+#ifdef CONFIG_FAT_WRITE
/*
* Set the file name information from 'name' into 'slot',
*/
return 1;
}
+#endif
/*
* Extract the full long filename starting at 'retdent' (which is really
return 0;
}
+#ifdef CONFIG_FAT_WRITE
/*
* Fill dir_slot entries with appropriate name, id, and attr
* The real directory entry is returned by dentptr
counter--;
}
}
+#endif
/* Calculate short name checksum */
static __u8 mkcksum (const char *str)
return ret;
}
+#ifdef CONFIG_FAT_WRITE
/*
* Fill alias_checksum in dir_slot with calculated checksum value
*/
for (i = 0; i < counter; i++, slotptr++)
slotptr->alias_checksum = mkcksum(name);
}
+#endif
#endif /* CONFIG_SUPPORT_VFAT */
/*
bs->secs_track = FAT2CPU16(bs->secs_track);
bs->heads = FAT2CPU16(bs->heads);
bs->total_sect = FAT2CPU32(bs->total_sect);
-
+#ifdef CONFIG_FAT_WRITE
total_sector = bs->total_sect;
+#endif
/* FAT32 entries */
if (bs->fat_length == 0) {
return do_fat_read(filename, buffer, maxsize, LS_NO);
}
+#ifdef CONFIG_FAT_WRITE
/*
* Set the entry at index 'entry' in a FAT (16/32) table.
*/
printf("writing %s\n", filename);
return do_fat_write(filename, buffer, maxsize);
}
-
+#endif