Lines Matching defs:ecc
30 * Call bch_encode to compute and store ecc parity bytes to a given buffer.
165 uint32_t *ecc)
174 p = bch->mod8_tab + (l+1)*(((ecc[0] >> 24)^(tmp)) & 0xff);
177 ecc[i] = ((ecc[i] << 8)|(ecc[i+1] >> 24))^(*p++);
179 ecc[l] = (ecc[l] << 8)^(*p);
184 * convert ecc bytes to aligned, zero-padded 32-bit ecc words
206 * convert 32-bit ecc words to ecc bytes
228 * bch_encode - calculate BCH ecc parity of data
232 * @ecc: ecc parity data, must be initialized by caller
234 * The @ecc parity array is used both as input and output parameter, in order to
238 * The exact number of computed ecc parity bits is given by member @ecc_bits of
242 unsigned int len, uint8_t *ecc)
258 if (ecc) {
259 /* load ecc parity bytes into internal 32-bit buffer */
260 load_ecc8(bch, bch->ecc_buf, ecc);
317 /* store ecc parity bytes into original parity buffer */
318 if (ecc)
319 store_ecc8(bch, ecc, bch->ecc_buf);
402 * compute 2t syndromes of ecc polynomial, i.e. ecc(a^j) for j=1..2t
404 static void compute_syndromes(struct bch_control *bch, uint32_t *ecc,
414 /* make sure extra bits in last ecc word are cleared */
417 ecc[s/32] &= ~((1u << (32-m))-1);
422 poly = *ecc++;
1016 * @recv_ecc: received ecc, if NULL then assume it was XORed in @calc_ecc
1017 * @calc_ecc: calculated ecc, if NULL then calc_ecc is computed from @data
1035 * by providing ecc = recv_ecc XOR calc_ecc:
1036 * bch_decode(@bch, NULL, @len, NULL, ecc, NULL, @errloc)
1044 * if (errloc[n] >= 8*len), then n-th error is located in ecc (no need for
1069 /* compute received data ecc into an internal buffer */
1074 /* load provided calculated ecc */
1077 /* load received ecc or assume it was XORed in calc_ecc */
1080 /* XOR received and calculated ecc */
1316 * BCH control structure, ecc length in bytes is given by member @ecc_bytes of