⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aspi.h

📁 一个SCSI的Tape设备读写等操作的软件.
💻 H
📖 第 1 页 / 共 3 页
字号:
/*
                    Table 200 - Device configuration page
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+========+========+=====================================================|
| 0   |   PS   |Reserved|         Page code (10h)                             |
|-----+-----------------------------------------------------------------------|
| 1   |                           Page length (0Eh)                           |
|-----+-----------------------------------------------------------------------|
| 2   |Reserved|  CAP   |  CAF   |                Active format               |
|-----+-----------------------------------------------------------------------|
| 3   |                           Active partition                            |
|-----+-----------------------------------------------------------------------|
| 4   |                           Write buffer full ratio                     |
|-----+-----------------------------------------------------------------------|
| 5   |                           Read buffer empty ratio                     |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                        Write delay time                         ---|
| 7   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 8   |  DBR   |  BIS   |  RSmk  |  AVC   |      SOCF       |   RBO  |  REW   |
|-----+-----------------------------------------------------------------------|
| 9   |                           Gap size                                    |
|-----+-----------------------------------------------------------------------|
| 10  |      EOD defined         |  EEG   |  SEW   |        Reserved          |
|-----+-----------------------------------------------------------------------|
| 11  | (MSB)                                                                 |
|-----+---                                                                 ---|
| 12  |                           Buffer size at early warning                |
|-----+---                                                                 ---|
| 13  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 14  |                           Select data compression algorithm           |
|-----+-----------------------------------------------------------------------|
| 15  |                           Reserved                                    |
+=============================================================================+
*/
typedef struct
{
	unsigned pagecode : 6;		//0x10
	unsigned _reserved1 : 1;	//n/a	
	unsigned ps : 1;			//
	unsigned len : 8;			//0x0E (n-2)
	unsigned format : 5;		//active format
	unsigned caf : 1;			//
	unsigned cap : 1;			//
	unsigned _reserved2 : 1;	//n/a
	unsigned partition : 8;		//active partition
	unsigned wrratio : 8;		//write buffer full ratio
	unsigned rdratio : 8;		//read buffer empty ratio
	unsigned delay1 : 8;		//write delay time (MSB)
	unsigned delay2 : 8;		//write delay time (LSB)
	unsigned rew : 1;			//
	unsigned rbo : 1;			//
	unsigned socf : 2;			//
	unsigned avc : 1;			//
	unsigned rsmk : 1;			//read setmarks
	unsigned bis : 1;			//
	unsigned dbr : 1;			//
	unsigned gap : 8;			//gap size
	unsigned _reserved3 : 3;	//n/a
	unsigned sew : 1;			//
	unsigned eeg : 1;			//
	unsigned eod : 3;			//
	unsigned size1 : 8;			//Buffer size at early warning (MSB)
	unsigned size2 : 8;			//Buffer size at early warning (...)
	unsigned size3 : 8;			//Buffer size at early warning (LSB)
	unsigned comp : 8;			//data compression algorithm
	unsigned _reserved4 : 8;	//n/a	
}_MPG_devconf;

/*
                    Table 202 - Medium partition page(1)
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+========+========+=====================================================|
| 0   |   PS   |Reserved|         Page code (11h)                             |
|-----+-----------------------------------------------------------------------|
| 1   |                           Page length                                 |
|-----+-----------------------------------------------------------------------|
| 2   |                           Maximum additional partitions               |
|-----+-----------------------------------------------------------------------|
| 3   |                           Additional partitions defined               |
|-----+-----------------------------------------------------------------------|
| 4   |  FDP   |  SDP   |  IDP   |       PSUM      |       Reserved           |
|-----+-----------------------------------------------------------------------|
| 5   |                           Medium format recognition                   |
|-----+-----------------------------------------------------------------------|
| 6   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 7   |                           Reserved                                    |
|=====+=======================================================================|
|     |                   Partition size descriptor(s)                        |
|=====+=======================================================================|
| 0   | (MSB)                                                                 |
|-----+---                        Partition size                           ---|
| 1   |                                                                 (LSB) |
+=============================================================================+
*/
typedef struct
{
	unsigned pagecode : 6;		//0x11
	unsigned _reserved1 : 1;	//n/a	
	unsigned ps : 1;			//
	unsigned len : 8;			//
	unsigned maxadd : 8;		//
	unsigned adddef : 8;		//
	unsigned _reserved2 : 3;	//n/a
	unsigned psum : 2;			//
	unsigned idp : 1;			//
	unsigned sdp : 1;			//
	unsigned fdp : 1;			//
	unsigned medrec : 8;		//
}_MPG_partition;
	/*
	unsigned _reserved3 : 8;	//n/a
	unsigned _reserved4 : 8;	//n/a	
	unsigned size1 : 8;			//
	unsigned size2 : 8;			//
}_MPG_partition1;
*/


