The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef __MTD_TRANS_H__ |
| 13 | #define __MTD_TRANS_H__ |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 14 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | #include <linux/mutex.h> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 16 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 17 | struct hd_geometry; |
| 18 | struct mtd_info; |
| 19 | struct mtd_blktrans_ops; |
| 20 | struct file; |
| 21 | struct inode; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 22 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 23 | struct mtd_blktrans_dev { |
| 24 | struct mtd_blktrans_ops *tr; |
| 25 | struct list_head list; |
| 26 | struct mtd_info *mtd; |
| 27 | struct mutex lock; |
| 28 | int devnum; |
| 29 | int blksize; |
| 30 | unsigned long size; |
| 31 | int readonly; |
| 32 | void *blkcore_priv; |
| 33 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 34 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 35 | struct blkcore_priv; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 36 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | struct mtd_blktrans_ops { |
| 38 | char *name; |
| 39 | int major; |
| 40 | int part_bits; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 41 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 42 | int (*readsect)(struct mtd_blktrans_dev *dev, |
| 43 | unsigned long block, char *buffer); |
| 44 | int (*writesect)(struct mtd_blktrans_dev *dev, |
| 45 | unsigned long block, char *buffer); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 46 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); |
| 48 | int (*flush)(struct mtd_blktrans_dev *dev); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 49 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 50 | int (*open)(struct mtd_blktrans_dev *dev); |
| 51 | int (*release)(struct mtd_blktrans_dev *dev); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 52 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 53 | void (*add_mtd)(struct mtd_blktrans_ops *tr, struct mtd_info *mtd); |
| 54 | void (*remove_dev)(struct mtd_blktrans_dev *dev); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 55 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | struct list_head devs; |
| 57 | struct list_head list; |
| 58 | struct module *owner; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 59 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 60 | struct mtd_blkcore_priv *blkcore_priv; |
| 61 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 62 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 63 | #endif |