nftl.h 1.5 KB

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