1 #include "yaffs_packedtags2.h"
5 static void yaffs_DumpPackedTags2(const yaffs_PackedTags2 *pt)
7 T(YAFFS_TRACE_MTD,(TSTR("packed tags obj %d chunk %d byte %d seq %d"TENDSTR),pt->t.objectId,pt->t.chunkId,pt->t.byteCount,pt->t.sequenceNumber));
10 static void yaffs_DumpTags2(const yaffs_ExtendedTags *t)
12 T(YAFFS_TRACE_MTD,(TSTR("ext.tags eccres %d blkbad %d chused %d obj %d chunk%d byte %d del %d ser %d seq %d"TENDSTR),
13 t->eccResult, t->blockBad, t->chunkUsed, t->objectId, t->chunkId, t->byteCount, t->chunkDeleted, t->serialNumber, t->sequenceNumber));
17 void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t)
19 pt->t.chunkId = t->chunkId;
20 pt->t.sequenceNumber = t->sequenceNumber;
21 pt->t.byteCount = t->byteCount;
22 pt->t.objectId = t->objectId;
24 yaffs_DumpPackedTags2(pt);
27 yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc);
31 void yaffs_UnpackTags2(yaffs_ExtendedTags *t, const yaffs_PackedTags2 *pt)
35 if(pt->t.sequenceNumber == 0xFFFFFFFF)
37 memset(t,0,sizeof(yaffs_ExtendedTags));
44 yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&ecc);
45 t->eccResult = yaffs_ECCCorrectOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc,&ecc);
48 t->objectId = pt->t.objectId;
49 t->chunkId = pt->t.chunkId;
50 t->byteCount = pt->t.byteCount;
53 t->sequenceNumber = pt->t.sequenceNumber;
56 yaffs_DumpPackedTags2(pt);