aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/mtd.h11
-rw-r--r--include/mtd/mtd-abi.h27
2 files changed, 27 insertions, 11 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index e75bb584e80b..9536567d041b 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -56,17 +56,6 @@ struct mtd_erase_region_info {
56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */ 56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */
57}; 57};
58 58
59/**
60 * struct mtd_ecc_stats - error correction status
61 *
62 * @corrected: number of corrected bits
63 * @failed: number of uncorrectable errors
64 */
65struct mtd_ecc_stats {
66 unsigned long corrected;
67 unsigned long failed;
68};
69
70/* 59/*
71 * oob operation modes 60 * oob operation modes
72 * 61 *
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 54c673f9648d..c11a589bdedf 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -99,6 +99,8 @@ struct otp_info {
99#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 99#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
100#define OTPLOCK _IOR('M', 16, struct otp_info) 100#define OTPLOCK _IOR('M', 16, struct otp_info)
101#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) 101#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
102#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
103#define MTDFILEMODE _IO('M', 19)
102 104
103/* 105/*
104 * Obsolete legacy interface. Keep it in order not to break userspace 106 * Obsolete legacy interface. Keep it in order not to break userspace
@@ -128,4 +130,29 @@ struct nand_ecclayout {
128 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; 130 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
129}; 131};
130 132
133/**
134 * struct mtd_ecc_stats - error correction status
135 *
136 * @corrected: number of corrected bits
137 * @failed: number of uncorrectable errors
138 * @badblocks: number of bad blocks in this partition
139 * @bbtblocks: number of blocks reserved for bad block tables
140 */
141struct mtd_ecc_stats {
142 uint32_t corrected;
143 uint32_t failed;
144 uint32_t badblocks;
145 uint32_t bbtblocks;
146};
147
148/*
149 * Read/write file modes for access to MTD
150 */
151enum mtd_file_modes {
152 MTD_MODE_NORMAL = MTD_OTP_OFF,
153 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
154 MTD_MODE_OTP_USER = MTD_OTP_USER,
155 MTD_MODE_RAW,
156};
157
131#endif /* __MTD_ABI_H__ */ 158#endif /* __MTD_ABI_H__ */