diff options
author | charles <charles> | 2006-09-21 08:13:59 +0000 |
---|---|---|
committer | charles <charles> | 2006-09-21 08:13:59 +0000 |
commit | a8e9cfa2968a5f16ff9ae578cc1d3202ebef8725 (patch) | |
tree | 83826466dcc5bf58777d7d322fc7868aaf2755ab /yaffs_packedtags2.c | |
parent | 20488750f4e5df4cec34f2bd4db39ab7e075d0a9 (diff) |
Better retirement and erasure checking.
Diffstat (limited to 'yaffs_packedtags2.c')
-rw-r--r-- | yaffs_packedtags2.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/yaffs_packedtags2.c b/yaffs_packedtags2.c index 5cc68af..69d78b2 100644 --- a/yaffs_packedtags2.c +++ b/yaffs_packedtags2.c @@ -114,20 +114,34 @@ void yaffs_UnpackTags2(yaffs_ExtendedTags * t, yaffs_PackedTags2 * pt) /* Page is in use */ #ifdef YAFFS_IGNORE_TAGS_ECC { - t->eccResult = 0; + t->eccResult = YAFFS_ECC_RESULT_NO_ERROR; } #else { yaffs_ECCOther ecc; + int result; yaffs_ECCCalculateOther((unsigned char *)&pt->t, sizeof (yaffs_PackedTags2TagsPart), &ecc); - t->eccResult = + result = yaffs_ECCCorrectOther((unsigned char *)&pt->t, sizeof (yaffs_PackedTags2TagsPart), &pt->ecc, &ecc); + switch(result){ + case 0: + t->eccResult = YAFFS_ECC_RESULT_NO_ERROR; + break; + case 1: + t->eccResult = YAFFS_ECC_RESULT_FIXED; + break; + case -1: + t->eccResult = YAFFS_ECC_RESULT_UNFIXED; + break; + default: + t->eccResult = YAFFS_ECC_RESULT_UNKNOWN; + } } #endif t->blockBad = 0; |