include/linux/mtd/nand.h
Source file repositories/reference/linux-study-clean/include/linux/mtd/nand.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mtd/nand.h- Extension
.h- Size
- 34539 bytes
- Lines
- 1145
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mtd/mtd.h
Detected Declarations
struct nand_devicestruct nand_memory_organizationstruct nand_row_converterstruct nand_posstruct nand_page_io_reqstruct nand_ecc_propsstruct nand_bbtstruct nand_opsstruct nand_ecc_contextstruct nand_ecc_engine_opsstruct nand_ecc_enginestruct nand_ecc_req_tweak_ctxstruct nand_eccstruct nand_devicestruct nand_io_iterenum nand_page_io_req_typeenum nand_ecc_engine_typeenum nand_ecc_placementenum nand_ecc_algoenum nand_ecc_engine_integrationenum nand_bbt_block_statusfunction nand_ecc_register_on_host_hw_enginefunction nand_ecc_unregister_on_host_hw_enginefunction mtd_to_nanddevfunction nanddev_to_mtdfunction nanddev_bits_per_cellfunction nanddev_page_sizefunction nanddev_per_page_oobsizefunction nanddev_pages_per_eraseblockfunction nanddev_pages_per_targetfunction nanddev_per_page_oobsizefunction nanddev_eraseblocks_per_lunfunction nanddev_eraseblocks_per_targetfunction nanddev_target_sizefunction nanddev_ntargetfunction nanddev_neraseblocksfunction nanddev_sizefunction nanddev_get_memorgfunction nanddev_get_ecc_conffunction nanddev_get_ecc_nstepsfunction nanddev_get_ecc_bytes_per_stepfunction nanddev_get_ecc_requirementsfunction nanddev_set_ecc_requirementsfunction nanddev_registerfunction nanddev_unregisterfunction nanddev_set_of_nodefunction nanddev_get_of_nodefunction nanddev_offs_to_pos
Annotated Snippet
struct nand_memory_organization {
unsigned int bits_per_cell;
unsigned int pagesize;
unsigned int oobsize;
unsigned int pages_per_eraseblock;
unsigned int eraseblocks_per_lun;
unsigned int max_bad_eraseblocks_per_lun;
unsigned int planes_per_lun;
unsigned int luns_per_target;
unsigned int ntargets;
};
#define NAND_MEMORG(bpc, ps, os, ppe, epl, mbb, ppl, lpt, nt) \
{ \
.bits_per_cell = (bpc), \
.pagesize = (ps), \
.oobsize = (os), \
.pages_per_eraseblock = (ppe), \
.eraseblocks_per_lun = (epl), \
.max_bad_eraseblocks_per_lun = (mbb), \
.planes_per_lun = (ppl), \
.luns_per_target = (lpt), \
.ntargets = (nt), \
}
/**
* struct nand_row_converter - Information needed to convert an absolute offset
* into a row address
* @lun_addr_shift: position of the LUN identifier in the row address
* @eraseblock_addr_shift: position of the eraseblock identifier in the row
* address
*/
struct nand_row_converter {
unsigned int lun_addr_shift;
unsigned int eraseblock_addr_shift;
};
/**
* struct nand_pos - NAND position object
* @target: the NAND target/die
* @lun: the LUN identifier
* @plane: the plane within the LUN
* @eraseblock: the eraseblock within the LUN
* @page: the page within the LUN
*
* These information are usually used by specific sub-layers to select the
* appropriate target/die and generate a row address to pass to the device.
*/
struct nand_pos {
unsigned int target;
unsigned int lun;
unsigned int plane;
unsigned int eraseblock;
unsigned int page;
};
/**
* enum nand_page_io_req_type - Direction of an I/O request
* @NAND_PAGE_READ: from the chip, to the controller
* @NAND_PAGE_WRITE: from the controller, to the chip
*/
enum nand_page_io_req_type {
NAND_PAGE_READ = 0,
NAND_PAGE_WRITE,
};
/**
* struct nand_page_io_req - NAND I/O request object
* @type: the type of page I/O: read or write
* @pos: the position this I/O request is targeting
* @dataoffs: the offset within the page
* @datalen: number of data bytes to read from/write to this page
* @databuf: buffer to store data in or get data from
* @ooboffs: the OOB offset within the page
* @ooblen: the number of OOB bytes to read from/write to this page
* @oobbuf: buffer to store OOB data in or get OOB data from
* @mode: one of the %MTD_OPS_XXX mode
* @continuous: no need to start over the operation at the end of each page, the
* NAND device will automatically prepare the next one
*
* This object is used to pass per-page I/O requests to NAND sub-layers. This
* way all useful information are already formatted in a useful way and
* specific NAND layers can focus on translating these information into
* specific commands/operations.
*/
struct nand_page_io_req {
enum nand_page_io_req_type type;
struct nand_pos pos;
unsigned int dataoffs;
unsigned int datalen;
Annotation
- Immediate include surface: `linux/mtd/mtd.h`.
- Detected declarations: `struct nand_device`, `struct nand_memory_organization`, `struct nand_row_converter`, `struct nand_pos`, `struct nand_page_io_req`, `struct nand_ecc_props`, `struct nand_bbt`, `struct nand_ops`, `struct nand_ecc_context`, `struct nand_ecc_engine_ops`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.