mtd/include/linux/mtd mtd.h,1.34,1.35 nand.h,1.15,1.16

gleixner at infradead.org gleixner at infradead.org
Thu Aug 29 17:41:45 EDT 2002


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

Modified Files:
	mtd.h nand.h 
Log Message:
oob-config for different filesystems, 6/512Byte hardware ecc

Index: mtd.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/mtd.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- mtd.h	27 Nov 2001 14:55:12 -0000	1.34
+++ mtd.h	29 Aug 2002 21:41:42 -0000	1.35
@@ -174,8 +174,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 (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf);
+	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_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);
@@ -198,7 +198,11 @@
 	   which contains an (ofs, len) tuple.
 	*/
 	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);
 	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);
 
 	/* Sync */
 	void (*sync) (struct mtd_info *mtd);

Index: nand.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/nand.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- nand.h	10 Aug 2002 23:07:25 -0000	1.15
+++ nand.h	29 Aug 2002 21:41:42 -0000	1.16
@@ -36,6 +36,12 @@
  *			CONFIG_MTD_NAND_ECC_JFFS2 is not set
  *   08-10-2002 TG	extensions to nand_chip structure to support HW-ECC
  *
+ *   08-29-2002 tglx 	nand_chip structure: data_poi for selecting 
+ *			internal / fs-driver buffer
+ *			support for 6byte/512byte hardware ECC
+ *			read_ecc, write_ecc extended for different oob-layout
+ *			oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
+ *			NAND_YAFFS_OOB
  */
 #ifndef __LINUX_MTD_NAND_H
 #define __LINUX_MTD_NAND_H
@@ -86,6 +92,7 @@
 #define NAND_ECC_SOFT		1
 #define NAND_ECC_HW3_256	2
 #define NAND_ECC_HW3_512	3
+#define NAND_ECC_HW6_512	4
 
 /*
  * Constants for Hardware ECC
@@ -165,6 +172,7 @@
 	nand_state_t 	state;
 	int 		page_shift;
 	u_char 		*data_buf;
+	u_char		*data_poi;
 	u_char 		*data_cache;
 	int		cache_page;
 };
@@ -215,7 +223,11 @@
 /*
 * Constants for oob configuration
 */
-#define NAND_FORCE_BADBPOS		5
+#define NAND_BADBLOCK_POS		5
+
+#define NAND_NONE_OOB			0
+#define NAND_JFFS2_OOB			1
+#define NAND_YAFFS_OOB			2
 
 #define NAND_NOOB_ECCPOS0		0
 #define NAND_NOOB_ECCPOS1		1
@@ -223,8 +235,6 @@
 #define NAND_NOOB_ECCPOS3		3
 #define NAND_NOOB_ECCPOS4		6
 #define NAND_NOOB_ECCPOS5		7
-#define NAND_NOOB_BADBPOS		NAND_FORCE_BADBPOS
-#define NAND_NOOB_ECCVPOS		4
 
 #define NAND_JFFS2_OOB_ECCPOS0		0
 #define NAND_JFFS2_OOB_ECCPOS1		1
@@ -232,8 +242,13 @@
 #define NAND_JFFS2_OOB_ECCPOS3		3
 #define NAND_JFFS2_OOB_ECCPOS4		6
 #define NAND_JFFS2_OOB_ECCPOS5		7
-#define NAND_JFFS2_OOB_BADBPOS		NAND_FORCE_BADBPOS
-#define NAND_JFFS2_OOB_ECCVPOS		4
+
+#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





More information about the linux-mtd-cvs mailing list