ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / mtd / mtdblock.h
1 /*
2  * drivers/mtd/mtdblock.h
3  *
4  * common defines for mtdblock-core and mtdblock-2x
5  *
6  * $Id: mtdblock.h,v 1.1 2002/11/27 10:33:37 gleixner Exp $
7  *
8  */
9
10 #ifndef __MTD_MTDBLOCK_H__
11 #define __MTD_MTDBLOCK_H__
12
13 #define MAJOR_NR MTD_BLOCK_MAJOR
14 #define DEVICE_NAME "mtdblock"
15
16 struct mtdblk_dev {
17         struct mtd_info *mtd; /* Locked */
18         int count;
19         struct semaphore cache_sem;
20         unsigned char *cache_data;
21         unsigned long cache_offset;
22         unsigned int cache_size;
23         enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state;
24 }; 
25
26 extern int write_cached_data (struct mtdblk_dev *mtdblk);
27 extern int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos, 
28                             int len, const char *buf);
29 extern int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos, 
30                            int len, char *buf);
31
32 extern void __exit cleanup_mtdblock(void);
33 extern int __init init_mtdblock(void);
34
35 #endif