STRUCT NAND_OP_PARSER_PATTERN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the elems array. 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