[Yaffs] yaffs2 oob offset problem

Ian McDonnell ian at brightstareng.com
Wed Aug 3 15:40:25 BST 2005


On Wednesday 03 August 2005 07:00, Artis Kugevics 
artis at mikrotik.com wrote:
> I wonder, at what oob offset yaffs2 out-of-band data is placed
> for curent yaffs2 users? This offset is taken from default
> nand_oobinfo structure in MTD. If not overriden, then it is
> nand_oob_64 in mtd/nand/nand_base.c, which sets offset to 2
> (oobfree = {{2,38}}).
>
> I personally, had to modify yaffs2 source, for it to work with
> such setting. Modification is necessarry, because that
> mtd->read_oob() call returns oob data from offset 0 (and not
> from offset 2, as specified by nand_oobinfo structure). My
> patch is attached for reference.

Attached is the hacking I did to get this to work for me.
I have yaffs1 call mtd->read_oob normally. Then in yaffs_mtdif2.c 
I hack the call to mtd->read_oob to pass a null 'retlen' 
pointer.

Then in MTD nand_base.c, I hacked the nand_read_oob function to 
not 'do-the-wrong-thing' when it is called with a null retlen. 
So I'm overloading 'retlen' and using it as a flag --- yes this 
is a hack, but so is MTD ;)

I don't understand why this isn't broken for everyone?
I don't know how yaffs2 ever works with the stock MTD code.

See attached files/functions.

-imcd

-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaffs_mtdif2.c
Type: text/x-csrc
Size: 4848 bytes
Desc: not available
Url : http://lists.aleph1.co.uk/pipermail/yaffs/attachments/20050803/694017e1/yaffs_mtdif2.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mtd_read_oob.c
Type: text/x-csrc
Size: 3118 bytes
Desc: not available
Url : http://lists.aleph1.co.uk/pipermail/yaffs/attachments/20050803/694017e1/mtd_read_oob.c


More information about the yaffs mailing list