#include "ecc.h"
Functions | |
int | ecc_compare_block_256b (unsigned long *ecc_calc, unsigned long *ecc_oob, unsigned char *data, unsigned long *error_offset, unsigned char *corrected_value) |
Compare two ECCs for a 256 byte block. More... | |
void | ecc_make_block_256b (unsigned long *ecc, unsigned char *data) |
Generate ECC for a 256 byte block. More... | |
int ecc_compare_block_256b | ( | unsigned long * | ecc1, |
unsigned long * | ecc2, | ||
unsigned char * | data, | ||
unsigned long * | error_offset, | ||
unsigned char * | corrected_value | ||
) |
Compare two ECCs for a 256 byte block.
This function will compare two 3 byte ECC for a 256 byte data block. If an error is found the compare function will provide a fix if a single one bit error is found. Multiple errors are not possible to fix.
ecc1 | Pointer to a variable for ECC value to compare against ecc2. |
ecc2 | Pointer to a variable for ECC value to compare against ecc1. |
data | Pointer to a 256 byte large buffer used when calculating the ecc1 and ecc2 ECC values. |
error_offset | Pointer to a variable to store the byte offset of a detected single bit error. |
corrected_value | Pointer to a variable to store the corrected byte if a single bit error was detected. |
References i.
void ecc_make_block_256b | ( | unsigned long * | ecc, |
unsigned char * | data | ||
) |
Generate ECC for a 256 byte block.
This function will generate a 3 byte ECC for a 256 byte data block.
ecc | Pointer to a variable to store the calculated ECC. |
data | Pointer to a 256 byte large buffer to calculate the ECC value of. |
References data, ecc_parity_table, i, and NAND_ECC_CHUNK_SIZE.