| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [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 | ***   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 __LINUX_JFFS2_H__ | 
|  | 20 | #define __LINUX_JFFS2_H__ | 
|  | 21 | #include <linux/types.h> | 
|  | 22 | #include <linux/magic.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define JFFS2_OLD_MAGIC_BITMASK 0x1984 | 
|  | 24 | #define JFFS2_MAGIC_BITMASK 0x1985 | 
|  | 25 | #define KSAMTIB_CIGAM_2SFFJ 0x8519 | 
|  | 26 | #define JFFS2_EMPTY_BITMASK 0xffff | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define JFFS2_DIRTY_BITMASK 0x0000 | 
|  | 28 | #define JFFS2_SUM_MAGIC 0x02851885 | 
|  | 29 | #define JFFS2_MAX_NAME_LEN 254 | 
|  | 30 | #define JFFS2_MIN_DATA_LEN 128 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define JFFS2_COMPR_NONE 0x00 | 
|  | 32 | #define JFFS2_COMPR_ZERO 0x01 | 
|  | 33 | #define JFFS2_COMPR_RTIME 0x02 | 
|  | 34 | #define JFFS2_COMPR_RUBINMIPS 0x03 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define JFFS2_COMPR_COPY 0x04 | 
|  | 36 | #define JFFS2_COMPR_DYNRUBIN 0x05 | 
|  | 37 | #define JFFS2_COMPR_ZLIB 0x06 | 
|  | 38 | #define JFFS2_COMPR_LZO 0x07 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define JFFS2_COMPAT_MASK 0xc000 | 
|  | 40 | #define JFFS2_NODE_ACCURATE 0x2000 | 
|  | 41 | #define JFFS2_FEATURE_INCOMPAT 0xc000 | 
|  | 42 | #define JFFS2_FEATURE_ROCOMPAT 0x8000 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000 | 
|  | 44 | #define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000 | 
|  | 45 | #define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1) | 
|  | 46 | #define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 
|  | 48 | #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) | 
|  | 49 | #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) | 
|  | 50 | #define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9) | 
|  | 52 | #define JFFS2_XPREFIX_USER 1 | 
|  | 53 | #define JFFS2_XPREFIX_SECURITY 2 | 
|  | 54 | #define JFFS2_XPREFIX_ACL_ACCESS 3 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define JFFS2_XPREFIX_ACL_DEFAULT 4 | 
|  | 56 | #define JFFS2_XPREFIX_TRUSTED 5 | 
|  | 57 | #define JFFS2_ACL_VERSION 0x0001 | 
|  | 58 | #define JFFS2_INO_FLAG_PREREAD 1 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define JFFS2_INO_FLAG_USERCOMPR 2 | 
|  | 60 | typedef struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | __u32 v32; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 62 | } __attribute__((packed)) jint32_t; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | typedef struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | __u32 m; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | } __attribute__((packed)) jmode_t; | 
|  | 66 | typedef struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | __u16 v16; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | } __attribute__((packed)) jint16_t; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 69 | struct jffs2_unknown_node { | 
|  | 70 | jint16_t magic; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | jint16_t nodetype; | 
|  | 72 | jint32_t totlen; | 
|  | 73 | jint32_t hdr_crc; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 74 | }; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | struct jffs2_raw_dirent { | 
|  | 76 | jint16_t magic; | 
|  | 77 | jint16_t nodetype; | 
|  | 78 | jint32_t totlen; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | jint32_t hdr_crc; | 
|  | 80 | jint32_t pino; | 
|  | 81 | jint32_t version; | 
|  | 82 | jint32_t ino; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | jint32_t mctime; | 
|  | 84 | __u8 nsize; | 
|  | 85 | __u8 type; | 
|  | 86 | __u8 unused[2]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | jint32_t node_crc; | 
|  | 88 | jint32_t name_crc; | 
|  | 89 | __u8 name[0]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 90 | }; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | struct jffs2_raw_inode { | 
|  | 92 | jint16_t magic; | 
|  | 93 | jint16_t nodetype; | 
|  | 94 | jint32_t totlen; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | jint32_t hdr_crc; | 
|  | 96 | jint32_t ino; | 
|  | 97 | jint32_t version; | 
|  | 98 | jmode_t mode; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | jint16_t uid; | 
|  | 100 | jint16_t gid; | 
|  | 101 | jint32_t isize; | 
|  | 102 | jint32_t atime; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 103 | jint32_t mtime; | 
|  | 104 | jint32_t ctime; | 
|  | 105 | jint32_t offset; | 
|  | 106 | jint32_t csize; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | jint32_t dsize; | 
|  | 108 | __u8 compr; | 
|  | 109 | __u8 usercompr; | 
|  | 110 | jint16_t flags; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 | jint32_t data_crc; | 
|  | 112 | jint32_t node_crc; | 
|  | 113 | __u8 data[0]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 114 | }; | 
|  | 115 | struct jffs2_raw_xattr { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 116 | jint16_t magic; | 
|  | 117 | jint16_t nodetype; | 
|  | 118 | jint32_t totlen; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | jint32_t hdr_crc; | 
|  | 120 | jint32_t xid; | 
|  | 121 | jint32_t version; | 
|  | 122 | __u8 xprefix; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 123 | __u8 name_len; | 
|  | 124 | jint16_t value_len; | 
|  | 125 | jint32_t data_crc; | 
|  | 126 | jint32_t node_crc; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | __u8 data[0]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 128 | } __attribute__((packed)); | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 129 | struct jffs2_raw_xref { | 
|  | 130 | jint16_t magic; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 | jint16_t nodetype; | 
|  | 132 | jint32_t totlen; | 
|  | 133 | jint32_t hdr_crc; | 
|  | 134 | jint32_t ino; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 | jint32_t xid; | 
|  | 136 | jint32_t xseqno; | 
|  | 137 | jint32_t node_crc; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 138 | } __attribute__((packed)); | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 | struct jffs2_raw_summary { | 
|  | 140 | jint16_t magic; | 
|  | 141 | jint16_t nodetype; | 
|  | 142 | jint32_t totlen; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | jint32_t hdr_crc; | 
|  | 144 | jint32_t sum_num; | 
|  | 145 | jint32_t cln_mkr; | 
|  | 146 | jint32_t padded; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | jint32_t sum_crc; | 
|  | 148 | jint32_t node_crc; | 
|  | 149 | jint32_t sum[0]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 150 | }; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 151 | union jffs2_node_union { | 
|  | 152 | struct jffs2_raw_inode i; | 
|  | 153 | struct jffs2_raw_dirent d; | 
|  | 154 | struct jffs2_raw_xattr x; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 155 | struct jffs2_raw_xref r; | 
|  | 156 | struct jffs2_raw_summary s; | 
|  | 157 | struct jffs2_unknown_node u; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 158 | }; | 
|  | 159 | union jffs2_device_node { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 160 | jint16_t old_id; | 
|  | 161 | jint32_t new_id; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 162 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 163 | #endif |