STRUCT NAND_OP_PARSER_PATTERN(9)
π struct nand_op_parser_pattern(9) β the Kernel API Manual, bestie edition π
okay so you found the struct nand_op_parser_pattern page β that's the NAND sub-operation pattern descriptor, and yes it's as niche as it sounds, but we're gonna make it make sense β¨
πΈ NAME πΈ
struct nand_op_parser_pattern β the NAND sub-operation pattern descriptor. that's the whole vibe. it describes a pattern. for the NAND op parser. iconic behavior honestly π
π¦ SYNOPSIS π¦
struct nand_op_parser_pattern {
const struct nand_op_parser_pattern_elem *elems;
unsigned int nelems;
int (*exec)(struct nand_chip *chip, const struct nand_subop *subop);
};
copy it exactly like that, we do not freestyle struct definitions in this house π
β¨ Members β¨ (the three besties)
elemsβ the array of pattern elements. it's giving "the actual list of stuff," lowkey the main character of the struct πnelemsβ how many pattern elements live in theelemsarray. the headcount. the roll call πexecβ the function that will issue a sub-operation. this is the one that actually does the thing π₯
π Description π
so a pattern is a list of elements, and every single element represents one instruction plus its constraints. the pattern itself is what the core uses to match a NAND chip operation against NAND controller operations. like a matchmaking app but for kernel subsystems, no cap π«Ά
and here's the slay part: once the core finds a match between a NAND controller operation pattern and a NAND chip operation (or a sub-set of a NAND operation), it calls the pattern's ->exec hook so the controller driver can go issue the operation on the bus. that's the moment. that's the payoff. periodt π«
controller drivers, listen up π£ β you should declare as many patterns as they support and pass that whole list of patterns (which you create with the help of the following macro) to the nand_op_parser_exec_op helper. more patterns = more coverage. it's giving prepared π
π SEE ALSO π
Kernel file ./include/linux/mtd/rawnand.h, plus the whole extended friend group:
struct nand_parameters(9)struct nand_id(9)struct nand_ecc_step_info(9)struct nand_ecc_caps(9)struct nand_ecc_ctrl(9)struct nand_sdr_timings(9)struct nand_nvddr_timings(9)enum nand_interface_type(9)struct nand_interface_config(9)nand_interface_is_sdr(9)nand_interface_is_nvddr(9)nand_get_sdr_timings(9)nand_get_nvddr_timings(9)struct nand_op_cmd_instr(9)struct nand_op_addr_instr(9)struct nand_op_data_instr(9)struct nand_op_waitrdy_instr(9)enum nand_op_instr_type(9)struct nand_op_instr(9)struct nand_subop(9)struct nand_op_parser_addr_constraints(9)struct nand_op_parser_data_constraints(9)struct nand_op_parser_pattern_elem(9)struct nand_op_parser(9)struct nand_operation(9)struct nand_controller_ops(9)struct nand_controller(9)struct nand_legacy(9)struct nand_chip_ops(9)struct nand_manufacturer(9)struct nand_secure_region(9)struct nand_chip(9)nand_get_interface_config(9)struct nand_flash_dev(9)nand_opcode_8bits(9)nand_get_data_buf(9)
like I said. big friend group. iykyk π
and that's the page, bestie π§ from ./include/linux/mtd, dated October 2026, filed under struct nand...rser_pattern(9) β go forth and match some operations πβ¨π
π¦ 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