MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / mtd / mtdblock.h
blobf4c77fe41f92e6bc5f9d7365a6761597aaac669c
1 /*
2 * drivers/mtd/mtdblock.h
4 * common defines for mtdblock-core and mtdblock-2x
6 * $Id: mtdblock.h,v 1.1 2002/11/27 10:33:37 gleixner Exp $
8 */
10 #ifndef __MTD_MTDBLOCK_H__
11 #define __MTD_MTDBLOCK_H__
13 #define MAJOR_NR MTD_BLOCK_MAJOR
14 #define DEVICE_NAME "mtdblock"
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 };
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);
32 extern void __exit cleanup_mtdblock(void);
33 extern int __init init_mtdblock(void);
35 #endif