📄 flioctl.h
字号:
/*********************************************************************
* *
* File : flioctl.h for VxWorks *
* Purpose : DiskOnChip driver (Ver. 4.1) for VxWorks *
* *
* Copyright (C) M-Systems 2000 *
* *
*********************************************************************/
/*
* $Log$
*/
#ifndef _FLIOCTL_H_
#define _FLIOCTL_H_
/*
* Status codes returned by IOCTL calls to DiskOnChip driver (flstatus.h)
*/
typedef enum {
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,
flIncomplete = 100,
flTimedOut = 101,
flTooManyComponents = 102
} FLStatus;
/*
* Types of the DiskOnChip IOCTL calls (flioct.h)
*/
#define FL_IOCTL_START 0x9000
#define FL_IOCTL_GET_INFO (FL_IOCTL_START + 0) /* get disk info */
#define FL_IOCTL_DEFRAGMENT (FL_IOCTL_START + 1) /* defragment DiskOnChip */
#define FL_IOCTL_WRITE_PROTECT (FL_IOCTL_START + 2) /* write-protection */
#define FL_IOCTL_BDK_OPERATION (FL_IOCTL_START + 5) /* BDK operations */
#define FL_IOCTL_READ_SECTORS (FL_IOCTL_START + 7) /* read abs. sector */
#define FL_IOCTL_WRITE_SECTORS (FL_IOCTL_START + 8) /* write abs. sector */
/* General output record that returns only status */
typedef struct { /* flioctl.h */
FLStatus status;
} flOutputStatusRecord;
/*
* FL_IOCTL_GET_INFO : Get disk information
*/
typedef struct { /* blockdev.h */
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 short 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 (NULL terminated string) */
unsigned long cylinders; /* Media..... */
unsigned long heads; /* geometry...... */
unsigned long sectors; /* parameters. */
} VolumeInfoRecord;
typedef struct { /* flioctl.h */
VolumeInfoRecord info;
FLStatus status;
} flDiskInfoOutput;
/*
* FL_IOCTL_DEFRAGMENT : Flash garbage collection on DiskOnChip
*/
typedef struct { /* flioctl.h */
long requiredNoOfSectors; /* Minimum number of sectors to make available. */
/* if -1 then a quick garbage collection operation */
/* is invoked. */
} flDefragInput;
typedef struct { /* flioctl.h */
long actualNoOfSectors; /* Actual number of sectors available */
FLStatus status;
} flDefragOutput;
/*
* FL_IOCTL_WRITE_PROTECT : Write-protect DiskOnChip
*/
typedef struct { /* flioctl.h */
unsigned char type; /* type of operation: FL_PROTECT/FL_UNPROTECT */
long password[2]; /* password */
} flWriteProtectInput;
/* Values for _flWriteProtectInput.type (flioctl.h) */
#define FL_PROTECT 0
#define FL_UNPROTECT 1
#define FL_UNLOCK 2
/*
* FL_IOCTL_BDK_OPERATION : Access BDK partition on the DiskOnChip
*/
#define BDK_DATA_SIZE 512
typedef struct { /* docbdk.h */
unsigned char oldSign[4];
unsigned char newSign[4];
unsigned char signOffset;
unsigned long startingBlock;
unsigned long length;
unsigned char flags;
unsigned char *bdkBuffer; /* BDK data */
} BDKStruct;
/* Values for flBDKOperationInput.bdkStruct.flags */
#define EDC 2 /* flflash.h */
#define ERASE_BEFORE_WRITE 8 /* flflash.h */
#define BDK_COMPLETE_IMAGE_UPDATE 16 /* bddefs.h */
/* Input data structure for BDK operations */
typedef struct { /* flioctl.h */
unsigned char type; /* type of BDK operation operation */
BDKStruct bdkStruct; /* parameters for BDK operations */
} flBDKOperationInput;
/* Values for flBDKOperationInput.type (flioctl.h) */
#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
/*
* FL_IOCTL_READ_SECTORS : Read absolute sectors.
* FL_IOCTL_WRITE_SECTORS : Write absolute sectors.
*/
/* Input data structure for abs. sector read/write */
typedef struct { /* flioctl.h */
long firstSector; /* first logical sector */
long numberOfSectors; /* Number of sectors to read\write */
char *buf; /* Data to read\write */
} flReadWriteInput;
/* Output data structure for abs. sector read/write */
typedef struct { /* flioctl.h */
long numberOfSectors; /* Actual Number of sectors read\written */
FLStatus status;
} flReadWriteOutput;
#endif /* _FLIOCTL_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -