]> git.ipfire.org Git - thirdparty/u-boot.git/blame - include/fat.h
* Temporarily disabled John Kerl's extended MII command code because
[thirdparty/u-boot.git] / include / fat.h
CommitLineData
71f95118
WD
1/*
2 * R/O (V)FAT 12/16/32 filesystem implementation by Marcus Sundberg
3 *
4 * 2002-07-28 - rjones@nexus-tech.net - ported to ppcboot v1.1.6
5 * 2003-03-10 - kharris@nexus-tech.net - ported to u-boot
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 *
25 */
26
27#ifndef _FAT_H_
28#define _FAT_H_
29
30#define CONFIG_SUPPORT_VFAT
31
32#define SECTOR_SIZE FS_BLOCK_SIZE
33
34#define FS_BLOCK_SIZE 512
35
36#if FS_BLOCK_SIZE != SECTOR_SIZE
37#error FS_BLOCK_SIZE != SECTOR_SIZE - This code needs to be fixed!
38#endif
39
40#define MAX_CLUSTSIZE 65536
41#define DIRENTSPERBLOCK (FS_BLOCK_SIZE/sizeof(dir_entry))
42#define DIRENTSPERCLUST ((mydata->clust_size*SECTOR_SIZE)/sizeof(dir_entry))
43
44#define FATBUFBLOCKS 6
45#define FATBUFSIZE (FS_BLOCK_SIZE*FATBUFBLOCKS)
cd37d9e6 46#define FAT12BUFSIZE ((FATBUFSIZE*2)/3)
71f95118
WD
47#define FAT16BUFSIZE (FATBUFSIZE/2)
48#define FAT32BUFSIZE (FATBUFSIZE/4)
49
50
51/* Filesystem identifiers */
52#define FAT12_SIGN "FAT12 "
53#define FAT16_SIGN "FAT16 "
54#define FAT32_SIGN "FAT32 "
55#define SIGNLEN 8
56
57/* File attributes */
58#define ATTR_RO 1
59#define ATTR_HIDDEN 2
60#define ATTR_SYS 4
61#define ATTR_VOLUME 8
62#define ATTR_DIR 16
63#define ATTR_ARCH 32
64
65#define ATTR_VFAT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
66
67#define DELETED_FLAG ((char)0xe5) /* Marks deleted files when in name[0] */
68