Hopefully the last iteration on this!
The handling of out of band data on NAND was accompanied by tons of fruitless
discussions and halfarsed patches to make it work for a particular
problem. Sufficiently annoyed by I all those "I know it better" mails and the
resonable amount of discarded "it solves my problem" patches, I finally decided
to go for the big rework. After removing the _ecc variants of mtd read/write
functions the solution to satisfy the various requirements was to refactor the
read/write _oob functions in mtd.
The major change is that read/write_oob now takes a pointer to an operation
descriptor structure "struct mtd_oob_ops".instead of having a function with at
least seven arguments.
read/write_oob which should probably renamed to a more descriptive name, can do
the following tasks:
- read/write out of band data
- read/write data content and out of band data
- read/write raw data content and out of band data (ecc disabled)
struct mtd_oob_ops has a mode field, which determines the oob handling mode.
Aside of the MTD_OOB_RAW mode, which is intended to be especially for
diagnostic purposes and some internal functions e.g. bad block table creation,
the other two modes are for mtd clients:
MTD_OOB_PLACE puts/gets the given oob data exactly to/from the place which is
described by the ooboffs and ooblen fields of the mtd_oob_ops strcuture. It's
up to the caller to make sure that the byte positions are not used by the ECC
placement algorithms.
MTD_OOB_AUTO puts/gets the given oob data automaticaly to/from the places in
the out of band area which are described by the oobfree tuples in the ecclayout
data structre which is associated to the devicee.
The decision whether data plus oob or oob only handling is done depends on the
setting of the datbuf member of the data structure. When datbuf == NULL then
the internal read/write_oob functions are selected, otherwise the read/write
data routines are invoked.
Tested on a few platforms with all variants. Please be aware of possible
regressions for your particular device / application scenario
Disclaimer: Any whining will be ignored from those who just contributed "hot
air blurb" and never sat down to tackle the underlying problem of the mess in
the NAND driver grown over time and the big chunk of work to fix up the
existing users. The problem was not the holiness of the existing MTD
interfaces. The problems was the lack of time to go for the big overhaul. It's
easy to add more mess to the existing one, but it takes alot of effort to go
for a real solution.
分享到:
相关推荐
rework 中 英 双语 Jason Fried
rework(ruby必读)rework 重构
rework 中文版rework
rework英文版.pdf 37signals.com
Rework 是 CSS 预处理在 Node.js 上的插件框架。所有的 CSS 操作均建立在 css 环境上,你可以创建自己的属性、内联图像等功能。示例:var rework = require('rework'); var pluginA = require('pluginA'); ...
Rework中文版.pdf 37signals http://37signals.com/
每一个有理想的程序员都应该读的一本书-《rework》 每一个程序员都有改变世界的梦想,他们不甘平凡,他们想要make a difference,他们想要创立世界上最cool的公司,那具体该如何做呢?风靡全球的《rework》将告诉...
BGA rework process 主要说明BGA 的流程
Rework 重塑工作英文版 37signals
重来Rework(中文word版)
Rework-Pure-Grids 是能够通过 Rework 为 Pure Grids 生成自定义单位(尺寸)的工具。为 Pure's defaut Grids 创建自定义媒体查询的单位:var rework = require('rework'), pureGrids = require('rework-...
前端开源库-rework-npm重做NPM,使用重做从NPM模块导入CSS
Windows 8 represents Microsoft’s desire to break out of the traditional desktop computing market and make an impact in the mobile world, which has been dominated by Android devices and, of course, ...
懂的人自然都知道,37signals公司出品,重来英文原版。
GOMake a dent in the universeScratch your own itchStart making somethingNo time is no excuseDraw a line in the sandMission statement impossibleOutside money is Plan ZYou need less than you thinkStart ...
很实用的一本书,适合互联网创业的人阅读,非常棒,全中文,很清晰
Rework中文版1
Principles for the detection and handling of errors [72, 76] i.e., exceptions Identifying commonalities in “families of systems” [76] To provide coarse-grained, stable common structures Recognition ...
用一个词形容《Rework》这本书就是“短小精悍”,只有130页,你只需要3-4个小时就可以读完,而且书中每一个观点都配了一张图,看起来很轻松,一点都不乏味。我们说“字如其人”,同样的道理,这本书很鲜明反映了37...