inftl.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * inftl.h -- defines to support the Inverse NAND Flash Translation Layer
  3. *
  4. * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
  5. *
  6. * $Id: inftl.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
  7. */
  8. #ifndef __MTD_INFTL_H__
  9. #define __MTD_INFTL_H__
  10. #ifndef __KERNEL__
  11. #error This is a kernel header. Perhaps include nftl-user.h instead?
  12. #endif
  13. #include <linux/mtd/blktrans.h>
  14. #include <linux/mtd/mtd.h>
  15. #include <linux/mtd/nftl.h>
  16. #include <mtd/inftl-user.h>
  17. #ifndef INFTL_MAJOR
  18. #define INFTL_MAJOR 96
  19. #endif
  20. #define INFTL_PARTN_BITS 4
  21. #ifdef __KERNEL__
  22. struct INFTLrecord {
  23. struct mtd_blktrans_dev mbd;
  24. __u16 MediaUnit;
  25. __u32 EraseSize;
  26. struct INFTLMediaHeader MediaHdr;
  27. int usecount;
  28. unsigned char heads;
  29. unsigned char sectors;
  30. unsigned short cylinders;
  31. __u16 numvunits;
  32. __u16 firstEUN;
  33. __u16 lastEUN;
  34. __u16 numfreeEUNs;
  35. __u16 LastFreeEUN; /* To speed up finding a free EUN */
  36. int head,sect,cyl;
  37. __u16 *PUtable; /* Physical Unit Table */
  38. __u16 *VUtable; /* Virtual Unit Table */
  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_ecclayout oobinfo;
  43. };
  44. int INFTL_mount(struct INFTLrecord *s);
  45. int INFTL_formatblock(struct INFTLrecord *s, int block);
  46. extern char inftlmountrev[];
  47. void INFTL_dumptables(struct INFTLrecord *s);
  48. void INFTL_dumpVUchains(struct INFTLrecord *s);
  49. #endif /* __KERNEL__ */
  50. #endif /* __MTD_INFTL_H__ */