0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef __MTD_NFTL_USER_H__
0022 #define __MTD_NFTL_USER_H__
0023
0024 #include <linux/types.h>
0025
0026
0027
0028 struct nftl_bci {
0029 unsigned char ECCSig[6];
0030 __u8 Status;
0031 __u8 Status1;
0032 }__attribute__((packed));
0033
0034
0035
0036 struct nftl_uci0 {
0037 __u16 VirtUnitNum;
0038 __u16 ReplUnitNum;
0039 __u16 SpareVirtUnitNum;
0040 __u16 SpareReplUnitNum;
0041 } __attribute__((packed));
0042
0043 struct nftl_uci1 {
0044 __u32 WearInfo;
0045 __u16 EraseMark;
0046 __u16 EraseMark1;
0047 } __attribute__((packed));
0048
0049 struct nftl_uci2 {
0050 __u16 FoldMark;
0051 __u16 FoldMark1;
0052 __u32 unused;
0053 } __attribute__((packed));
0054
0055 union nftl_uci {
0056 struct nftl_uci0 a;
0057 struct nftl_uci1 b;
0058 struct nftl_uci2 c;
0059 };
0060
0061 struct nftl_oob {
0062 struct nftl_bci b;
0063 union nftl_uci u;
0064 };
0065
0066
0067
0068 struct NFTLMediaHeader {
0069 char DataOrgID[6];
0070 __u16 NumEraseUnits;
0071 __u16 FirstPhysicalEUN;
0072 __u32 FormattedSize;
0073 unsigned char UnitSizeFactor;
0074 } __attribute__((packed));
0075
0076 #define MAX_ERASE_ZONES (8192 - 512)
0077
0078 #define ERASE_MARK 0x3c69
0079 #define SECTOR_FREE 0xff
0080 #define SECTOR_USED 0x55
0081 #define SECTOR_IGNORE 0x11
0082 #define SECTOR_DELETED 0x00
0083
0084 #define FOLD_MARK_IN_PROGRESS 0x5555
0085
0086 #define ZONE_GOOD 0xff
0087 #define ZONE_BAD_ORIGINAL 0
0088 #define ZONE_BAD_MARKED 7
0089
0090
0091 #endif