Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

struct_nand_ecc_ctrl(9) [centos man page]

STRUCT 
NAND_ECC_CTRL(9) Structures STRUCT NAND_ECC_CTRL(9) NAME
struct_nand_ecc_ctrl - Control structure for ECC SYNOPSIS
struct nand_ecc_ctrl { nand_ecc_modes_t mode; int steps; int size; int bytes; int total; int strength; int prepad; int postpad; struct nand_ecclayout * layout; void * priv; void (* hwctl) (struct mtd_info *mtd, int mode); int (* calculate) (struct mtd_info *mtd, const uint8_t *dat,uint8_t *ecc_code); int (* correct) (struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,uint8_t *calc_ecc); int (* read_page_raw) (struct mtd_info *mtd, struct nand_chip *chip,uint8_t *buf, int oob_required, int page); int (* write_page_raw) (struct mtd_info *mtd, struct nand_chip *chip,const uint8_t *buf, int oob_required); int (* read_page) (struct mtd_info *mtd, struct nand_chip *chip,uint8_t *buf, int oob_required, int page); int (* read_subpage) (struct mtd_info *mtd, struct nand_chip *chip,uint32_t offs, uint32_t len, uint8_t *buf); 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); int (* write_page) (struct mtd_info *mtd, struct nand_chip *chip,const uint8_t *buf, int oob_required); int (* write_oob_raw) (struct mtd_info *mtd, struct nand_chip *chip,int page); int (* read_oob_raw) (struct mtd_info *mtd, struct nand_chip *chip,int page); int (* read_oob) (struct mtd_info *mtd, struct nand_chip *chip, int page); int (* write_oob) (struct mtd_info *mtd, struct nand_chip *chip,int page); }; MEMBERS
mode ECC mode steps number of ECC steps per page size data bytes per ECC step bytes ECC bytes per step total total number of ECC bytes per page strength max number of correctible bits per ECC step prepad padding information for syndrome based ECC generators postpad padding information for syndrome based ECC generators layout ECC layout control struct pointer priv pointer to private ECC control data hwctl function to control hardware ECC generator. Must only be provided if an hardware ECC is available calculate function for ECC calculation or readback from ECC hardware correct function for ECC correction, matching to ECC generator (sw/hw) read_page_raw function to read a raw page without ECC write_page_raw function to write a raw page without ECC read_page function to read a page according to the ECC generator requirements; returns maximum number of bitflips corrected in any single ECC step, 0 if bitflips uncorrectable, -EIO hw error read_subpage function to read parts of the page covered by ECC; returns same as read_page write_subpage function to write parts of the page covered by ECC. write_page function to write a page according to the ECC generator requirements. write_oob_raw function to write chip OOB data without ECC read_oob_raw function to read chip OOB data without ECC read_oob function to read chip OOB data write_oob function to write chip OOB data AUTHOR
Thomas Gleixner <tglx@linutronix.de> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 STRUCT NAND_ECC_CTRL(9)

Check Out this Related Man Page

SG_READ_LONG(8) 						     SG3_UTILS							   SG_READ_LONG(8)

NAME
sg_read_long - send a SCSI READ LONG command SYNOPSIS
sg_read_long [--16] [--correct] [--help] [--lba=LBA] [--out=OF] [--pblock] [--readonly] [--verbose] [--version] [--xfer_len=BTL] DEVICE DESCRIPTION
Send SCSI READ LONG command to DEVICE. The read buffer is output in hex and ASCII to stdout or placed in a file. Note that the data returned includes the logical block data (typically 512 bytes for a disk) plus ECC information (whose format is proprietary) plus option- ally other proprietary data. OPTIONS
Arguments to long options are mandatory for short options as well. -S, --16 uses a SCSI READ LONG(16) command. The default action is to use a SCSI READ LONG(10) command. The READ LONG(10) command has a 32 bit field for the lba while READ LONG(16) has a 64 bit field. -c, --correct sets the 'CORRCT' bit in the SCSI READ LONG command. When set the data is corrected by the ECC before being transferred back to this utility. The default is to leave the 'CORRCT' bit clear in which case the data is not corrected. -h, --help output the usage message then exit. -l, --lba=LBA where LBA is the logical block address of the sector to read. Assumed to be in decimal unless prefixed with '0x' (or has a trailing 'h'). Defaults to lba 0. If the lba is larger than can fit in 32 bits then the --16 option should be used. -o, --out=OF instead of outputting ASCII hex to stdout, send it in binary to the file called OF. If '-' is given for OF then the (binary) output is sent to stdout. Note that all informative and error output is sent to stderr. -p, --pblock sets the 'PBLOCK' bit in the SCSI READ LONG command. When set the physical block (plus ECC data) containing the requested logical block address is read. The default is to leave the 'PBLOCK' bit clear in which case the logical block (plus any ECC data) is read. -r, --readonly opens the DEVICE read-only rather than read-write which is the default. The Linux sg driver needs read-write access for the SCSI READ LONG command but other access methods may require read-only access. -v, --verbose increase the level of verbosity, (i.e. debug output). -V, --version print the version string and then exit. -x, --xfer_len=BTL where BTL is the byte transfer length (default to 520). If the given value (or the default) does not match the "long" block size of the device, the appropriate BTL is deduced from the error response and printed (to stderr). The idea is that the user will retry this utility with the correct transfer length. NOTES
If a defective block is found and its contents, if any, has been retrieved then "sg_reassign" could be used to map out the defective block. Associated with such an action the number of elements in the "grown" defect list could be monitored (with "sg_reassign --grown") as the disk could be nearing the end of its useful lifetime. Various numeric arguments (e.g. LBA) may include multiplicative suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" section in the sg3_utils(8) man page. As a data point, Fujitsu uses a 54 byte ECC (per block) which is capable of correcting up to a single burst error or 216 bits "on the fly". [Information obtained from MAV20xxrc product manual.] EXIT STATUS
The exit status of sg_read_long is 0 when it is successful. Otherwise see the sg3_utils(8) man page. AUTHORS
Written by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2004-2010 Douglas Gilbert This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_reassign, sg_write_long, sg_dd sg3_utils-1.30 April 2010 SG_READ_LONG(8)
Man Page