Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\bch.c Create Date:2022-07-28 07:00:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mpute generator polynomial for given (m,t) parameters.

Proto:static uint32_t *compute_generator_polynomial(struct bch_control *bch)

Type:uint32_t

Parameter:

TypeParameterName
struct bch_control *bch
1176  m = GF_M(bch)
1177  t = GF_T(bch)
1178  err = 0
1183  g = bch_alloc(given its degree, compute a polynomial size in bytes (m * t), & err)
1184  roots = bch_alloc((n + 1) * size of roots , & err)
1185  genpoly = bch_alloc(DIV_ROUND_UP(m * t + 1, 32) * size of genpoly , & err)
1187  If err Then
1188  kfree(genpoly)
1189  genpoly = NULL
1190  Go to finish
1194  memset(roots, 0, (n + 1) * size of roots )
1195  When i < t cycle
1196  When j < m cycle
1197  roots[r] = 1
1202  polynomial degree = 0
1203  polynomial terms [0] = 1
1204  When i < GF_N(bch) cycle
1205  If roots[i] Then
1207  r = private: [i]
1217  n = polynomial degree + 1
1218  i = 0
1220  When n > 0 cycle
1221  nbits = If n > 32 Then 32 Else n
1222  When j < nbits cycle
1223  If polynomial terms [n - 1 - j] Then word |= 1u << 31 - j
1226  genpoly[i++] = word
1227  n -= nbits
1229  ecc_bits = polynomial degree
1231  finish :
1232  kfree(g)
1233  kfree(roots)
1235  Return genpoly
Caller
NameDescribe
init_bch_bch - initialize a BCH encoder/decoder*@m: Galois field order, should be in the range 5-15*@t: maximum error correction capability, in bits*@prim_poly: user-provided primitive polynomial (or 0 to use default)* Returns:* a newly allocated BCH control