Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * $Id: nftl.h,v 1.16 2004/06/30 14:49:00 dbrown Exp $ |
| 3 | * |
| 4 | * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> |
| 5 | */ |
| 6 | |
| 7 | #ifndef __MTD_NFTL_H__ |
| 8 | #define __MTD_NFTL_H__ |
| 9 | |
| 10 | #include <linux/mtd/mtd.h> |
| 11 | #include <linux/mtd/blktrans.h> |
| 12 | |
| 13 | #include <mtd/nftl-user.h> |
| 14 | |
| 15 | /* these info are used in ReplUnitTable */ |
| 16 | #define BLOCK_NIL 0xffff /* last block of a chain */ |
| 17 | #define BLOCK_FREE 0xfffe /* free block */ |
| 18 | #define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */ |
| 19 | #define BLOCK_RESERVED 0xfffc /* bios block or bad block */ |
| 20 | |
| 21 | struct NFTLrecord { |
| 22 | struct mtd_blktrans_dev mbd; |
| 23 | __u16 MediaUnit, SpareMediaUnit; |
| 24 | __u32 EraseSize; |
| 25 | struct NFTLMediaHeader MediaHdr; |
| 26 | int usecount; |
| 27 | unsigned char heads; |
| 28 | unsigned char sectors; |
| 29 | unsigned short cylinders; |
| 30 | __u16 numvunits; |
| 31 | __u16 lastEUN; /* should be suppressed */ |
| 32 | __u16 numfreeEUNs; |
| 33 | __u16 LastFreeEUN; /* To speed up finding a free EUN */ |
| 34 | int head,sect,cyl; |
| 35 | __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */ |
| 36 | __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */ |
| 37 | unsigned int nb_blocks; /* number of physical blocks */ |
| 38 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ |
| 39 | struct erase_info instr; |
| 40 | struct nand_oobinfo oobinfo; |
| 41 | }; |
| 42 | |
| 43 | int NFTL_mount(struct NFTLrecord *s); |
| 44 | int NFTL_formatblock(struct NFTLrecord *s, int block); |
| 45 | |
| 46 | #ifndef NFTL_MAJOR |
| 47 | #define NFTL_MAJOR 93 |
| 48 | #endif |
| 49 | |
| 50 | #define MAX_NFTLS 16 |
| 51 | #define MAX_SECTORS_PER_UNIT 64 |
| 52 | #define NFTL_PARTN_BITS 4 |
| 53 | |
| 54 | #endif /* __MTD_NFTL_H__ */ |