~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/bch.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/bch.h (Version linux-6.12-rc7) and /include/linux/bch.h (Version linux-5.16.20)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*                                                  2 /*
  3  * Generic binary BCH encoding/decoding librar      3  * Generic binary BCH encoding/decoding library
  4  *                                                  4  *
  5  * Copyright © 2011 Parrot S.A.                    5  * Copyright © 2011 Parrot S.A.
  6  *                                                  6  *
  7  * Author: Ivan Djelic <ivan.djelic@parrot.com      7  * Author: Ivan Djelic <ivan.djelic@parrot.com>
  8  *                                                  8  *
  9  * Description:                                     9  * Description:
 10  *                                                 10  *
 11  * This library provides runtime configurable      11  * This library provides runtime configurable encoding/decoding of binary
 12  * Bose-Chaudhuri-Hocquenghem (BCH) codes.         12  * Bose-Chaudhuri-Hocquenghem (BCH) codes.
 13 */                                                 13 */
 14 #ifndef _BCH_H                                     14 #ifndef _BCH_H
 15 #define _BCH_H                                     15 #define _BCH_H
 16                                                    16 
 17 #include <linux/types.h>                           17 #include <linux/types.h>
 18                                                    18 
 19 /**                                                19 /**
 20  * struct bch_control - BCH control structure      20  * struct bch_control - BCH control structure
 21  * @m:          Galois field order                 21  * @m:          Galois field order
 22  * @n:          maximum codeword size in bits      22  * @n:          maximum codeword size in bits (= 2^m-1)
 23  * @t:          error correction capability in     23  * @t:          error correction capability in bits
 24  * @ecc_bits:   ecc exact size in bits, i.e. g     24  * @ecc_bits:   ecc exact size in bits, i.e. generator polynomial degree (<=m*t)
 25  * @ecc_bytes:  ecc max size (m*t bits) in byt     25  * @ecc_bytes:  ecc max size (m*t bits) in bytes
 26  * @a_pow_tab:  Galois field GF(2^m) exponenti     26  * @a_pow_tab:  Galois field GF(2^m) exponentiation lookup table
 27  * @a_log_tab:  Galois field GF(2^m) log looku     27  * @a_log_tab:  Galois field GF(2^m) log lookup table
 28  * @mod8_tab:   remainder generator polynomial     28  * @mod8_tab:   remainder generator polynomial lookup tables
 29  * @ecc_buf:    ecc parity words buffer            29  * @ecc_buf:    ecc parity words buffer
 30  * @ecc_buf2:   ecc parity words buffer            30  * @ecc_buf2:   ecc parity words buffer
 31  * @xi_tab:     GF(2^m) base for solving degre     31  * @xi_tab:     GF(2^m) base for solving degree 2 polynomial roots
 32  * @syn:        syndrome buffer                    32  * @syn:        syndrome buffer
 33  * @cache:      log-based polynomial represent     33  * @cache:      log-based polynomial representation buffer
 34  * @elp:        error locator polynomial           34  * @elp:        error locator polynomial
 35  * @poly_2t:    temporary polynomials of degre     35  * @poly_2t:    temporary polynomials of degree 2t
 36  * @swap_bits:  swap bits within data and synd     36  * @swap_bits:  swap bits within data and syndrome bytes
 37  */                                                37  */
 38 struct bch_control {                               38 struct bch_control {
 39         unsigned int    m;                         39         unsigned int    m;
 40         unsigned int    n;                         40         unsigned int    n;
 41         unsigned int    t;                         41         unsigned int    t;
 42         unsigned int    ecc_bits;                  42         unsigned int    ecc_bits;
 43         unsigned int    ecc_bytes;                 43         unsigned int    ecc_bytes;
 44 /* private: */                                     44 /* private: */
 45         uint16_t       *a_pow_tab;                 45         uint16_t       *a_pow_tab;
 46         uint16_t       *a_log_tab;                 46         uint16_t       *a_log_tab;
 47         uint32_t       *mod8_tab;                  47         uint32_t       *mod8_tab;
 48         uint32_t       *ecc_buf;                   48         uint32_t       *ecc_buf;
 49         uint32_t       *ecc_buf2;                  49         uint32_t       *ecc_buf2;
 50         unsigned int   *xi_tab;                    50         unsigned int   *xi_tab;
 51         unsigned int   *syn;                       51         unsigned int   *syn;
 52         int            *cache;                     52         int            *cache;
 53         struct gf_poly *elp;                       53         struct gf_poly *elp;
 54         struct gf_poly *poly_2t[4];                54         struct gf_poly *poly_2t[4];
 55         bool            swap_bits;                 55         bool            swap_bits;
 56 };                                                 56 };
 57                                                    57 
 58 struct bch_control *bch_init(int m, int t, uns     58 struct bch_control *bch_init(int m, int t, unsigned int prim_poly,
 59                              bool swap_bits);      59                              bool swap_bits);
 60                                                    60 
 61 void bch_free(struct bch_control *bch);            61 void bch_free(struct bch_control *bch);
 62                                                    62 
 63 void bch_encode(struct bch_control *bch, const     63 void bch_encode(struct bch_control *bch, const uint8_t *data,
 64                 unsigned int len, uint8_t *ecc     64                 unsigned int len, uint8_t *ecc);
 65                                                    65 
 66 int bch_decode(struct bch_control *bch, const      66 int bch_decode(struct bch_control *bch, const uint8_t *data, unsigned int len,
 67                const uint8_t *recv_ecc, const      67                const uint8_t *recv_ecc, const uint8_t *calc_ecc,
 68                const unsigned int *syn, unsign     68                const unsigned int *syn, unsigned int *errloc);
 69                                                    69 
 70 #endif /* _BCH_H */                                70 #endif /* _BCH_H */
 71                                                    71 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php