TAPE_PHYS_POSITION
TapeClassLogicalBlockToPhysicalBlock(
IN UCHAR DensityCode,
IN ULONG LogicalBlockAddress,
IN ULONG BlockLength,
IN BOOLEAN FromBOT
);
TapeClassLogicalBlockToPhysicalBlock translates a pseudological block address to a physical block address. This routine is for SCSI-I devices.
TapeClassLogicalBlockToPhysicalBlock returns a structure containing the physical block address:
typedef struct _TAPE_PHYS_POSITION { ULONG SeekBlockAddress; ULONG SpaceBlockCount; } TAPE_PHYS_POSITION, PTAPE_PHYS_POSITION;
A tape miniclass driver calls TapeClassLogicalBlockToPhysicalBlock to translate a logical block address from an application to a physical block address for a tape device. TapeClassLogicalBlockToPhysicalBlock is not necessary for SCSI-II drivers because SCSI-II devices support logical block addressing.
To position a tape to the physical block address returned by this routine a tape miniclass driver issues two SCSI commands: a LOCATE command to position the tape to the SeekBlockAddress and then a SPACE command to advance the tape SpaceBlockCount. The SpaceBlockCount value is necessary if the pseudological blocks on the tape are smaller than the physical blocks; in that case, the logical block boundary might not align with a physical block boundary.
If a tape miniclass driver calls this routine with an unsupported tape density code, TapeClassLogicalBlockToPhysicalBlock does not perform any translation. It returns the logical block address in SeekBlockAddress and returns zero in SpaceBlockCount.