/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/*2* Copyright © 1999-2010 David Woodhouse <[email protected]>3*4* This program is free software; you can redistribute it and/or modify5* it under the terms of the GNU General Public License as published by6* the Free Software Foundation; either version 2 of the License, or7* (at your option) any later version.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14* You should have received a copy of the GNU General Public License15* along with this program; if not, write to the Free Software16* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA17*18*/1920#ifndef __MTD_NFTL_USER_H__21#define __MTD_NFTL_USER_H__2223#include <linux/types.h>2425/* Block Control Information */2627struct nftl_bci {28unsigned char ECCSig[6];29__u8 Status;30__u8 Status1;31}__attribute__((packed));3233/* Unit Control Information */3435struct nftl_uci0 {36__u16 VirtUnitNum;37__u16 ReplUnitNum;38__u16 SpareVirtUnitNum;39__u16 SpareReplUnitNum;40} __attribute__((packed));4142struct nftl_uci1 {43__u32 WearInfo;44__u16 EraseMark;45__u16 EraseMark1;46} __attribute__((packed));4748struct nftl_uci2 {49__u16 FoldMark;50__u16 FoldMark1;51__u32 unused;52} __attribute__((packed));5354union nftl_uci {55struct nftl_uci0 a;56struct nftl_uci1 b;57struct nftl_uci2 c;58};5960struct nftl_oob {61struct nftl_bci b;62union nftl_uci u;63};6465/* NFTL Media Header */6667struct NFTLMediaHeader {68char DataOrgID[6];69__u16 NumEraseUnits;70__u16 FirstPhysicalEUN;71__u32 FormattedSize;72unsigned char UnitSizeFactor;73} __attribute__((packed));7475#define MAX_ERASE_ZONES (8192 - 512)7677#define ERASE_MARK 0x3c6978#define SECTOR_FREE 0xff79#define SECTOR_USED 0x5580#define SECTOR_IGNORE 0x1181#define SECTOR_DELETED 0x008283#define FOLD_MARK_IN_PROGRESS 0x55558485#define ZONE_GOOD 0xff86#define ZONE_BAD_ORIGINAL 087#define ZONE_BAD_MARKED 7888990#endif /* __MTD_NFTL_USER_H__ */919293