diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/mtd/blktrans.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/mtd/blktrans.h')
-rw-r--r-- | include/linux/mtd/blktrans.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h new file mode 100644 index 000000000000..4ebc2e5a16e2 --- /dev/null +++ b/include/linux/mtd/blktrans.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * $Id: blktrans.h,v 1.5 2003/06/23 12:00:08 dwmw2 Exp $ | ||
3 | * | ||
4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> | ||
5 | * | ||
6 | * Interface to Linux block layer for MTD 'translation layers'. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef __MTD_TRANS_H__ | ||
11 | #define __MTD_TRANS_H__ | ||
12 | |||
13 | #include <asm/semaphore.h> | ||
14 | |||
15 | struct hd_geometry; | ||
16 | struct mtd_info; | ||
17 | struct mtd_blktrans_ops; | ||
18 | struct file; | ||
19 | struct inode; | ||
20 | |||
21 | struct mtd_blktrans_dev { | ||
22 | struct mtd_blktrans_ops *tr; | ||
23 | struct list_head list; | ||
24 | struct mtd_info *mtd; | ||
25 | struct semaphore sem; | ||
26 | int devnum; | ||
27 | int blksize; | ||
28 | unsigned long size; | ||
29 | int readonly; | ||
30 | void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */ | ||
31 | }; | ||
32 | |||
33 | struct blkcore_priv; /* Differs for 2.4 and 2.5 kernels; private */ | ||
34 | |||
35 | struct mtd_blktrans_ops { | ||
36 | char *name; | ||
37 | int major; | ||
38 | int part_bits; | ||
39 | |||
40 | /* Access functions */ | ||
41 | int (*readsect)(struct mtd_blktrans_dev *dev, | ||
42 | unsigned long block, char *buffer); | ||
43 | int (*writesect)(struct mtd_blktrans_dev *dev, | ||
44 | unsigned long block, char *buffer); | ||
45 | |||
46 | /* Block layer ioctls */ | ||
47 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); | ||
48 | int (*flush)(struct mtd_blktrans_dev *dev); | ||
49 | |||
50 | /* Called with mtd_table_mutex held; no race with add/remove */ | ||
51 | int (*open)(struct mtd_blktrans_dev *dev); | ||
52 | int (*release)(struct mtd_blktrans_dev *dev); | ||
53 | |||
54 | /* Called on {de,}registration and on subsequent addition/removal | ||
55 | of devices, with mtd_table_mutex held. */ | ||
56 | void (*add_mtd)(struct mtd_blktrans_ops *tr, struct mtd_info *mtd); | ||
57 | void (*remove_dev)(struct mtd_blktrans_dev *dev); | ||
58 | |||
59 | struct list_head devs; | ||
60 | struct list_head list; | ||
61 | struct module *owner; | ||
62 | |||
63 | struct mtd_blkcore_priv *blkcore_priv; | ||
64 | }; | ||
65 | |||
66 | extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); | ||
67 | extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); | ||
68 | extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | ||
69 | extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); | ||
70 | |||
71 | |||
72 | #endif /* __MTD_TRANS_H__ */ | ||