blob: 98e9e57f22de1925d8448288c5d27c67220b5ffc [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Thomas Gleixnere4f06482005-11-07 11:15:37 +00002 * Parts of NFTL headers shared with userspace
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 */
5
6#ifndef __MTD_NFTL_USER_H__
7#define __MTD_NFTL_USER_H__
8
Arnd Bergmannccef7ab2009-02-26 00:51:41 +01009#include <linux/types.h>
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011/* Block Control Information */
12
13struct nftl_bci {
14 unsigned char ECCSig[6];
Arnd Bergmannccef7ab2009-02-26 00:51:41 +010015 __u8 Status;
16 __u8 Status1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017}__attribute__((packed));
18
19/* Unit Control Information */
20
21struct nftl_uci0 {
Arnd Bergmannccef7ab2009-02-26 00:51:41 +010022 __u16 VirtUnitNum;
23 __u16 ReplUnitNum;
24 __u16 SpareVirtUnitNum;
25 __u16 SpareReplUnitNum;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026} __attribute__((packed));
27
28struct nftl_uci1 {
Arnd Bergmannccef7ab2009-02-26 00:51:41 +010029 __u32 WearInfo;
30 __u16 EraseMark;
31 __u16 EraseMark1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032} __attribute__((packed));
33
34struct nftl_uci2 {
Arnd Bergmannccef7ab2009-02-26 00:51:41 +010035 __u16 FoldMark;
36 __u16 FoldMark1;
37 __u32 unused;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038} __attribute__((packed));
39
40union nftl_uci {
41 struct nftl_uci0 a;
42 struct nftl_uci1 b;
43 struct nftl_uci2 c;
44};
45
46struct nftl_oob {
47 struct nftl_bci b;
48 union nftl_uci u;
49};
50
51/* NFTL Media Header */
52
53struct NFTLMediaHeader {
54 char DataOrgID[6];
Arnd Bergmannccef7ab2009-02-26 00:51:41 +010055 __u16 NumEraseUnits;
56 __u16 FirstPhysicalEUN;
57 __u32 FormattedSize;
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 unsigned char UnitSizeFactor;
59} __attribute__((packed));
60
61#define MAX_ERASE_ZONES (8192 - 512)
62
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
68
69#define FOLD_MARK_IN_PROGRESS 0x5555
70
71#define ZONE_GOOD 0xff
72#define ZONE_BAD_ORIGINAL 0
73#define ZONE_BAD_MARKED 7
74
75
76#endif /* __MTD_NFTL_USER_H__ */