1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef __YNANDIF_H__
18#define __YNANDIF_H__
19
20#include "yaffs_guts.h"
21
22struct ynandif_Geometry {
23 unsigned start_block;
24 unsigned end_block;
25 unsigned dataSize;
26 unsigned spareSize;
27 unsigned pagesPerBlock;
28 unsigned hasECC;
29 unsigned inband_tags;
30 unsigned useYaffs2;
31
32 int (*initialise)(struct yaffs_dev *dev);
33 int (*deinitialise)(struct yaffs_dev *dev);
34
35 int (*readChunk) (struct yaffs_dev *dev,
36 unsigned pageId,
37 unsigned char *data,
38 unsigned dataLength,
39 unsigned char *spare,
40 unsigned spareLength,
41 int *eccStatus);
42
43
44 int (*writeChunk)(struct yaffs_dev *dev,
45 unsigned pageId,
46 const unsigned char *data,
47 unsigned dataLength,
48 const unsigned char *spare,
49 unsigned spareLength);
50
51 int (*eraseBlock)(struct yaffs_dev *dev, unsigned blockId);
52
53 int (*checkBlockOk)(struct yaffs_dev *dev, unsigned blockId);
54 int (*markBlockBad)(struct yaffs_dev *dev, unsigned blockId);
55
56 void *privateData;
57
58};
59
60struct yaffs_dev *
61 yaffs_add_dev_from_geometry(const YCHAR *name,
62 const struct ynandif_Geometry *geometry);
63
64
65#endif
66