Files
rtems/cpukit/libfs/src/jffs2/include/linux/mtd/rawnand.h
Kinsey Moore 5db68a5859 cpukit/jffs2: Add support for NAND under JFFS2
This adds write buffer and bad block support required for JFFS2
operation on NAND devices. This also adds the minor modifications
necessary for RTEMS support in the Linux header stubs and in wbuf.c.
Memory and NOR backed applications should experience no difference in
operation since they do not expose the callbacks required for write
buffer support.
2023-03-15 13:29:12 -05:00

27 lines
800 B
C

#ifndef __LINUX_MTD_RAWNAND_H__
#define __LINUX_MTD_RAWNAND_H__
#define mtd_read_oob(mtd_sp, offset, ops) ({ \
struct jffs2_sb_info *sb_info = RTEMS_CONTAINER_OF(&(mtd_sp), struct jffs2_sb_info, mtd); \
int sc = jffs2_flash_oob_read(sb_info, offset, (ops)->oobbuf, (ops)->ooblen); \
if (sc) { \
sc = -EIO; \
} else { \
(ops)->oobretlen = (ops)->ooblen; \
} \
sc; \
})
#define mtd_write_oob(mtd_sp, offset, ops) ({ \
struct jffs2_sb_info *sb_info = RTEMS_CONTAINER_OF(&(mtd_sp), struct jffs2_sb_info, mtd); \
int sc = jffs2_flash_oob_write(sb_info, offset, (ops)->oobbuf, (ops)->ooblen); \
if (sc != RTEMS_SUCCESSFUL) { \
sc = -EIO; \
} else { \
(ops)->oobretlen = (ops)->ooblen; \
} \
sc; \
})
#define MTD_OPS_AUTO_OOB 1
#endif /* __LINUX_MTD_RAWNAND_H__ */