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