From ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 4 Dec 2006 21:37:22 +0000 Subject: Much simpler implementation of large virtual sector support, not needing larger sector buffers and not touching file.c at all. secmult is simply used to normalize all sector counts to 512-byte physical sectors. * Moved MAX_SECTOR_SIZE definition to config-*.h, and enabled it for iPod Video only. MAX_SECTOR_SIZE now only enables checking for alternate disk layouts due to sector size (as iPod Video G5.5 is presented as having 2048-byte _physical_ sectors to the PC). Large virtual sector support in fat.c is always enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11659 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-ipodvideo.h | 4 ++++ firmware/export/fat.h | 12 ++---------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index 0caa2f2..b2b5615 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h @@ -121,6 +121,10 @@ /* Define this if you can read an absolute wheel position */ #define HAVE_WHEEL_POSITION +/* define this if the device has larger sectors when accessed via USB */ +/* (only relevant in disk.c, fat.c now always supports large virtual sectors) */ +#define MAX_SECTOR_SIZE 2048 + #define BOOTFILE_EXT "ipod" #define BOOTFILE "rockbox." BOOTFILE_EXT diff --git a/firmware/export/fat.h b/firmware/export/fat.h index 4110f76..2680fdf 100644 --- a/firmware/export/fat.h +++ b/firmware/export/fat.h @@ -24,14 +24,7 @@ #include "ata.h" /* for volume definitions */ #include "config.h" -#define PHYSICAL_SECTOR_SIZE 512 - -/* Some never players (such as iPod 5.5G) might have 2048 bytes per sector. */ -#ifdef IPOD_VIDEO -#define MAX_SECTOR_SIZE 2048 -#else -#define MAX_SECTOR_SIZE 512 -#endif +#define SECTOR_SIZE 512 /* Number of bytes reserved for a file name (including the trailing \0). Since names are stored in the entry as UTF-8, we won't be able to @@ -86,7 +79,7 @@ struct fat_dir unsigned int entrycount; long sector; struct fat_file file; - unsigned char sectorcache[3][MAX_SECTOR_SIZE]; + unsigned char sectorcache[3][SECTOR_SIZE]; }; @@ -109,7 +102,6 @@ extern int fat_create_file(const char* name, extern long fat_readwrite(struct fat_file *ent, long sectorcount, void* buf, bool write ); extern int fat_closewrite(struct fat_file *ent, long size, int attr); -extern int fat_get_secsize(const struct fat_file *file); extern int fat_seek(struct fat_file *ent, unsigned long sector ); extern int fat_remove(struct fat_file *ent); extern int fat_truncate(const struct fat_file *ent); -- cgit v1.1