0001
0002
0003
0004
0005
0006 #ifndef __MTD_NFTL_H__
0007 #define __MTD_NFTL_H__
0008
0009 #include <linux/mtd/mtd.h>
0010 #include <linux/mtd/blktrans.h>
0011
0012 #include <mtd/nftl-user.h>
0013
0014
0015 #define BLOCK_NIL 0xffff
0016 #define BLOCK_FREE 0xfffe
0017 #define BLOCK_NOTEXPLORED 0xfffd
0018 #define BLOCK_RESERVED 0xfffc
0019
0020 struct NFTLrecord {
0021 struct mtd_blktrans_dev mbd;
0022 __u16 MediaUnit, SpareMediaUnit;
0023 __u32 EraseSize;
0024 struct NFTLMediaHeader MediaHdr;
0025 int usecount;
0026 unsigned char heads;
0027 unsigned char sectors;
0028 unsigned short cylinders;
0029 __u16 numvunits;
0030 __u16 lastEUN;
0031 __u16 numfreeEUNs;
0032 __u16 LastFreeEUN;
0033 int head,sect,cyl;
0034 __u16 *EUNtable;
0035 __u16 *ReplUnitTable;
0036 unsigned int nb_blocks;
0037 unsigned int nb_boot_blocks;
0038 struct erase_info instr;
0039 };
0040
0041 int NFTL_mount(struct NFTLrecord *s);
0042 int NFTL_formatblock(struct NFTLrecord *s, int block);
0043
0044 int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
0045 size_t *retlen, uint8_t *buf);
0046 int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
0047 size_t *retlen, uint8_t *buf);
0048
0049 #ifndef NFTL_MAJOR
0050 #define NFTL_MAJOR 93
0051 #endif
0052
0053 #define MAX_NFTLS 16
0054 #define MAX_SECTORS_PER_UNIT 64
0055 #define NFTL_PARTN_BITS 4
0056
0057 #endif