Lines Matching +full:error +full:- +full:correction

1 // SPDX-License-Identifier: GPL-2.0
34 __param(int, bc, 1, "Test for correct behaviour beyond error correction capacity");
80 uint16_t *corr; /* correction buffer */
103 kfree(ws->errlocs); in free_ws()
104 kfree(ws->c); in free_ws()
110 int nroots = rs->nroots; in alloc_ws()
112 int nn = rs->nn; in alloc_ws()
118 ws->c = kmalloc_array(2 * (nn + nroots), in alloc_ws()
120 if (!ws->c) in alloc_ws()
123 ws->r = ws->c + nn; in alloc_ws()
124 ws->s = ws->r + nn; in alloc_ws()
125 ws->corr = ws->s + nroots; in alloc_ws()
127 ws->errlocs = kmalloc_array(nn + nroots, sizeof(int), GFP_KERNEL); in alloc_ws()
128 if (!ws->errlocs) in alloc_ws()
131 ws->derrlocs = ws->errlocs + nn; in alloc_ws()
145 * 0 if there is no error in this position;
146 * 1 if there is a symbol error in this position;
154 int nroots = rs->codec->nroots; in get_rcw_we()
155 int *derrlocs = ws->derrlocs; in get_rcw_we()
156 int *errlocs = ws->errlocs; in get_rcw_we()
157 int dlen = len - nroots; in get_rcw_we()
158 int nn = rs->codec->nn; in get_rcw_we()
159 uint16_t *c = ws->c; in get_rcw_we()
160 uint16_t *r = ws->r; in get_rcw_we()
180 /* Error value must be nonzero */ in get_rcw_we()
208 /* Error value must be nonzero */ in get_rcw_we()
232 struct rs_codec *rs = rsc->codec; in compute_syndrome()
233 uint16_t *alpha_to = rs->alpha_to; in compute_syndrome()
234 uint16_t *index_of = rs->index_of; in compute_syndrome()
235 int nroots = rs->nroots; in compute_syndrome()
236 int prim = rs->prim; in compute_syndrome()
237 int fcr = rs->fcr; in compute_syndrome()
256 syn[i] = rs->index_of[syn[i]]; in compute_syndrome()
259 /* Test up to error correction capacity */
264 int dlen = len - rs->codec->nroots; in test_uc()
265 int *derrlocs = ws->derrlocs; in test_uc()
266 int *errlocs = ws->errlocs; in test_uc()
267 uint16_t *corr = ws->corr; in test_uc()
268 uint16_t *c = ws->c; in test_uc()
269 uint16_t *r = ws->r; in test_uc()
270 uint16_t *s = ws->s; in test_uc()
298 stat->irv++; in test_uc()
303 stat->wepos++; in test_uc()
308 stat->dwrong++; in test_uc()
310 stat->nwords += trials; in test_uc()
317 "Testing correction buffer interface...", in ex_rs_helper()
319 "Testing in-place interface..." in ex_rs_helper()
323 int nroots = rs->codec->nroots; in ex_rs_helper()
330 for (eras = 0; eras <= nroots - 2 * errs; eras++) in ex_rs_helper()
339 pr_info(" Wrong error position: %d\n", stat.wepos); in ex_rs_helper()
357 pr_info("Testing up to error correction capacity...\n"); in exercise_rs()
365 /* Tests for correct behaviour beyond error correction capacity */
370 int nroots = rs->codec->nroots; in test_bc()
371 int dlen = len - nroots; in test_bc()
372 int *derrlocs = ws->derrlocs; in test_bc()
373 uint16_t *corr = ws->corr; in test_bc()
374 uint16_t *r = ws->r; in test_bc()
384 stat->rsuccess++; in test_bc()
399 stat->noncw++; in test_bc()
401 stat->rfail++; in test_bc()
404 stat->nwords += trials; in test_bc()
411 int nroots = rs->codec->nroots; in exercise_rs_bc()
415 pr_info("Testing beyond error correction capacity...\n"); in exercise_rs_bc()
418 eras = nroots - 2 * errs + 1; in exercise_rs_bc()
422 cutoff = nroots <= len - errs ? nroots : len - errs; in exercise_rs_bc()
444 int nn = (1 << e->symsize) - 1; in run_exercise()
445 int kk = nn - e->nroots; in run_exercise()
447 int retval = -ENOMEM; in run_exercise()
448 int max_pad = kk - 1; in run_exercise()
449 int prev_pad = -1; in run_exercise()
453 rsc = init_rs(e->symsize, e->genpoly, e->fcs, e->prim, e->nroots); in run_exercise()
457 ws = alloc_ws(rsc->codec); in run_exercise()
464 int len = nn - pad; in run_exercise()
472 len, kk - pad, nn + 1); in run_exercise()
475 retval |= exercise_rs(rsc, ws, len, e->ntrials); in run_exercise()
477 retval |= exercise_rs_bc(rsc, ws, len, e->ntrials); in run_exercise()
496 return -ENOMEM; in test_rslib_init()
506 return -EAGAIN; /* Fail will directly unload the module */ in test_rslib_init()
518 MODULE_DESCRIPTION("Reed-Solomon library test");