mtd/drivers/mtd/chips cfi_cmdset_0001.c,1.100,1.101

Joakim Tjernlund jocke at infradead.org
Thu Sep 5 16:30:49 EDT 2002


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv16344

Modified Files:
	cfi_cmdset_0001.c 
Log Message:
Initial point()/unpoint() support. Only good for scanning ATM

Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- cfi_cmdset_0001.c	21 Jun 2002 13:58:09 -0000	1.100
+++ cfi_cmdset_0001.c	5 Sep 2002 20:30:47 -0000	1.101
@@ -52,6 +52,10 @@
 
 static struct mtd_info *cfi_intelext_setup (struct map_info *);
 
+static int do_point (struct mtd_info *mtd, loff_t from, size_t len,
+		     size_t *retlen, u_char **mtdbuf);
+static void do_unpoint (struct mtd_info *mtd, u_char *addr);
+
 static struct mtd_chip_driver cfi_intelext_chipdrv = {
 	probe: NULL, /* Not usable directly */
 	destroy: cfi_intelext_destroy,
@@ -248,6 +252,12 @@
 	/* Also select the correct geometry setup too */ 
 		mtd->erase = cfi_intelext_erase_varsize;
 	mtd->read = cfi_intelext_read;
+
+	if(map->point && map->unpoint){
+		mtd->point = do_point;
+		mtd->unpoint = do_unpoint;
+	}
+
 #ifndef FORCE_WORD_WRITE
 	if ( cfi->cfiq->BufWriteTimeoutTyp ) {
 		printk("Using buffer write method\n" );
@@ -273,6 +283,24 @@
 	return mtd;
 }
 
+static int do_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf)
+{
+	struct map_info *map = mtd->priv;
+	
+	if (from + len > mtd->size)
+		return -EINVAL;
+	
+	*mtdbuf = map->point(map, from, len);	
+	*retlen = len;
+	return 0;
+}
+
+static void do_unpoint (struct mtd_info *mtd, u_char *addr)
+{
+	struct map_info *map = mtd->priv;
+
+	map->unpoint(map, addr);
+}
 
 static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf)
 {





More information about the linux-mtd-cvs mailing list