Check in inband tags, some extra yaffs direct functions and some other changes
[yaffs2.git] / yaffs_tagscompat.c
index b51bccd6c91ab50a099e6a262739bfdf460af8a7..ab756d06d0a9eb580ef520bd48265dc08e03e4f3 100644 (file)
@@ -1,21 +1,20 @@
 /*
- * YAFFS: Yet another FFS. A NAND-flash specific file system. 
- * yaffs_tagscompat.h: Tags compatability layer to use YAFFS1 formatted NAND.
+ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002 Aleph One Ltd.
+ * Copyright (C) 2002-2007 Aleph One Ltd.
+ *   for Toby Churchill Ltd and Brightstar Engineering
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * $Id: yaffs_tagscompat.c,v 1.8 2005-11-29 20:54:32 marty Exp $
  */
 
 #include "yaffs_guts.h"
 #include "yaffs_tagscompat.h"
 #include "yaffs_ecc.h"
+#include "yaffs_getblockinfo.h"
 
 static void yaffs_HandleReadDataError(yaffs_Device * dev, int chunkInNAND);
 #ifdef NOTYET
@@ -47,7 +46,7 @@ static const char yaffs_countBitsTable[256] = {
        4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
 };
 
-static int yaffs_CountBits(__u8 x)
+int yaffs_CountBits(__u8 x)
 {
        int retVal;
        retVal = yaffs_countBitsTable[x];
@@ -440,7 +439,7 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev,
        yaffs_ECCResult eccResult;
 
        static yaffs_Spare spareFF;
-       static int init;
+       static int init = 0;
 
        if (!init) {
                memset(&spareFF, 0xFF, sizeof(spareFF));
@@ -499,9 +498,9 @@ int yaffs_TagsCompatabilityMarkNANDBlockBad(struct yaffs_DeviceStruct *dev,
 }
 
 int yaffs_TagsCompatabilityQueryNANDBlock(struct yaffs_DeviceStruct *dev,
-                                         int blockNo, yaffs_BlockState *
-                                         state,
-                                         int *sequenceNumber)
+                                         int blockNo,
+                                         yaffs_BlockState *state,
+                                         __u32 *sequenceNumber)
 {
 
        yaffs_Spare spare0, spare1;