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