mtd/include/linux/mtd mtd.h,1.39,1.40 nand.h,1.20,1.21 partitions.h,1.10,1.11

gleixner at infradead.org gleixner at infradead.org
Tue Feb 18 15:53:57 EST 2003


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv23371/mtd/include/linux/mtd

Modified Files:
	mtd.h nand.h partitions.h 
Log Message:
tglx declares himself healed from temporary brain damage and comes back to the original plan of passing
oob-layout structures. This implies minor changes to filesystem layers, but removes file system dependend
code in nand.c/.h. For userspace apps ioctl (MEMSETOOBSEL) can pass a structure with the layout, which 
has to be used for functions  like read/write, which have no knowledge about oob-layout. see util/nandwrite.c
 



Index: mtd.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/mtd.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- mtd.h	18 Feb 2003 10:08:17 -0000	1.39
+++ mtd.h	18 Feb 2003 20:53:55 -0000	1.40
@@ -26,7 +26,6 @@
 	unsigned char *ptr;
 };
 
-
 #define MTD_CHAR_MAJOR 90
 #define MTD_BLOCK_MAJOR 31
 #define MAX_MTD_DEVICES 16
@@ -95,15 +94,21 @@
 #define MEMGETREGIONINFO	_IOWR('M', 8, struct region_info_user)
 #define MEMSETOOBSEL		_IOW('M', 9, int)
 
+struct nand_oobinfo {
+	int	useecc;
+	int	eccpos[6];	
+};
+
+
 #ifndef __KERNEL__
 
 typedef struct mtd_info_user mtd_info_t;
 typedef struct erase_info_user erase_info_t;
 typedef struct region_info_user region_info_t;
+typedef struct nand_oobinfo nand_oobinfo_t;
 
 	/* User-space ioctl definitions */
 
-
 #else /* __KERNEL__ */
 
 
@@ -148,12 +153,15 @@
 	u_int32_t oobsize;   // Amount of OOB data per block (e.g. 16)
 	u_int32_t ecctype;
 	u_int32_t eccsize;
-	u_int32_t oobsel;
+	
 
 	// Kernel-only stuff starts here.
 	char *name;
 	int index;
 
+	// oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
+	struct nand_oobinfo oobinfo;
+
 	/* Data for variable erase regions. If numeraseregions is zero,
 	 * it means that the whole device has erasesize as given above. 
 	 */
@@ -176,8 +184,8 @@
 	int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 	int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
 
-	int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, int *oobsel);
-	int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, int *oobsel);
+	int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
+	int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
 
 	int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 	int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
@@ -201,10 +209,10 @@
 	*/
 	int (*readv) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, size_t *retlen);
 	int (*readv_ecc) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, 
-		size_t *retlen, u_char *eccbuf, int *oobsel);
+		size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
 	int (*writev) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen);
 	int (*writev_ecc) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, 
-		size_t *retlen, u_char *eccbuf, int *oobsel);
+		size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
 
 	/* Sync */
 	void (*sync) (struct mtd_info *mtd);

Index: nand.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/nand.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- nand.h	18 Feb 2003 11:15:34 -0000	1.20
+++ nand.h	18 Feb 2003 20:53:55 -0000	1.21
@@ -48,8 +48,6 @@
 #ifndef __LINUX_MTD_NAND_H
 #define __LINUX_MTD_NAND_H
 
-#ifdef __KERNEL__
-
 #include <linux/config.h>
 
 /*
@@ -241,39 +239,5 @@
 * Constants for oob configuration
 */
 #define NAND_BADBLOCK_POS		5
-
-
-#define NAND_NOOB_ECCPOS0		0
-#define NAND_NOOB_ECCPOS1		1
-#define NAND_NOOB_ECCPOS2		2
-#define NAND_NOOB_ECCPOS3		3
-#define NAND_NOOB_ECCPOS4		6
-#define NAND_NOOB_ECCPOS5		7
-
-#define NAND_JFFS2_OOB_ECCPOS0		0
-#define NAND_JFFS2_OOB_ECCPOS1		1
-#define NAND_JFFS2_OOB_ECCPOS2		2
-#define NAND_JFFS2_OOB_ECCPOS3		3
-#define NAND_JFFS2_OOB_ECCPOS4		6
-#define NAND_JFFS2_OOB_ECCPOS5		7
-
-#define NAND_YAFFS_OOB_ECCPOS0		8
-#define NAND_YAFFS_OOB_ECCPOS1		9
-#define NAND_YAFFS_OOB_ECCPOS2		10
-#define NAND_YAFFS_OOB_ECCPOS3		13
-#define NAND_YAFFS_OOB_ECCPOS4		14
-#define NAND_YAFFS_OOB_ECCPOS5		15
-
-#define NAND_JFFS2_OOB8_FSDAPOS		6
-#define NAND_JFFS2_OOB16_FSDAPOS	8
-#define NAND_JFFS2_OOB8_FSDALEN		2
-#define NAND_JFFS2_OOB16_FSDALEN	8
-
-#endif
-
-#define NAND_NONE_OOB			0
-#define NAND_JFFS2_OOB			1
-#define NAND_YAFFS_OOB			2
-
 
 #endif /* __LINUX_MTD_NAND_H */

Index: partitions.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/partitions.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- partitions.h	18 Feb 2003 10:13:25 -0000	1.10
+++ partitions.h	18 Feb 2003 20:53:55 -0000	1.11
@@ -37,12 +37,12 @@
  */ 
 
 struct mtd_partition {
-	char *name;		/* identifier string */
-	u_int32_t size;		/* partition size */
+	char *name;			/* identifier string */
+	u_int32_t size;			/* partition size */
 	u_int32_t offset;		/* offset within the master MTD space */
-	u_int32_t mask_flags;	/* master MTD flags to mask out for this partition */
-	u_int32_t oobsel;	/* out of band layout for this partition (NAND only)*/
-	struct mtd_info **mtdp;	/* pointer to store the MTD object */
+	u_int32_t mask_flags;		/* master MTD flags to mask out for this partition */
+	struct nand_oobinfo *oobsel;	/* out of band layout for this partition (NAND only)*/
+	struct mtd_info **mtdp;		/* pointer to store the MTD object */
 };
 
 #define MTDPART_OFS_NXTBLK	(-2)





More information about the linux-mtd-cvs mailing list