函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:de_bch - calculate BCH ecc parity of data*@bch: BCH control structure*@data: data to encode*@len: data length in bytes*@ecc: ecc parity data, must be initialized by caller* The @ecc parity array is used both as input and output parameter, in order to

函数原型:void encode_bch(struct bch_control *bch, const uint8_t *data, unsigned int len, uint8_t *ecc)

返回类型:void

参数:

类型参数名称
struct bch_control *bch
const uint8_t *data
unsigned intlen
uint8_t *ecc
193  l等于BCH_ECC_WORDS(bch)减1
197  r_bytes等于BCH_ECC_WORDS(bch)乘r的长度
198  tab0等于mod8_tab
199  tab1等于tab0加256乘l加1的和
200  tab2等于tab1加256乘l加1的和
201  tab3等于tab2加256乘l加1的和
204  如果WARN_ON(r_bytes > r的长度)则返回
207  如果ecc
209  vert ecc bytes to aligned, zero-padded 32-bit ecc words
210  否则
211  memset(ecc_buf, 0, r_bytes)
215  m等于data按位与3
216  如果m
217  mlen等于如果len小于4减mlen否则4减m
218  same as encode_bch(), but process input data one byte at a time
219  data加等于mlen
220  len减等于mlen
224  pdata等于data
225  mlen等于len除4
226  data加等于4乘mlen
227  len减等于4乘mlen
228  内存复制(r, ecc_buf, r_bytes)
241 mlen自减循环
243  w等于r[0]按位异或cpu_to_be32( * pdata++)
244  p0等于tab0l加1的和乘w右移0位按位与0xff的值
245  p1等于tab1l加1的和乘w右移8位按位与0xff的值
246  p2等于tab2l加1的和乘w右移16位按位与0xff的值
247  p3等于tab3l加1的和乘w右移24位按位与0xff的值
249 i小于l循环r[i]等于r[i + 1]按位异或p0[i]按位异或p1[i]按位异或p2[i]按位异或p3[i]
252  r[l]等于p0[l]按位异或p1[l]按位异或p2[l]按位异或p3[l]
254  内存复制(ecc_buf, r, r_bytes)
257  如果lensame as encode_bch(), but process input data one byte at a time
261  如果eccvert 32-bit ecc words to ecc bytes
调用者
名称描述
decode_bchdecode_bch - decode received codeword and find bit error locations*@bch: BCH control structure*@data: received data, ignored if @calc_ecc is provided*@len: data length in bytes, must always be provided*@recv_ecc: received ecc, if NULL then assume it was