函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\bch.c Create Date:2022-07-27 07:57:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mpute generator polynomial for given (m,t) parameters.

函数原型:static uint32_t *compute_generator_polynomial(struct bch_control *bch)

返回类型:uint32_t

参数:

类型参数名称
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) * roots的长度, & err)
1185  genpoly等于bch_alloc(DIV_ROUND_UP(m * t + 1, 32) * genpoly的长度, & err)
1187  如果err
1188  kfree(genpoly)
1189  genpoly = NULL
1190  转到:finish
1194  memset(roots, 0, (n + 1) * roots的长度)
1195 i小于t循环
1196 j小于m循环
1197  roots[r]等于1
1202  polynomial degree 等于0
1203  polynomial terms [0]等于1
1204 i小于GF_N(bch)循环
1205  如果roots[i]则
1207  r等于private: [i]
1213  polynomial degree 自加
1217  n等于polynomial degree 加1
1218  i等于0
1220 n大于0循环
1221  nbits等于如果n大于32则32否则n
1222 j小于nbits循环
1223  如果polynomial terms [n - 1 - j]则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  返回:genpoly
调用者
名称描述
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