Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\reed_solomon\test_rslib.c Create Date:2022-07-28 06:59:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Generates a random codeword and stores it in c

Proto:static int get_rcw_we(struct rs_control *rs, struct wspace *ws, int len, int errs, int eras)

Type:int

Parameter:

TypeParameterName
struct rs_control *rs
struct wspace *ws
intlen
interrs
interas
154  nroots = nroots
155  derrlocs = derrlocs
156  errlocs = errlocs
157  dlen = len - nroots
158  nn = nn
159  c = sent codeword
160  r = received word
166  When i < dlen cycle c[i] = prandom_u32() & nn
169  memset(c + dlen, 0, nroots * size of c )
170  encode_rs16(rs, c, dlen, c + dlen, 0)
173  No 3D Now!(r, c, len * size of r )
174  memset(errlocs, 0, len * size of errlocs )
175  memset(derrlocs, 0, nroots * size of derrlocs )
178  When i < errs cycle
179  Do
181  errval = prandom_u32() & nn
182  When errval == 0 cycle
184  Do
186  errloc = prandom_u32() % len
187  When errlocs[errloc] != 0 cycle
189  errlocs[errloc] = 1
190  r[errloc] ^= errval
194  When i < eras cycle
195  Do
197  errloc = prandom_u32() % len
198  When errlocs[errloc] != 0 cycle
200  derrlocs[i] = errloc
202  If ewsc && prandom_u32() & 1 Then
204  errlocs[errloc] = 2
205  Else
207  Do
209  errval = prandom_u32() & nn
210  When errval == 0 cycle
212  errlocs[errloc] = 1
213  r[errloc] ^= errval
214  errs++
218  Return errs
Caller
NameDescribe
test_ucTest up to error correction capacity
test_bcTests for correct behaviour beyond error correction capacity