aboutsummaryrefslogtreecommitdiffstats
path: root/include/mtd
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-27 16:16:10 -0400
committerThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 09:06:50 -0400
commit5bd34c091a044d130601370c370f84b1c59f1627 (patch)
tree8b08012a9a30186a8805d506f8438e2944f5f31b /include/mtd
parentff268fb8791cf18df536113355d7184007c269d9 (diff)
[MTD] NAND Replace oobinfo by ecclayout
The nand_oobinfo structure is not fitting the newer error correction demands anymore. Replace it by struct nand_ecclayout and fixup the users all over the place. Keep the nand_oobinfo based ioctl for user space compability reasons. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/mtd')
-rw-r--r--include/mtd/mtd-abi.h36
-rw-r--r--include/mtd/mtd-user.h1
2 files changed, 30 insertions, 7 deletions
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 1e09e4c8f485..54c673f9648d 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -82,12 +82,12 @@ struct otp_info {
82 uint32_t locked; 82 uint32_t locked;
83}; 83};
84 84
85#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 85#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
86#define MEMERASE _IOW('M', 2, struct erase_info_user) 86#define MEMERASE _IOW('M', 2, struct erase_info_user)
87#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 87#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
88#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) 88#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
89#define MEMLOCK _IOW('M', 5, struct erase_info_user) 89#define MEMLOCK _IOW('M', 5, struct erase_info_user)
90#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) 90#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
91#define MEMGETREGIONCOUNT _IOR('M', 7, int) 91#define MEMGETREGIONCOUNT _IOR('M', 7, int)
92#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 92#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
93#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 93#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
@@ -97,8 +97,13 @@ struct otp_info {
97#define OTPSELECT _IOR('M', 13, int) 97#define OTPSELECT _IOR('M', 13, int)
98#define OTPGETREGIONCOUNT _IOW('M', 14, int) 98#define OTPGETREGIONCOUNT _IOW('M', 14, int)
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 102
103/*
104 * Obsolete legacy interface. Keep it in order not to break userspace
105 * interfaces
106 */
102struct nand_oobinfo { 107struct nand_oobinfo {
103 uint32_t useecc; 108 uint32_t useecc;
104 uint32_t eccbytes; 109 uint32_t eccbytes;
@@ -106,4 +111,21 @@ struct nand_oobinfo {
106 uint32_t eccpos[32]; 111 uint32_t eccpos[32];
107}; 112};
108 113
114struct nand_oobfree {
115 uint32_t offset;
116 uint32_t length;
117};
118
119#define MTD_MAX_OOBFREE_ENTRIES 8
120/*
121 * ECC layout control structure. Exported to userspace for
122 * diagnosis and to allow creation of raw images
123 */
124struct nand_ecclayout {
125 uint32_t eccbytes;
126 uint32_t eccpos[64];
127 uint32_t oobavail;
128 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
129};
130
109#endif /* __MTD_ABI_H__ */ 131#endif /* __MTD_ABI_H__ */
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h
index 1c13fc7161fe..713f34d3e62e 100644
--- a/include/mtd/mtd-user.h
+++ b/include/mtd/mtd-user.h
@@ -16,5 +16,6 @@ typedef struct mtd_info_user mtd_info_t;
16typedef struct erase_info_user erase_info_t; 16typedef struct erase_info_user erase_info_t;
17typedef struct region_info_user region_info_t; 17typedef struct region_info_user region_info_t;
18typedef struct nand_oobinfo nand_oobinfo_t; 18typedef struct nand_oobinfo nand_oobinfo_t;
19typedef struct nand_ecclayout nand_ecclayout_t;
19 20
20#endif /* __MTD_USER_H__ */ 21#endif /* __MTD_USER_H__ */