/*1* Copyright © 1999-2010 David Woodhouse <[email protected]>2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA16*17*/1819#ifndef __MTD_NFTL_USER_H__20#define __MTD_NFTL_USER_H__2122#include <linux/types.h>2324/* Block Control Information */2526struct nftl_bci {27unsigned char ECCSig[6];28__u8 Status;29__u8 Status1;30}__attribute__((packed));3132/* Unit Control Information */3334struct nftl_uci0 {35__u16 VirtUnitNum;36__u16 ReplUnitNum;37__u16 SpareVirtUnitNum;38__u16 SpareReplUnitNum;39} __attribute__((packed));4041struct nftl_uci1 {42__u32 WearInfo;43__u16 EraseMark;44__u16 EraseMark1;45} __attribute__((packed));4647struct nftl_uci2 {48__u16 FoldMark;49__u16 FoldMark1;50__u32 unused;51} __attribute__((packed));5253union nftl_uci {54struct nftl_uci0 a;55struct nftl_uci1 b;56struct nftl_uci2 c;57};5859struct nftl_oob {60struct nftl_bci b;61union nftl_uci u;62};6364/* NFTL Media Header */6566struct NFTLMediaHeader {67char DataOrgID[6];68__u16 NumEraseUnits;69__u16 FirstPhysicalEUN;70__u32 FormattedSize;71unsigned char UnitSizeFactor;72} __attribute__((packed));7374#define MAX_ERASE_ZONES (8192 - 512)7576#define ERASE_MARK 0x3c6977#define SECTOR_FREE 0xff78#define SECTOR_USED 0x5579#define SECTOR_IGNORE 0x1180#define SECTOR_DELETED 0x008182#define FOLD_MARK_IN_PROGRESS 0x55558384#define ZONE_GOOD 0xff85#define ZONE_BAD_ORIGINAL 086#define ZONE_BAD_MARKED 7878889#endif /* __MTD_NFTL_USER_H__ */909192