blob: 6977780e548f96809a2c5df708490f7bae81bff0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * inftl.h -- defines to support the Inverse NAND Flash Translation Layer
3 *
4 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
5 *
Sean Youngbfabb982005-06-13 14:08:48 +01006 * $Id: inftl.h,v 1.7 2005/06/13 13:08:45 sean Exp $
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
8
9#ifndef __MTD_INFTL_H__
10#define __MTD_INFTL_H__
11
12#ifndef __KERNEL__
13#error This is a kernel header. Perhaps include nftl-user.h instead?
14#endif
15
16#include <linux/mtd/blktrans.h>
17#include <linux/mtd/mtd.h>
18#include <linux/mtd/nftl.h>
19
20#include <mtd/inftl-user.h>
21
22#ifndef INFTL_MAJOR
Sean Youngbfabb982005-06-13 14:08:48 +010023#define INFTL_MAJOR 96
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#endif
25#define INFTL_PARTN_BITS 4
26
27#ifdef __KERNEL__
28
29struct INFTLrecord {
30 struct mtd_blktrans_dev mbd;
31 __u16 MediaUnit;
32 __u32 EraseSize;
33 struct INFTLMediaHeader MediaHdr;
34 int usecount;
35 unsigned char heads;
36 unsigned char sectors;
37 unsigned short cylinders;
38 __u16 numvunits;
39 __u16 firstEUN;
40 __u16 lastEUN;
41 __u16 numfreeEUNs;
42 __u16 LastFreeEUN; /* To speed up finding a free EUN */
43 int head,sect,cyl;
44 __u16 *PUtable; /* Physical Unit Table */
45 __u16 *VUtable; /* Virtual Unit Table */
46 unsigned int nb_blocks; /* number of physical blocks */
47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
48 struct erase_info instr;
Thomas Gleixner5bd34c02006-05-27 22:16:10 +020049 struct nand_ecclayout oobinfo;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050};
51
52int INFTL_mount(struct INFTLrecord *s);
53int INFTL_formatblock(struct INFTLrecord *s, int block);
54
Adrian Bunk0500abf2006-03-31 02:29:42 -080055extern char inftlmountrev[];
56
57void INFTL_dumptables(struct INFTLrecord *s);
58void INFTL_dumpVUchains(struct INFTLrecord *s);
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#endif /* __KERNEL__ */
61
62#endif /* __MTD_INFTL_H__ */