Name

nand_prepare_oobbuf — [GENERIC] Prepare the out of band buffer

Synopsis

u_char * nand_prepare_oobbuf (struct mtd_info *  mtd,
 u_char *  fsbuf,
 struct nand_oobinfo *  oobsel,
 int  autoplace,
 int  numpages);

Arguments

mtd

MTD device structure

fsbuf

buffer given by fs driver

oobsel

out of band selection structre

autoplace

1 = place given buffer into the oob bytes

numpages

number of pages to prepare

Return

1. Filesystem buffer available and autoplacement is off, return filesystem buffer 2. No filesystem buffer or autoplace is off, return internal buffer 3. Filesystem buffer is given and autoplace selected put data from fs buffer into internal buffer and retrun internal buffer

Note

The internal buffer is filled with 0xff. This must be done only once, when no autoplacement happens Autoplacement sets the buffer dirty flag, which forces the 0xff fill before using the buffer again.