/* * $Log$ * Revision 1.2 2004/12/01 10:07:10 itsme * newer version of m-sys headerfile * * * Rev 1.4 Dec 16 2003 11:06:44 alexander.geller * Comment change * * Rev 1.3 Sep 14 2003 08:38:28 doronc * Added - Update XIP support * * Rev 1.2 May 27 2003 16:10:28 doronc * Change format flags definies according to allowed values of TrueFFS 6.1. * * Rev 1.1 May 27 2003 14:02:50 doronc * VolumeInfoRecord structure changed physicalUnitSize field * type from short to long. * * Rev 1.0 May 05 2003 13:30:50 doronc * Initial revision. * * Rev 1.2 Jun 02 2002 16:34:08 doronc * Added constants TL_NORMAL_FORMAT and BINARY_AREA * for format structure. * * Rev 1.1 May 28 2002 17:42:46 doronc * Add API for FL_IOCTL_EXTENDED_WRITE_IPL, * replace the names of flCEBDKOperation and flBDKOperation to keep backward compatability with ver 5.04, * Remove mutex taking in DSK_PowerUp and DSK_PowerDown since The mutex API is not available in this stage. * * Rev 1.0 May 09 2002 17:44:52 doronc * Initial revision. * * Rev 1.8 Jan 17 2002 23:02:02 oris * Added 3 new ioctls * - FL_IOCTL_EXTENDED_ENVIRONMENT_VARIABLES - Set environment variables * - flExtendedEnvVarsInput and flExtendedEnvVarsOutput records * - FL_APPLY_TO_ALL / FL_APPLY_TO_SOCKET / FL_APPLY_TO_VOLUME definitions * - FL_IOCTL_SET_ACCESS_ROUTINE -set access routines * - flVerifyVolumeOutput record * - FL_IOCTL_VERIFY_VOLUME - check volume for errors caused by power failures. * - flSetMemoryAccessInput record * * Rev 1.7 May 09 2001 00:45:48 oris * Changed protection ioctl interface to prevent the use of input buffer as an output buffer. * * Rev 1.6 Apr 16 2001 13:45:10 oris * Removed warrnings by changing some of the fields types to standart flite types. * * Rev 1.5 Apr 09 2001 15:02:22 oris * Added comment to ifdef statment. * End with an empty line. * * Rev 1.4 Apr 01 2001 15:16:38 oris * Updated inquire capability ioctl - diffrent input and output records. * * Rev 1.3 Apr 01 2001 07:58:44 oris * Moved the following defines to blockdev.h: * FL_PROTECT 0 * FL_UNPROTECT 1 * FL_UNLOCK 2 * * Rev 1.2 Feb 14 2001 02:16:16 oris * Updated inquire capabilities ioctl. * * Rev 1.1 Feb 13 2001 01:49:06 oris * Added the following new IO Controls: * FL_IOCTL_FORMAT_VOLUME2, * FL_IOCTL_FORMAT_PARTITION, * FL_IOCTL_BDTL_HW_PROTECTION, * FL_IOCTL_BINARY_HW_PROTECTION, * FL_IOCTL_OTP, * FL_IOCTL_CUSTOMER_ID, * FL_IOCTL_UNIQUE_ID, * FL_IOCTL_NUMBER_OF_PARTITIONS, * FL_IOCTL_SUPPORTED_FEATURES, * FL_IOCTL_SET_ENVIRONMENT_VARIABLES, * FL_IOCTL_PLACE_EXB_BY_BUFFER, * FL_IOCTL_WRITE_IPL, * FL_IOCTL_DEEP_POWER_DOWN_MODE, * and BDK_GET_INFO type in FL_IOCTL_BDK_OPERATION * * Rev 1.0 Feb 04 2001 11:38:18 oris * Initial revision. * */ /***********************************************************************************/ /* M-Systems Confidential */ /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */ /* All Rights Reserved */ /***********************************************************************************/ /* NOTICE OF M-SYSTEMS OEM */ /* SOFTWARE LICENSE AGREEMENT */ /* */ /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */ /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */ /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */ /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */ /* E-MAIL = info@m-sys.com */ /***********************************************************************************/ #ifndef FLIOCTL_H #define FLIOCTL_H #ifndef CE_DRIVER_LAYER #define FL_IOCTL_START 3000 #endif /* In every call to flIOctl function, the irFlags field in the structure IOreq should hold one of the following: */ typedef enum{FL_IOCTL_GET_INFO = FL_IOCTL_START, FL_IOCTL_DEFRAGMENT, FL_IOCTL_WRITE_PROTECT, FL_IOCTL_MOUNT_VOLUME, FL_IOCTL_FORMAT_VOLUME, FL_IOCTL_BDK_OPERATION, FL_IOCTL_DELETE_SECTORS, FL_IOCTL_READ_SECTORS, FL_IOCTL_WRITE_SECTORS, FL_IOCTL_FORMAT_PHYSICAL_DRIVE, FL_IOCTL_FORMAT_LOGICAL_DRIVE, FL_IOCTL_BDTL_HW_PROTECTION, FL_IOCTL_BINARY_HW_PROTECTION, FL_IOCTL_OTP, FL_IOCTL_CUSTOMER_ID, FL_IOCTL_UNIQUE_ID, FL_IOCTL_NUMBER_OF_PARTITIONS, FL_IOCTL_INQUIRE_CAPABILITIES, FL_IOCTL_SET_ENVIRONMENT_VARIABLES, /* No longer supported */ FL_IOCTL_PLACE_EXB_BY_BUFFER, FL_IOCTL_WRITE_IPL, /* For backward compatability only, use FL_IOCTL_EXTENDED_WRITE_IPL instead*/ FL_IOCTL_DEEP_POWER_DOWN_MODE, FL_IOCTL_EXTENDED_ENVIRONMENT_VARIABLES, FL_IOCTL_VERIFY_VOLUME, FL_IOCTL_SET_ACCESS_ROUTINE, /*Not supported for CE*/ FL_IOCTL_GET_ACCESS_ROUTINE, /*Not supported for CE*/ FL_IOCTL_EXTENDED_WRITE_IPL, FL_IOCTL_OPEN_TRANSACTION, FL_IOCTL_COMMIT_TRANSACTION, FL_IOCTL_IS_VOLUME_RUGGEDIZED, FL_IOCTL_COMPLETE_OPERATION, FL_IOCTL_UPDATE_XIP_MODE = FL_IOCTL_START + 150 } flIOctlFunctionNo; #ifndef CE_DRIVER_LAYER typedef enum { /* Status code for operation. A zero value indicates success, other codes are the extended DOS codes. */ flOK = 0, flBadFunction = 1, flFileNotFound = 2, flPathNotFound = 3, flTooManyOpenFiles = 4, flNoWriteAccess = 5, flBadFileHandle = 6, flDriveNotAvailable = 9, flNonFATformat = 10, flFormatNotSupported = 11, flNoMoreFiles = 18, flWriteProtect = 19, flBadDriveHandle = 20, flDriveNotReady = 21, flUnknownCmd = 22, flBadFormat = 23, flBadLength = 24, flDataError = 25, flUnknownMedia = 26, flSectorNotFound = 27, flOutOfPaper = 28, flWriteFault = 29, flReadFault = 30, flGeneralFailure = 31, flDiskChange = 34, flVppFailure = 50, flBadParameter = 51, flNoSpaceInVolume = 52, flInvalidFATchain = 53, flRootDirectoryFull = 54, flNotMounted = 55, flPathIsRootDirectory = 56, flNotADirectory = 57, flDirectoryNotEmpty = 58, flFileIsADirectory = 59, flAdapterNotFound = 60, flFormattingError = 62, flNotEnoughMemory = 63, flVolumeTooSmall = 64, flBufferingError = 65, flFileAlreadyExists = 80, flForceDismount = 85, flIncomplete = 100, flTimedOut = 101, flTooManyComponents = 102, flTooManyDrives = 103, flTooManyBinaryPartitions = 104, flPartitionNotFound = 105, flFeatureNotSupported = 106, flWrongVersion = 107, flTooManyBadBlocks = 108, flNotProtected = 109, flUnchangeableProtection = 110, flBadDownload = 111, flBadBBT = 112, flInterleaveError = 113, flWrongKey = 114, flHWProtection = 115, flLeftForCompetability = 116, flMultiDocContradiction = 117, flCanNotFold = 118, flBadIPLBlock = 119, flIOCommandBlocked = 120, flBadTransaction = 121, flTooManyTransactions = 122, flUnitIsNotErased = 123, flSequenceError = 124, flFIFOTimeOut = 125, flUnitIsBad = 126, flFlashIsVirgin = 127, } FLStatus; #endif /*CE_DRIVER_LAYER*/ #ifdef CE_DRIVER_LAYER FLStatus flIOctl(IOreq far *); #endif /*CE_DRIVER_LAYER*/ /* In every call to flIOctl function, the irData field in the structure IOreq should point to the structure defined below. The fields inputRecord and outputRecord should point to structures which are specific to each IOctl function as defined in this file. */ typedef struct { void far *inputRecord; void far *outputRecord; } flIOctlRecord; /* General output record that returns only status. */ typedef struct { FLStatus status; } flOutputStatusRecord; /* Input and output records for the different IOCTL functions: */ /* =========================================================== */ /* Get disk information (FL_IOCTL_GET_INFO) */ #ifndef CE_DRIVER_LAYER /*----------------------------------------------------------------------*/ /* V o l u m e I n f o R e c o r d */ /* */ /* A structure that holds general information about the media. The */ /* information includes Physical Info (see flGetPhysicalInfo), Logical */ /* partition (number of sectors and CHS), boot area size, S/W versions */ /* Media life-time etc. */ /* A pointer to this structure is passed to the function flVolumeInfo */ /* where it receives the relevant data. */ /*----------------------------------------------------------------------*/ typedef struct { unsigned long logicalSectors; /* number of logical sectors */ unsigned long bootAreaSize; /* boot area size */ unsigned long baseAddress; /* physical base address */ unsigned short flashType; /* JEDEC id of the flash */ unsigned long physicalSize; /* physical size of the media */ unsigned long physicalUnitSize; /* Erasable block size */ char DOCType; /* DiskOnChip type (MDoc/Doc2000) */ char lifeTime; /* Life time indicator for the media (1-10) */ /* 1 - the media is fresh, */ /* 10 - the media is close to its end of life */ char driverVer[10]; /* driver version (NULL terminated string) */ char OSAKVer[10]; /* OSAK version that driver is based on (NULL terminated string) */ unsigned long cylinders; /* Media..... */ unsigned long heads; /* geometry...... */ unsigned long sectors; /* parameters. */ } VolumeInfoRecord; #endif /*CE_DRIVER_LAYER*/ /* Input record: NULL */ /* Output record: */ typedef struct { VolumeInfoRecord info; /* VolumeInfoRecord is defined in blockdev.h */ FLStatus status; } flDiskInfoOutput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Defragment volume (FL_IOCTL_DEFRAGMENT) */ /* Input record: */ typedef struct { long requiredNoOfSectors; /* Minimum number of sectors to make available. if -1 then a quick garbage collection operation is invoked. */ } flDefragInput; /* Outout record: */ typedef struct { long actualNoOfSectors; /* Actual number of sectors available */ FLStatus status; } flDefragOutput; /*************************************************************************/ /* Write protection (FL_IOCTL_WRITE_PROTECT) */ /* Input record: */ #define FL_PROTECT 0 #define FL_UNPROTECT 1 #define FL_UNLOCK 2 typedef struct { byte type; /* type of operation: FL_PROTECT\FL_UNPROTECT */ long password[2]; /* password */ } flWriteProtectInput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Mount volume (FL_IOCTL_MOUNT_VOLUME) */ /* Input record: */ typedef struct { byte type; /* type of operation: FL_MOUNT\FL_DISMOUNT */ } flMountInput; #define FL_MOUNT 0 #define FL_DISMOUNT 1 /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Format volume (FL_IOCTL_FORMAT_VOLUME) */ #ifndef CE_DRIVER_LAYER /*----------------------------------------------------------*/ /* User Format Parameters record for flFormatVolume routine */ /*----------------------------------------------------------*/ typedef FLStatus (*FLProgressCallback)(unsigned short totalUnitsToFormat, unsigned short totalUnitsFormattedSoFar); typedef struct { /* FTL formatting section */ long int bootImageLen; /* Space to reserve for a boot-image at the start of the medium. The FLite volume will begin at the next higher erase unit boundary */ unsigned percentUse; /* FTL performance depends on how full the Flash media is, getting slower when the media is close to 100%. It is possible to avoid the worst consequences of this effect by formatting the media to less than 100% capacity, so guaranteeing some free space at all times. This of course sacrifices some capcity. The standard value to use is 98 */ unsigned noOfSpareUnits; /* BDTL partitions needs at least one spare erase unit to function as a read/write media. That unit is normally taken from the transfer units specified by the percentUsed field, but it is possible to specify additional units (which takes more media space). This ensures that if all the transfer units become bad and inerasable, the spare unit enables TrueFFS to continue its read/write functionality. Conversely, if no spare units are available the media may switch into read-only mode. The standard value used is 1 */ DWORD vmAddressingLimit; /* A part of the FTL Virtual Map always resides in RAM. The RAM part is the one that is used to address the part of the media below the VM addressing limit. Reading and writing to this part is usually faster to some degree. The downside is that the bigger the limit, the more RAM size is required. To get the extra RAM requirement in bytes, divide the limit by 128 or by 256, depending on whether you specified in #2.9 more than 32 or not, respectively. The minimum VM limit is 0. The standard value to use is 0x10000 (first 64 KBytes) */ FLProgressCallback progressCallback; /* Progress callback routine, will be called if not NULL. The callback routine is called after erasing each unit, and its parameters are the total number of erase units to format and the number erased so far. The callback routine returns a Status value. A value of OK (0) allows formatting to continue. Any other value will abort the formatting with the returned status code. */ /* DOS formatting section */ char volumeId[4]; /* Volume identification number */ char far * volumeLabel; /* Volume label string. If NULL, no label */ unsigned noOfFATcopies; /* It is customary to format DOS media with 2 FAT copies. The first copy is always used, but more copies make it possible to recover if the FAT becomes corrupted (a rare occurrence). On the other hand, this slows down performance and uses media space. The standard value to use is 2 */ unsigned embeddedCISlength; /* Length in bytes of CIS to embed after the unit header */ char far * embeddedCIS; /* The unit header is structured as a beginning of a PCMCIA 'tuple' chain (a CIS). The unit header contains a data-organization tuple, which points past the end of the unit header to a location which usually just contains hex FF's which mark an 'end-of-tuple-chain'. Optionally, it is possible to embed an entire CIS chain at this location. If so, 'embeddedCISlength' marks the length in bytes */ } FormatParams; /*----------------------------------------------*/ /* User BDTL Partition Format Parameters record */ /*----------------------------------------------*/ typedef struct { DWORD length; /* The size of the usable storage space. The size will be rounded upwards to a multiplication of a block size. The size of the last partition will calculated automatically, but if the requested size is greater then the remaining space an error code will be returned,. Requesting zero size for any partition but the last will generate an flBadParameters status. */ unsigned noOfSpareUnits; /* BDTL needs at least one spare erase unit in order to function as a read/write media. It is possible to specify more than one spare unit, which takes more media space. The advantage of specifying more than one spare unit is that if one of the flash erase units becomes bad and inerasable in the future, then one of the spare units can replace it. In that case, a second spare unit enables TrueFFS to continue its read/write functionality, whereas if no second spare unit is available the media goes into read-only mode. The standard value used is 1 */ byte flags; /* Available values for this field: */ #define TL_NORMAL_FORMAT 0 #define TL_FORMAT_FAT 2 /* Add FAT format on the media */ byte volumeId[4]; /* DOS partition identification number */ byte far * volumeLabel; /*DOS partition label string. If NULL, no label */ byte noOfFATcopies; /* It is customary to format DOS media with two FAT copies. The first copy is always used, but more copies make it possible to recover if the FAT becomes corrupted (a rare occurrence). On the other hand, this slows down performance and uses media space. The standard value used is 2. */ byte protectionKey[8]; /* The key for the protection*/ byte protectionType; /* PROTECTABLE - Can recieve protection */ /* READ_PROTECTED - Protect against read operations */ /* WRITE_PROTECTED - Protect against write operations */ /* LOCK_ENABLED - Enables the hardware lock signal */ /* PROTECTABLE - This partition can be protected */ /* CHANGEABLE_PROTECTION - protection type can be changed */ #ifdef COMPRESSION unsigned short ratioDenominator; unsigned short ratioNominator; #endif /* COMPRESSION */ /* The ratio between the real media size and the virtual size reported to the file system when compression is active. */ } BDTLPartitionFormatParams; /*------------------------------------------------*/ /* User binary Partition Format Parameters record */ /*------------------------------------------------*/ typedef struct { DWORD length; /* Required number of good blocks in the partition.*/ byte sign[4]; /* signature of the binary partition to format. The signature 0xFFFF FFFF is not a valid signature */ byte signOffset; /* This field indicates one of the following modes : */ /* Available values for this field: */ /*#define TL_NORMAL_FORMAT 0 */ #define TL_SPL_FORMAT 0xb0 byte protectionKey[8]; /* The key for the protection*/ byte protectionType; /* PROTECTABLE - Can recieve protection */ /* READ_PROTECTED - Protect against read operations */ /* WRITE_PROTECTED - Protect against write operations */ /* LOCK_ENABLED - Enables the hardware lock signal */ /* PROTECTABLE - This partition can be protected */ /* CHANGEABLE_PROTECTION - protection type can be changed */ } BinaryPartitionFormatParams; typedef struct { /*****************************/ /* Device formatting section */ /*****************************/ byte percentUse; /* BDTL performance depends on how full the flash media is, becoming slower as the media becomes closer to 100% full. It is possible to avoid the worst-case performance (at 100% full) by formatting the media to less than 100% capacity, thus guaranteeing free space at all times. This of course sacrifices some capacity. The standard value used is 98 */ byte noOfBDTLPartitions; /* Indicates the number of BDTL partitions (1 to 4). 0 will cause a single STD_BDTL_PARAMS BDTL partition */ byte noOfBinaryPartitions; /* Indicates the number of binary partitions (up to 3). 0 will cause formatting with no binary partition. This value is ignored unless the TL_BINARY_FORMAT flag is set in the irFlags f the ioreq */ BDTLPartitionFormatParams far* BDTLPartitionInfo; /* BDTL partition information array */ BinaryPartitionFormatParams far* binaryPartitionInfo; /* Binary partition information array*/ /***********************************/ /* Special format features section */ /***********************************/ byte cascadedDeviceNo; /* Not used */ byte noOfCascadedDevices; /* Not used */ FLProgressCallback progressCallback; /* Progress callback routine, will be called if not NULL. The callback routine is called after erasing each unit, and its parameters are the total number of erase units to format and the number erased so far. The callback routine returns a Status value. A value of OK (0) allows formatting to continue. Any other value will abort the formatting with the returned status code. */ /* Note the following section is not used by for DiskOnChips */ /*************************************************************/ DWORD vmAddressingLimit; /* A part of the FTL Virtual Map always resides in RAM. The RAM part is the one that is used to address the part of the media below the VM addressing limit. Reading and writing to this part is usually faster to some degree. The downside is that the bigger the limit, the more RAM size is required. To get the extra RAM requirement in bytes, divide the limit by 128 or by 256, depending on whether you specified in #2.9 more than 32 or not, respectively. The minimum VM limit is 0. The standard value to use is 0x10000 (first 64 KBytes) */ unsigned short embeddedCISlength; /* Length in bytes of CIS to embed after the unit header */ byte far * embeddedCIS; /* The unit header is structured as a beginning of a PCMCIA 'tuple' chain (a CIS). The unit header contains a data-organization tuple, which points past the end of the unit header to a location which usually just contains hex FF's which mark an 'end-of-tuple-chain'. Optionally, it is possible to embed an entire CIS chain at this location. If so, 'embeddedCISlength' marks the length in bytes */ } FormatParams2; #endif /*CE_DRIVER_LAYER*/ /* Format volume (FL_IOCTL_FORMAT_VOLUME) */ /* Input record: */ typedef struct { byte formatType; /* type of format as defined in blockdev.h */ FormatParams fp; /* Format parameters structure (defined in flformat.h) */ } flFormatInput; /*type of format values are: */ #define FAT_ONLY_FORMAT 0 #define TL_FORMAT 1 #define TL_FORMAT_IF_NEEDED 2 #define TL_FORMAT_ONLY 8 /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Format volume (FL_IOCTL_FORMAT_PHYSICAL_DRIVE) */ /* Input record: */ typedef struct { byte formatType; /* type of format as defined in blockdev.h */ FormatParams2 fp; /* Format parameters structure (defined in flformat.h) */ } flFormatPhysicalInput; /*type of format values are: */ /*#define FAT_ONLY_FORMAT 0 */ /*#define TL_FORMAT 1 */ /*#define TL_FORMAT_IF_NEEDED 2 */ #define TL_LEAVE_BINARY_AREA 8 /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* BDK operations read\write\erase\create (FL_IOCTL_BDK_OPERATION) */ /* Input record: */ /* The following structure is used for SDK internal calls, Do not use it when calling TrueFFS driver. Use the flBDKOperationInput structure.*/ /*************************************************************************/ /* BDK struct used when formating for BDK partition settings */ #ifndef CE_DRIVER_LAYER #define BDK_SIGNATURE_NAME 4 typedef struct { byte oldSign[BDK_SIGNATURE_NAME]; byte newSign[BDK_SIGNATURE_NAME]; byte signOffset; DWORD startingBlock; DWORD length; byte flags; byte far *bdkBuffer; } BDKStruct; /*Available values for flags: */ #define ERASE_BEFORE_WRITE 8 #define EXTRA_SIZE 16 #else typedef struct { byte type; /* type of operation: BDK_INIT_READ\BDK_READ\BDK_INIT_WRITE\ */ /* BDK_WRITE\BDK_ERASE\BDK_CREATE\BDK_GET_INFO */ BDKStruct bdkStruct; /* parameters for BDK operations (defined in docbdk.h) */ } flCEBDKOperationInput; #endif /*CE_DRIVER_LAYER*/ /* This is the inpur record used:*/ typedef struct { byte partitionNumber; byte type; /* type of operation: BDK_INIT_READ\BDK_READ\BDK_INIT_WRITE\ */ /* BDK_WRITE\BDK_ERASE\BDK_CREATE\BDK_GET_INFO */ BDKStruct bdkStruct; /* parameters for BDK operations (defined in docbdk.h) */ } flBDKOperationInput; /* Available values for type are:*/ #define BDK_INIT_READ 0 #define BDK_READ 1 #define BDK_INIT_WRITE 2 #define BDK_WRITE 3 #define BDK_ERASE 4 #define BDK_CREATE 5 #define BDK_GET_INFO 6 /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* BDK and BDTL protection operations: (FL_IOCTL_BINARY_HW_PROTECTION) */ /* (FL_IOCTL_BDTL_HW_PROTECTION) */ /* insert key \ remove key \ identify \ change key \ */ /* change protection type \ change lock status */ /* Input record: */ typedef struct { byte protectionType; /* see flflash.h for the protection attributes */ byte key[8]; /* The new key to the change Key call */ byte type; /* Operation type see list bellow */ } flProtectionInput; typedef struct { byte partitionNumber; /* the BDK partition number */ byte protectionType; /* see list bellow for the protection attributes */ byte key[8]; /* The new key to the change Key call */ byte type; /* Operation type see list bellow */ } flBDKProtectionInput; #define PROTECTION_INSERT_KEY 0 #define PROTECTION_REMOVE_KEY 1 #define PROTECTION_GET_TYPE 2 #define PROTECTION_DISABLE_LOCK 3 #define PROTECTION_ENABLE_LOCK 4 #define PROTECTION_CHANGE_KEY 5 #define PROTECTION_CHANGE_TYPE 6 /* The options for protection attributes are:*/ #define PROTECTABLE 1 /* partition can recieve protection */ #define READ_PROTECTED 2 /* partition is read protected */ #define WRITE_PROTECTED 4 /* partition is write protected */ #define LOCK_ENABLED 8 /* HW lock signal is enabled */ #define LOCK_ASSERTED 16 /* HW lock signal is asserted */ #define KEY_INSERTED 32 /* key is inserted (not currently */ #define CHANGEABLE_PROTECTION 64 /* changeable protection area type */ #define OTW_PROTECTED 128 /* partition is locked forever */ #define STICKY_LOCK_ASSERTED 256 /* Sticky lock is activated */ /* Output record: */ typedef struct { byte protectionType; /* see flflash.h for the protection attributes */ FLStatus status; } flProtectionOutput; /*************************************************************************/ /* One Time Programing operations: (FL_IOCTL_OTP */ /* OTP size \ OTP read \ OTP write and lock */ /* Input record: */ typedef struct { DWORD length; /* Length to read\write\size */ DWORD usedSize; /* The written size of the area \ Area offset */ byte lockedFlag; /* The area condition LOCKED_OTP (flflash.h) */ byte far* buffer; /* pointer to user buffer */ unsigned short type; /* defined bellow */ } flOtpInput; /* Values for type are: */ #define OTP_SIZE 1 #define OTP_READ 2 #define OTP_WRITE_LOCK 3 /* LOCKED_OTP definition: */ #define LOCKED_OTP 1 /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Read customer ID (FL_IOCTL_CUSTOMER_ID) */ /* Input record: NULL */ /* Output record: */ typedef struct { byte id[4]; FLStatus status; } flCustomerIdOutput; /*************************************************************************/ /* Read unique ID (FL_IOCTL_UNIQUE_ID) */ /* Input record: NULL */ /* Output record: */ typedef struct { byte id[16]; FLStatus status; } flUniqueIdOutput; /*************************************************************************/ /* Read unique ID (FL_IOCTL_NUMBER_OF_PARTITIONS) */ /* Input record: NULL */ /* Output record: */ typedef struct { byte noOfPartitions; FLStatus status; } flCountPartitionsOutput; /*************************************************************************/ /* Quary the device h/w and s/w capabilities (FL_IOCTL_INQUIRE_CAPABILITIES) */ /*************************************************************************/ /* Quary the device h/w and s/w capabilities */ #ifndef CE_DRIVER_LAYER typedef enum{ CAPABILITY_NOT_SUPPORTED = 0, CAPABILITY_SUPPORTED = 1, SUPPORT_UNERASABLE_BBT = 2, SUPPORT_MULTIPLE_BDTL_PARTITIONS = 3, SUPPORT_MULTIPLE_BINARY_PARTITIONS = 4, SUPPORT_HW_PROTECTION = 5, SUPPORT_HW_LOCK_KEY = 6, SUPPORT_CUSTOMER_ID = 7, SUPPORT_UNIQUE_ID = 8, SUPPORT_DEEP_POWER_DOWN_MODE = 9, SUPPORT_OTP_AREA = 10, SUPPORT_WRITE_IPL_ROUTINE = 11, SUPPORT_OTW_PROTECTION = 12, SUPPORT_STICKY_LOCK_PROTECTION = 13 }FLCapability; #endif /*CE_DRIVER_LAYER*/ /* Input record: */ typedef struct { FLCapability capability; /* defined in blockdev.h */ } flCapabilityInput; /* Output record: */ typedef struct { FLCapability capability; /* defined in blockdev.h */ FLStatus status; } flCapabilityOutput; /*************************************************************************/ /* Place EXB file by buffers (FL_IOCTL_PLACE_EXB_BY_BUFFER) */ /* Input record: */ typedef struct { byte far* buf; /* buffer of EXB file */ DWORD bufLen; /* buffer length */ byte exbFlags; /* a combination of EXB flags see flPlaceExbByBuffer routine */ /* The list of flags is defined in doc2exb.h */ unsigned short exbWindow; /* explicitly set device window. 0 will automatcly set window */ } flPlaceExbInput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Write IPL area for docPlus family (FL_IOCTL_WRITE_IPL) */ /* This is an old API, it is used only for backward campatability.*/ /* Input record: */ typedef struct { byte far* buf; /* IPL data buffer */ unsigned short bufLen; /* IPL data buffer length */ } flIplOldInput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /*************************************************************************/ /* Write IPL area for docPlus family (FL_IOCTL_EXTENDED_WRITE_IPL) */ /* Input record: */ typedef struct { byte far* buf; /* IPL data buffer */ unsigned short flags; /* IPL flags (see flflash.h) */ unsigned short bufLen; /* IPL data buffer length */ } flIplInput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Place the device into and out of the power down mode (FL_IOCTL_DEEP_POWER_DOWN_MODE) */ typedef struct { byte state; /* DEEP_POWER_DOWN - low power consumption */ /* otherwise - regular power consumption */ } flPowerDownInput; #define EXIT_DEEP_POWER_DOWN 0 /* must be the same as in blockdev.h */ #define DEEP_POWER_DOWN 1 /* must be the same as in blockdev.h */ /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* Delete logical sectors (FL_IOCTL_DELETE_SECTORS) */ /* Input record: */ typedef struct { long firstSector; /* First logical sector to delete */ long numberOfSectors; /* Number of sectors to delete */ } flDeleteSectorsInput; /* Output record: flOutputStatusRecord */ /*************************************************************************/ /* read & write logical sectors (FL_IOCTL_READ_SECTORS & FL_IOCTL_WRITE_SECTORS) */ /* Input record: */ typedef struct { long firstSector; /* first logical sector */ long numberOfSectors; /* Number of sectors to read\write */ byte far *buf; /* Data to read\write */ } flReadWriteInput; /* Output record: */ typedef struct { long numberOfSectors; /* Actual Number of sectors read\written */ FLStatus status; } flReadWriteOutput; /*************************************************************************/ /* Mount volume (FL_IOCTL_UPDATE_XIP_MODE) */ /* Input record: */ typedef struct { byte mode; /*FL_ON or FL_OFF - type of update XIP mode */ byte handle; /*Partition which is used for bin FS that is being updated.*/ } flUpdateXIPInput; #define FL_MOUNT 0 #endif /*FLIOCTL_H*/