diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2007-05-02 12:18:41 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-05-02 11:56:33 +0100 |
commit | d7e5a5462f68270ed66efff22b1981be57a28c19 (patch) | |
tree | d8125b02762dfd169d110fb67c6f9a7acb686939 /include/linux/rslib.h | |
parent | 7c96b7a146eb81d13be738709c36752c20abe4fc (diff) | |
download | linux-stable-d7e5a5462f68270ed66efff22b1981be57a28c19.tar.gz linux-stable-d7e5a5462f68270ed66efff22b1981be57a28c19.tar.bz2 linux-stable-d7e5a5462f68270ed66efff22b1981be57a28c19.zip |
[RSLIB] Support non-canonical GF representations
For the CAFÉ NAND controller, we need to support non-canonical
representations of the Galois field. Allow the caller to provide its own
function for generating the field, and CAFÉ can use rslib instead of its
own implementation.
Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include/linux/rslib.h')
-rw-r--r-- | include/linux/rslib.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/rslib.h b/include/linux/rslib.h index ace25acfdc97..746580c1939c 100644 --- a/include/linux/rslib.h +++ b/include/linux/rslib.h @@ -34,6 +34,7 @@ * @prim: Primitive element, index form * @iprim: prim-th root of 1, index form * @gfpoly: The primitive generator polynominal + * @gffunc: Function to generate the field, if non-canonical representation * @users: Users of this structure * @list: List entry for the rs control list */ @@ -48,6 +49,7 @@ struct rs_control { int prim; int iprim; int gfpoly; + int (*gffunc)(int); int users; struct list_head list; }; @@ -77,6 +79,8 @@ int decode_rs16(struct rs_control *rs, uint16_t *data, uint16_t *par, int len, /* Create or get a matching rs control structure */ struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots); +struct rs_control *init_rs_non_canonical(int symsize, int (*func)(int), + int fcr, int prim, int nroots); /* Release a rs control structure */ void free_rs(struct rs_control *rs); |