TapeClassPhysicalBlockToLogicalBlock

ULONG
TapeClassPhysicalBlockToLogicalBlock(
IN UCHAR 
DensityCode,
IN ULONG 
PhysicalBlockAddress,
IN ULONG 
BlockLength,
IN BOOLEAN 
FromBOT
);

TapeClassPhysicalBlockToLogicalBlock translates a physical block address to a pseudological block address. This routine is for SCSI-I devices.

Parameters

DensityCode

Specifies the tape media density code. This routine supports tapes with the following density codes: QIC_24, QIC_120, QIC_150, QIC_525, QIC_1000, QIC_2GB, QIC_1350, and QIC_2100.

PhysicalBlockAddress

Specifies the physical block address obtained by a SCSI READ POSITION command.

BlockLength

Specifies the logical block size, in bytes.

FromBOT

TRUE indicates that the logical block calculation should start at the beginning of the tape and account for the physical device header. FALSE indicates that the tape has two partitions, that the block address is on the directory partition, and therefore no physical device header needs to be factored into the calculation.

Return Value

TapeClassPhysicalBlockToLogicalBlock returns the logical block address.

Comments

A tape miniclass driver calls TapeClassPhysicalBlockToLogicalBlock to translate a physical block address from a tape device to a logical block address for an application. TapeClassPhysicalBlockToLogicalBlock is not necessary for SCSI-II drivers because SCSI-II devices support logical block addressing.

If a tape miniclass driver calls this routine with an unsupported tape density code, TapeClassPhysicalBlockToLogicalBlock returns the physical block address in the return value, without performing any translation.

See Also

TapeClassLogicalBlockToPhysicalBlock