2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License version 2.1 as
11 * published by the Free Software Foundation.
13 * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
20 #include "yaffs_guts.h"
28 unsigned pagesPerBlock;
33 int (*initialise)(yaffs_Device *dev);
34 int (*deinitialise)(yaffs_Device *dev);
36 int (*readChunk) (yaffs_Device *dev,
38 unsigned char *data, unsigned dataLength,
39 unsigned char *spare, unsigned spareLength,
41 // ECC status is set to 0 for OK, 1 for fixed, -1 for unfixed.
43 int (*writeChunk)(yaffs_Device *dev,
45 const unsigned char *data, unsigned dataLength,
46 const unsigned char *spare, unsigned spareLength);
48 int (*eraseBlock)(yaffs_Device *dev, unsigned blockId);
50 int (*checkBlockOk)(yaffs_Device *dev, unsigned blockId);
51 int (*markBlockBad)(yaffs_Device *dev, unsigned blockId);
57 struct yaffs_DeviceStruct *
58 yaffs_AddDeviceFromGeometry(const YCHAR *name,
59 const ynandif_Geometry *geometry);
63 int ynandif_WriteChunkWithTagsToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_ExtendedTags *tags);
64 int ynandif_ReadChunkWithTagsFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_ExtendedTags *tags);
65 int ynandif_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);
66 int ynandif_InitialiseNAND(yaffs_Device *dev);
67 int ynandif_MarkNANDBlockBad(yaffs_Device *dev,int blockNumber);
68 int ynandif_QueryNANDBlock(yaffs_Device *dev, int blockNo, yaffs_BlockState *state, __u32 *sequenceNumber);
69 int ynandif_GetGeometry(yaffs_Device *dev, ynandif_Geometry *geometry);