sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/core-api/librsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/core-api/librsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/core-api/librsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/core-api/librsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/core-api/librsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/core-api/librsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h*Reed-Solomon Library Programming Interfaceh]h*Reed-Solomon Library Programming Interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh/* the Reed Solomon control structure */ static struct rs_control *rs_decoder; /* Symbolsize is 10 (bits) * Primitive polynomial is x^10+x^3+1 * first consecutive root is 0 * primitive element to generate roots = 1 * generator polynomial degree (number of roots) = 6 */ rs_decoder = init_rs (10, 0x409, 0, 1, 6);h]hX>/* the Reed Solomon control structure */ static struct rs_control *rs_decoder; /* Symbolsize is 10 (bits) * Primitive polynomial is x^10+x^3+1 * first consecutive root is 0 * primitive element to generate roots = 1 * generator polynomial degree (number of roots) = 6 */ rs_decoder = init_rs (10, 0x409, 0, 1, 6);}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK)hjhhubeh}(h] initializingah ]h"] initializingah$]h&]uh1hhjchhhhhKubh)}(hhh](h)}(hEncodingh]hEncoding}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK6ubh)}(hThe encoder calculates the Reed-Solomon code over the given data length and stores the result in the parity buffer. Note that the parity buffer must be initialized before calling the encoder.h]hThe encoder calculates the Reed-Solomon code over the given data length and stores the result in the parity buffer. Note that the parity buffer must be initialized before calling the encoder.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hXThe expanded data can be inverted on the fly by providing a non-zero inversion mask. The expanded data is XOR'ed with the mask. This is used e.g. for FLASH ECC, where the all 0xFF is inverted to an all 0x00. The Reed-Solomon code for all 0x00 is all 0x00. The code is inverted before storing to FLASH so it is 0xFF too. This prevents that reading from an erased FLASH results in ECC errors.h]hXThe expanded data can be inverted on the fly by providing a non-zero inversion mask. The expanded data is XOR’ed with the mask. This is used e.g. for FLASH ECC, where the all 0xFF is inverted to an all 0x00. The Reed-Solomon code for all 0x00 is all 0x00. The code is inverted before storing to FLASH so it is 0xFF too. This prevents that reading from an erased FLASH results in ECC errors.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKubah}(h]h ]h"]h$]h&]uh1jNhj"ubeh}(h]h ]h"]h$]h&]uh1j,hj=hK4hjubeh}(h]h ]h"]h$]h&]uh1j'hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIinit_rs (C function) c.init_rshNtauh1j<hjhhhNhNubjN)}(hhh](jS)}(hTstruct rs_control * init_rs (int symsize, int gfpoly, int fcr, int prim, int nroots)h]jY)}(hRstruct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots)h](j_)}(hjbh]hstruct}(hjhhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hj~hhhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKaubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj~hhhjhKaubh)}(hhh]j)}(h rs_controlh]h rs_control}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jinit_rssb c.init_rsasbuh1hhj~hhhjhKaubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj~hhhjhKaubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhj~hhhjhKaubj)}(hinit_rsh]j)}(hjh]hinit_rs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhj~hhhjhKaubhdesc_parameterlist)}(h8(int symsize, int gfpoly, int fcr, int prim, int nroots)h](hdesc_parameter)}(h int symsizeh](hdesc_sig_keyword_type)}(hinth]hint}(hj hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j hj ubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj ubj)}(hsymsizeh]hsymsize}(hj+ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj )}(h int gfpolyh](j )}(hinth]hint}(hjD hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj@ ubjq)}(h h]h }(hjR hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj@ ubj)}(hgfpolyh]hgfpoly}(hj` hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@ ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj )}(hint fcrh](j )}(hinth]hint}(hjy hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hju ubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphju ubj)}(hfcrh]hfcr}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhju ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj )}(hint primh](j )}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj ubj)}(hprimh]hprim}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj )}(h int nrootsh](j )}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj ubj)}(hnrootsh]hnroots}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1j hj~hhhjhKaubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjzhhhjhKaubah}(h]juah ](jjeh"]h$]h&]jj)jhuh1jRhjhKahjwhhubj)}(hhh]h)}(h,Create a RS control struct and initialize ith]h,Create a RS control struct and initialize it}(hj) hhhNhNubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKUhj& hhubah}(h]h ]h"]h$]h&]uh1jhjwhhhjhKaubeh}(h]h ](jfunctioneh"]h$]h&]jjjjA jjA jjjuh1jMhhhjhNhNubj)}(hX**Parameters** ``int symsize`` the symbol size (number of bits) ``int gfpoly`` the extended Galois field generator polynomial coefficients, with the 0th coefficient in the low order bit. The polynomial must be primitive; ``int fcr`` the first consecutive root of the rs code generator polynomial in index form ``int prim`` primitive element to generate polynomial roots ``int nroots`` RS code generator polynomial degree (number of roots) **Description** Allocations use GFP_KERNEL.h](h)}(h**Parameters**h]j)}(hjK h]h Parameters}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjI ubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKYhjE ubj()}(hhh](j-)}(h1``int symsize`` the symbol size (number of bits) h](j3)}(h``int symsize``h]j9)}(hjj h]h int symsize}(hjl hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjh ubah}(h]h ]h"]h$]h&]uh1j2hU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKVhjd ubjO)}(hhh]h)}(h the symbol size (number of bits)h]h the symbol size (number of bits)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKVhj ubah}(h]h ]h"]h$]h&]uh1jNhjd ubeh}(h]h ]h"]h$]h&]uh1j,hj hKVhja ubj-)}(h``int gfpoly`` the extended Galois field generator polynomial coefficients, with the 0th coefficient in the low order bit. The polynomial must be primitive; h](j3)}(h``int gfpoly``h]j9)}(hj h]h int gfpoly}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2hU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKYhj ubjO)}(hhh]h)}(hthe extended Galois field generator polynomial coefficients, with the 0th coefficient in the low order bit. The polynomial must be primitive;h]hthe extended Galois field generator polynomial coefficients, with the 0th coefficient in the low order bit. The polynomial must be primitive;}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKWhj ubah}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj hKYhja ubj-)}(hY``int fcr`` the first consecutive root of the rs code generator polynomial in index form h](j3)}(h ``int fcr``h]j9)}(hj h]hint fcr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2hU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhK[hj ubjO)}(hhh]h)}(hLthe first consecutive root of the rs code generator polynomial in index formh]hLthe first consecutive root of the rs code generator polynomial in index form}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhKZhj ubah}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj hK[hja ubj-)}(h<``int prim`` primitive element to generate polynomial roots h](j3)}(h ``int prim``h]j9)}(hj h]hint prim}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2hU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhK\hj ubjO)}(hhh]h)}(h.primitive element to generate polynomial rootsh]h.primitive element to generate polynomial roots}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj, hK\hj- ubah}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj, hK\hja ubj-)}(hE``int nroots`` RS code generator polynomial degree (number of roots) h](j3)}(h``int nroots``h]j9)}(hjP h]h int nroots}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjN ubah}(h]h ]h"]h$]h&]uh1j2hU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhK]hjJ ubjO)}(hhh]h)}(h5RS code generator polynomial degree (number of roots)h]h5RS code generator polynomial degree (number of roots)}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1hhje hK]hjf ubah}(h]h ]h"]h$]h&]uh1jNhjJ ubeh}(h]h ]h"]h$]h&]uh1j,hje hK]hja ubeh}(h]h ]h"]h$]h&]uh1j'hjE ubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhK_hjE ubh)}(hAllocations use GFP_KERNEL.h]hAllocations use GFP_KERNEL.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhU/var/lib/git/docbuild/linux/Documentation/core-api/librs:182: ./include/linux/rslib.hhK_hjE ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubeh}(h] structuresah ]h"] structuresah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hPublic Functions Providedh]hPublic Functions Provided}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hgThis chapter contains the autogenerated documentation of the Reed-Solomon functions which are exported.h]hgThis chapter contains the autogenerated documentation of the Reed-Solomon functions which are exported.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIfree_rs (C function) c.free_rshNtauh1j<hj hhhNhNubjN)}(hhh](jS)}(h$void free_rs (struct rs_control *rs)h]jY)}(h#void free_rs(struct rs_control *rs)h](j )}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj hhh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chKubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj hhhj hKubj)}(hfree_rsh]j)}(hfree_rsh]hfree_rs}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hKubj )}(h(struct rs_control *rs)h]j )}(hstruct rs_control *rsh](j_)}(hjbh]hstruct}(hj4 hhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hj0 ubjq)}(h h]h }(hjA hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj0 ubh)}(hhh]j)}(h rs_controlh]h rs_control}(hjR hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjO ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjT modnameN classnameNjj)}j]j)}jj sb c.free_rsasbuh1hhj0 ubjq)}(h h]h }(hjr hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj0 ubj)}(hjh]h*}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0 ubj)}(hrsh]hrs}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0 ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj, ubah}(h]h ]h"]h$]h&]jjuh1j hj hhhj hKubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhj hhhj hKubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jRhj hKhj hhubj)}(hhh]h)}(hFree the rs control structureh]hFree the rs control structure}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chKhj hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hKubeh}(h]h ](jfunctioneh"]h$]h&]jjjj jj jjjuh1jMhhhj hNhNubj)}(h**Parameters** ``struct rs_control *rs`` The control structure which is not longer used by the caller **Description** Free the control structure. If **rs** is the last user of the associated codec, free the codec as well.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chKhj ubj()}(hhh]j-)}(hW``struct rs_control *rs`` The control structure which is not longer used by the caller h](j3)}(h``struct rs_control *rs``h]j9)}(hj h]hstruct rs_control *rs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chKhj ubjO)}(hhh]h)}(hhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(hint fcrh](j )}(hinth]hint}(hjVhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjRubjq)}(h h]h }(hjdhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjRubj)}(hfcrh]hfcr}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjRubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(hint primh](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hprimh]hprim}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(h int nrootsh](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hnrootsh]hnroots}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubeh}(h]h ]h"]h$]h&]jjuh1j hjhhhj.hM3ubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjhhhj.hM3ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jRhj.hM3hjhhubj)}(hhh]h)}(hGAllocate rs control struct for fields with non-canonical representationh]hGAllocate rs control struct for fields with non-canonical representation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM(hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhj.hM3ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jMhhhj hNhNubj)}(hX**Parameters** ``int symsize`` the symbol size (number of bits) ``int (*gffunc)(int)`` pointer to function to generate the next field element, or the multiplicative identity element if given 0. Used instead of gfpoly if gfpoly is 0 ``int fcr`` the first consecutive root of the rs code generator polynomial in index form ``int prim`` primitive element to generate polynomial roots ``int nroots`` RS code generator polynomial degree (number of roots)h](h)}(h**Parameters**h]j)}(hj(h]h Parameters}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM,hj"ubj()}(hhh](j-)}(h1``int symsize`` the symbol size (number of bits) h](j3)}(h``int symsize``h]j9)}(hjGh]h int symsize}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjEubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM*hjAubjO)}(hhh]h)}(h the symbol size (number of bits)h]h the symbol size (number of bits)}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\hM*hj]ubah}(h]h ]h"]h$]h&]uh1jNhjAubeh}(h]h ]h"]h$]h&]uh1j,hj\hM*hj>ubj-)}(h``int (*gffunc)(int)`` pointer to function to generate the next field element, or the multiplicative identity element if given 0. Used instead of gfpoly if gfpoly is 0 h](j3)}(h``int (*gffunc)(int)``h]j9)}(hjh]hint (*gffunc)(int)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj~ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM-hjzubjO)}(hhh]h)}(hpointer to function to generate the next field element, or the multiplicative identity element if given 0. Used instead of gfpoly if gfpoly is 0h]hpointer to function to generate the next field element, or the multiplicative identity element if given 0. Used instead of gfpoly if gfpoly is 0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM+hjubah}(h]h ]h"]h$]h&]uh1jNhjzubeh}(h]h ]h"]h$]h&]uh1j,hjhM-hj>ubj-)}(hY``int fcr`` the first consecutive root of the rs code generator polynomial in index form h](j3)}(h ``int fcr``h]j9)}(hjh]hint fcr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM/hjubjO)}(hhh]h)}(hLthe first consecutive root of the rs code generator polynomial in index formh]hLthe first consecutive root of the rs code generator polynomial in index form}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM.hjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhM/hj>ubj-)}(h<``int prim`` primitive element to generate polynomial roots h](j3)}(h ``int prim``h]j9)}(hjh]hint prim}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM0hjubjO)}(hhh]h)}(h.primitive element to generate polynomial rootsh]h.primitive element to generate polynomial roots}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hM0hj ubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hj hM0hj>ubj-)}(hD``int nroots`` RS code generator polynomial degree (number of roots)h](j3)}(h``int nroots``h]j9)}(hj-h]h int nroots}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj+ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM2hj'ubjO)}(hhh]h)}(h5RS code generator polynomial degree (number of roots)h]h5RS code generator polynomial degree (number of roots)}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM1hjCubah}(h]h ]h"]h$]h&]uh1jNhj'ubeh}(h]h ]h"]h$]h&]uh1j,hjBhM2hj>ubeh}(h]h ]h"]h$]h&]uh1j'hj"ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj hhhNhNubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIencode_rs8 (C function) c.encode_rs8hNtauh1j<hj hhhNhNubjN)}(hhh](jS)}(h_int encode_rs8 (struct rs_control *rsc, uint8_t *data, int len, uint16_t *par, uint16_t invmsk)h]jY)}(h^int encode_rs8(struct rs_control *rsc, uint8_t *data, int len, uint16_t *par, uint16_t invmsk)h](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhhh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMHubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjhhhjhMHubj)}(h encode_rs8h]j)}(h encode_rs8h]h encode_rs8}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhMHubj )}(hP(struct rs_control *rsc, uint8_t *data, int len, uint16_t *par, uint16_t invmsk)h](j )}(hstruct rs_control *rsch](j_)}(hjbh]hstruct}(hjhhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubh)}(hhh]j)}(h rs_controlh]h rs_control}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsb c.encode_rs8asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hrsch]hrsc}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(h uint8_t *datah](h)}(hhh]j)}(huint8_th]huint8_t}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj;modnameN classnameNjj)}j]j c.encode_rs8asbuh1hhj2ubjq)}(h h]h }(hjWhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj2ubj)}(hjh]h*}(hjehhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubj)}(hdatah]hdata}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(hint lenh](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hlenh]hlen}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(h uint16_t *parh](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j c.encode_rs8asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hparh]hpar}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(huint16_t invmskh](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j c.encode_rs8asbuh1hhjubjq)}(h h]h }(hj6hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hinvmskh]hinvmsk}(hjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubeh}(h]h ]h"]h$]h&]jjuh1j hjhhhjhMHubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjhhhjhMHubah}(h]jzah ](jjeh"]h$]h&]jj)jhuh1jRhjhMHhj|hhubj)}(hhh]h)}(h6Calculate the parity for data values (8bit data width)h]h6Calculate the parity for data values (8bit data width)}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM=hjkhhubah}(h]h ]h"]h$]h&]uh1jhj|hhhjhMHubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jMhhhj hNhNubj)}(hX**Parameters** ``struct rs_control *rsc`` the rs control structure ``uint8_t *data`` data field of a given type ``int len`` data length ``uint16_t *par`` parity data, must be initialized by caller (usually all 0) ``uint16_t invmsk`` invert data mask (will be xored on data) The parity uses a uint16_t data type to enable symbol size > 8. The calling code must take care of encoding of the syndrome result for storage itself.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMAhjubj()}(hhh](j-)}(h4``struct rs_control *rsc`` the rs control structure h](j3)}(h``struct rs_control *rsc``h]j9)}(hjh]hstruct rs_control *rsc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM>hjubjO)}(hhh]h)}(hthe rs control structureh]hthe rs control structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM>hjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhM>hjubj-)}(h-``uint8_t *data`` data field of a given type h](j3)}(h``uint8_t *data``h]j9)}(hjh]h uint8_t *data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM?hjubjO)}(hhh]h)}(hdata field of a given typeh]hdata field of a given type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM?hjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhM?hjubj-)}(h``int len`` data length h](j3)}(h ``int len``h]j9)}(hj!h]hint len}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM@hjubjO)}(hhh]h)}(h data lengthh]h data length}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hM@hj7ubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hj6hM@hjubj-)}(hM``uint16_t *par`` parity data, must be initialized by caller (usually all 0) h](j3)}(h``uint16_t *par``h]j9)}(hjZh]h uint16_t *par}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjXubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMAhjTubjO)}(hhh]h)}(h:parity data, must be initialized by caller (usually all 0)h]h:parity data, must be initialized by caller (usually all 0)}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohMAhjpubah}(h]h ]h"]h$]h&]uh1jNhjTubeh}(h]h ]h"]h$]h&]uh1j,hjohMAhjubj-)}(h``uint16_t invmsk`` invert data mask (will be xored on data) The parity uses a uint16_t data type to enable symbol size > 8. The calling code must take care of encoding of the syndrome result for storage itself.h](j3)}(h``uint16_t invmsk``h]j9)}(hjh]huint16_t invmsk}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMEhjubjO)}(hhh](h)}(h(invert data mask (will be xored on data)h]h(invert data mask (will be xored on data)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMBhjubh)}(hThe parity uses a uint16_t data type to enable symbol size > 8. The calling code must take care of encoding of the syndrome result for storage itself.h]hThe parity uses a uint16_t data type to enable symbol size > 8. The calling code must take care of encoding of the syndrome result for storage itself.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMDhjubeh}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhMEhjubeh}(h]h ]h"]h$]h&]uh1j'hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj hhhNhNubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIdecode_rs8 (C function) c.decode_rs8hNtauh1j<hj hhhNhNubjN)}(hhh](jS)}(hint decode_rs8 (struct rs_control *rsc, uint8_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h]jY)}(hint decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhhh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMiubjq)}(h h]h }(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjhhhj hMiubj)}(h decode_rs8h]j)}(h decode_rs8h]h decode_rs8}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhj hMiubj )}(h(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h](j )}(hstruct rs_control *rsch](j_)}(hjbh]hstruct}(hj9hhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hj5ubjq)}(h h]h }(hjFhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj5ubh)}(hhh]j)}(h rs_controlh]h rs_control}(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjYmodnameN classnameNjj)}j]j)}jjsb c.decode_rs8asbuh1hhj5ubjq)}(h h]h }(hjwhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj5ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubj)}(hrsch]hrsc}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(h uint8_t *datah](h)}(hhh]j)}(huint8_th]huint8_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]js c.decode_rs8asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hdatah]hdata}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(h uint16_t *parh](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]js c.decode_rs8asbuh1hhjubjq)}(h h]h }(hj!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hj/hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hparh]hpar}(hj<hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(hint lenh](j )}(hinth]hint}(hjUhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjQubjq)}(h h]h }(hjchhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjQubj)}(hlenh]hlen}(hjqhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(h uint16_t *sh](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]js c.decode_rs8asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hsh]hs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(h int no_erash](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hno_erash]hno_eras}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(h int *eras_posh](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hj"hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hj0hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(heras_posh]heras_pos}(hj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(huint16_t invmskh](h)}(hhh]j)}(huint16_th]huint16_t}(hjYhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjVubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj[modnameN classnameNjj)}j]js c.decode_rs8asbuh1hhjRubjq)}(h h]h }(hjwhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjRubj)}(hinvmskh]hinvmsk}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjRubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubj )}(huint16_t *corrh](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]js c.decode_rs8asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hcorrh]hcorr}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj1ubeh}(h]h ]h"]h$]h&]jjuh1j hjhhhj hMiubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjhhhj hMiubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jRhj hMihjhhubj)}(hhh]h)}(h!Decode codeword (8bit data width)h]h!Decode codeword (8bit data width)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMRhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhj hMiubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jMhhhj hNhNubj)}(hX**Parameters** ``struct rs_control *rsc`` 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, must be in index form (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 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. **Note** The rs_control struct **rsc** contains buffers which are used for decoding, so the caller has to ensure that decoder invocations are serialized. Returns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h](h)}(h**Parameters**h]j)}(hj&h]h Parameters}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMVhj ubj()}(hhh](j-)}(h4``struct rs_control *rsc`` the rs control structure h](j3)}(h``struct rs_control *rsc``h]j9)}(hjEh]hstruct rs_control *rsc}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjCubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMShj?ubjO)}(hhh]h)}(hthe rs control structureh]hthe rs control structure}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZhMShj[ubah}(h]h ]h"]h$]h&]uh1jNhj?ubeh}(h]h ]h"]h$]h&]uh1j,hjZhMShj<ubj-)}(h-``uint8_t *data`` data field of a given type h](j3)}(h``uint8_t *data``h]j9)}(hj~h]h uint8_t *data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj|ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMThjxubjO)}(hhh]h)}(hdata field of a given typeh]hdata field of a given type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMThjubah}(h]h ]h"]h$]h&]uh1jNhjxubeh}(h]h ]h"]h$]h&]uh1j,hjhMThj<ubj-)}(h-``uint16_t *par`` received parity data field h](j3)}(h``uint16_t *par``h]j9)}(hjh]h uint16_t *par}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMUhjubjO)}(hhh]h)}(hreceived parity data fieldh]hreceived parity data field}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMUhjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhMUhj<ubj-)}(h``int len`` data length h](j3)}(h ``int len``h]j9)}(hjh]hint len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMVhjubjO)}(hhh]h)}(h data lengthh]h data length}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMVhjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhMVhj<ubj-)}(h]``uint16_t *s`` syndrome data field, must be in index form (if NULL, syndrome is calculated) h](j3)}(h``uint16_t *s``h]j9)}(hj)h]h uint16_t *s}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj'ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMXhj#ubjO)}(hhh]h)}(hLsyndrome data field, must be in index form (if NULL, syndrome is calculated)h]hLsyndrome data field, must be in index form (if NULL, syndrome is calculated)}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMWhj?ubah}(h]h ]h"]h$]h&]uh1jNhj#ubeh}(h]h ]h"]h$]h&]uh1j,hj>hMXhj<ubj-)}(h#``int no_eras`` number of erasures h](j3)}(h``int no_eras``h]j9)}(hjch]h int no_eras}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjaubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMYhj]ubjO)}(hhh]h)}(hnumber of erasuresh]hnumber of erasures}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhMYhjyubah}(h]h ]h"]h$]h&]uh1jNhj]ubeh}(h]h ]h"]h$]h&]uh1j,hjxhMYhj<ubj-)}(h4``int *eras_pos`` position of erasures, can be NULL h](j3)}(h``int *eras_pos``h]j9)}(hjh]h int *eras_pos}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMZhjubjO)}(hhh]h)}(h!position of erasures, can be NULLh]h!position of erasures, can be NULL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMZhjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhMZhj<ubj-)}(hM``uint16_t invmsk`` invert data mask (will be xored on data, not on parity!) h](j3)}(h``uint16_t invmsk``h]j9)}(hjh]huint16_t invmsk}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM[hjubjO)}(hhh]h)}(h8invert data mask (will be xored on data, not on parity!)h]h8invert data mask (will be xored on data, not on parity!)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM[hjubah}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hjhM[hj<ubj-)}(hX``uint16_t *corr`` buffer to store correction bitmask on eras_pos 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. h](j3)}(h``uint16_t *corr``h]j9)}(hjh]huint16_t *corr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM`hjubjO)}(hhh](h)}(h.buffer to store correction bitmask on eras_posh]h.buffer to store correction bitmask on eras_pos}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM\hj$ubh)}(hThe 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.h]hThe 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.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM^hj$ubeh}(h]h ]h"]h$]h&]uh1jNhjubeh}(h]h ]h"]h$]h&]uh1j,hj#hM`hj<ubeh}(h]h ]h"]h$]h&]uh1j'hj ubh)}(h**Note**h]j)}(hjYh]hNote}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMbhj ubj()}(hhh]j-)}(hXThe rs_control struct **rsc** contains buffers which are used for decoding, so the caller has to ensure that decoder invocations are serialized. Returns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h](j3)}(hAThe rs_control struct **rsc** contains buffers which are used forh](hThe rs_control struct }(hjvhhhNhNubj)}(h**rsc**h]hrsc}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubh$ contains buffers which are used for}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMfhjrubjO)}(hhh](h)}(hNdecoding, so the caller has to ensure that decoder invocations are serialized.h]hNdecoding, so the caller has to ensure that decoder invocations are serialized.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMchjubh)}(hvReturns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h]hvReturns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMfhjubeh}(h]h ]h"]h$]h&]uh1jNhjrubeh}(h]h ]h"]h$]h&]uh1j,hjhMfhjoubah}(h]h ]h"]h$]h&]uh1j'hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj hhhNhNubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIencode_rs16 (C function) c.encode_rs16hNtauh1j<hj hhhNhNubjN)}(hhh](jS)}(haint encode_rs16 (struct rs_control *rsc, uint16_t *data, int len, uint16_t *par, uint16_t invmsk)h]jY)}(h`int encode_rs16(struct rs_control *rsc, uint16_t *data, int len, uint16_t *par, uint16_t invmsk)h](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhhh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM}ubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjhhhjhM}ubj)}(h encode_rs16h]j)}(h encode_rs16h]h encode_rs16}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhM}ubj )}(hQ(struct rs_control *rsc, uint16_t *data, int len, uint16_t *par, uint16_t invmsk)h](j )}(hstruct rs_control *rsch](j_)}(hjbh]hstruct}(hj&hhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hj"ubjq)}(h h]h }(hj3hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj"ubh)}(hhh]j)}(h rs_controlh]h rs_control}(hjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjAubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjFmodnameN classnameNjj)}j]j)}jj sb c.encode_rs16asbuh1hhj"ubjq)}(h h]h }(hjdhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj"ubj)}(hjh]h*}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubj)}(hrsch]hrsc}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(huint16_t *datah](h)}(hhh]j)}(huint16_th]huint16_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j` c.encode_rs16asbuh1hhjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hdatah]hdata}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(hint lenh](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hlenh]hlen}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(h uint16_t *parh](h)}(hhh]j)}(huint16_th]huint16_t}(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj'modnameN classnameNjj)}j]j` c.encode_rs16asbuh1hhjubjq)}(h h]h }(hjChhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubj)}(hjh]h*}(hjQhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hparh]hpar}(hj^hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj )}(huint16_t invmskh](h)}(hhh]j)}(huint16_th]huint16_t}(hjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj|modnameN classnameNjj)}j]j` c.encode_rs16asbuh1hhjsubjq)}(h h]h }(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjsubj)}(hinvmskh]hinvmsk}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubeh}(h]h ]h"]h$]h&]jjuh1j hjhhhjhM}ubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjhhhjhM}ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jRhjhM}hjhhubj)}(hhh]h)}(h7Calculate the parity for data values (16bit data width)h]h7Calculate the parity for data values (16bit data width)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMthjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM}ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jMhhhj hNhNubj)}(hX**Parameters** ``struct rs_control *rsc`` the rs control structure ``uint16_t *data`` data field of a given type ``int len`` data length ``uint16_t *par`` parity data, must be initialized by caller (usually all 0) ``uint16_t invmsk`` invert data mask (will be xored on data, not on parity!) Each field in the data array contains up to symbol size bits of valid data.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMxhjubj()}(hhh](j-)}(h4``struct rs_control *rsc`` the rs control structure h](j3)}(h``struct rs_control *rsc``h]j9)}(hj h]hstruct rs_control *rsc}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMuhj ubjO)}(hhh]h)}(hthe rs control structureh]hthe rs control structure}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj& hMuhj' ubah}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj& hMuhj ubj-)}(h.``uint16_t *data`` data field of a given type h](j3)}(h``uint16_t *data``h]j9)}(hjJ h]huint16_t *data}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjH ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMvhjD ubjO)}(hhh]h)}(hdata field of a given typeh]hdata field of a given type}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_ hMvhj` ubah}(h]h ]h"]h$]h&]uh1jNhjD ubeh}(h]h ]h"]h$]h&]uh1j,hj_ hMvhj ubj-)}(h``int len`` data length h](j3)}(h ``int len``h]j9)}(hj h]hint len}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMwhj} ubjO)}(hhh]h)}(h data lengthh]h data length}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMwhj ubah}(h]h ]h"]h$]h&]uh1jNhj} ubeh}(h]h ]h"]h$]h&]uh1j,hj hMwhj ubj-)}(hM``uint16_t *par`` parity data, must be initialized by caller (usually all 0) h](j3)}(h``uint16_t *par``h]j9)}(hj h]h uint16_t *par}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMxhj ubjO)}(hhh]h)}(h:parity data, must be initialized by caller (usually all 0)h]h:parity data, must be initialized by caller (usually all 0)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMxhj ubah}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj hMxhj ubj-)}(h``uint16_t invmsk`` invert data mask (will be xored on data, not on parity!) Each field in the data array contains up to symbol size bits of valid data.h](j3)}(h``uint16_t invmsk``h]j9)}(hj h]huint16_t invmsk}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMzhj ubjO)}(hhh](h)}(h8invert data mask (will be xored on data, not on parity!)h]h8invert data mask (will be xored on data, not on parity!)}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMyhj !ubh)}(hKEach field in the data array contains up to symbol size bits of valid data.h]hKEach field in the data array contains up to symbol size bits of valid data.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chM{hj !ubeh}(h]h ]h"]h$]h&]uh1jNhj ubeh}(h]h ]h"]h$]h&]uh1j,hj !hMzhj ubeh}(h]h ]h"]h$]h&]uh1j'hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj hhhNhNubj=)}(hhh]h}(h]h ]h"]h$]h&]entries](jIdecode_rs16 (C function) c.decode_rs16hNtauh1j<hj hhhNhNubjN)}(hhh](jS)}(hint decode_rs16 (struct rs_control *rsc, uint16_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h]jY)}(hint decode_rs16(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h](j )}(hinth]hint}(hj^!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjZ!hhh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMubjq)}(h h]h }(hjm!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjZ!hhhjl!hMubj)}(h decode_rs16h]j)}(h decode_rs16h]h decode_rs16}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{!ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjZ!hhhjl!hMubj )}(h(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, uint16_t *corr)h](j )}(hstruct rs_control *rsch](j_)}(hjbh]hstruct}(hj!hhhNhNubah}(h]h ]jkah"]h$]h&]uh1j^hj!ubjq)}(h h]h }(hj!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj!ubh)}(hhh]j)}(h rs_controlh]h rs_control}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj!modnameN classnameNjj)}j]j)}jj!sb c.decode_rs16asbuh1hhj!ubjq)}(h h]h }(hj!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj!ubj)}(hjh]h*}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hrsch]hrsc}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(huint16_t *datah](h)}(hhh]j)}(huint16_th]huint16_t}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj "ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj"modnameN classnameNjj)}j]j! c.decode_rs16asbuh1hhj "ubjq)}(h h]h }(hj."hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj "ubj)}(hjh]h*}(hj<"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj "ubj)}(hdatah]hdata}(hjI"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj "ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(h uint16_t *parh](h)}(hhh]j)}(huint16_th]huint16_t}(hje"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjb"ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjg"modnameN classnameNjj)}j]j! c.decode_rs16asbuh1hhj^"ubjq)}(h h]h }(hj"hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj^"ubj)}(hjh]h*}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj^"ubj)}(hparh]hpar}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj^"ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(hint lenh](j )}(hinth]hint}(hj"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj"ubjq)}(h h]h }(hj"hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj"ubj)}(hlenh]hlen}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(h uint16_t *sh](h)}(hhh]j)}(huint16_th]huint16_t}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj"modnameN classnameNjj)}j]j! c.decode_rs16asbuh1hhj"ubjq)}(h h]h }(hj #hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj"ubj)}(hjh]h*}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubj)}(hjh]hs}(hj(#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(h int no_erash](j )}(hinth]hint}(hj@#hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj<#ubjq)}(h h]h }(hjN#hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj<#ubj)}(hno_erash]hno_eras}(hj\#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<#ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(h int *eras_posh](j )}(hinth]hint}(hju#hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjq#ubjq)}(h h]h }(hj#hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjq#ubj)}(hjh]h*}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjq#ubj)}(heras_posh]heras_pos}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjq#ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(huint16_t invmskh](h)}(hhh]j)}(huint16_th]huint16_t}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj#modnameN classnameNjj)}j]j! c.decode_rs16asbuh1hhj#ubjq)}(h h]h }(hj#hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj#ubj)}(hinvmskh]hinvmsk}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubj )}(huint16_t *corrh](h)}(hhh]j)}(huint16_th]huint16_t}(hj$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj$modnameN classnameNjj)}j]j! c.decode_rs16asbuh1hhj#ubjq)}(h h]h }(hj $hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphj#ubj)}(hjh]h*}(hj.$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubj)}(hcorrh]hcorr}(hj;$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj!ubeh}(h]h ]h"]h$]h&]jjuh1j hjZ!hhhjl!hMubeh}(h]h ]h"]h$]h&]jjjuh1jXjjhjV!hhhjl!hMubah}(h]jQ!ah ](jjeh"]h$]h&]jj)jhuh1jRhjl!hMhjS!hhubj)}(hhh]h)}(h"Decode codeword (16bit data width)h]h"Decode codeword (16bit data width)}(hje$hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhjb$hhubah}(h]h ]h"]h$]h&]uh1jhjS!hhhjl!hMubeh}(h]h ](jfunctioneh"]h$]h&]jjjj}$jj}$jjjuh1jMhhhj hNhNubj)}(hX|**Parameters** ``struct rs_control *rsc`` the rs control structure ``uint16_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, must be in index form (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 Each field in the data array contains up to symbol size bits of valid data. **Note** The rc_control struct **rsc** contains buffers which are used for decoding, so the caller has to ensure that decoder invocations are serialized. Returns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h](h)}(h**Parameters**h]j)}(hj$h]h Parameters}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj$ubj()}(hhh](j-)}(h4``struct rs_control *rsc`` the rs control structure h](j3)}(h``struct rs_control *rsc``h]j9)}(hj$h]hstruct rs_control *rsc}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj$ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj$ubjO)}(hhh]h)}(hthe rs control structureh]hthe rs control structure}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hMhj$ubah}(h]h ]h"]h$]h&]uh1jNhj$ubeh}(h]h ]h"]h$]h&]uh1j,hj$hMhj$ubj-)}(h.``uint16_t *data`` data field of a given type h](j3)}(h``uint16_t *data``h]j9)}(hj$h]huint16_t *data}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj$ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj$ubjO)}(hhh]h)}(hdata field of a given typeh]hdata field of a given type}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hMhj$ubah}(h]h ]h"]h$]h&]uh1jNhj$ubeh}(h]h ]h"]h$]h&]uh1j,hj$hMhj$ubj-)}(h-``uint16_t *par`` received parity data field h](j3)}(h``uint16_t *par``h]j9)}(hj%h]h uint16_t *par}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj%ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj%ubjO)}(hhh]h)}(hreceived parity data fieldh]hreceived parity data field}(hj1%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-%hMhj.%ubah}(h]h ]h"]h$]h&]uh1jNhj%ubeh}(h]h ]h"]h$]h&]uh1j,hj-%hMhj$ubj-)}(h``int len`` data length h](j3)}(h ``int len``h]j9)}(hjQ%h]hint len}(hjS%hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjO%ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhjK%ubjO)}(hhh]h)}(h data lengthh]h data length}(hjj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjf%hMhjg%ubah}(h]h ]h"]h$]h&]uh1jNhjK%ubeh}(h]h ]h"]h$]h&]uh1j,hjf%hMhj$ubj-)}(h]``uint16_t *s`` syndrome data field, must be in index form (if NULL, syndrome is calculated) h](j3)}(h``uint16_t *s``h]j9)}(hj%h]h uint16_t *s}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj%ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj%ubjO)}(hhh]h)}(hLsyndrome data field, must be in index form (if NULL, syndrome is calculated)h]hLsyndrome data field, must be in index form (if NULL, syndrome is calculated)}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj%ubah}(h]h ]h"]h$]h&]uh1jNhj%ubeh}(h]h ]h"]h$]h&]uh1j,hj%hMhj$ubj-)}(h#``int no_eras`` number of erasures h](j3)}(h``int no_eras``h]j9)}(hj%h]h int no_eras}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj%ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj%ubjO)}(hhh]h)}(hnumber of erasuresh]hnumber of erasures}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj%hMhj%ubah}(h]h ]h"]h$]h&]uh1jNhj%ubeh}(h]h ]h"]h$]h&]uh1j,hj%hMhj$ubj-)}(h4``int *eras_pos`` position of erasures, can be NULL h](j3)}(h``int *eras_pos``h]j9)}(hj%h]h int *eras_pos}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj%ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj%ubjO)}(hhh]h)}(h!position of erasures, can be NULLh]h!position of erasures, can be NULL}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hMhj&ubah}(h]h ]h"]h$]h&]uh1jNhj%ubeh}(h]h ]h"]h$]h&]uh1j,hj&hMhj$ubj-)}(hM``uint16_t invmsk`` invert data mask (will be xored on data, not on parity!) h](j3)}(h``uint16_t invmsk``h]j9)}(hj6&h]huint16_t invmsk}(hj8&hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hj4&ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj0&ubjO)}(hhh]h)}(h8invert data mask (will be xored on data, not on parity!)h]h8invert data mask (will be xored on data, not on parity!)}(hjO&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjK&hMhjL&ubah}(h]h ]h"]h$]h&]uh1jNhj0&ubeh}(h]h ]h"]h$]h&]uh1j,hjK&hMhj$ubj-)}(h``uint16_t *corr`` buffer to store correction bitmask on eras_pos Each field in the data array contains up to symbol size bits of valid data. h](j3)}(h``uint16_t *corr``h]j9)}(hjo&h]huint16_t *corr}(hjq&hhhNhNubah}(h]h ]h"]h$]h&]uh1j8hjm&ubah}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhji&ubjO)}(hhh](h)}(h.buffer to store correction bitmask on eras_posh]h.buffer to store correction bitmask on eras_pos}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj&ubh)}(hKEach field in the data array contains up to symbol size bits of valid data.h]hKEach field in the data array contains up to symbol size bits of valid data.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hMhj&ubeh}(h]h ]h"]h$]h&]uh1jNhji&ubeh}(h]h ]h"]h$]h&]uh1j,hj&hMhj$ubeh}(h]h ]h"]h$]h&]uh1j'hj$ubh)}(h**Note**h]j)}(hj&h]hNote}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj$ubj()}(hhh]j-)}(hXThe rc_control struct **rsc** contains buffers which are used for decoding, so the caller has to ensure that decoder invocations are serialized. Returns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h](j3)}(hAThe rc_control struct **rsc** contains buffers which are used forh](hThe rc_control struct }(hj&hhhNhNubj)}(h**rsc**h]hrsc}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubh$ contains buffers which are used for}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1j2h_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj&ubjO)}(hhh](h)}(hNdecoding, so the caller has to ensure that decoder invocations are serialized.h]hNdecoding, so the caller has to ensure that decoder invocations are serialized.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/core-api/librs:191: ./lib/reed_solomon/reed_solomon.chMhj&ubh)}(hvReturns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.h]hvReturns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity.}(hj 'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hMhj&ubeh}(h]h ]h"]h$]h&]uh1jNhj&ubeh}(h]h ]h"]h$]h&]uh1j,hj&hMhj&ubah}(h]h ]h"]h$]h&]uh1j'hj$ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj hhhNhNubeh}(h]public-functions-providedah ]h"]public functions providedah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hCreditsh]hCredits}(hj;'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8'hhhhhKubh)}(hDThe library code for encoding and decoding was written by Phil Karn.h]hDThe library code for encoding and decoding was written by Phil Karn.}(hjI'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8'hhubj)}(hcCopyright 2002, Phil Karn, KA9Q May be used under the terms of the GNU General Public License (GPL)h]hcCopyright 2002, Phil Karn, KA9Q May be used under the terms of the GNU General Public License (GPL)}hjW'sbah}(h]h ]h"]h$]h&]jjuh1jhhhKhj8'hhubh)}(hDThe wrapper functions and interfaces are written by Thomas Gleixner.h]hDThe wrapper functions and interfaces are written by Thomas Gleixner.}(hje'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8'hhubh)}(h\Many users have provided bugfixes, improvements and helping hands for testing. Thanks a lot.h]h\Many users have provided bugfixes, improvements and helping hands for testing. Thanks a lot.}(hjs'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8'hhubh)}(h7The following people have contributed to this document:h]h7The following people have contributed to this document:}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8'hhubh)}(h#Thomas Gleixner\ tglx@linutronix.deh](hThomas Gleixner }(hj'hhhNhNubh reference)}(htglx@linutronix.deh]htglx@linutronix.de}(hj'hhhNhNubah}(h]h ]h"]h$]h&]refurimailto:tglx@linutronix.deuh1j'hj'ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj8'hhubeh}(h]creditsah ]h"]creditsah$]h&]uh1hhhhhhhhKubeh}(h]*reed-solomon-library-programming-interfaceah ]h"]*reed-solomon library programming interfaceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj'error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j'j'j9j6j`j]jjjjj jjjjyjvjjjjjjj j j5'j2'j'j'u nametypes}(j'j9j`jjj jjyjjjj j5'j'uh}(j'hj6hj]j<jjcjjjjjj jvjUjj|jjjjj jjKjTj3j8jujzj2'j j j j~ j jjjzjjjjjjQ!jV!j'j8'u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.