+
+
+void yaffs_unpack_tags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt, int tagsECC)
+{
+
+ yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_NO_ERROR;
+
+ if (pt->t.sequenceNumber != 0xFFFFFFFF &&
+ tagsECC){
+ /* Chunk is in use and we need to do ECC */
+
+ yaffs_ECCOther ecc;
+ int result;
+ yaffs_ecc_calc_other((unsigned char *)&pt->t,
+ sizeof(yaffs_PackedTags2TagsPart),
+ &ecc);
+ result = yaffs_ecc_correct_other((unsigned char *)&pt->t,
+ sizeof(yaffs_PackedTags2TagsPart),
+ &pt->ecc, &ecc);
+ switch (result) {
+ case 0:
+ eccResult = YAFFS_ECC_RESULT_NO_ERROR;
+ break;
+ case 1:
+ eccResult = YAFFS_ECC_RESULT_FIXED;
+ break;
+ case -1:
+ eccResult = YAFFS_ECC_RESULT_UNFIXED;
+ break;
+ default:
+ eccResult = YAFFS_ECC_RESULT_UNKNOWN;
+ }
+ }
+
+ yaffs_unpack_tags2tags_part(t, &pt->t);
+
+ t->eccResult = eccResult;
+
+ yaffs_DumpPackedTags2(pt);
+ yaffs_DumpTags2(t);
+}
+