decode_rs8(9)
hey bestie π okay so this is the decode_rs8(9) page from the Kernel API Manual β section 9, no cap.
π NAME π
decode_rs8 β Decode codeword (8bit data width). that's the whole vibe: it's the decoder for 8-bit data width. slay.
β¨ SYNOPSIS β¨
here's the exact signature, character for character β don't let the line wrap gaslight you:
int decode_rs8 (struct rs_control *rsc , uint8_t *data , uint16_t *par ,
int len , uint16_t *s , int no_eras , int *eras_pos , uint16_t invmsk ,
uint16_t *corr );
πΈ ARGUMENTS πΈ
okay bestie, argument-by-argument, let's go:
rscβ the rs control structure. main character energy.dataβ data field of a given type. yep, that's the field.parβ received parity data field. the parity bestie.lenβ data length. how long the data is, periodt.sβ syndrome data field, and it must be in index form. if it'sNULL, the syndrome is calculated. iconic convenience.no_erasβ number of erasures. count 'em.eras_posβ position of erasures. can beNULL, so no pressure.invmskβ invert data mask. IMPORTANT: it will be xored on data, not on parity! literally not parity, bestie β data only. πcorrβ buffer to store correction bitmask oneras_pos. that's its whole job.
π¦ DESCRIPTION π¦
so here's the tea: the syndrome and parity uses a uint16_t data type to enable symbol size > 8. highkey useful. The calling code must take care of decoding of the syndrome result and the received parity before calling this code. no cap, that part is on the caller.
π NOTE π
The rs_control struct rsc contains buffers which are used for decoding, so the caller has to ensure that decoder invocations are serialized. like, one at a time, bestie β don't let them overlap. π«Ά
Returns the number of corrected symbols or -EBADMSG for uncorrectable errors. The count includes errors in the parity. so yes, parity errors are in the count too β the way that detail matters. π
π SEE ALSO π
go read these next, iykyk:
- Kernel file
./lib/reed_solomon/reed_solomon.c codec_init(9)free_rs(9)init_rs_internal(9)init_rs_gfp(9)init_rs_non_canonical(9)encode_rs8(9)encode_rs16(9)decode_rs16(9)
this page is brought to you by source ./lib/reed_solomon, dated October 2026, and it's the decode_rs8(9) page in the Kernel API Manual. stay slay, bestie π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms