函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:int decode_bch(struct bch_control *bch, const uint8_t *data, unsigned int len, const uint8_t *recv_ecc, const uint8_t *calc_ecc, const unsigned int *syn, unsigned int *errloc)

返回类型:int

参数:

类型参数名称
struct bch_control *bch
const uint8_t *data
unsigned intlen
const uint8_t *recv_ecc
const uint8_t *calc_ecc
const unsigned int *syn
unsigned int *errloc
1000  ecc_words等于BCH_ECC_WORDS(bch)
1006  如果8乘len大于necc_bits则返回:负EINVAL
1010  如果非syn
1011  如果非calc_ecc
1013  如果非data或非recv_ecc则返回:负EINVAL
1016  否则
1021  如果recv_ecc
1024 i小于ecc_words循环
1025  ecc_buf[i]异或等于ecc_buf2[i]
1026  sum或等于ecc_buf[i]
1028  如果非sum则返回:0
1032  mpute 2t syndromes of ecc polynomial, i.e. ecc(a^j) for j=1..2t
1033  syn等于syn
1036  err等于compute_error_locator_polynomial(bch, syn)
1037  如果err大于0则
1038  nroots等于d roots of a polynomial, using BTZ algorithm; see the beginning of this* file for details
1039  如果err不等于nrootserr等于负1
1042  如果err大于0则
1044  nbits等于len乘8加ecc_bits
1045 i小于err循环
1046  如果errloc[i]大于等于nbits
1047  err等于负1
1048  退出
1050  errloc[i]等于nbits减1减errloc[i]
1051  errloc[i]等于errloc[i]按位与7的反按位或7减errloc[i]按位与7的值
1054  返回:如果err大于等于0则err否则负EBADMSG