yaffs Changes to direct tests
[yaffs2.git] / direct / yaffs_nandif.h
index 1a17262..cf4562c 100644 (file)
 
 #include "yaffs_guts.h"
 
+
 typedef struct {
-               unsigned startBlock;
-               unsigned endBlock;
-               unsigned dataSize;              // Number of data bytes per page
-               unsigned spareSize;             // Number of spare bytes per chunk
-               unsigned pagesPerBlock;
-               unsigned hasECC;
-               unsigned inbandTags;    // Use inband tags on this device
-               unsigned useYaffs2;
+       unsigned startBlock;
+       unsigned endBlock;
+       unsigned dataSize;
+       unsigned spareSize;
+       unsigned pagesPerBlock;
+       unsigned hasECC;
+       unsigned inbandTags;
+       unsigned useYaffs2;
+
+       int (*initialise)(yaffs_Device *dev);
+       int (*deinitialise)(yaffs_Device *dev);
+
+       int (*readChunk) (yaffs_Device *dev,
+                                         unsigned pageId, 
+                                         unsigned char *data, unsigned dataLength,
+                                         unsigned char *spare, unsigned spareLength,
+                                         int *eccStatus);
+// ECC status is set to 0 for OK, 1 for fixed, -1 for unfixed.
+
+       int (*writeChunk)(yaffs_Device *dev,
+                                         unsigned pageId, 
+                                         const unsigned char *data, unsigned dataLength,
+                                         const unsigned char *spare, unsigned spareLength);
+
+       int (*eraseBlock)(yaffs_Device *dev, unsigned blockId);
+
+       int (*checkBlockOk)(yaffs_Device *dev, unsigned blockId);
+       int (*markBlockBad)(yaffs_Device *dev, unsigned blockId);
+
+       void *privateData;
+
 } ynandif_Geometry;
 
+struct yaffs_DeviceStruct * 
+       yaffs_AddDeviceFromGeometry(const YCHAR *name,
+                                       const ynandif_Geometry *geometry);
+
+#if 0
+
 int ynandif_WriteChunkWithTagsToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_ExtendedTags *tags);
 int ynandif_ReadChunkWithTagsFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_ExtendedTags *tags);
 int ynandif_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);
@@ -38,3 +68,6 @@ int ynandif_MarkNANDBlockBad(yaffs_Device *dev,int blockNumber);
 int ynandif_QueryNANDBlock(yaffs_Device *dev, int blockNo, yaffs_BlockState *state, __u32 *sequenceNumber);
 int ynandif_GetGeometry(yaffs_Device *dev, ynandif_Geometry *geometry);
 #endif
+
+
+#endif