public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Denis Dowling" <dpd@alphalink.com.au>
To: "linux-mtd" <linux-mtd@lists.infradead.org>
Subject: nftl_format
Date: Fri, 28 Nov 2003 09:55:57 +1100	[thread overview]
Message-ID: <043c01c3b539$9ecbde30$4879a1ca@techmanager> (raw)

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hi,

Attached is a patch to get nftl_format compiling with the latest version of
mtd. I managed to get 2 of my DoC chips into a state where DFORMAT would not
want to reprogram them. The trigger for this seemed to be loading the
grub_firmware into them with doc_loadbios. Anyway with this patch I was able
to build nftl_format and reformat both of the chips.

Regards,
Denis.

[-- Attachment #2: mtd.patch --]
[-- Type: application/octet-stream, Size: 3798 bytes --]

Index: mtd/include/linux/mtd/nftl.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/nftl.h,v
retrieving revision 1.13
diff -u -b -B -w -p -r1.13 nftl.h
--- mtd/include/linux/mtd/nftl.h	23 May 2003 11:25:02 -0000	1.13
+++ mtd/include/linux/mtd/nftl.h	27 Nov 2003 22:46:29 -0000
@@ -8,7 +8,10 @@
 #define __MTD_NFTL_H__
 
 #include <linux/mtd/mtd.h>
+
+#ifdef __KERNEL__
 #include <linux/mtd/blktrans.h>
+#endif /* __KERNEL__ */
 
 /* Block Control Information */
 
Index: mtd/util/Makefile
===================================================================
RCS file: /home/cvs/mtd/util/Makefile,v
retrieving revision 1.34
diff -u -b -B -w -p -r1.34 Makefile
--- mtd/util/Makefile	20 Jun 2003 13:58:46 -0000	1.34
+++ mtd/util/Makefile	27 Nov 2003 22:46:29 -0000
@@ -10,7 +10,8 @@ CFLAGS += -I../include -O2 -Wall -Wstric
 TARGETS = ftl_format erase eraseall  nanddump doc_loadbios \
 	mkfs.jffs ftl_check mkfs.jffs2 lock unlock \
 	einfo mtd_debug fcp nandwrite jffs2dump \
-	#jffs2reader nftldump nftl_format
+	nftl_format nftldump 
+#	jffs2reader
 
 SYMLINKS = crc32.h crc32.c compr_rtime.c
 
Index: mtd/util/nftl_format.c
===================================================================
RCS file: /home/cvs/mtd/util/nftl_format.c,v
retrieving revision 1.19
diff -u -b -B -w -p -r1.19 nftl_format.c
--- mtd/util/nftl_format.c	1 May 2002 10:59:04 -0000	1.19
+++ mtd/util/nftl_format.c	27 Nov 2003 22:46:29 -0000
@@ -59,7 +59,8 @@
 #define le32_to_cpu(x) cpu_to_le32(x)
 #define le16_to_cpu(x) cpu_to_le16(x)
 
-extern ssize_t pread(), pwrite();
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
 
 unsigned char BadUnitTable[MAX_ERASE_ZONES];
 unsigned char *readbuf;
@@ -330,7 +331,7 @@ int main(int argc, char **argv)
 			continue;
 		oob.start = (ezone * meminfo.erasesize) + 512;
 		if (ioctl(fd, MEMWRITEOOB, &oob))
-			printf("MEMWRITEOOB at %lx: %s\n", (unsigned long)oob.start, sys_errlist[errno]);
+			printf("MEMWRITEOOB at %lx: %s\n", (unsigned long)oob.start, strerror(errno));
 	}
 
 	exit(0);
Index: mtd/util/nftldump.c
===================================================================
RCS file: /home/cvs/mtd/util/nftldump.c,v
retrieving revision 1.14
diff -u -b -B -w -p -r1.14 nftldump.c
--- mtd/util/nftldump.c	16 Jul 2001 16:13:50 -0000	1.14
+++ mtd/util/nftldump.c	27 Nov 2003 22:46:29 -0000
@@ -37,7 +37,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nftl.h>
 
-extern ssize_t pread();
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
 
 static struct NFTLMediaHeader MedHead[2];
 static mtd_info_t meminfo;
@@ -87,7 +87,7 @@ static unsigned short nextEUN(unsigned s
 	return UCItable[curEUN][0].a.ReplUnitNum;
 }
 
-static unsigned int find_media_headers()
+static unsigned int find_media_headers(void)
 {
 	int i;
 	static unsigned long ofs = 0;
@@ -135,7 +135,7 @@ static unsigned int find_media_headers()
 	return NumMedHeads;
 }
 
-static void dump_erase_units()
+static void dump_erase_units(void)
 {
 	int i, j;
 	unsigned long ofs;
@@ -150,7 +150,7 @@ static void dump_erase_units()
 			oob.start = ofs + (j * 512);
 			if (ioctl(fd, MEMREADOOB, &oob))
 				printf("MEMREADOOB at %lx: %s\n",
-				       (unsigned long) oob.start, sys_errlist[errno]);
+				       (unsigned long) oob.start, strerror(errno));
 			memcpy(&UCItable[i][j], &oobbuf.u, 8);
 		}
 		if (UCItable[i][1].b.EraseMark != cpu_to_le16(0x3c69)) {
@@ -199,7 +199,7 @@ static void dump_erase_units()
 	}
 }
 
-static void dump_virtual_units()
+static void dump_virtual_units(void)
 {
 	int i, j;
 	char readbuf[512];

             reply	other threads:[~2003-11-27 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-27 22:55 Denis Dowling [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-11-06 17:10 nftl_format Chris Ellec
2001-04-25 19:00 nftl_format Marc Karasek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='043c01c3b539$9ecbde30$4879a1ca@techmanager' \
    --to=dpd@alphalink.com.au \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox