X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmkyaffsimage.c;h=b7173eb3b91c354c81fc17d604362c2ea20cbbdd;hb=e33554a67753729f6b74677473cf0ec3b8d35a7e;hp=e4c8fc68ee5bbd0ef3f85e7c380aa7b790fccd6e;hpb=6f1de4473200f31d1ca1cf4672baf7afcdec2db0;p=yaffs2.git diff --git a/utils/mkyaffsimage.c b/utils/mkyaffsimage.c index e4c8fc6..b7173eb 100644 --- a/utils/mkyaffsimage.c +++ b/utils/mkyaffsimage.c @@ -11,7 +11,6 @@ * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. - * */ /* @@ -114,7 +113,7 @@ static int find_obj_in_list(dev_t dev, ino_t ino) } // NCB added 10/9/2002 -static __u16 yaffs_CalcNameSum(const char *name) +static __u16 yaffs_calc_name_sum(const char *name) { __u16 sum = 0; __u16 i = 1; @@ -131,13 +130,13 @@ static __u16 yaffs_CalcNameSum(const char *name) } -static void yaffs_CalcECC(const __u8 *data, yaffs_Spare *spare) +static void yaffs_calc_ecc(const __u8 *data, yaffs_Spare *spare) { - yaffs_ECCCalculate(data , spare->ecc1); - yaffs_ECCCalculate(&data[256] , spare->ecc2); + yaffs_ecc_cacl(data , spare->ecc1); + yaffs_ecc_cacl(&data[256] , spare->ecc2); } -static void yaffs_CalcTagsECC(yaffs_Tags *tags) +static void yaffs_calc_tags_ecc(yaffs_Tags *tags) { // Todo don't do anything yet. Need to calculate ecc unsigned char *b = ((yaffs_TagsUnion *)tags)->asBytes; @@ -182,11 +181,11 @@ static void yaffs_CalcTagsECC(yaffs_Tags *tags) b[7] |= ((ecc & 0x3F) << 2); } } -static void yaffs_LoadTagsIntoSpare(yaffs_Spare *sparePtr, yaffs_Tags *tagsPtr) +static void yaffs_load_tags_to_spare(yaffs_Spare *sparePtr, yaffs_Tags *tagsPtr) { yaffs_TagsUnion *tu = (yaffs_TagsUnion *)tagsPtr; - //yaffs_CalcTagsECC(tagsPtr); + //yaffs_calc_tags_ecc(tagsPtr); sparePtr->tagByte0 = tu->asBytes[0]; sparePtr->tagByte1 = tu->asBytes[1]; @@ -242,7 +241,7 @@ static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) t.chunkId = chunkId; t.serialNumber = 0; - t.byteCount = nBytes; + t.byteCountLSB = nBytes; t.objectId = objId; if (convert_endian) @@ -250,9 +249,9 @@ static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) little_to_big_endian(&t); } - yaffs_CalcTagsECC(&t); - yaffs_LoadTagsIntoSpare(&s,&t); - yaffs_CalcECC(data,&s); + yaffs_calc_tags_ecc(&t); + yaffs_load_tags_to_spare(&s,&t); + yaffs_calc_ecc(data,&s); nPages++;