122851890Sopenharmony_ci/*
222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py,
322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants,
422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information.
522851890Sopenharmony_ci */
622851890Sopenharmony_ci#ifndef __MTD_NFTL_USER_H__
722851890Sopenharmony_ci#define __MTD_NFTL_USER_H__
822851890Sopenharmony_ci#include <linux/types.h>
922851890Sopenharmony_cistruct nftl_bci {
1022851890Sopenharmony_ci	unsigned char ECCSig[6];
1122851890Sopenharmony_ci	__u8 Status;
1222851890Sopenharmony_ci	__u8 Status1;
1322851890Sopenharmony_ci}__attribute__((packed));
1422851890Sopenharmony_cistruct nftl_uci0 {
1522851890Sopenharmony_ci	__u16 VirtUnitNum;
1622851890Sopenharmony_ci	__u16 ReplUnitNum;
1722851890Sopenharmony_ci	__u16 SpareVirtUnitNum;
1822851890Sopenharmony_ci	__u16 SpareReplUnitNum;
1922851890Sopenharmony_ci} __attribute__((packed));
2022851890Sopenharmony_cistruct nftl_uci1 {
2122851890Sopenharmony_ci	__u32 WearInfo;
2222851890Sopenharmony_ci	__u16 EraseMark;
2322851890Sopenharmony_ci	__u16 EraseMark1;
2422851890Sopenharmony_ci} __attribute__((packed));
2522851890Sopenharmony_cistruct nftl_uci2 {
2622851890Sopenharmony_ci        __u16 FoldMark;
2722851890Sopenharmony_ci        __u16 FoldMark1;
2822851890Sopenharmony_ci	__u32 unused;
2922851890Sopenharmony_ci} __attribute__((packed));
3022851890Sopenharmony_ciunion nftl_uci {
3122851890Sopenharmony_ci	struct nftl_uci0 a;
3222851890Sopenharmony_ci	struct nftl_uci1 b;
3322851890Sopenharmony_ci	struct nftl_uci2 c;
3422851890Sopenharmony_ci};
3522851890Sopenharmony_cistruct nftl_oob {
3622851890Sopenharmony_ci	struct nftl_bci b;
3722851890Sopenharmony_ci	union nftl_uci u;
3822851890Sopenharmony_ci};
3922851890Sopenharmony_cistruct NFTLMediaHeader {
4022851890Sopenharmony_ci	char DataOrgID[6];
4122851890Sopenharmony_ci	__u16 NumEraseUnits;
4222851890Sopenharmony_ci	__u16 FirstPhysicalEUN;
4322851890Sopenharmony_ci	__u32 FormattedSize;
4422851890Sopenharmony_ci	unsigned char UnitSizeFactor;
4522851890Sopenharmony_ci} __attribute__((packed));
4622851890Sopenharmony_ci#define MAX_ERASE_ZONES (8192 - 512)
4722851890Sopenharmony_ci#define ERASE_MARK 0x3c69
4822851890Sopenharmony_ci#define SECTOR_FREE 0xff
4922851890Sopenharmony_ci#define SECTOR_USED 0x55
5022851890Sopenharmony_ci#define SECTOR_IGNORE 0x11
5122851890Sopenharmony_ci#define SECTOR_DELETED 0x00
5222851890Sopenharmony_ci#define FOLD_MARK_IN_PROGRESS 0x5555
5322851890Sopenharmony_ci#define ZONE_GOOD 0xff
5422851890Sopenharmony_ci#define ZONE_BAD_ORIGINAL 0
5522851890Sopenharmony_ci#define ZONE_BAD_MARKED 7
5622851890Sopenharmony_ci#endif
57