chiark / gitweb /
udev: remove seqnum API and all assumptions about seqnums
[elogind.git] / src / udev / mtd_probe / mtd_probe.h
1 /*
2  * Copyright (C) 2010 - Maxim Levitsky
3  *
4  * mtd_probe is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * mtd_probe is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with mtd_probe; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA  02110-1301  USA
18  */
19
20 #include <mtd/mtd-user.h>
21
22 /* Full oob structure as written on the flash */
23 struct sm_oob {
24         uint32_t reserved;
25         uint8_t data_status;
26         uint8_t block_status;
27         uint8_t lba_copy1[2];
28         uint8_t ecc2[3];
29         uint8_t lba_copy2[2];
30         uint8_t ecc1[3];
31 } __attribute__((packed));
32
33
34 /* one sector is always 512 bytes, but it can consist of two nand pages */
35 #define SM_SECTOR_SIZE                512
36
37 /* oob area is also 16 bytes, but might be from two pages */
38 #define SM_OOB_SIZE                16
39
40 /* This is maximum zone size, and all devices that have more that one zone
41    have this size */
42 #define SM_MAX_ZONE_SIZE         1024
43
44 /* support for small page nand */
45 #define SM_SMALL_PAGE                 256
46 #define SM_SMALL_OOB_SIZE        8
47
48
49 void probe_smart_media(int mtd_fd, mtd_info_t *info);