patch-2.4.0-test12 linux/include/linux/mtd/map.h

Next file: linux/include/linux/mtd/mtd.h
Previous file: linux/include/linux/mtd/doc2000.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/include/linux/mtd/map.h linux/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
 
 /* Overhauled routines for dealing with different mmap regions of flash */
-/* $Id: map.h,v 1.5 2000/06/26 16:18:58 dwmw2 Exp $ */
+/* $Id: map.h,v 1.10 2000/12/04 13:18:33 dwmw2 Exp $ */
 
 #ifndef __LINUX_MTD_MAP_H__
 #define __LINUX_MTD_MAP_H__
@@ -42,6 +42,8 @@
 	void (*write16)(struct map_info *, __u16, unsigned long);
 	void (*write32)(struct map_info *, __u32, unsigned long);
 	void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
+
+	void (*set_vpp)(int);
 	/* We put these two here rather than a single void *map_priv, 
 	   because we want mappers to be able to have quickly-accessible
 	   cache for the 'currently-mapped page' without the _extra_
@@ -54,6 +56,7 @@
 	const char *im_name;
 };
 
+#ifdef CONFIG_MODULES
 /* 
  * Probe for the contents of a map device and make an MTD structure
  * if anything is recognised. Doesn't register it because the calling
@@ -78,6 +81,18 @@
 #define do_jedec_probe(x) do_map_probe(x, "jedec_probe", "jedec_probe")
 #define do_ram_probe(x) do_map_probe(x, "map_ram_probe", "map_ram")
 #define do_rom_probe(x) do_map_probe(x, "map_rom_probe", "map_rom")
+#else
+	/* without module support, call probe function directly */
+extern struct mtd_info *cfi_probe(struct map_info *);
+extern struct mtd_info *jedec_probe(struct map_info *);
+extern struct mtd_info *map_ram_probe(struct map_info *);
+extern struct mtd_info *map_rom_probe(struct map_info *);
+
+#define do_cfi_probe(x) cfi_probe(x)
+#define do_jedec_probe(x) jedec_probe(x)
+#define do_ram_probe(x) map_ram_probe(x)
+#define do_rom_probe(x) map_rom_probe(x)
+#endif
 
 /*
  * Destroy an MTD device which was created for a map device.
@@ -92,5 +107,7 @@
 	kfree(mtd);
 }
 
+#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(1); } while(0)
+#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(0); } while(0)
 
 #endif /* __LINUX_MTD_MAP_H__ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)