2 * $Id: nftl.h,v 1.13 2003/05/23 11:25:02 dwmw2 Exp $
4 * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
10 #include <linux/mtd/mtd.h>
11 #include <linux/mtd/blktrans.h>
13 /* Block Control Information */
16 unsigned char ECCSig[6];
19 }__attribute__((packed));
21 /* Unit Control Information */
26 __u16 SpareVirtUnitNum;
27 __u16 SpareReplUnitNum;
28 } __attribute__((packed));
34 } __attribute__((packed));
40 } __attribute__((packed));
53 /* NFTL Media Header */
55 struct NFTLMediaHeader {
58 __u16 FirstPhysicalEUN;
60 unsigned char UnitSizeFactor;
61 } __attribute__((packed));
63 #define MAX_ERASE_ZONES (8192 - 512)
65 #define ERASE_MARK 0x3c69
66 #define SECTOR_FREE 0xff
67 #define SECTOR_USED 0x55
68 #define SECTOR_IGNORE 0x11
69 #define SECTOR_DELETED 0x00
71 #define FOLD_MARK_IN_PROGRESS 0x5555
73 #define ZONE_GOOD 0xff
74 #define ZONE_BAD_ORIGINAL 0
75 #define ZONE_BAD_MARKED 7
79 /* these info are used in ReplUnitTable */
80 #define BLOCK_NIL 0xffff /* last block of a chain */
81 #define BLOCK_FREE 0xfffe /* free block */
82 #define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */
83 #define BLOCK_RESERVED 0xfffc /* bios block or bad block */
86 struct mtd_blktrans_dev mbd;
87 __u16 MediaUnit, SpareMediaUnit;
89 struct NFTLMediaHeader MediaHdr;
92 unsigned char sectors;
93 unsigned short cylinders;
95 __u16 lastEUN; /* should be suppressed */
97 __u16 LastFreeEUN; /* To speed up finding a free EUN */
99 __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */
100 __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */
101 unsigned int nb_blocks; /* number of physical blocks */
102 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
103 struct erase_info instr;
106 int NFTL_mount(struct NFTLrecord *s);
107 int NFTL_formatblock(struct NFTLrecord *s, int block);
110 #define NFTL_MAJOR 93
114 #define MAX_SECTORS_PER_UNIT 64
115 #define NFTL_PARTN_BITS 4
117 #endif /* __KERNEL__ */
119 #endif /* __MTD_NFTL_H__ */