diff options
Diffstat (limited to 'firmware/common/disk.c')
-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 e3a7aaaa3d..3c1f01cc61 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c | |||
@@ -46,6 +46,16 @@ | |||
46 | ((long)array[pos] | ((long)array[pos+1] << 8 ) | \ | 46 | ((long)array[pos] | ((long)array[pos+1] << 8 ) | \ |
47 | ((long)array[pos+2] << 16 ) | ((long)array[pos+3] << 24 )) | 47 | ((long)array[pos+2] << 16 ) | ((long)array[pos+3] << 24 )) |
48 | 48 | ||
49 | static const unsigned char fat_partition_types[] = { | ||
50 | 0x0b, 0x1b, /* FAT32 + hidden variant */ | ||
51 | 0x0c, 0x1c, /* FAT32 (LBA) + hidden variant */ | ||
52 | #ifdef HAVE_FAT16SUPPORT | ||
53 | 0x04, 0x14, /* FAT16 <= 32MB + hidden variant */ | ||
54 | 0x06, 0x16, /* FAT16 > 32MB + hidden variant */ | ||
55 | 0x0e, 0x1e, /* FAT16 (LBA) + hidden variant */ | ||
56 | #endif | ||
57 | }; | ||
58 | |||
49 | static struct partinfo part[NUM_DRIVES*4]; /* space for 4 partitions on 2 drives */ | 59 | static struct partinfo part[NUM_DRIVES*4]; /* space for 4 partitions on 2 drives */ |
50 | static int vol_drive[NUM_VOLUMES]; /* mounted to which drive (-1 if none) */ | 60 | static int vol_drive[NUM_VOLUMES]; /* mounted to which drive (-1 if none) */ |
51 | static struct mutex disk_mutex; | 61 | static struct mutex disk_mutex; |
@@ -179,8 +189,9 @@ int disk_mount(int drive) | |||
179 | #endif | 189 | #endif |
180 | for (; volume != -1 && i<4 && mounted<NUM_VOLUMES_PER_DRIVE; i++) | 190 | for (; volume != -1 && i<4 && mounted<NUM_VOLUMES_PER_DRIVE; i++) |
181 | { | 191 | { |
182 | if (pinfo[i].type == 0 || pinfo[i].type == 5) | 192 | if (memchr(fat_partition_types, pinfo[i].type, |
183 | continue; /* skip free/extended partitions */ | 193 | sizeof(fat_partition_types)) == NULL) |
194 | continue; /* not an accepted partition type */ | ||
184 | 195 | ||
185 | #ifdef MAX_LOG_SECTOR_SIZE | 196 | #ifdef MAX_LOG_SECTOR_SIZE |
186 | int j; | 197 | int j; |