Name

decode_rs8 — Decode codeword (8bit data width)

Synopsis

int decode_rs8 (struct rs_control * rs,
 uint8_t * data,
 uint16_t * par,
 int len,
 uint16_t * s,
 int no_eras,
 int * eras_pos,
 uint16_t invmsk,
 uint16_t * corr);
 

Arguments

struct rs_control * rs

the rs control structure

uint8_t * data

data field of a given type

uint16_t * par

received parity data field

int len

data length

uint16_t * s

syndrome data field (if NULL, syndrome is calculated)

int no_eras

number of erasures

int * eras_pos

position of erasures, can be NULL

uint16_t invmsk

invert data mask (will be xored on data, not on parity!)

uint16_t * corr

buffer to store correction bitmask on eras_pos

Description

The syndrome and parity uses a uint16_t data type to enable symbol size > 8. The calling code must take care of decoding of the syndrome result and the received parity before calling this code. Returns the number of corrected bits or -EBADMSG for uncorrectable errors.