diff options
| author | Robert Kukla <roolku@rockbox.org> | 2011-10-02 11:39:31 +0000 |
|---|---|---|
| committer | Robert Kukla <roolku@rockbox.org> | 2011-10-02 11:39:31 +0000 |
| commit | d25341a032a19985af85c72b95964bef812971c3 (patch) | |
| tree | fc77102e4369868f65fa712d29360c4da696d64d | |
| parent | e86423a97fc96c54657355d31f197657cfae8274 (diff) | |
| download | rockbox-d25341a032a19985af85c72b95964bef812971c3.zip rockbox-d25341a032a19985af85c72b95964bef812971c3.tar.gz rockbox-d25341a032a19985af85c72b95964bef812971c3.tar.bz2 rockbox-d25341a032a19985af85c72b95964bef812971c3.tar.xz | |
revert r30566 and r30567 to fix FS#12294 (superfloppy not mounting)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30632 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/common/disk.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index e3a7aaa..3c1f01c 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -46,6 +46,16 @@ ((long)array[pos] | ((long)array[pos+1] << 8 ) | \ ((long)array[pos+2] << 16 ) | ((long)array[pos+3] << 24 )) +static const unsigned char fat_partition_types[] = { + 0x0b, 0x1b, /* FAT32 + hidden variant */ + 0x0c, 0x1c, /* FAT32 (LBA) + hidden variant */ +#ifdef HAVE_FAT16SUPPORT + 0x04, 0x14, /* FAT16 <= 32MB + hidden variant */ + 0x06, 0x16, /* FAT16 > 32MB + hidden variant */ + 0x0e, 0x1e, /* FAT16 (LBA) + hidden variant */ +#endif +}; + static struct partinfo part[NUM_DRIVES*4]; /* space for 4 partitions on 2 drives */ static int vol_drive[NUM_VOLUMES]; /* mounted to which drive (-1 if none) */ static struct mutex disk_mutex; @@ -179,8 +189,9 @@ int disk_mount(int drive) #endif for (; volume != -1 && i<4 && mounted<NUM_VOLUMES_PER_DRIVE; i++) { - if (pinfo[i].type == 0 || pinfo[i].type == 5) - continue; /* skip free/extended partitions */ + if (memchr(fat_partition_types, pinfo[i].type, + sizeof(fat_partition_types)) == NULL) + continue; /* not an accepted partition type */ #ifdef MAX_LOG_SECTOR_SIZE int j; |