*** empty log message ***
[yaffs/.git] / wince / ynandif.h
1 /*\r
2  * YAFFS: Yet another FFS. A NAND-flash specific file system. \r
3  * ynandif.h: Nand interface routines for WinCE version of YAFFS.\r
4  *\r
5  * Copyright (C) 2002 Trimble Navigaion Ltd.\r
6  *\r
7  * Created by Brad Beveridge <brad.beveridge@trimble.co.nz>\r
8  *\r
9  * This program is free software; you can redistribute it and/or modify\r
10  * it under the terms of the GNU Lesser General Public License version 2.1 as\r
11  * published by the Free Software Foundation.\r
12  *\r
13  * This program is distributed in the hope that it will be useful, \r
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of \r
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
16  * General Public License for more details. You should have received a \r
17  * copy of the GNU General Public License along with this program; \r
18  * if not, write to the Free Software Foundation, Inc., \r
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \r
20  *\r
21  *\r
22  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.\r
23  *\r
24  * $Id: ynandif.h,v 1.1 2002-11-08 07:30:00 charles Exp $\r
25  */\r
26 \r
27 #ifndef YNANDIF_H\r
28 #define YNANDIF_H\r
29 \r
30 #include "yaffs_guts.h"\r
31 \r
32 typedef struct\r
33 {\r
34         int chunk;\r
35         unsigned char *data;\r
36         unsigned char *spare;\r
37 } ynandif_data;\r
38 \r
39 typedef enum\r
40 {\r
41         YNANDIF_WRITE = 0x59AFF,\r
42         YNANDIF_READ,\r
43         YNANDIF_ERASE,\r
44         YNANDIF_INIT,\r
45         YNANDIF_GETSIZE,\r
46 } ynandif_commands;\r
47 \r
48 \r
49 /*\r
50 *       Functions that need to be provided for YAFFS\r
51 */\r
52 int ynandif_WriteChunkToNAND(yaffs_Device *dev, int chunkInNAND,const __u8 *data, yaffs_Spare *spare);\r
53 int ynandif_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);\r
54 int ynandif_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);\r
55 int ynandif_InitialiseNAND(yaffs_Device *dev);\r
56 \r
57 /*\r
58 *       Additional optional functions\r
59 */\r
60 \r
61 int ynandif_EraseAllBlocks(yaffs_Device *dev);\r
62 int ynandif_GetChipSize(unsigned char chipNumber);\r
63 \r
64 #endif // end of file