blob: 99ac366f17ffcca6ea8e96a4b25e6b56670fcb43 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __MTD_NFTL_USER_H__
20#define __MTD_NFTL_USER_H__
21#include <linux/types.h>
22struct nftl_bci {
Tao Baod7db5942015-01-28 10:07:51 -080023 unsigned char ECCSig[6];
24 __u8 Status;
25 __u8 Status1;
26} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070027struct nftl_uci0 {
Tao Baod7db5942015-01-28 10:07:51 -080028 __u16 VirtUnitNum;
29 __u16 ReplUnitNum;
30 __u16 SpareVirtUnitNum;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u16 SpareReplUnitNum;
Ben Cheng655a7c02013-10-16 16:09:24 -070032} __attribute__((packed));
33struct nftl_uci1 {
Tao Baod7db5942015-01-28 10:07:51 -080034 __u32 WearInfo;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u16 EraseMark;
36 __u16 EraseMark1;
Ben Cheng655a7c02013-10-16 16:09:24 -070037} __attribute__((packed));
38struct nftl_uci2 {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u16 FoldMark;
40 __u16 FoldMark1;
41 __u32 unused;
Ben Cheng655a7c02013-10-16 16:09:24 -070042} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070043union nftl_uci {
Tao Baod7db5942015-01-28 10:07:51 -080044 struct nftl_uci0 a;
45 struct nftl_uci1 b;
46 struct nftl_uci2 c;
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48struct nftl_oob {
Tao Baod7db5942015-01-28 10:07:51 -080049 struct nftl_bci b;
50 union nftl_uci u;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52struct NFTLMediaHeader {
Tao Baod7db5942015-01-28 10:07:51 -080053 char DataOrgID[6];
54 __u16 NumEraseUnits;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u16 FirstPhysicalEUN;
56 __u32 FormattedSize;
57 unsigned char UnitSizeFactor;
Ben Cheng655a7c02013-10-16 16:09:24 -070058} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define MAX_ERASE_ZONES (8192 - 512)
60#define ERASE_MARK 0x3c69
61#define SECTOR_FREE 0xff
62#define SECTOR_USED 0x55
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define SECTOR_IGNORE 0x11
64#define SECTOR_DELETED 0x00
65#define FOLD_MARK_IN_PROGRESS 0x5555
66#define ZONE_GOOD 0xff
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define ZONE_BAD_ORIGINAL 0
68#define ZONE_BAD_MARKED 7
69#endif