百问网Linux技术区Linux系统开发 请教nandflash驱动中的一个结构体参数含义

1  /  1  页   1 跳转 查看:277

请教nandflash驱动中的一个结构体参数含义

请教nandflash驱动中的一个结构体参数含义

/**
* struct nand_ecc_ctrl - Control structure for ecc
* @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
* @prepad: padding information for syndrome based ecc generators
* @postpad: padding information for syndrome based ecc generators
* @layout: ECC layout control struct pointer
* @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
* @write_page: function to write a page according to the ecc generator requirements
* @read_oob: function to read chip OOB data
* @write_oob: function to write chip OOB data
*/
struct nand_ecc_ctrl {
nand_ecc_modes_t mode;
int  steps;
int  size;
int  bytes;
int  total;
int  prepad;
int  postpad;
struct nand_ecclayout *layout;
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);
void  (*write_page_raw)(struct mtd_info *mtd,
        struct nand_chip *chip,
        const uint8_t *buf);
int  (*read_page)(struct mtd_info *mtd,
          struct nand_chip *chip,
          uint8_t *buf);
void  (*write_page)(struct mtd_info *mtd,
          struct nand_chip *chip,
          const uint8_t *buf);
int  (*read_oob)(struct mtd_info *mtd,
        struct nand_chip *chip,
        int page,
        int sndcmd);
int  (*write_oob)(struct mtd_info *mtd,
          struct nand_chip *chip,
          int page);
};


请教一下结构体struct nand_ecc_ctrl 中的 size: data bytes per ecc step,具体含义是什么呢?我不太理解。nandflash相关内容我也看过。希望有经验的高手给我解释一下。。。
 

回复:请教nandflash驱动中的一个结构体参数含义

我猜测可能是这样:
计算ECC时,一般是以“256字节”为单位的,这个size的意思从字面上看似乎就是256
 
1  /  1  页   1 跳转

地址:广东省深圳市南山区南山大道3003号久商大厦C-1406;邮编:518052;电话:0755-86200561

粤ICP备09041549号, 版权所有 百问网   Sitemap

Powered by Discuz!NT 2.0.1214    Copyright © 2001-2010 Comsenz Inc.
Processed in 0.03125 second(s) , 3 queries.
返顶部