1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct nand_ecc_ctrl</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="MTD NAND Driver Programming Interface"><link rel="up" href="structs.html" title="Chapter&#160;9.&#160;Structures"><link rel="prev" href="API-struct-nand-hw-control.html" title="struct nand_hw_control"><link rel="next" href="API-struct-nand-buffers.html" title="struct nand_buffers"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct nand_ecc_ctrl</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-nand-hw-control.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;9.&#160;Structures</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-struct-nand-buffers.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-nand-ecc-ctrl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct nand_ecc_ctrl &#8212; 
2     Control structure for ECC
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct nand_ecc_ctrl {
5  nand_ecc_modes_t mode;
6  int steps;
7  int size;
8  int bytes;
9  int total;
10  int strength;
11  int prepad;
12  int postpad;
13  struct nand_ecclayout * layout;
14  void * priv;
15  void (* hwctl) (struct mtd_info *mtd, int mode);
16  int (* calculate) (struct mtd_info *mtd, const uint8_t *dat,uint8_t *ecc_code);
17  int (* correct) (struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,uint8_t *calc_ecc);
18  int (* read_page_raw) (struct mtd_info *mtd, struct nand_chip *chip,uint8_t *buf, int oob_required, int page);
19  int (* write_page_raw) (struct mtd_info *mtd, struct nand_chip *chip,const uint8_t *buf, int oob_required);
20  int (* read_page) (struct mtd_info *mtd, struct nand_chip *chip,uint8_t *buf, int oob_required, int page);
21  int (* read_subpage) (struct mtd_info *mtd, struct nand_chip *chip,uint32_t offs, uint32_t len, uint8_t *buf, int page);
22  int (* write_subpage) (struct mtd_info *mtd, struct nand_chip *chip,uint32_t offset, uint32_t data_len,const uint8_t *data_buf, int oob_required);
23  int (* write_page) (struct mtd_info *mtd, struct nand_chip *chip,const uint8_t *buf, int oob_required);
24  int (* write_oob_raw) (struct mtd_info *mtd, struct nand_chip *chip,int page);
25  int (* read_oob_raw) (struct mtd_info *mtd, struct nand_chip *chip,int page);
26  int (* read_oob) (struct mtd_info *mtd, struct nand_chip *chip, int page);
27  int (* write_oob) (struct mtd_info *mtd, struct nand_chip *chip,int page);
28};  </pre></div><div class="refsect1"><a name="idp1099752900"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">mode</span></dt><dd><p>
29   ECC mode
30      </p></dd><dt><span class="term">steps</span></dt><dd><p>
31   number of ECC steps per page
32      </p></dd><dt><span class="term">size</span></dt><dd><p>
33   data bytes per ECC step
34      </p></dd><dt><span class="term">bytes</span></dt><dd><p>
35   ECC bytes per step
36      </p></dd><dt><span class="term">total</span></dt><dd><p>
37   total number of ECC bytes per page
38      </p></dd><dt><span class="term">strength</span></dt><dd><p>
39   max number of correctible bits per ECC step
40      </p></dd><dt><span class="term">prepad</span></dt><dd><p>
41   padding information for syndrome based ECC generators
42      </p></dd><dt><span class="term">postpad</span></dt><dd><p>
43   padding information for syndrome based ECC generators
44      </p></dd><dt><span class="term">layout</span></dt><dd><p>
45   ECC layout control struct pointer
46      </p></dd><dt><span class="term">priv</span></dt><dd><p>
47   pointer to private ECC control data
48      </p></dd><dt><span class="term">hwctl</span></dt><dd><p>
49   function to control hardware ECC generator. Must only
50   be provided if an hardware ECC is available
51      </p></dd><dt><span class="term">calculate</span></dt><dd><p>
52   function for ECC calculation or readback from ECC hardware
53      </p></dd><dt><span class="term">correct</span></dt><dd><p>
54   function for ECC correction, matching to ECC generator (sw/hw)
55      </p></dd><dt><span class="term">read_page_raw</span></dt><dd><p>
56   function to read a raw page without ECC. This function
57   should hide the specific layout used by the ECC
58   controller and always return contiguous in-band and
59   out-of-band data even if they're not stored
60   contiguously on the NAND chip (e.g.
61   NAND_ECC_HW_SYNDROME interleaves in-band and
62   out-of-band data).
63      </p></dd><dt><span class="term">write_page_raw</span></dt><dd><p>
64   function to write a raw page without ECC. This function
65   should hide the specific layout used by the ECC
66   controller and consider the passed data as contiguous
67   in-band and out-of-band data. ECC controller is
68   responsible for doing the appropriate transformations
69   to adapt to its specific layout (e.g.
70   NAND_ECC_HW_SYNDROME interleaves in-band and
71   out-of-band data).
72      </p></dd><dt><span class="term">read_page</span></dt><dd><p>
73   function to read a page according to the ECC generator
74   requirements; returns maximum number of bitflips corrected in
75   any single ECC step, 0 if bitflips uncorrectable, -EIO hw error
76      </p></dd><dt><span class="term">read_subpage</span></dt><dd><p>
77   function to read parts of the page covered by ECC;
78   returns same as <code class="function">read_page</code>
79      </p></dd><dt><span class="term">write_subpage</span></dt><dd><p>
80   function to write parts of the page covered by ECC.
81      </p></dd><dt><span class="term">write_page</span></dt><dd><p>
82   function to write a page according to the ECC generator
83   requirements.
84      </p></dd><dt><span class="term">write_oob_raw</span></dt><dd><p>
85   function to write chip OOB data without ECC
86      </p></dd><dt><span class="term">read_oob_raw</span></dt><dd><p>
87   function to read chip OOB data without ECC
88      </p></dd><dt><span class="term">read_oob</span></dt><dd><p>
89   function to read chip OOB data
90      </p></dd><dt><span class="term">write_oob</span></dt><dd><p>
91   function to write chip OOB data
92      </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-nand-hw-control.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="structs.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-struct-nand-buffers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct nand_hw_control</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct nand_buffers</span></td></tr></table></div></body></html>
93