Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * $Id: mtd.h,v 1.56 2004/08/09 18:46:04 dmarlin Exp $ | |
3 | * | |
4 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. | |
5 | * | |
6 | * Released under GPL | |
7 | */ | |
8 | ||
9 | #ifndef __MTD_MTD_H__ | |
10 | #define __MTD_MTD_H__ | |
11 | ||
12 | #ifndef __KERNEL__ | |
13 | #error This is a kernel header. Perhaps include mtd-user.h instead? | |
14 | #endif | |
15 | ||
16 | #include <linux/config.h> | |
17 | #include <linux/version.h> | |
18 | #include <linux/types.h> | |
19 | #include <linux/module.h> | |
20 | #include <linux/uio.h> | |
21 | ||
22 | #include <linux/mtd/compatmac.h> | |
23 | #include <mtd/mtd-abi.h> | |
24 | ||
25 | #define MTD_CHAR_MAJOR 90 | |
26 | #define MTD_BLOCK_MAJOR 31 | |
27 | #define MAX_MTD_DEVICES 16 | |
28 | ||
29 | #define MTD_ERASE_PENDING 0x01 | |
30 | #define MTD_ERASING 0x02 | |
31 | #define MTD_ERASE_SUSPEND 0x04 | |
32 | #define MTD_ERASE_DONE 0x08 | |
33 | #define MTD_ERASE_FAILED 0x10 | |
34 | ||
35 | /* If the erase fails, fail_addr might indicate exactly which block failed. If | |
36 | fail_addr = 0xffffffff, the failure was not at the device level or was not | |
37 | specific to any particular block. */ | |
38 | struct erase_info { | |
39 | struct mtd_info *mtd; | |
40 | u_int32_t addr; | |
41 | u_int32_t len; | |
42 | u_int32_t fail_addr; | |
43 | u_long time; | |
44 | u_long retries; | |
45 | u_int dev; | |
46 | u_int cell; | |
47 | void (*callback) (struct erase_info *self); | |
48 | u_long priv; | |
49 | u_char state; | |
50 | struct erase_info *next; | |
51 | }; | |
52 | ||
53 | struct mtd_erase_region_info { | |
54 | u_int32_t offset; /* At which this region starts, from the beginning of the MTD */ | |
55 | u_int32_t erasesize; /* For this region */ | |
56 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ | |
57 | }; | |
58 | ||
59 | struct mtd_info { | |
60 | u_char type; | |
61 | u_int32_t flags; | |
62 | u_int32_t size; // Total size of the MTD | |
63 | ||
64 |