STRUCT NAND_OP_INSTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct nand_op_instr(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” we're talking about struct nand_op_instr today, aka the literal instruction object of the NAND world. it's giving "one tiny struct, so much responsibility" and honestly? iconic. πŸ’…


🌸 NAME 🌸

struct nand_op_instr β€” Instruction object, no cap. that's it, that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the shape of it, bestie β€” copy it exactly, don't freestyle:

struct nand_op_instr {
    enum nand_op_instr_type type;
    union {
      struct nand_op_cmd_instr cmd;
      struct nand_op_addr_instr addr;
      struct nand_op_data_instr data;
      struct nand_op_waitrdy_instr waitrdy;
    } ctx;
    unsigned int delay_ns;
 };

πŸ’– Members πŸ’–

  • type β€” literally the instruction type. that's the whole job. πŸ”₯
  • ctx β€” the extra data that comes attached to the instruction. and here's the thing, bestie: you have to use the appropriate element depending on type. like, don't just grab any of them, that's not the move πŸ™ˆ
  • ctx.cmd β€” use it if type is NAND_OP_CMD_INSTR. easy. ✨
  • ctx.addr β€” use it if type is NAND_OP_ADDR_INSTR. πŸŽ€
  • ctx.data β€” use it if type is NAND_OP_DATA_IN_INSTR or NAND_OP_DATA_OUT_INSTR. both of those, yes. πŸ‘‘
  • ctx.waitrdy β€” use it if type is NAND_OP_WAITRDY_INSTR. πŸ¦‹
  • delay_ns β€” the delay the controller should apply after the instruction has been issued on the bus. most modern controllers have internal timings control logic, and in that case the controller driver can just ignore this field. so like... it's there if you need it, no pressure 🌸

🌈 SEE ALSO 🌈

Kernel file ./include/linux/mtd/rawnand.h, plus the whole friend group β€” all of these, exactly as listed, bestie, i'm not skipping a single one: 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_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_pattern(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).

side note: that's a lot of structs. main character energy for the whole MTD headers folder, fr fr πŸ’€

and that's the page, bestie! 🫢 cute little sign-off for you: this one lives in ./include/linux/mtd, dated October 2026 β€” go off, kernel docs. slay πŸ’œ

πŸ“¦ where this page comes from