RTEMS 6.1-rc1
rawnand.h
1#ifndef __LINUX_MTD_RAWNAND_H__
2#define __LINUX_MTD_RAWNAND_H__
3
4#define mtd_read_oob(mtd_sp, offset, ops) ({ \
5 struct jffs2_sb_info *sb_info = RTEMS_CONTAINER_OF(&(mtd_sp), struct jffs2_sb_info, mtd); \
6 int sc = jffs2_flash_oob_read(sb_info, offset, (ops)->oobbuf, (ops)->ooblen); \
7 if (sc) { \
8 sc = -EIO; \
9 } else { \
10 (ops)->oobretlen = (ops)->ooblen; \
11 } \
12 sc; \
13})
14#define mtd_write_oob(mtd_sp, offset, ops) ({ \
15 struct jffs2_sb_info *sb_info = RTEMS_CONTAINER_OF(&(mtd_sp), struct jffs2_sb_info, mtd); \
16 int sc = jffs2_flash_oob_write(sb_info, offset, (ops)->oobbuf, (ops)->ooblen); \
17 if (sc != RTEMS_SUCCESSFUL) { \
18 sc = -EIO; \
19 } else { \
20 (ops)->oobretlen = (ops)->ooblen; \
21 } \
22 sc; \
23})
24#define MTD_OPS_AUTO_OOB 1
25
26#endif /* __LINUX_MTD_RAWNAND_H__ */