• Keine Ergebnisse gefunden

Using Fixed and Variable Length Blocks

Im Dokument Functional Specifications ~ (Seite 22-25)

2.6. 1.

VarIable and Fixed Length Blocks

When reading or writing the Drive groups data transferred toIfrom the Initiator into blocks. The length of a block may vary. When executing read and write commands two parameters must be specified; the block length and also the number of blocks to read or write. As the SCSI read and write commands only have room for a single parameter, only the block length or the number of block can be specified directly. For this reason there are two different versions of each command capable of transferring tape data to or from the Initiator. The fixed length type commands can specify the number of blocks to be processed. For these commands all blocks will be of equal size. The actual size is given by the current value in the Block Size field in the Block Descriptor List of the MODE SELECT command. The variable length type commands can specify the length of the individual blocks, but the number of blocks written is always only one (for each command).

When the Block Size field has a value different from zero, the Drive is said to be in /hed block mode. In this mode both the fixed length type commands and the variable length type commands are allowed. When the Block Size field is zero, the Drive is said to be in variable block mode. In this mode only the variable length type commands are allowed (as writing fIXed length blocks of size zero bytes does not make any sense).

NOTE:

The illegal length handling in the READ command differs slightly de-pending on the current mode.

2.6.2.

Wrfflng

When writing, the Drive groups the data transferred from the Initiator into blocks. When using the QIC-52511000 tape format a block can be from 1 to 16777215 bytes long. When using the QIC-120 or QIC-150 tape formats it may be from 1 to 32786 bytes long.

Data blocks may be written with two different versions of the WRITE command; one with the fixed (FIX) bit set and one with the fixed (FIX) bit cleared.

When the FIX bit is cleared, a WRITE command will write a single block. The block length may be specified on a block-by-block basis. This is useful when writing blocks of varying length.

When the FIX bit is set to one, a WRITE command may write multiple blocks. The WRITE command must specify the number of blocks to write. All written blocks will be of the same length. The length used is the length reported by the MODE SENSE command (the Block Size field of the Block Descriptor List). Note that when the Block Size field has been set to zero, the Drive is said to be in Variable Block mode and commands with the FIX bit set to one is not allowed.

2-7 SCSI-2 Functional SpecifICations

Tandberg Data About Tape Streamers

2.6.3. Reading

When reading data of a tape, the Drive is able to determine the length of each block read. When reading, the expected block length must be specified. This can be done in two different ways with the two different versions of the READ command; one with the fixed (FIX) bit set and one with the fixed (FIX) bit clear.

When the FIX bit is clear, a READ command will read a single block.

The expected block length may be specified on a block-by-block basis.

When the FIX bit is set to one, a READ command may read multiple blocks. The READ command must specify the number of blocks to read.

The expected block length of all blocks is the same.The expected length is specified with the MODE SELECT command(the Block Size field of the Block Descriptor List). Note that when the Block Size field has been set to zero, the Drive is said to be in Variable Block mode and com-mands with the FIX bit set to one is not allowed.

2.6.4. Illegal Length Conditions when Reading

When the specified block length does not match the actual block length, the READ command will complain (if not the Suppress ruegal Length Indicator (SILl) bit was set in the READ Command Descriptor Block).

2.6.4. 1. Reading with the Fixed-Bit Clear

If the actual block length is smaller then the expected block length (the length specified in the Command Descriptor Block of the READ com-mand), the READ command will transfer the actual number of bytes found in the block. The READ command is then terminated with a CHECK CONDITION Status. The ruegal Length Indicator will be set in the Sense Data List. The Information Bytes will be set to the difference between the expected number of bytes and the actual number of bytes.

This will be a positive number in this case. The logical tape position will be at the beginning of the next block on the tape.

If the actual block length is larger than the expected block length, the READ command will transfer the expected number of bytes only. The READ command is then terminated with a CHECK CONDITION Sta-tus. The Illegal Length Indicator will be set in the Sense Data List. The Information bytes will be set up with the difference between the ex-pected number of bytes and the actual number of bytes. This will be a negative number in this case. The information bytes is presented as a 32 bit 2's complement number. The logical tape position will be at the beginning of the next block on the tape. This means that the additional bytes in the block with the unexpected length is lost.

2-8 SCSI-2 Functional Specifications

2.6.4.2. Reading with the Fixed-Bit Set

lf the actual block length is smaller then the expected block length, the READ command will transfer the actual number of bytes found in the block. The READ command is then terminated with a CHECK CONDI-TION Status. The megal Length Indicator will be set in the Sense Data List. The Information Bytes will be set to the difference between the specified number of blocks and the actual number of blocks transferred.

The block with the unexpected length is counted among the transferred blocks even if its length was wrong. Note that this means that the Information Bytes may read zero even if the READ command was termi-nated with CHECK CONDITION and megal Length Indication. The logical tape position will be at the beginning of the block following the block with the unexpected length.

If the actual block length is larger than the expected block length, the READ command will transfer the expected number of bytes only. The READ command is then terminated with a CHECK CONDITION Sta-tus. The megal Length Indicator will be set in the Sense Data List. The Information bytes will be set up with the difference between the speci-fied number of blocks and the actual number of blocks transferred. The block with the unexpected length is counted among the transferred blocks even if its length was wrong. Note that this means that the Information Bytes may read zero even if the READ command was termi-nated with CHECK CONDITION and megal Length Indication. The logical tape position will be at the beginning of the block following the block with the unexpected length. This means that the additional bytes in the block with the unexpected length is lost.

2-9 SCSI-2 Functional Specifications

The Scratch Pad

Tandberg Data About Tape Streamers

Im Dokument Functional Specifications ~ (Seite 22-25)