Add first-cut Linux kernel patch-in mechanism
[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-2003 Trimble Navigaion Ltd.\r
6  *\r
7  * Created by Brad Beveridge <brad.beveridge@trimble.co.nz>\r
8  * Modified for CE 4.x by Steve Fogle <stevef@atworkcom.com>\r
9  *\r
10  * This program is free software; you can redistribute it and/or modify\r
11  * it under the terms of the GNU Lesser General Public License version 2.1 as\r
12  * published by the Free Software Foundation.\r
13  *\r
14  * This program is distributed in the hope that it will be useful, \r
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of \r
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
17  * General Public License for more details. You should have received a \r
18  * copy of the GNU General Public License along with this program; \r
19  * if not, write to the Free Software Foundation, Inc., \r
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \r
21  *\r
22  *\r
23  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.\r
24  *\r
25  * $Id: ynandif.h,v 1.2 2003-01-31 00:52:53 charles Exp $\r
26 */\r
27 \r
28 #ifndef YNANDIF_H\r
29 #define YNANDIF_H\r
30 \r
31 #include "yaffs_guts.h"\r
32 \r
33 typedef struct\r
34 {\r
35         int chunk;\r
36         unsigned char *data;\r
37         unsigned char *spare;\r
38 } ynandif_data;\r
39 \r
40 typedef enum\r
41 {\r
42         YNANDIF_WRITE = 0x59AFF,\r
43         YNANDIF_READ,\r
44         YNANDIF_ERASE,\r
45         YNANDIF_INIT,\r
46         YNANDIF_GETSIZE,\r
47         //slf021105a begin\r
48         YNANDIF_GETPARTITIONS,\r
49         //slf021105a end\r
50 } ynandif_commands;\r
51 \r
52 //slf021105a begin\r
53 typedef struct\r
54 {\r
55         int startBlock;\r
56         int endBlock;\r
57         unsigned short volName[12];\r
58 } ynandif_partition;\r
59 //slf021105a end\r
60 \r
61 /*\r
62 *       Functions that need to be provided for YAFFS\r
63 */\r
64 int ynandif_WriteChunkToNAND(yaffs_Device *dev, int chunkInNAND,const __u8 *data, yaffs_Spare *spare);\r
65 int ynandif_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);\r
66 int ynandif_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);\r
67 int ynandif_InitialiseNAND(yaffs_Device *dev);\r
68 //slf021220a begin Cleanup block driver interface\r
69 void ynandif_DeinitialiseNAND(yaffs_Device *dev);\r
70 //slf021220a end Cleanup block driver interface\r
71 \r
72 /*\r
73 *       Additional optional functions\r
74 */\r
75 \r
76 int ynandif_EraseAllBlocks(yaffs_Device *dev);\r
77 //slf021220a begin Cleanup block driver interface\r
78 //int ynandif_GetChipSize(unsigned char chipNumber);\r
79 int ynandif_GetChipSize(yaffs_Device *dev, unsigned char chipNumber);\r
80 //slf021220a end Cleanup block driver interface\r
81 \r
82 #endif // end of file