41 #include <linux/errno.h>
42 #include <linux/kernel.h>
44 #include <linux/module.h>
46 #include <linux/slab.h>
77 INIT_LIST_HEAD(&rs->
list);
80 rs->
nn = (1 << symsize) - 1;
105 for (i = 0; i < rs->
nn; i++) {
109 if (sr & (1 << symsize))
115 for (i = 0; i < rs->
nn; i++) {
126 for(iprim = 1; (iprim %
prim) != 0; iprim += rs->
nn);
132 for (i = 0, root = fcr * prim; i <
nroots; i++, root +=
prim) {
135 for (j = i; j > 0; j--) {
149 for (i = 0; i <=
nroots; i++)
199 static struct rs_control *init_rs_internal(
int symsize,
int gfpoly,
200 int (*
gffunc)(
int),
int fcr,
201 int prim,
int nroots)
209 if (fcr < 0 || fcr >= (1<<symsize))
211 if (prim <= 0 || prim >= (1<<symsize))
213 if (nroots < 0 || nroots >= (1<<symsize))
221 if (symsize != rs->
mm)
229 if (prim != rs->
prim)
242 list_add(&rs->
list, &rslist);
263 return init_rs_internal(symsize, gfpoly,
NULL, fcr, prim, nroots);
280 int fcr,
int prim,
int nroots)
282 return init_rs_internal(symsize, 0,
gffunc, fcr, prim, nroots);
285 #ifdef CONFIG_REED_SOLOMON_ENC8
306 #ifdef CONFIG_REED_SOLOMON_DEC8
333 #ifdef CONFIG_REED_SOLOMON_ENC16
352 #ifdef CONFIG_REED_SOLOMON_DEC16