inftl.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.6 2004/06/30 14:49:00 dbrown 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 94
  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_oobinfo oobinfo;
  43. };
  44. int INFTL_mount(struct INFTLrecord *s);
  45. int INFTL_formatblock(struct INFTLrecord *s, int block);
  46. #endif /* __KERNEL__ */
  47. #endif /* __MTD_INFTL_H__ */