Unit SCSI

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo SCSI Interface unit

The SCSI interface unit is device non specific in that it implements only the SCSI protocol.

Actual command transfer is performed by a device specific driver that implements the exact semantics of the device. eg USB Mass Storage devices use the SCSI protocol, the SCSI interface implements the protocol behaviour but the actual command transfer is handled by the USB storage driver.

Constants



[Expand]
SCSI specific constants SCSI_*


[Expand]
SCSI device type SCSI_TYPE_*


[Expand]
SCSI device state SCSI_STATE_*


[Expand]
SCSI device flag SCSI_FLAG_*


[Expand]
SCSI protocol message SCSI_MESSAGE_*


[Expand]
SCSI protocol status SCSI_STATUS_*


[Expand]
SCSI protocol sense key SCSI_SENSE_*


[Expand]
SCSI protocol additional sense code SCSI_ASC_*


[Expand]
SCSI protocol additional sense code qualifier SCSI_ASCQ_*


[Expand]
SCSI protocol command SCSI_COMMAND_*


[Expand]
SCSI command data SCSI_COMMAND_MAX_*


[Expand]
SCSI service action SCSI_SAI_*


[Expand]
SCSI inquiry data SCSI_INQUIRY_*


[Expand]
SCSI standard inquiry data SCSI_STANDARD_INQUIRY_*


[Expand]
SCSI inquiry peripheral device type SCSI_DEVICE_TYPE_*


[Expand]
SCSI inquiry removable media bit SCSI_REMOVABLE_MEDIA_*


[Expand]
SCSI request sense data SCSI_REQUEST_SENSE_*


[Expand]
SCSI read capacity data SCSI_READ_CAPACITY_*


[Expand]
SCSI read 10 data SCSI_READ_10_*


[Expand]
SCSI write 10 data SCSI_WRITE_10_*


[Expand]
SCSI logging SCSI_LOG_*


Type definitions



SCSI host enumeration callback

TSCSIHostEnumerate = function(Host:PSCSIHost; Data:Pointer):LongWord;

SCSI host

[Expand]

PSCSIHost = ^TSCSIHost;

TSCSIHost = record

SCSI enumeration callback

TSCSIEnumerate = function(SCSI:PSCSIDevice; Data:Pointer):LongWord;

SCSI notification callback

TSCSINotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

SCSI device

[Expand]

PSCSIDevice = ^TSCSIDevice;

TSCSIDevice = record

SCSI command block

[Expand]

PSCSICommandBlock = ^TSCSICommandBlock;

TSCSICommandBlock = record

SCSI standard inquiry data

[Expand]

PSCSIStandardInquiryData = ^TSCSIStandardInquiryData;

TSCSIStandardInquiryData = packed record

SCSI request sense data

[Expand]

PSCSIRequestSenseData = ^TSCSIRequestSenseData;

TSCSIRequestSenseData = packed record

SCSI read capacity data

[Expand]

PSCSIReadCapacityData = ^TSCSIReadCapacityData;

TSCSIReadCapacityData = packed record

SCSI read capacity 16 data

[Expand]

PSCSIReadCapacity16Data = ^TSCSIReadCapacity16Data;

TSCSIReadCapacity16Data = packed record


Public variables



SCSI logging

SCSI_DEFAULT_LOG_LEVEL:LongWord = SCSI_LOG_LEVEL_DEBUG; Minimum level for SCSI messages. Only messages with level greater than or equal to this will be printed.
SCSI_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure SCSIInit;
Description: To be documented


SCSI functions

[Expand]
function SCSIDeviceInquiry(SCSI:PSCSIDevice; var DeviceType,DeviceFlags:LongWord; var Vendor,Product,Revision:PChar):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceRequestSense(SCSI:PSCSIDevice; var SenseKey,ASC,ASCQ:Byte):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceReadCapacity(SCSI:PSCSIDevice; var BlockSize,BlockShift:LongWord; var BlockCount:Int64):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceTestUnitReady(SCSI:PSCSIDevice; var DeviceFlags:LongWord):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceRead10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceWrite10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceRead16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceWrite16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceTransport(SCSI:PSCSIDevice; Command:PSCSICommandBlock):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceCreate:PSCSIDevice;
Description: Create a new SCSI entry


[Expand]
function SCSIDeviceCreateEx(Size:LongWord):PSCSIDevice;
Description: Create a new SCSI entry


[Expand]
function SCSIDeviceDestroy(SCSI:PSCSIDevice):LongWord;
Description: Destroy an existing SCSI entry


[Expand]
function SCSIDeviceRegister(SCSI:PSCSIDevice):LongWord;
Description: Register a new SCSI in the SCSI table


[Expand]
function SCSIDeviceDeregister(SCSI:PSCSIDevice):LongWord;
Description: Deregister a SCSI from the SCSI table


[Expand]
function SCSIDeviceFind(SCSIId:LongWord):PSCSIDevice;
Description: To be documented


[Expand]
function SCSIDeviceFindByName(const Name:String):PSCSIDevice; inline;
Description: To be documented


[Expand]
function SCSIDeviceFindByDescription(const Description:String):PSCSIDevice; inline;
Description: To be documented


[Expand]
function SCSIDeviceEnumerate(Callback:TSCSIEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIDeviceNotification(SCSI:PSCSIDevice; Callback:TSCSINotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


[Expand]
function SCSIHostCreate:PSCSIHost;
Description: Create a new Host entry


[Expand]
function SCSIHostCreateEx(Size:LongWord):PSCSIHost;
Description: Create a new Host entry


[Expand]
function SCSIHostDestroy(Host:PSCSIHost):LongWord;
Description: Destroy an existing Host entry


[Expand]
function SCSIHostRegister(Host:PSCSIHost):LongWord;
Description: Register a new Host in the Host table


[Expand]
function SCSIHostDeregister(Host:PSCSIHost):LongWord;
Description: Deregister a Host from the Host table


[Expand]
function SCSIHostFind(HostId:LongWord):PSCSIHost;
Description: To be documented


[Expand]
function SCSIHostEnumerate(Callback:TSCSIHostEnumerate; Data:Pointer):LongWord;
Description: To be documented


SCSI helper functions

[Expand]
function SCSIGetCount:LongWord;
Description: Get the current SCSI count


[Expand]
function SCSIDeviceCheck(SCSI:PSCSIDevice):PSCSIDevice;
Description: Check if the supplied SCSI is in the SCSI table


[Expand]
procedure SCSILog(Level:LongWord; SCSI:PSCSIDevice; const AText:String);
Description: To be documented


[Expand]
procedure SCSILogInfo(SCSI:PSCSIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure SCSILogWarn(SCSI:PSCSIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure SCSILogError(SCSI:PSCSIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure SCSILogDebug(SCSI:PSCSIDevice; const AText:String); inline;
Description: To be documented


[Expand]
function SCSIDeviceTypeToStorageType(DeviceType:Byte; Removable,Floppy:Boolean):LongWord;
Description: To be documented


[Expand]
function SCSIHostGetCount:LongWord;
Description: Get the current Host count


[Expand]
function SCSIHostCheck(Host:PSCSIHost):PSCSIHost;
Description: Check if the supplied Host is in the host table


SCSI storage functions

[Expand]
function SCSIStorageDeviceRead(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIStorageDeviceWrite(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented


[Expand]
function SCSIStorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: To be documented


Return to Unit Reference