On Wednesday 03 August 2005 07:00, Artis Kugevics artis@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