aboutsummaryrefslogtreecommitdiffstats
path: root/include/mtd
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2009-02-25 18:51:41 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-26 13:14:17 -0400
commitccef7ab534347e2e1e1ef398d2ec987d37e519f3 (patch)
tree1f74e2abb5ad84725e3eb52ac3320ffda480f281 /include/mtd
parent9adfbfb611307060db54691bc7e6d53fdc12312b (diff)
make MTD headers use strict integer types
The MTD headers traditionally use stdint types rather than the kernel integer types. This converts them to do the same as all the others. Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/mtd')
-rw-r--r--include/mtd/inftl-user.h36
-rw-r--r--include/mtd/jffs2-user.h5
-rw-r--r--include/mtd/mtd-abi.h66
-rw-r--r--include/mtd/nftl-user.h32
-rw-r--r--include/mtd/ubi-user.h72
5 files changed, 109 insertions, 102 deletions
diff --git a/include/mtd/inftl-user.h b/include/mtd/inftl-user.h
index d409d489d900..8376bd1a9e01 100644
--- a/include/mtd/inftl-user.h
+++ b/include/mtd/inftl-user.h
@@ -16,33 +16,33 @@
16/* Block Control Information */ 16/* Block Control Information */
17 17
18struct inftl_bci { 18struct inftl_bci {
19 uint8_t ECCsig[6]; 19 __u8 ECCsig[6];
20 uint8_t Status; 20 __u8 Status;
21 uint8_t Status1; 21 __u8 Status1;
22} __attribute__((packed)); 22} __attribute__((packed));
23 23
24struct inftl_unithead1 { 24struct inftl_unithead1 {
25 uint16_t virtualUnitNo; 25 __u16 virtualUnitNo;
26 uint16_t prevUnitNo; 26 __u16 prevUnitNo;
27 uint8_t ANAC; 27 __u8 ANAC;
28 uint8_t NACs; 28 __u8 NACs;
29 uint8_t parityPerField; 29 __u8 parityPerField;
30 uint8_t discarded; 30 __u8 discarded;
31} __attribute__((packed)); 31} __attribute__((packed));
32 32
33struct inftl_unithead2 { 33struct inftl_unithead2 {
34 uint8_t parityPerField; 34 __u8 parityPerField;
35 uint8_t ANAC; 35 __u8 ANAC;
36 uint16_t prevUnitNo; 36 __u16 prevUnitNo;
37 uint16_t virtualUnitNo; 37 __u16 virtualUnitNo;
38 uint8_t NACs; 38 __u8 NACs;
39 uint8_t discarded; 39 __u8 discarded;
40} __attribute__((packed)); 40} __attribute__((packed));
41 41
42struct inftl_unittail { 42struct inftl_unittail {
43 uint8_t Reserved[4]; 43 __u8 Reserved[4];
44 uint16_t EraseMark; 44 __u16 EraseMark;
45 uint16_t EraseMark1; 45 __u16 EraseMark1;
46} __attribute__((packed)); 46} __attribute__((packed));
47 47
48union inftl_uci { 48union inftl_uci {
diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h
index 001685d7fa88..fa94b0eb67c1 100644
--- a/include/mtd/jffs2-user.h
+++ b/include/mtd/jffs2-user.h
@@ -7,6 +7,7 @@
7 7
8/* This file is blessed for inclusion by userspace */ 8/* This file is blessed for inclusion by userspace */
9#include <linux/jffs2.h> 9#include <linux/jffs2.h>
10#include <linux/types.h>
10#include <endian.h> 11#include <endian.h>
11#include <byteswap.h> 12#include <byteswap.h>
12 13
@@ -19,8 +20,8 @@
19 20
20extern int target_endian; 21extern int target_endian;
21 22
22#define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) 23#define t16(x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
23#define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); }) 24#define t32(x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
24 25
25#define cpu_to_je16(x) ((jint16_t){t16(x)}) 26#define cpu_to_je16(x) ((jint16_t){t16(x)})
26#define cpu_to_je32(x) ((jint32_t){t32(x)}) 27#define cpu_to_je32(x) ((jint32_t){t32(x)})
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index fb672013299c..b6595b3c68b6 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -5,14 +5,16 @@
5#ifndef __MTD_ABI_H__ 5#ifndef __MTD_ABI_H__
6#define __MTD_ABI_H__ 6#define __MTD_ABI_H__
7 7
8#include <linux/types.h>
9
8struct erase_info_user { 10struct erase_info_user {
9 uint32_t start; 11 __u32 start;
10 uint32_t length; 12 __u32 length;
11}; 13};
12 14
13struct mtd_oob_buf { 15struct mtd_oob_buf {
14 uint32_t start; 16 __u32 start;
15 uint32_t length; 17 __u32 length;
16 unsigned char __user *ptr; 18 unsigned char __user *ptr;
17}; 19};
18 20
@@ -48,30 +50,30 @@ struct mtd_oob_buf {
48#define MTD_OTP_USER 2 50#define MTD_OTP_USER 2
49 51
50struct mtd_info_user { 52struct mtd_info_user {
51 uint8_t type; 53 __u8 type;
52 uint32_t flags; 54 __u32 flags;
53 uint32_t size; // Total size of the MTD 55 __u32 size; // Total size of the MTD
54 uint32_t erasesize; 56 __u32 erasesize;
55 uint32_t writesize; 57 __u32 writesize;
56 uint32_t oobsize; // Amount of OOB data per block (e.g. 16) 58 __u32 oobsize; // Amount of OOB data per block (e.g. 16)
57 /* The below two fields are obsolete and broken, do not use them 59 /* The below two fields are obsolete and broken, do not use them
58 * (TODO: remove at some point) */ 60 * (TODO: remove at some point) */
59 uint32_t ecctype; 61 __u32 ecctype;
60 uint32_t eccsize; 62 __u32 eccsize;
61}; 63};
62 64
63struct region_info_user { 65struct region_info_user {
64 uint32_t offset; /* At which this region starts, 66 __u32 offset; /* At which this region starts,
65 * from the beginning of the MTD */ 67 * from the beginning of the MTD */
66 uint32_t erasesize; /* For this region */ 68 __u32 erasesize; /* For this region */
67 uint32_t numblocks; /* Number of blocks in this region */ 69 __u32 numblocks; /* Number of blocks in this region */
68 uint32_t regionindex; 70 __u32 regionindex;
69}; 71};
70 72
71struct otp_info { 73struct otp_info {
72 uint32_t start; 74 __u32 start;
73 uint32_t length; 75 __u32 length;
74 uint32_t locked; 76 __u32 locked;
75}; 77};
76 78
77#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 79#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
@@ -99,15 +101,15 @@ struct otp_info {
99 * interfaces 101 * interfaces
100 */ 102 */
101struct nand_oobinfo { 103struct nand_oobinfo {
102 uint32_t useecc; 104 __u32 useecc;
103 uint32_t eccbytes; 105 __u32 eccbytes;
104 uint32_t oobfree[8][2]; 106 __u32 oobfree[8][2];
105 uint32_t eccpos[32]; 107 __u32 eccpos[32];
106}; 108};
107 109
108struct nand_oobfree { 110struct nand_oobfree {
109 uint32_t offset; 111 __u32 offset;
110 uint32_t length; 112 __u32 length;
111}; 113};
112 114
113#define MTD_MAX_OOBFREE_ENTRIES 8 115#define MTD_MAX_OOBFREE_ENTRIES 8
@@ -116,9 +118,9 @@ struct nand_oobfree {
116 * diagnosis and to allow creation of raw images 118 * diagnosis and to allow creation of raw images
117 */ 119 */
118struct nand_ecclayout { 120struct nand_ecclayout {
119 uint32_t eccbytes; 121 __u32 eccbytes;
120 uint32_t eccpos[64]; 122 __u32 eccpos[64];
121 uint32_t oobavail; 123 __u32 oobavail;
122 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; 124 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
123}; 125};
124 126
@@ -131,10 +133,10 @@ struct nand_ecclayout {
131 * @bbtblocks: number of blocks reserved for bad block tables 133 * @bbtblocks: number of blocks reserved for bad block tables
132 */ 134 */
133struct mtd_ecc_stats { 135struct mtd_ecc_stats {
134 uint32_t corrected; 136 __u32 corrected;
135 uint32_t failed; 137 __u32 failed;
136 uint32_t badblocks; 138 __u32 badblocks;
137 uint32_t bbtblocks; 139 __u32 bbtblocks;
138}; 140};
139 141
140/* 142/*
diff --git a/include/mtd/nftl-user.h b/include/mtd/nftl-user.h
index 390d21c080aa..98e9e57f22de 100644
--- a/include/mtd/nftl-user.h
+++ b/include/mtd/nftl-user.h
@@ -6,33 +6,35 @@
6#ifndef __MTD_NFTL_USER_H__ 6#ifndef __MTD_NFTL_USER_H__
7#define __MTD_NFTL_USER_H__ 7#define __MTD_NFTL_USER_H__
8 8
9#include <linux/types.h>
10
9/* Block Control Information */ 11/* Block Control Information */
10 12
11struct nftl_bci { 13struct nftl_bci {
12 unsigned char ECCSig[6]; 14 unsigned char ECCSig[6];
13 uint8_t Status; 15 __u8 Status;
14 uint8_t Status1; 16 __u8 Status1;
15}__attribute__((packed)); 17}__attribute__((packed));
16 18
17/* Unit Control Information */ 19/* Unit Control Information */
18 20
19struct nftl_uci0 { 21struct nftl_uci0 {
20 uint16_t VirtUnitNum; 22 __u16 VirtUnitNum;
21 uint16_t ReplUnitNum; 23 __u16 ReplUnitNum;
22 uint16_t SpareVirtUnitNum; 24 __u16 SpareVirtUnitNum;
23 uint16_t SpareReplUnitNum; 25 __u16 SpareReplUnitNum;
24} __attribute__((packed)); 26} __attribute__((packed));
25 27
26struct nftl_uci1 { 28struct nftl_uci1 {
27 uint32_t WearInfo; 29 __u32 WearInfo;
28 uint16_t EraseMark; 30 __u16 EraseMark;
29 uint16_t EraseMark1; 31 __u16 EraseMark1;
30} __attribute__((packed)); 32} __attribute__((packed));
31 33
32struct nftl_uci2 { 34struct nftl_uci2 {
33 uint16_t FoldMark; 35 __u16 FoldMark;
34 uint16_t FoldMark1; 36 __u16 FoldMark1;
35 uint32_t unused; 37 __u32 unused;
36} __attribute__((packed)); 38} __attribute__((packed));
37 39
38union nftl_uci { 40union nftl_uci {
@@ -50,9 +52,9 @@ struct nftl_oob {
50 52
51struct NFTLMediaHeader { 53struct NFTLMediaHeader {
52 char DataOrgID[6]; 54 char DataOrgID[6];
53 uint16_t NumEraseUnits; 55 __u16 NumEraseUnits;
54 uint16_t FirstPhysicalEUN; 56 __u16 FirstPhysicalEUN;
55 uint32_t FormattedSize; 57 __u32 FormattedSize;
56 unsigned char UnitSizeFactor; 58 unsigned char UnitSizeFactor;
57} __attribute__((packed)); 59} __attribute__((packed));
58 60
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 296efae3525e..466a8320f1e6 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -21,6 +21,8 @@
21#ifndef __UBI_USER_H__ 21#ifndef __UBI_USER_H__
22#define __UBI_USER_H__ 22#define __UBI_USER_H__
23 23
24#include <linux/types.h>
25
24/* 26/*
25 * UBI device creation (the same as MTD device attachment) 27 * UBI device creation (the same as MTD device attachment)
26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -152,7 +154,7 @@
152/* Create an UBI volume */ 154/* Create an UBI volume */
153#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req) 155#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
154/* Remove an UBI volume */ 156/* Remove an UBI volume */
155#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, int32_t) 157#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
156/* Re-size an UBI volume */ 158/* Re-size an UBI volume */
157#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) 159#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
158/* Re-name volumes */ 160/* Re-name volumes */
@@ -165,24 +167,24 @@
165/* Attach an MTD device */ 167/* Attach an MTD device */
166#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req) 168#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
167/* Detach an MTD device */ 169/* Detach an MTD device */
168#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t) 170#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
169 171
170/* ioctl commands of UBI volume character devices */ 172/* ioctl commands of UBI volume character devices */
171 173
172#define UBI_VOL_IOC_MAGIC 'O' 174#define UBI_VOL_IOC_MAGIC 'O'
173 175
174/* Start UBI volume update */ 176/* Start UBI volume update */
175#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t) 177#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
176/* LEB erasure command, used for debugging, disabled by default */ 178/* LEB erasure command, used for debugging, disabled by default */
177#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t) 179#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
178/* Atomic LEB change command */ 180/* Atomic LEB change command */
179#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t) 181#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
180/* Map LEB command */ 182/* Map LEB command */
181#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req) 183#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
182/* Unmap LEB command */ 184/* Unmap LEB command */
183#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t) 185#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
184/* Check if LEB is mapped command */ 186/* Check if LEB is mapped command */
185#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t) 187#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
186/* Set an UBI volume property */ 188/* Set an UBI volume property */
187#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req) 189#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
188 190
@@ -260,10 +262,10 @@ enum {
260 * sub-page of the first page and add needed padding. 262 * sub-page of the first page and add needed padding.
261 */ 263 */
262struct ubi_attach_req { 264struct ubi_attach_req {
263 int32_t ubi_num; 265 __s32 ubi_num;
264 int32_t mtd_num; 266 __s32 mtd_num;
265 int32_t vid_hdr_offset; 267 __s32 vid_hdr_offset;
266 int8_t padding[12]; 268 __s8 padding[12];
267}; 269};
268 270
269/** 271/**
@@ -298,13 +300,13 @@ struct ubi_attach_req {
298 * BLOBs, without caring about how to properly align them. 300 * BLOBs, without caring about how to properly align them.
299 */ 301 */
300struct ubi_mkvol_req { 302struct ubi_mkvol_req {
301 int32_t vol_id; 303 __s32 vol_id;
302 int32_t alignment; 304 __s32 alignment;
303 int64_t bytes; 305 __s64 bytes;
304 int8_t vol_type; 306 __s8 vol_type;
305 int8_t padding1; 307 __s8 padding1;
306 int16_t name_len; 308 __s16 name_len;
307 int8_t padding2[4]; 309 __s8 padding2[4];
308 char name[UBI_MAX_VOLUME_NAME + 1]; 310 char name[UBI_MAX_VOLUME_NAME + 1];
309} __attribute__ ((packed)); 311} __attribute__ ((packed));
310 312
@@ -320,8 +322,8 @@ struct ubi_mkvol_req {
320 * zero number of bytes). 322 * zero number of bytes).
321 */ 323 */
322struct ubi_rsvol_req { 324struct ubi_rsvol_req {
323 int64_t bytes; 325 __s64 bytes;
324 int32_t vol_id; 326 __s32 vol_id;
325} __attribute__ ((packed)); 327} __attribute__ ((packed));
326 328
327/** 329/**
@@ -356,12 +358,12 @@ struct ubi_rsvol_req {
356 * re-name request. 358 * re-name request.
357 */ 359 */
358struct ubi_rnvol_req { 360struct ubi_rnvol_req {
359 int32_t count; 361 __s32 count;
360 int8_t padding1[12]; 362 __s8 padding1[12];
361 struct { 363 struct {
362 int32_t vol_id; 364 __s32 vol_id;
363 int16_t name_len; 365 __s16 name_len;
364 int8_t padding2[2]; 366 __s8 padding2[2];
365 char name[UBI_MAX_VOLUME_NAME + 1]; 367 char name[UBI_MAX_VOLUME_NAME + 1];
366 } ents[UBI_MAX_RNVOL]; 368 } ents[UBI_MAX_RNVOL];
367} __attribute__ ((packed)); 369} __attribute__ ((packed));
@@ -375,10 +377,10 @@ struct ubi_rnvol_req {
375 * @padding: reserved for future, not used, has to be zeroed 377 * @padding: reserved for future, not used, has to be zeroed
376 */ 378 */
377struct ubi_leb_change_req { 379struct ubi_leb_change_req {
378 int32_t lnum; 380 __s32 lnum;
379 int32_t bytes; 381 __s32 bytes;
380 int8_t dtype; 382 __s8 dtype;
381 int8_t padding[7]; 383 __s8 padding[7];
382} __attribute__ ((packed)); 384} __attribute__ ((packed));
383 385
384/** 386/**
@@ -388,9 +390,9 @@ struct ubi_leb_change_req {
388 * @padding: reserved for future, not used, has to be zeroed 390 * @padding: reserved for future, not used, has to be zeroed
389 */ 391 */
390struct ubi_map_req { 392struct ubi_map_req {
391 int32_t lnum; 393 __s32 lnum;
392 int8_t dtype; 394 __s8 dtype;
393 int8_t padding[3]; 395 __s8 padding[3];
394} __attribute__ ((packed)); 396} __attribute__ ((packed));
395 397
396 398
@@ -402,9 +404,9 @@ struct ubi_map_req {
402 * @value: value to set 404 * @value: value to set
403 */ 405 */
404struct ubi_set_prop_req { 406struct ubi_set_prop_req {
405 uint8_t property; 407 __u8 property;
406 uint8_t padding[7]; 408 __u8 padding[7];
407 uint64_t value; 409 __u64 value;
408} __attribute__ ((packed)); 410} __attribute__ ((packed));
409 411
410#endif /* __UBI_USER_H__ */ 412#endif /* __UBI_USER_H__ */