函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:_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

函数原型:struct bch_control *init_bch(int m, int t, unsigned int prim_poly)

返回类型:struct bch_control

参数:

类型参数名称
intm
intt
unsigned intprim_poly
1261  err等于0
1264  struct bch_control * bch = NULL
1266  min_m等于5
1269  static const unsigned int prim_poly_tab[] = {0x25, 0x43, 0x83, 0x11d, 0x211, 0x409, 0x805, 0x1053, 0x201b, 0x402b, 0x8003, }
1282  如果m小于min_mm大于2KB 则转到:fail
1290  如果t大于64 bit correction 则转到:fail
1298  如果t小于1或mt大于等于1左移m位的值减1则转到:fail
1303  如果prim_poly恒等于0则prim_poly等于prim_poly_tab[m - min_m]
1306  bch等于分配内存并置零
1307  如果(bch == NULL)则转到:fail
1310  m等于m
1311  t等于t
1312  n等于1左移m位的值减1
1313  words等于DIV_ROUND_UP(m * t, 32)
1314  ecc_bytes等于DIV_ROUND_UP(m * t, 8)
1315  private: 等于bch_alloc((1 + n) * private: 的长度, & err)
1316  a_log_tab等于bch_alloc((1 + n) * a_log_tab的长度, & err)
1317  mod8_tab等于bch_alloc(words * 1024 * mod8_tab的长度, & err)
1318  ecc_buf等于bch_alloc(words * ecc_buf的长度, & err)
1319  ecc_buf2等于bch_alloc(words * ecc_buf2的长度, & err)
1320  xi_tab等于bch_alloc(m * xi_tab的长度, & err)
1321  syn等于bch_alloc(2 * t * syn的长度, & err)
1322  cache等于bch_alloc(2 * t * cache的长度, & err)
1323  elp等于bch_alloc((t + 1) * sizeof(structgf_poly_deg1), & err)
1325 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(poly_2t)循环poly_2t[i]等于bch_alloc(given its degree, compute a polynomial size in bytes (2 * t), & err)
1328  如果err则转到:fail
1331  err等于generate Galois field lookup tables
1332  如果err则转到:fail
1336  genpoly等于mpute generator polynomial for given (m,t) parameters.
1337  如果(genpoly == NULL)则转到:fail
1340  mpute generator polynomial remainder tables for fast encoding
1341  kfree(genpoly)
1343  err等于ld a base for factoring degree 2 polynomials
1344  如果err则转到:fail
1347  返回:bch
1349  fail :
1350  释放BCH控制结构
1351  返回:NULL