1
2
3
4
5#ifndef __MTD_NFTL_H__
6#define __MTD_NFTL_H__
7
8#include <linux/mtd/mtd.h>
9#include <linux/mtd/blktrans.h>
10
11#include <mtd/nftl-user.h>
12
13
14#define BLOCK_NIL 0xffff
15#define BLOCK_FREE 0xfffe
16#define BLOCK_NOTEXPLORED 0xfffd
17#define BLOCK_RESERVED 0xfffc
18
19struct NFTLrecord {
20 struct mtd_blktrans_dev mbd;
21 __u16 MediaUnit, SpareMediaUnit;
22 __u32 EraseSize;
23 struct NFTLMediaHeader MediaHdr;
24 int usecount;
25 unsigned char heads;
26 unsigned char sectors;
27 unsigned short cylinders;
28 __u16 numvunits;
29 __u16 lastEUN;
30 __u16 numfreeEUNs;
31 __u16 LastFreeEUN;
32 int head,sect,cyl;
33 __u16 *EUNtable;
34 __u16 *ReplUnitTable;
35 unsigned int nb_blocks;
36 unsigned int nb_boot_blocks;
37 struct erase_info instr;
38 struct nand_ecclayout oobinfo;
39};
40
41int NFTL_mount(struct NFTLrecord *s);
42int NFTL_formatblock(struct NFTLrecord *s, int block);
43
44int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
45 size_t *retlen, uint8_t *buf);
46int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
47 size_t *retlen, uint8_t *buf);
48
49#ifndef NFTL_MAJOR
50#define NFTL_MAJOR 93
51#endif
52
53#define MAX_NFTLS 16
54#define MAX_SECTORS_PER_UNIT 64
55#define NFTL_PARTN_BITS 4
56
57#endif
58