diff -uNr mtd-19991025/include/linux/mtd/nftl.h mtd-20000119/include/linux/mtd/nftl.h --- mtd-19991025/include/linux/mtd/nftl.h Sat Oct 16 19:22:14 1999 +++ mtd-20000119/include/linux/mtd/nftl.h Wed Jan 19 08:35:13 2000 @@ -2,7 +2,7 @@ /* Defines for NAND Flash Translation Layer */ /* (c) 1999 Machine Vision Holdings, Inc. */ /* Author: David Woodhouse */ -/* $Id: nftl.h,v 1.3 1999/08/20 15:31:01 dwmw2 Exp $ */ +/* $Id: nftl.h,v 1.4 2000/01/19 08:35:13 dwmw2 Exp $ */ #ifndef __MTD_NFTL_H__ #define __MTD_NFTL_H__ diff -uNr mtd-19991025/kernel/Config.in mtd-20000119/kernel/Config.in --- mtd-19991025/kernel/Config.in Fri Sep 17 16:55:17 1999 +++ mtd-20000119/kernel/Config.in Wed Jan 19 10:04:37 2000 @@ -1,3 +1,6 @@ +mainmenu_option next_comment +comment 'Memory Technology Device (MTD)' + tristate 'Memory Technology Device (MTD) support' CONFIG_MTD if [ "$CONFIG_MTD" != "n" ]; then @@ -10,5 +13,7 @@ dep_tristate 'FTL (Flash Translation Layer) support' CONFIG_FTL $CONFIG_MTD dep_tristate 'NFTL (NAND Flash Translation Layer) support' CONFIG_NFTL $CONFIG_MTD - dep_tristate 'Direct blockdevice access to MTD devices' CONFIG_MTDBLOCK $CONFIG_MTD + dep_tristate 'Direct blockdevice access to MTD devices' CONFIG_MTD_BLOCK $CONFIG_MTD fi + +endmenu diff -uNr mtd-19991025/kernel/doc1000.c mtd-20000119/kernel/doc1000.c --- mtd-19991025/kernel/doc1000.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/doc1000.c Wed Jan 19 10:26:04 2000 @@ -1,6 +1,6 @@ /*====================================================================== - $Id: doc1000.c,v 1.4 1999/10/25 14:55:46 dwmw2 Exp $ + $Id: doc1000.c,v 1.5 2000/01/19 10:26:04 dwmw2 Exp $ A general driver for accessing PCMCIA card memory via Bulk Memory Services. @@ -153,7 +153,7 @@ u_char *pageaddr=pagein(mtd,from); struct mypriv *priv=mtd->priv; u_char device = from >> priv->devshift; - u_char cell = (from - (device << priv->devshift)) / mtd->erasesize; + u_char cell = (int) (from - (device << priv->devshift)) / mtd->erasesize; int ret = 0, timeron = 0; if ((from & WINDOW_MASK) + len <= WINDOW_SIZE) @@ -593,10 +593,4 @@ del_mtd_device(mymtd); kfree(mymtd); } - -module_init (init_doc1000); -module_exit(cleanup_doc1000); - - - diff -uNr mtd-19991025/kernel/doc2000.c mtd-20000119/kernel/doc2000.c --- mtd-19991025/kernel/doc2000.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/doc2000.c Wed Jan 19 10:26:04 2000 @@ -2,7 +2,7 @@ /* Linux driver for Disk-On-Chip 2000 */ /* (c) 1999 Machine Vision Holdings, Inc. */ /* Author: David Woodhouse */ -/* $Id: doc2000.c,v 1.8 1999/10/25 14:55:46 dwmw2 Exp $ */ +/* $Id: doc2000.c,v 1.9 2000/01/19 10:26:04 dwmw2 Exp $ */ /* DOC_PASSIVE_PROBE: @@ -895,7 +895,7 @@ printk(KERN_NOTICE "M-Systems DiskOnChip driver. (C) 1999 Machine Vision Holdings, Inc.\n"); #ifdef PRERELEASE - printk(KERN_INFO "$Id: doc2000.c,v 1.8 1999/10/25 14:55:46 dwmw2 Exp $\n"); + printk(KERN_INFO "$Id: doc2000.c,v 1.9 2000/01/19 10:26:04 dwmw2 Exp $\n"); #endif for (i=0; doc_locations[i]; i++) { @@ -929,23 +929,4 @@ } } } -#if LINUX_VERSION_CODE < 0x20300 -#ifndef MODULE -__initfunc(init_doc2000); -#endif -#else /* V2.3.x */ -module_init(init_doc2000); -module_exit(cleanup_doc2000); -#endif - - - - - - - - - - - diff -uNr mtd-19991025/kernel/ftl.c mtd-20000119/kernel/ftl.c --- mtd-19991025/kernel/ftl.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/ftl.c Wed Jan 19 10:26:04 2000 @@ -1,6 +1,6 @@ /*====================================================================== - $Id: ftl.c,v 1.4 1999/10/25 14:55:46 dwmw2 Exp $ + $Id: ftl.c,v 1.5 2000/01/19 10:26:04 dwmw2 Exp $ A Flash Translation Layer memory card driver @@ -134,7 +134,7 @@ -void dummy_init(struct gendisk *crap) +static void dummy_init(struct gendisk *crap) { } diff -uNr mtd-19991025/kernel/makefree.c mtd-20000119/kernel/makefree.c --- mtd-19991025/kernel/makefree.c Fri Aug 20 00:01:07 1999 +++ mtd-20000119/kernel/makefree.c Thu Jan 1 01:00:00 1970 @@ -1,26 +0,0 @@ - -#include -#include -#include - -#include -extern struct NFTLrecord *NFTLs[]; -extern u16 NFTL_makefreeblock(struct NFTLrecord *NFTL, unsigned block); - -int init_module(void) -{ - - if (NFTLs[0]) { - printk("Calling NFTL_makefreeblock()\n"); - NFTL_makefreeblock(NFTLs[0], 0xffffffff); - } - else - printk("No NFTL\n"); - - return -ENODEV; -} - -int cleanup_module(void) -{ - return 0; -} diff -uNr mtd-19991025/kernel/mapped.c mtd-20000119/kernel/mapped.c --- mtd-19991025/kernel/mapped.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/mapped.c Wed Jan 19 10:26:04 2000 @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: mapped.c,v 1.5 1999/10/25 14:55:46 dwmw2 Exp $ +// $Id: mapped.c,v 1.6 2000/01/19 10:26:04 dwmw2 Exp $ /* ###################################################################### Flash MTD Routines @@ -88,7 +88,7 @@ /*}}}*/ // SetJedec - Set the jedec information for a chip /*{{{*/ // --------------------------------------------------------------------- -/* We track the configuration of each chip seperately in the chip list, +/* We track the configuration of each chip separately in the chip list, each chip can have a different type and configuration to allow for maximum flexability. */ void set_jedec(struct mapped_mtd_info *map,unsigned chip,unsigned char mfr, @@ -373,7 +373,7 @@ if (page_jump(map,chip->base + chip->start + off,1,&base,0) != 0) return -EIO; - // Check to make sure we didnt timeout + // Check to make sure we didn't timeout writeb(0x30,base); if ((readb(base) & (1 << 3)) != 0) { diff -uNr mtd-19991025/kernel/mixmem.c mtd-20000119/kernel/mixmem.c --- mtd-19991025/kernel/mixmem.c Fri Sep 17 16:58:36 1999 +++ mtd-20000119/kernel/mixmem.c Wed Jan 19 10:04:37 2000 @@ -24,6 +24,10 @@ #define MIXMEM_PAGESIZE 4096 #define FIRST_BLOCK_OFFSET 0x1000 +#if LINUX_VERSION_CODE < 0x20300 +#define __exit +#endif + static unsigned int mixmem_addrs[] = { 0xc8000, 0xd8000, 0 }; static unsigned int mixcom_ports[] = { 0x180, 0x280, 0x380, 0 }; diff -uNr mtd-19991025/kernel/mtd.c mtd-20000119/kernel/mtd.c --- mtd-19991025/kernel/mtd.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/mtd.c Wed Jan 19 10:26:04 2000 @@ -1,6 +1,6 @@ /*====================================================================== - $Id: mtd.c,v 1.8 1999/10/25 14:55:46 dwmw2 Exp $ + $Id: mtd.c,v 1.9 2000/01/19 10:26:04 dwmw2 Exp $ A general driver for accessing Memory Technology Devices @@ -553,14 +553,3 @@ #endif } - - - -#if LINUX_VERSION_CODE < 0x20300 -#ifndef MODULE -__initfunc(init_mtd); -#endif -#else -module_init(init_mtd); -module_exit(cleanup_mtd); -#endif diff -uNr mtd-19991025/kernel/mtdblock.c mtd-20000119/kernel/mtdblock.c --- mtd-19991025/kernel/mtdblock.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/mtdblock.c Wed Jan 19 10:26:04 2000 @@ -1,15 +1,15 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: mtdblock.c,v 1.3 1999/10/25 14:55:46 dwmw2 Exp $ +// $Id: mtdblock.c,v 1.4 2000/01/19 10:26:04 dwmw2 Exp $ /* ###################################################################### Memory Technology Devices Manager TODO: - Add a ioctl method to the mtd structure and move all flash related - stuff into a new seperated structure so as not to pollute the + stuff into a new separated structure so as not to pollute the main mtd info. - - Flexable partitioning + - Flexible partitioning ##################################################################### */ /*}}}*/ @@ -73,7 +73,7 @@ int dev; struct mtd_info *mtd; - printk("mtdblock_open\n"); + printk("mtdblock_release\n"); if (inode == NULL) return -ENODEV; @@ -93,7 +93,7 @@ if (mtd->module) __MOD_DEC_USE_COUNT(mtd->module); -printk("ok\n"); + printk("ok\n"); MOD_DEC_USE_COUNT; return 0; } @@ -182,7 +182,7 @@ res = 0; break; - // Shouldnt happen + // Shouldn't happen default: printk("mtd: unknown request\n"); break; diff -uNr mtd-19991025/kernel/nftl.c mtd-20000119/kernel/nftl.c --- mtd-19991025/kernel/nftl.c Mon Oct 25 15:55:46 1999 +++ mtd-20000119/kernel/nftl.c Wed Jan 19 10:26:04 2000 @@ -2,7 +2,7 @@ /* Linux driver for NAND Flash Translation Layer */ /* (c) 1999 Machine Vision Holdings, Inc. */ /* Author: David Woodhouse */ -/* $Id: nftl.c,v 1.9 1999/10/25 14:55:46 dwmw2 Exp $ */ +/* $Id: nftl.c,v 1.12 2000/01/19 10:26:04 dwmw2 Exp $ */ #define PRERELEASE @@ -45,7 +45,7 @@ struct hd_struct part_table[256] = {{0,0},}; -void dummy_init (struct gendisk *crap) +static void dummy_init (struct gendisk *crap) {} @@ -133,11 +133,10 @@ if (thisNFTL->nr_sects != thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors) { printk("NFTL capacity reduced for geometry reasons from %lx to %lx sectors\n", thisNFTL->nr_sects, - thisNFTL->nr_sects = thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors); - } - - + thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors); + thisNFTL->nr_sects = thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors; + } thisNFTL->EUNtable = kmalloc( 2 * thisNFTL->numvunits, @@ -1127,17 +1126,8 @@ printk(KERN_NOTICE "M-Systems NAND Flash Translation Layer driver. (C) 1999 MVHI\n"); #ifdef PRERELEASE - printk(KERN_INFO"$Id: nftl.c,v 1.9 1999/10/25 14:55:46 dwmw2 Exp $\n"); + printk(KERN_INFO"$Id: nftl.c,v 1.12 2000/01/19 10:26:04 dwmw2 Exp $\n"); #endif - register_mtd_notifier(&nftl_notifier); - - for (i=0; i < MAX_MTD_DEVICES; i++) { - mtd = get_mtd_device(i); - - if (mtd) - NFTL_notify_func(mtd, i); - } - if (register_blkdev(NFTL_MAJOR, "nftl", &nftl_fops)){ printk("unable to register NFTL block device\n"); @@ -1150,7 +1140,15 @@ gendisk_head = &nftl_gendisk; } - + register_mtd_notifier(&nftl_notifier); + + for (i=0; i < MAX_MTD_DEVICES; i++) { + mtd = get_mtd_device(i); + + if (mtd) + NFTL_notify_func(mtd, i); + } + return 0; } diff -uNr mtd-19991025/kernel/slram.c mtd-20000119/kernel/slram.c --- mtd-19991025/kernel/slram.c Tue Aug 17 17:36:21 1999 +++ mtd-20000119/kernel/slram.c Wed Jan 19 10:26:04 2000 @@ -1,6 +1,6 @@ /*====================================================================== - $Id: slram.c,v 1.3 1999/08/17 16:36:03 dwmw2 Exp $ + $Id: slram.c,v 1.4 2000/01/19 10:26:04 dwmw2 Exp $ A general driver for accessing PCMCIA card memory via Bulk Memory Services. @@ -33,6 +33,14 @@ #include +#ifndef THIS_MODULE +#ifdef MODULE +#define THIS_MODULE (&__this_module) +#else +#define THIS_MODULE NULL +#endif +#endif + struct mypriv { u_char *start; u_char *end; @@ -142,7 +150,8 @@ if (start + length != end) { - printk(KERN_NOTICE "physmem: start(%p) + length(%p) != end(%p) !\n"); + printk(KERN_NOTICE "physmem: start(%lx) + length(%lx) != end(%lx) !\n", + start, length, end); return -EINVAL; } @@ -182,7 +191,7 @@ mymtd->unpoint = physmem_unpoint; mymtd->read = physmem_read; mymtd->write = physmem_write; - mymtd->module = &__this_module; + mymtd->module = THIS_MODULE; mymtd->type = MTD_RAM; mymtd->erasesize = 0x10000;