writeback: safer lock nesting
[linux/fpc-iii.git] / include / uapi / mtd / inftl-user.h
blob8d5044e32e53f4ea5a2ea2048a5f68c66092449b
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3 * Parts of INFTL headers shared with userspace
5 */
7 #ifndef __MTD_INFTL_USER_H__
8 #define __MTD_INFTL_USER_H__
10 #include <linux/types.h>
12 #define OSAK_VERSION 0x5120
13 #define PERCENTUSED 98
15 #define SECTORSIZE 512
17 /* Block Control Information */
19 struct inftl_bci {
20 __u8 ECCsig[6];
21 __u8 Status;
22 __u8 Status1;
23 } __attribute__((packed));
25 struct inftl_unithead1 {
26 __u16 virtualUnitNo;
27 __u16 prevUnitNo;
28 __u8 ANAC;
29 __u8 NACs;
30 __u8 parityPerField;
31 __u8 discarded;
32 } __attribute__((packed));
34 struct inftl_unithead2 {
35 __u8 parityPerField;
36 __u8 ANAC;
37 __u16 prevUnitNo;
38 __u16 virtualUnitNo;
39 __u8 NACs;
40 __u8 discarded;
41 } __attribute__((packed));
43 struct inftl_unittail {
44 __u8 Reserved[4];
45 __u16 EraseMark;
46 __u16 EraseMark1;
47 } __attribute__((packed));
49 union inftl_uci {
50 struct inftl_unithead1 a;
51 struct inftl_unithead2 b;
52 struct inftl_unittail c;
55 struct inftl_oob {
56 struct inftl_bci b;
57 union inftl_uci u;
61 /* INFTL Media Header */
63 struct INFTLPartition {
64 __u32 virtualUnits;
65 __u32 firstUnit;
66 __u32 lastUnit;
67 __u32 flags;
68 __u32 spareUnits;
69 __u32 Reserved0;
70 __u32 Reserved1;
71 } __attribute__((packed));
73 struct INFTLMediaHeader {
74 char bootRecordID[8];
75 __u32 NoOfBootImageBlocks;
76 __u32 NoOfBinaryPartitions;
77 __u32 NoOfBDTLPartitions;
78 __u32 BlockMultiplierBits;
79 __u32 FormatFlags;
80 __u32 OsakVersion;
81 __u32 PercentUsed;
82 struct INFTLPartition Partitions[4];
83 } __attribute__((packed));
85 /* Partition flag types */
86 #define INFTL_BINARY 0x20000000
87 #define INFTL_BDTL 0x40000000
88 #define INFTL_LAST 0x80000000
90 #endif /* __MTD_INFTL_USER_H__ */