📄 part_inf.h
字号:
/****************************************************************************** * * * Project: DOC Driver for Linux 2.4 Block device driver for mDOC H3 family * * of devices under Linux kernel 2.4. * * * * Version: 1.0 * * Email questions to: oemsupport@sandisk.com * * Copyright (C) SanDisk IL Ltd. 1995 - 2007 * * SanDisk IL Ltd., 7 Atir Yeda Street, Kfar Saba 44425, Israel * * * ****************************************************************************** * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or any later version.* * This program is distributed in the hope that it will be useful, but WITHOUT* * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * * more details, which is set forth in the readme.txt file. * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * * * This License does not grant you any right to use the trademarks, service * * marks or logos of SanDisk IL Ltd. or SanDisk Corporation. * * Subject to the foregoing, SanDisk IL Ltd., for itself and on behalf of its * * licensors, hereby reserves all intellectual property rights in the program,* * except for the rights expressly granted in this License. * * * ******************************************************************************/
/***********************************************************************************/
/* */
/* This file contains various structure and defines concerning Partition info and */
/* access */
/* */
/***********************************************************************************/
/*
* $Log: V:/PVCSDB/DiskOnChip/archives/Test for 7.x/src/H3/part_inf.h-arc $
*
* Rev 1.18.1.0 Nov 30 2006 10:24:10 Yaniv.Iarovici
* Added 'DOCH_SecureDeleteDev1' to SDK Device Attributes.
*
* Rev 1.18 Sep 11 2006 13:45:26 yaniv.iarovici
* Legal header added
*
* Rev 1.17 Aug 09 2006 17:26:58 Polina.Marimont
* initial for DOC Driver 1.0
*
* Rev 1.16.1.0 Aug 08 2006 15:55:32 Polina.Marimont
* DOC Driver 1.0 initial
*
* Rev 1.16 May 28 2006 13:02:34 polina.marimont
* 1. IDENTIFY DEVICE interface update
* 2. floors fix for format, where partition ended at the end of floor 0
*
* Rev 1.15 May 18 2006 14:41:24 polina.marimont
* v1.40Fin1, PVCS log inside
*/
#ifndef _PARTITION_INFO_H
#define _PARTITION_INFO_H
#include "doch_api.h"
/* Extended device info structure*/
typedef struct {
FLWord wFlashType;
FLWord wPhysicalPageSize; /*In Sectors*/
FLWord wNumOfPhysicalPagesInPhysicalErasableBlockSize;
FLWord wNumOfErasableBlocksPerPhysicalChip;
FLWord wPhysicalChipBusWidth; /*8/16*/
FLWord wNumOfChipsOnDataBus; /*1..2*/
FLWord wFlashChipNumOfPlanes; /*1..4*/
FLWord wFlashChipNumOfBanks; /*Independently accessible parts of flash array*/
FLWord wLogicalPageSize; /*In Sectors*/
FLWord wNumOfLogicalPagesInLogicalErasableBlockSize;
FLWord wTotalNumOfLogicalErasableUnits;
FLWord wMapinfoUnitsUsed;
FLWord wLUNCurrentlyUsed;
FLWord wFreeUnitsOnMedia;
FLByte bReserved1[0x1E4];
} DOCH_ExtendedDeviceInfo;
/*Partition user attributes
512Byte overall (1 sector)
First DOCH_PART_INFO_SDK_RESERVED_BYTES bytes are reserved for SDK*/
#define DOCH_PART_INFO_SDK_RESERVED_BYTES 0x40
typedef struct {
FLByte bReserved1[DOCH_PART_INFO_SDK_RESERVED_BYTES]; /*For SDK use*/
FLByte bReserved2[DOCH_SECTOR_SIZE - DOCH_PART_INFO_SDK_RESERVED_BYTES]; /*For application use*/
} DOCH_PartitionUserAttr;
/*Device user attributes
512Byte overall (1 sector)
First DOCH_DEVICE_INFO_SDK_RESERVED_BYTES bytes are reserved for SDK*/
#define DOCH_DEVICE_INFO_SDK_RESERVED_BYTES 0x40
typedef struct {
FLByte bLastDev0PartSpanned;
FLByte numOfSpannedPartitionOnDev0;
FLByte secondFloorActive; /*At least 1 user partition resides on Dev1*/
FLByte bLastPartitionOnDev0; /*Number of last partition that resides on Dev0*/
FLDword dwSpanSector; /*Which sector in the spanned partition is the last that resides on dev0*/
FLDword dwSpanSizeOnDev0; /*How many sectors on Dev0*/
FLByte spare[4];
} DOCH_PartitionSpanData;
typedef struct {
FLDword dwSecureDeleteStartSector;
FLDword dwSecureDeleteNumOfSectors;
FLByte bOperationRequired;
FLByte bPart;
FLByte spare[2];
} DOCH_SecureDeleteDev1;
typedef struct {
DOCH_PartitionSpanData sSpanInfo;
DOCH_SecureDeleteDev1 sSecureDeleteDev1;
FLByte spare[0x24]; /*Rest of 0x40 bytes that are reserved for SDK use*/
} DOCH_SDKDeviceAttr;
typedef struct {
DOCH_SDKDeviceAttr sdkAttributes;
FLByte bReserved2[DOCH_SECTOR_SIZE - DOCH_DEVICE_INFO_SDK_RESERVED_BYTES]; /*For application use*/
} DOCH_DeviceUserAttr;
/******************************************************************************/
/*
* Configuration Partition structure, sub-structures and ENUMS
*/
/******************************************************************************/
/*Configuration Partition Layout*/
/*Sector #0*/
typedef struct {
FLWord wVersion;
FLWord wCompatabilityVersion;
FLDword dwCommandFlagsOrStatuses;
FLDword dwDiskAttributes1;
FLDword dwGateKeeperAttr; /*FLDword dwDiskAttributes2;*/
FLByte bReserved2[0x10];
FLByte bUniqueID[0x10];
FLByte bReserved3[0x10];
FLByte bSerialNumber[0x14];
FLByte bModelNumber[0x28];
FLByte breserved4[2];
FLWord wDefaultPartitionNumber;
FLDword dwUnformattedCapacity; /*In Sectors*/
FLDword dwConfigurationPartitionExistsSign;
FLDword dwETFFSVER;
FLDword dwConfigPartitionSize; /*In Bytes*/
FLByte bProgrammerName[0x10];
FLByte bProgrammerVersion[0x8];
FLByte bReserved6[0x58];
FLByte bGateKeeperKey[0x80];
FLByte bGateKeeperKeyReservedLargerKey[0x80];
} DOCH_ConfigPartitionSector0;
/*Sector #1*/
typedef enum {
DOCH_MP_AUTH_TYPE_NONE = 0, /*No master password*/
DOCH_MP_AUTH_TYPE_PWD = 1, /*Password protection (Null terminated)*/
DOCH_MP_AUTH_TYPE_RSA = 2 /*RSA Protection (All 128Bytes are significant*/
} DOCH_MasterPwdAuthType;
typedef enum {
DOCH_MAO_MASTER_PWD_AUTH_TYPE = 0
} DOCH_MasterAttributes_Offset;
typedef enum {
DOCH_MAB_MASTER_PWD_AUTH_TYPE = 0x0000003F
} DOCH_MasterAttributes_Bits;
typedef struct {
FLByte bReserved1[0xC];
FLDword masterAttributes;
FLByte bReserved2[0xF0];
FLByte bMasterPasskey[0x80];
FLByte bReservedLargeMasterPasskey[0x80];
} DOCH_ConfigPartitionSector1;
/*Sector #2*/
typedef struct {
FLByte bDochPublicKey[0x80];
FLByte bReserved1[0x80];
FLByte bDochPrivateKey[0x80];
FLByte bReserved2[0x80];
} DOCH_ConfigPartitionSector2;
/*Sector #3*/
/*Identical to DOCH_DriveParameters structure (ATA IDENTIFY_DEVICE structure)*/
/*Sectors #4..#14 are reserved*/
/*Sector #15 - OTP sector for tester*/
typedef struct {
FLByte bUniqueID[0x10];
FLByte bReserved1[0x10];
FLByte bSerialNumber[0x14];
FLByte bModelNumber[0x28];
FLByte bReserved2[0x1A4];
} DOCH_ConfigPartitionSector15;
#endif /*_PARTITION_INFO_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -