nftl-user.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * $Id: nftl-user.h,v 1.1.1.1 2007/06/12 07:27:15 eyryu Exp $
  3. *
  4. * Parts of NFTL headers shared with userspace
  5. *
  6. */
  7. #ifndef __MTD_NFTL_USER_H__
  8. #define __MTD_NFTL_USER_H__
  9. /* Block Control Information */
  10. struct nftl_bci {
  11. unsigned char ECCSig[6];
  12. uint8_t Status;
  13. uint8_t Status1;
  14. }__attribute__((packed));
  15. /* Unit Control Information */
  16. struct nftl_uci0 {
  17. uint16_t VirtUnitNum;
  18. uint16_t ReplUnitNum;
  19. uint16_t SpareVirtUnitNum;
  20. uint16_t SpareReplUnitNum;
  21. } __attribute__((packed));
  22. struct nftl_uci1 {
  23. uint32_t WearInfo;
  24. uint16_t EraseMark;
  25. uint16_t EraseMark1;
  26. } __attribute__((packed));
  27. struct nftl_uci2 {
  28. uint16_t FoldMark;
  29. uint16_t FoldMark1;
  30. uint32_t unused;
  31. } __attribute__((packed));
  32. union nftl_uci {
  33. struct nftl_uci0 a;
  34. struct nftl_uci1 b;
  35. struct nftl_uci2 c;
  36. };
  37. struct nftl_oob {
  38. struct nftl_bci b;
  39. union nftl_uci u;
  40. };
  41. /* NFTL Media Header */
  42. struct NFTLMediaHeader {
  43. char DataOrgID[6];
  44. uint16_t NumEraseUnits;
  45. uint16_t FirstPhysicalEUN;
  46. uint32_t FormattedSize;
  47. unsigned char UnitSizeFactor;
  48. } __attribute__((packed));
  49. #define MAX_ERASE_ZONES (8192 - 512)
  50. #define ERASE_MARK 0x3c69
  51. #define SECTOR_FREE 0xff
  52. #define SECTOR_USED 0x55
  53. #define SECTOR_IGNORE 0x11
  54. #define SECTOR_DELETED 0x00
  55. #define FOLD_MARK_IN_PROGRESS 0x5555
  56. #define ZONE_GOOD 0xff
  57. #define ZONE_BAD_ORIGINAL 0
  58. #define ZONE_BAD_MARKED 7
  59. #endif /* __MTD_NFTL_USER_H__ */