Merge branch 'docs-next' of git://git.lwn.net/linux-2.6
[linux-2.6/next.git] / include / mtd / nftl-user.h
blob98e9e57f22de1925d8448288c5d27c67220b5ffc
1 /*
2 * Parts of NFTL headers shared with userspace
4 */
6 #ifndef __MTD_NFTL_USER_H__
7 #define __MTD_NFTL_USER_H__
9 #include <linux/types.h>
11 /* Block Control Information */
13 struct nftl_bci {
14 unsigned char ECCSig[6];
15 __u8 Status;
16 __u8 Status1;
17 }__attribute__((packed));
19 /* Unit Control Information */
21 struct nftl_uci0 {
22 __u16 VirtUnitNum;
23 __u16 ReplUnitNum;
24 __u16 SpareVirtUnitNum;
25 __u16 SpareReplUnitNum;
26 } __attribute__((packed));
28 struct nftl_uci1 {
29 __u32 WearInfo;
30 __u16 EraseMark;
31 __u16 EraseMark1;
32 } __attribute__((packed));
34 struct nftl_uci2 {
35 __u16 FoldMark;
36 __u16 FoldMark1;
37 __u32 unused;
38 } __attribute__((packed));
40 union nftl_uci {
41 struct nftl_uci0 a;
42 struct nftl_uci1 b;
43 struct nftl_uci2 c;
46 struct nftl_oob {
47 struct nftl_bci b;
48 union nftl_uci u;
51 /* NFTL Media Header */
53 struct NFTLMediaHeader {
54 char DataOrgID[6];
55 __u16 NumEraseUnits;
56 __u16 FirstPhysicalEUN;
57 __u32 FormattedSize;
58 unsigned char UnitSizeFactor;
59 } __attribute__((packed));
61 #define MAX_ERASE_ZONES (8192 - 512)
63 #define ERASE_MARK 0x3c69
64 #define SECTOR_FREE 0xff
65 #define SECTOR_USED 0x55
66 #define SECTOR_IGNORE 0x11
67 #define SECTOR_DELETED 0x00
69 #define FOLD_MARK_IN_PROGRESS 0x5555
71 #define ZONE_GOOD 0xff
72 #define ZONE_BAD_ORIGINAL 0
73 #define ZONE_BAD_MARKED 7
76 #endif /* __MTD_NFTL_USER_H__ */