📄 mtx.h
字号:
unsigned char VendorIdentification[8]; /* Bytes 8-15 */ unsigned char ProductIdentification[16]; /* Bytes 16-31 */ unsigned char ProductRevisionLevel[4]; /* Bytes 32-35 */ unsigned char FullProductRevisionLevel[19]; /* bytes 36-54 */ unsigned char VendorFlags; /* byte 55 */}Inquiry_T;/* Hockey Pux may define these. If so, *UN*define them. */#ifdef ILI#undef ILI#endif#ifdef EOM#undef EOM#endiftypedef struct RequestSense{#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char ErrorCode:7; /* Byte 0 Bits 0-6 */ boolean Valid:1; /* Byte 0 Bit 7 */#else boolean Valid:1; /* Byte 0 Bit 7 */ unsigned char ErrorCode:7; /* Byte 0 Bits 0-6 */#endif unsigned char SegmentNumber; /* Byte 1 */#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char SenseKey:4; /* Byte 2 Bits 0-3 */ unsigned char :1; /* Byte 2 Bit 4 */ boolean ILI:1; /* Byte 2 Bit 5 */ boolean EOM:1; /* Byte 2 Bit 6 */ boolean Filemark:1; /* Byte 2 Bit 7 */#else boolean Filemark:1; /* Byte 2 Bit 7 */ boolean EOM:1; /* Byte 2 Bit 6 */ boolean ILI:1; /* Byte 2 Bit 5 */ unsigned char :1; /* Byte 2 Bit 4 */ unsigned char SenseKey:4; /* Byte 2 Bits 0-3 */#endif unsigned char Information[4]; /* Bytes 3-6 */ unsigned char AdditionalSenseLength; /* Byte 7 */ unsigned char CommandSpecificInformation[4]; /* Bytes 8-11 */ unsigned char AdditionalSenseCode; /* Byte 12 */ unsigned char AdditionalSenseCodeQualifier; /* Byte 13 */ unsigned char :8; /* Byte 14 */#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char BitPointer:3; /* Byte 15 */ boolean BPV:1; unsigned char :2; boolean CommandData :1; boolean SKSV:1; #else boolean SKSV:1; boolean CommandData :1; unsigned char :2; boolean BPV:1; unsigned char BitPointer:3; /* Byte 15 */#endif unsigned char FieldData[2]; /* Byte 16,17 */}RequestSense_T;/* Okay, now for the element status mode sense page (0x1d): */typedef struct ElementModeSensePageHeader { unsigned char PageCode; /* byte 0 */ unsigned char ParameterLengthList; /* byte 1; */ unsigned char MediumTransportStartHi; /* byte 2,3 */ unsigned char MediumTransportStartLo; unsigned char NumMediumTransportHi; /* byte 4,5 */ unsigned char NumMediumTransportLo; /* byte 4,5 */ unsigned char StorageStartHi; /* byte 6,7 */ unsigned char StorageStartLo; /* byte 6,7 */ unsigned char NumStorageHi; /* byte 8,9 */ unsigned char NumStorageLo; /* byte 8,9 */ unsigned char ImportExportStartHi; /* byte 10,11 */ unsigned char ImportExportStartLo; /* byte 10,11 */ unsigned char NumImportExportHi; /* byte 12,13 */ unsigned char NumImportExportLo; /* byte 12,13 */ unsigned char DataTransferStartHi; /* byte 14,15 */ unsigned char DataTransferStartLo; /* byte 14,15 */ unsigned char NumDataTransferHi; /* byte 16,17 */ unsigned char NumDataTransferLo; /* byte 16,17 */ unsigned char Reserved1; /* byte 18, 19 */ unsigned char Reserved2; /* byte 18, 19 */} ElementModeSensePage_T;typedef struct ElementModeSenseHeader { int MaxReadElementStatusData; /* 'nuff for all of below. */ int NumElements; /* total # of elements. */ int MediumTransportStart; int NumMediumTransport; int StorageStart; int NumStorage; int ImportExportStart; int NumImportExport; int DataTransferStart; int NumDataTransfer;} ElementModeSense_T;typedef enum ElementTypeCode{ AllElementTypes = 0, MediumTransportElement = 1, StorageElement = 2, ImportExportElement = 3, DataTransferElement = 4}ElementTypeCode_T;typedef struct ElementStatusDataHeader{ unsigned char FirstElementAddressReported[2]; /* Bytes 0-1 */ unsigned char NumberOfElementsAvailable[2]; /* Bytes 2-3 */ unsigned char :8; /* Byte 4 */ unsigned char ByteCountOfReportAvailable[3]; /* Bytes 5-7 */}ElementStatusDataHeader_T;typedef struct ElementStatusPage{ ElementTypeCode_T ElementTypeCode:8; /* Byte 0 */#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char :6; /* Byte 1 Bits 0-5 */ boolean AVolTag:1; /* Byte 1 Bit 6 */ boolean PVolTag:1; /* Byte 1 Bit 7 */#else boolean PVolTag:1; /* Byte 1 Bit 7 */ boolean AVolTag:1; /* Byte 1 Bit 6 */ unsigned char :6; /* Byte 1 Bits 0-5 */#endif unsigned char ElementDescriptorLength[2]; /* Bytes 2-3 */ unsigned char :8; /* Byte 4 */ unsigned char ByteCountOfDescriptorDataAvailable[3]; /* Bytes 5-7 */}ElementStatusPage_T;typedef struct Element2StatusPage{ ElementTypeCode_T ElementTypeCode:8; /* Byte 0 */ unsigned char VolBits ; /* byte 1 */#define E2_PVOLTAG 0x80#define E2_AVOLTAG 0x40 unsigned char ElementDescriptorLength[2]; /* Bytes 2-3 */ unsigned char :8; /* Byte 4 */ unsigned char ByteCountOfDescriptorDataAvailable[3]; /* Bytes 5-7 */}Element2StatusPage_T;typedef struct TransportElementDescriptorShort{ unsigned char ElementAddress[2]; /* Bytes 0-1 */#ifdef LITTLE_ENDIAN_BITFIELDS boolean Full:1; /* Byte 2 Bit 0 */ unsigned char :1; /* Byte 2 Bit 1 */ boolean Except:1; /* Byte 2 Bit 2 */ unsigned char :5; /* Byte 2 Bits 3-7 */#else unsigned char :5; /* Byte 2 Bits 3-7 */ boolean Except:1; /* Byte 2 Bit 2 */ unsigned char :1; /* Byte 2 Bit 1 */ boolean Full:1; /* Byte 2 Bit 0 */#endif unsigned char :8; /* Byte 3 */ unsigned char AdditionalSenseCode; /* Byte 4 */ unsigned char AdditionalSenseCodeQualifier; /* Byte 5 */ unsigned char :8; /* Byte 6 */ unsigned char :8; /* Byte 7 */ unsigned char :8; /* Byte 8 */#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char :6; /* Byte 9 Bits 0-5 */ boolean SValid:1; /* Byte 9 Bit 6 */ boolean Invert:1; /* Byte 9 Bit 7 */#else boolean Invert:1; /* Byte 9 Bit 7 */ boolean SValid:1; /* Byte 9 Bit 6 */ unsigned char :6; /* Byte 9 Bits 0-5 */#endif unsigned char SourceStorageElementAddress[2]; /* Bytes 10-11 */}TransportElementDescriptorShort_T;typedef struct TransportElementDescriptor{ unsigned char ElementAddress[2]; /* Bytes 0-1 */#ifdef LITTLE_ENDIAN_BITFIELDS boolean Full:1; /* Byte 2 Bit 0 */ unsigned char :1; /* Byte 2 Bit 1 */ boolean Except:1; /* Byte 2 Bit 2 */ unsigned char :5; /* Byte 2 Bits 3-7 */#else unsigned char :5; /* Byte 2 Bits 3-7 */ boolean Except:1; /* Byte 2 Bit 2 */ unsigned char :1; /* Byte 2 Bit 1 */ boolean Full:1; /* Byte 2 Bit 0 */#endif unsigned char :8; /* Byte 3 */ unsigned char AdditionalSenseCode; /* Byte 4 */ unsigned char AdditionalSenseCodeQualifier; /* Byte 5 */ unsigned char :8; /* Byte 6 */ unsigned char :8; /* Byte 7 */ unsigned char :8; /* Byte 8 */#ifdef LITTLE_ENDIAN_BITFIELDS unsigned char :6; /* Byte 9 Bits 0-5 */ boolean SValid:1; /* Byte 9 Bit 6 */ boolean Invert:1; /* Byte 9 Bit 7 */#else boolean Invert:1; /* Byte 9 Bit 7 */ boolean SValid:1; /* Byte 9 Bit 6 */ unsigned char :6; /* Byte 9 Bits 0-5 */#endif unsigned char SourceStorageElementAddress[2]; /* Bytes 10-11 */ unsigned char PrimaryVolumeTag[36]; /* barcode */ unsigned char AlternateVolumeTag[36]; }TransportElementDescriptor_T;/* Now for element status data; */typedef unsigned char barcode[37];typedef struct ElementStatus { int StorageElementCount; int ImportExportCount; int DataTransferElementCount; int *DataTransferElementAddress; /* array. */ int *DataTransferElementSourceStorageElementNumber; /* array */ barcode *DataTransferPrimaryVolumeTag; /* array. */ barcode *DataTransferAlternateVolumeTag; /* array. */ barcode *PrimaryVolumeTag; /* array */ barcode *AlternateVolumeTag; /* array */ int *StorageElementAddress; /* array */ boolean *StorageElementIsImportExport; /* array */ int TransportElementAddress; /* assume only one of those... */ boolean *DataTransferElementFull; /* array */ boolean *StorageElementFull; /* array */} ElementStatus_T;/* Now for the SCSI ID and LUN information: */typedef struct scsi_id { int id; int lun;} scsi_id_t;#define MEDIUM_CHANGER_TYPE 8 /* what type bits are set for medium changers. */#endif /* of multi-include protection. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -