// Bit 0 of each entry indicates whether the entry has an odd or even parity, and therefore
// this bytes influence on the line parity.
-const char *yaffs_ecc_c_version = "$Id: yaffs_ecc.c,v 1.1 2004-11-03 08:14:07 charles Exp $";
+const char *yaffs_ecc_c_version = "$Id: yaffs_ecc.c,v 1.2 2005-03-16 04:00:36 charles Exp $";
#include "yaffs_ecc.h"
// swap the bytes to correct for the wrong order
unsigned char t;
+#if 0 // NCB
t = d0;
d0 = d1;
d1 = t;
+#else
+ t = cDelta;
+ cDelta = lDelta;
+ lDelta = t;
+#endif
#endif
bit = 0;
*/
-const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.1 2004-12-17 04:39:04 charles Exp $";
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.2 2005-03-16 04:00:36 charles Exp $";
extern const char *yaffs_guts_c_version;
+
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#endif
-
#include <asm/uaccess.h>
#include "yportenv.h"
-//unsigned yaffs_traceMask = YAFFS_TRACE_ALWAYS | YAFFS_TRACE_BAD_BLOCKS;
-unsigned yaffs_traceMask = 0xFFFFFFFF;
+unsigned yaffs_traceMask = YAFFS_TRACE_ALWAYS | YAFFS_TRACE_BAD_BLOCKS;
+//unsigned yaffs_traceMask = 0xFFFFFFFF;
#ifdef CONFIG_YAFFS_RAM_ENABLED
*/
//yaffs_guts.c
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.4 2004-12-17 04:39:04 charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.5 2005-03-16 04:00:36 charles Exp $";
#include "yportenv.h"
__u8 *data = yaffs_GetTempBuffer(dev,__LINE__);
yaffs_ExtendedTags tags;
- dev->readChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
+// NCB dev->readChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
+ yaffs_ReadChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
if(!yaffs_CheckFF(data,dev->nBytesPerChunk) || tags.chunkUsed)
{
* 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.1 2004-11-03 08:14:07 charles Exp $
+ * $Id: yaffs_tagscompat.c,v 1.2 2005-03-16 04:00:36 charles Exp $
*/
#include "yaffs_guts.h"
tags.byteCount = eTags->byteCount;
tags.serialNumber = eTags->serialNumber;
+// NCB
+ if (!dev->useNANDECC && data)
+ {
+ yaffs_CalcECC(data,&spare);
+ }
+
+// /NCB
yaffs_LoadTagsIntoSpare(&spare,&tags);
}
yaffs_Tags tags;
yaffs_ECCResult eccResult;
+// NCB
+ static yaffs_Spare spareFF;
+ static int init;
+
+ if(!init)
+ {
+ memset(&spareFF,0xFF,sizeof(spareFF));
+ init = 1;
+ }
+// /NCB
if(yaffs_ReadChunkFromNAND(dev,chunkInNAND,data,&spare,&eccResult,1))
{
+// added NCB - eTags may be NULL
+ if (eTags) {
+
int deleted = (yaffs_CountBits(spare.pageStatus) < 7) ? 1 : 0;
yaffs_GetTagsFromSpare(dev,&spare,&tags);
eTags->eccResult = eccResult;
eTags->blockBad = 0; // We're reading it therefore it is not a bad block
+// NCB added 18/2/2005
+ eTags->chunkUsed = (memcmp(&spareFF,&spare,sizeof(spareFF)) != 0) ? 1:0;
+ }
+
return YAFFS_OK;
}
else