STRUCT NAND_ECC_CONTEXT(9)
π struct nand_ecc_context(9) π
okay so bestie, welcome to the Kernel API Manual β yes we're reading kernel docs together, this is our bonding era π«Ά. Today's main character is struct nand_ecc_context, and ngl, she's the lil' bookkeeping baddie that holds the Context for the ECC engine. That's literally her whole job and she does it slayfully. β¨
πΈ NAME πΈ
struct nand_ecc_context β the Context for the ECC engine, no cap π
β SYNOPSIS β
here's the whole glow-up, copied exactly because we do not freestyle kernel structs in this house π€
struct nand_ecc_context {
struct nand_ecc_props conf;
unsigned int nsteps;
unsigned int total;
void *priv;
};
π Members π
four fields, four besties, all iconic in their own way π¦
confβ the basic ECC engine parameters. like, the vibe settings. the defaults. the whole personality of the engine lives here πnstepsβ number of ECC steps. that's it, that's the field, she's counting steps and she's booked and busy π₯totalβ total number of bytes used for storing ECC codes. and listen β this one is used by generic OOB layouts, so she's not just decorative, she's load-bearing πprivβ ECC engine driver private data. it's giving "don't look in my bag" energy π, only the driver knows what's in there
π SEE ALSO π
the whole friend group, iykyk π β first up, the header location herself:
- Kernel file
./include/linux/mtd/nand.hstruct
and now the extended squad, all of them, in order, no one left out because we don't do that here π«Ά
struct nand_memory_organization(9),struct nand_row_converter(9),struct nand_pos(9),enum nand_page_io_req_type(9)struct nand_page_io_req(9),enum nand_ecc_engine_type(9),enum nand_ecc_placement(9),enum nand_ecc_algo(9)struct nand_ecc_props(9),struct nand_bbt(9),struct nand_ops(9),struct nand_ecc_engine_ops(9)enum nand_ecc_engine_integration(9),struct nand_ecc_engine(9),struct nand_ecc_req_tweak_ctx(9),struct nand_ecc(9)struct nand_device(9),struct nand_io_iter(9),mtd_to_nanddev(9),nanddev_to_mtd(9)nanddev_page_size(9),nanddev_per_page_oobsize(9),nanddev_pages_per_eraseblock(9),nanddev_pages_per_target(9)nanddev_eraseblocks_per_lun(9),nanddev_eraseblocks_per_target(9),nanddev_target_size(9),nanddev_neraseblocks(9)nanddev_size(9),nanddev_get_memorg(9),nanddev_get_ecc_conf(9),nanddev_get_ecc_nsteps(9)nanddev_get_ecc_bytes_per_step(9),nanddev_get_ecc_requirements(9),nanddev_set_ecc_requirements(9),nanddev_register(9)nanddev_unregister(9),nanddev_set_of_node(9),nanddev_get_of_node(9),nanddev_offs_to_pos(9)nanddev_pos_cmp(9),nanddev_pos_to_offs(9),nanddev_pos_to_row(9),nanddev_pos_next_target(9)nanddev_pos_next_lun(9),nanddev_pos_next_eraseblock(9),nanddev_pos_next_page(9),nanddev_bbt_pos_to_entry(9)nanddev_bbt_is_initialized(9)
lowkey reminder bestie: every single one of those names is exactly as written β don't go "fixing" the spelling ofnanddevor swapping astructfor anenumbecause the kernel does NOT forgive and will NOT forget π
alright that's the whole page, mwah π β this gem dropped from ./include/linux/mtd back in October 2026, and it's still serving struct nand_ecc_context(9) realness to this very day. periodt. πβ¨π
π¦ 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