| Function report | 
| Source Code: lib\bch.c | Create Date:2022-07-28 07:00:06 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:_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
Proto:struct bch_control *init_bch(int m, int t, unsigned int prim_poly)
Type:struct bch_control
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | m | |
| int | t | |
| unsigned int | prim_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, } | 
| 1290 | If t > 64 bit correction Then Go to fail | 
| 1303 | If prim_poly == 0 Then prim_poly = prim_poly_tab[m - min_m] | 
| 1306 | bch = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). | 
| 1313 | words = DIV_ROUND_UP(m * t, 32) | 
| 1314 | ecc_bytes = DIV_ROUND_UP(m * t, 8) | 
| 1325 | When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(poly_2t) cycle poly_2t[i] = bch_alloc(given its degree, compute a polynomial size in bytes (2 * t), & err) | 
| 1347 | Return bch | 
| 1349 | fail : | 
| 1351 | Return NULL | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |