} else {
tags.objectId = eTags->objectId;
tags.chunkId = eTags->chunkId;
- tags.byteCount = eTags->byteCount;
+
+ tags.byteCountLSB = eTags->byteCount & 0x3ff;
+
+ if(dev->nDataBytesPerChunk >= 1024){
+ tags.byteCountMSB = (eTags->byteCount >> 10) & 3;
+ } else {
+ tags.byteCountMSB = 3;
+ }
+
+
tags.serialNumber = eTags->serialNumber;
if (!dev->useNANDECC && data) {
eTags->objectId = tags.objectId;
eTags->chunkId = tags.chunkId;
- eTags->byteCount = tags.byteCount;
+ eTags->byteCount = tags.byteCountLSB;
+
+ if(dev->nDataBytesPerChunk >= 1024)
+ eTags->byteCount |= (((unsigned) tags.byteCountMSB) << 10);
+
eTags->serialNumber = tags.serialNumber;
}
}