/* ECCxxxOther does ECC calcs on arbitrary n bytes of data  */
void yaffs_ECCCalculateOther(const unsigned char *data, unsigned nBytes, yaffs_ECCOther *eccOther)
/* ECCxxxOther does ECC calcs on arbitrary n bytes of data  */
void yaffs_ECCCalculateOther(const unsigned char *data, unsigned nBytes, yaffs_ECCOther *eccOther)
{
	unsigned int i;
	unsigned char col_parity = 0;
	unsigned line_parity = 0;
	unsigned line_parity_prime = 0;
	unsigned char b;
	for (i = 0; i < nBytes; i++) {
		b = column_parity_table[*data++];
		col_parity ^= b;
		if (b & 0x01)	 {
			line_parity ^= i;
			line_parity_prime ^= ~i;
		}
	}
	eccOther->colParity = (col_parity >> 2) & 0x3f;
	eccOther->lineParity = line_parity;
	eccOther->lineParityPrime = line_parity_prime;
}