//Data Compression Page
typedef struct
{
	unsigned pagecode : 6;		//0x0F
	unsigned _reserved1 : 1;	//n/a	
	unsigned ps : 1;			//
	unsigned len : 8;			//
	unsigned _reserved2 : 6;	//n/a
	unsigned dcc : 1;			//data compression ????
	unsigned dce : 1;			//data compression enable
	unsigned _reserved3 : 5;	//n/a
	unsigned red : 2;			//
	unsigned dde : 1;			//data decompression enable
	unsigned comp_1 : 8;		//compression algorithm
	unsigned comp_2 : 8;		//
	unsigned comp_3 : 8;		//
	unsigned comp_4 : 8;		//
	unsigned decomp_1 : 8;		//decompression algorithm
	unsigned decomp_2 : 8;		//
	unsigned decomp_3 : 8;		//
	unsigned decomp_4 : 8;		//
	unsigned _reserved4 : 8;	//n/a
	unsigned _reserved5 : 8;	//n/a	
	unsigned _reserved6 : 8;	//n/a
	unsigned _reserved7 : 8;	//n/a
}_MPG_compression;


/*
                     Table 91 - Mode parameter header(6)
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Mode data length                            |
|-----+-----------------------------------------------------------------------|
| 1   |                           Medium type                                 |
|-----+-----------------------------------------------------------------------|
| 2   |                           Device-specific parameter                   |
|-----+-----------------------------------------------------------------------|
| 3   |                           Block descriptor length                     |
+=============================================================================+
*/
typedef struct
{
	unsigned modesize : 8;		//
	unsigned medium : 8;		//
	unsigned speed : 4;			//
	unsigned buff : 3;			//buffered mode 
	unsigned wp : 1;			//write protected ?
	unsigned bdsize : 8;		//block descriptor length
}ParameterHeader;

/*
                  Table 93 - Mode parameter block descriptor
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Density code                                |
|-----+-----------------------------------------------------------------------|
| 1   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 2   |                           Number of blocks                            |
|-----+---                                                                 ---|
| 3   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 6   |                           Block length                                |
|-----+---                                                                 ---|
| 7   |                                                                 (LSB) |
+=============================================================================+
*/
typedef struct
{
	unsigned density : 8;		//
	unsigned blocks1 : 8;		//
	unsigned blocks2 : 8;		//
	unsigned blocks3 : 8;		//
	unsigned _reserved1 : 8;	//n/a
	unsigned size1 : 8;			//
	unsigned size2 : 8;			//
	unsigned size3 : 8;			//
}BlockDescriptor;

//complete Device Configuration Mode-Page
typedef struct
{
	ParameterHeader		head;
	BlockDescriptor		bd;
	_MPG_devconf		dev;
}MPG_devconf;

//complete Partition1 Mode-Page (e.g.Sony)
typedef struct
{
	ParameterHeader		head;
	BlockDescriptor		bd;
	_MPG_partition		par;
}MPG_partition;

//complete Partition1 Mode-Page for most DAT-Streamers
typedef struct
{
	ParameterHeader		head;
	_MPG_partition		par;
}MPG_partition_small;

//complete Compression Mode-Page
typedef struct
{
	ParameterHeader		head;
	BlockDescriptor		bd;
	_MPG_compression	com;
}MPG_compression;

/*
                        Table 36 - COPY parameter list
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+============================================+==========================|
| 0   |         COPY function code                 |         Priority         |
|-----+-----------------------------------------------------------------------|
| 1   |                           Vendor-specific                             |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|=====+=======================================================================|
|     |                         Segment descriptor(s)                         |
|=====+=======================================================================|
| 0   |                           Segment descriptor 0                        |
|- - -+---                                                                 ---|
| n   |                     (See specific table for length.)                  |
|-----+-----------------------------------------------------------------------|
|     |                                 .                                     |
|     |                                 .                                     |
|-----+-----------------------------------------------------------------------|
| 0   |                           Segment descriptor x                        |
|- - -+---                                                                 ---|
| n   |                     (See specific table for length.)                  |
+=============================================================================+
*/
typedef struct
{
	unsigned priority : 3;		//01 00
	unsigned code : 5;			//function code 0x04 for image copy 
	unsigned vendor : 8;		//???
	unsigned _reserved1 : 8;	//n/a
	unsigned _reserved2 : 8;	//n/a
	//segment descriptors
	//....
}CPY_para_head;

/*
           Table 41 - Segment descriptor for COPY function code 04h
+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+==========================+=================+==========================|
| 0   | Source address           |   Reserved      | Source LUN               |
|-----+--------------------------+-----------------+--------------------------|
| 1   | Destination address      |   Reserved      | Destination LUN          |
|-----+-----------------------------------------------------------------------|
| 2   |                              Count                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                                                                       |
|- - -+---                           Reserved                              ---|
| 7   |                                                                       |
|-----+-----------------------------------------------------------------------|
| 8   |                                                                       |
|- - -+---                           Vendor-specific                       ---|
| 11  |                                                                       |
+=============================================================================+
*/
typedef struct
{
	unsigned source_lun : 3;	//source lun
	unsigned _reserved1 : 2;	//n/a
	unsigned source_id : 3;		//source id
	unsigned dest_lun : 3;		//destination lun
	unsigned _reserved2 : 2;	//n/a
	unsigned dest_id : 3;		//destination id
	unsigned count : 8;			//count (number of setmarks or filemarks to copy)
	unsigned _reserved3 : 8;	//n/a
	unsigned _reserved4 : 8;	//n/a
	unsigned _reserved5 : 8;	//n/a
	unsigned _reserved6 : 8;	//n/a
	unsigned _reserved7 : 8;	//n/a
	unsigned vendor1 : 8;		//???
	unsigned vendor2 : 8;		//???
	unsigned vendor3 : 8;		//???
	unsigned vendor4 : 8;		//???
}CPY_segment_desc;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -