Difference between revisions of "Unit SCSI"
(Created page with "Return to Unit Reference === Description === ---- ''To be documented'' === Constants === ---- ''To be documented'' === Type definitions === ---- ''To...") |
|||
(23 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''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 === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI specific constants''' <code> SCSI_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_NAME_PREFIX = 'SCSI';</code> | ||
+ | | Name prefix for SCSI Devices | ||
+ | |- | ||
+ | | <code>SCSI_HOST_PREFIX = 'SCSIHost';</code> | ||
+ | | Name prefix for Host Devices | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI device type''' <code> SCSI_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_TYPE_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_TYPE_HDD = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI device state''' <code> SCSI_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_STATE_EJECTED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_STATE_INSERTED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI device flag''' <code> SCSI_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol message''' <code> SCSI_MESSAGE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_COMPLETE = $00;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_EXTENDED = $01;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_SAVE_DP = $02;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_RESTORE_DP = $03;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_DISCONNECT = $04;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_ID_ERROR = $05;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_ABORT = $06;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_REJECT = $07;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_NOOP = $08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_PARITY = $09;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_LCOMPLETE = $0a;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_FCOMPLETE = $0b;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_RESET = $0c;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_ABORT_TAG = $0d;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_CLEAR_QUEUE = $0e;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_INIT_REC = $0f;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_REL_REC = $10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_TERMINATE = $11;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_SIMPLE_TAG = $20;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_HEAD_TAG = $21;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_ORDERED_TAG = $22;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_IGN_RESIDUE = $23;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_IDENTIFY = $80;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_X_MODIFY_DP = $00;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_X_SYNC_REQ = $01;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_X_WIDE_REQ = $03;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_MESSAGE_X_PPR_REQ = $04;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol status''' <code> SCSI_STATUS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_GOOD = $00;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_CHECK_COND = $02;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_COND_MET = $04;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_BUSY = $08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_INT = $10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_INT_COND_MET = $14;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_CONFLICT = $18;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_TERMINATED = $20;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_QUEUE_FULL = $28;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_ILLEGAL = $ff;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_STATUS_SENSE = $80;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol sense key''' <code> SCSI_SENSE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_NO_SENSE = $00;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_RECOVERED_ERROR = $01;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_NOT_READY = $02;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_MEDIUM_ERROR = $03;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_HARDWARE_ERROR = $04;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_ILLEGAL_REQUEST = $05;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_UNIT_ATTENTION = $06;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_DATA_PROTECT = $07;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_BLANK_CHECK = $08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_VENDOR_SPECIFIC = $09;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_COPY_ABORTED = $0A;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_ABORTED_COMMAND = $0B;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_VOLUME_OVERFLOW = $0D;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCSI_SENSE_MISCOMPARE = $0E;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol additional sense code''' <code> SCSI_ASC_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_ASC_NO_SENSE = $00;</code> | ||
+ | | NO SENSE | ||
+ | |- | ||
+ | | <code>SCSI_ASC_RECOVERED_RETRIES = $17;</code> | ||
+ | | RECOVERED DATA WITH RETRIES | ||
+ | |- | ||
+ | | <code>SCSI_ASC_RECOVERED_ECC = $18;</code> | ||
+ | | RECOVERED DATA WITH ECC | ||
+ | |- | ||
+ | | <code>SCSI_ASC_NOT_READY_LUN = $04;</code> | ||
+ | | LOGICAL UNIT NOT READY | ||
+ | |- | ||
+ | | <code>SCSI_ASC_NOT_READY_NO_REF_POS = $06;</code> | ||
+ | | NO REFERENCE POSITION FOUND | ||
+ | |- | ||
+ | | <code>SCSI_ASC_NOT_READY_LUN_COMM = $08;</code> | ||
+ | | LOGICAL UNIT COMMUNICATION | ||
+ | |- | ||
+ | | <code>SCSI_ASC_NOT_READY_MEDIUM_NOT_PRESENT = $3A;</code> | ||
+ | | MEDIUM NOT PRESENT | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol additional sense code qualifier''' <code> SCSI_ASCQ_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NO_SENSE = $00;</code> | ||
+ | | NO SENSE | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_RECOVERED_RETRIES = $01;</code> | ||
+ | | RECOVERED DATA WITH RETRIES | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_RECOVERED_ECC = $00;</code> | ||
+ | | RECOVERED DATA WITH ECC | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_BECOME_READY = $01;</code> | ||
+ | | LOGICAL DRIVE NOT READY - BECOMING READY | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_INIT_REQUIRED = $02;</code> | ||
+ | | LOGICAL DRIVE NOT READY - INITIALIZATION REQUIRED | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_FORMAT_PROGRESS = $04;</code> | ||
+ | | LOGICAL UNIT NOT READY - FORMAT IN PROGRESS | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_DEVICE_BUSY = $FF;</code> | ||
+ | | LOGICAL DRIVE NOT READY - DEVICE IS BUSY | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_COMM_FAILURE = $00;</code> | ||
+ | | LOGICAL UNIT COMMUNICATION FAILURE | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_COMM_TIMEOUT = $01;</code> | ||
+ | | LOGICAL UNIT COMMUNICATION TIME-OUT | ||
+ | |- | ||
+ | | <code>SCSI_ASCQ_NOT_READY_LUN_COMM_OVERRUN = $80;</code> | ||
+ | | LOGICAL UNIT COMMUNICATION OVERRUN | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI protocol command''' <code> SCSI_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_CHANGE_DEF = $40;</code> | ||
+ | | Change Definition (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_COMPARE = $39;</code> | ||
+ | | Compare (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_COPY = $18;</code> | ||
+ | | Copy (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_COP_VERIFY = $3A;</code> | ||
+ | | Copy and Verify (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_INQUIRY = $12;</code> | ||
+ | | Inquiry (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_LOG_SELECT = $4C;</code> | ||
+ | | Log Select (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_LOG_SENSE = $4D;</code> | ||
+ | | Log Sense (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MODE_SEL6 = $15;</code> | ||
+ | | Mode Select 6-byte (Device Specific) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MODE_SEL10 = $55;</code> | ||
+ | | Mode Select 10-byte (Device Specific) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MODE_SEN6 = $1A;</code> | ||
+ | | Mode Sense 6-byte (Device Specific) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MODE_SEN10 = $5A;</code> | ||
+ | | Mode Sense 10-byte (Device Specific) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ_BUFF = $3C;</code> | ||
+ | | Read Buffer (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_REQ_SENSE = $03;</code> | ||
+ | | Request Sense (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SEND_DIAG = $1D;</code> | ||
+ | | Send Diagnostic (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_TST_U_RDY = $00;</code> | ||
+ | | Test Unit Ready (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE_BUFF = $3B;</code> | ||
+ | | Write Buffer (Optional) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Commands Unique to Direct Access Devices'' | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_COMPARE = $39;</code> | ||
+ | | Compare (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_FORMAT = $04;</code> | ||
+ | | Format Unit (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_LCK_UN_CAC = $36;</code> | ||
+ | | Lock Unlock Cache (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_PREFETCH = $34;</code> | ||
+ | | Prefetch (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MED_REMOVL = $1E;</code> | ||
+ | | Prevent/Allow medium Removal (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ6 = $08;</code> | ||
+ | | Read 6-byte (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ10 = $28;</code> | ||
+ | | Read 10-byte (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ12 = $A8;</code> | ||
+ | | Read 12-byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ16 = $88;</code> | ||
+ | | Read 16-byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RD_CAPAC = $25;</code> | ||
+ | | Read Capacity (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RD_CAPAC10 = SCSI_COMMAND_RD_CAPAC;</code> | ||
+ | | Read Capacity (10) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RD_DEFECT = $37;</code> | ||
+ | | Read Defect Data (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_READ_LONG = $3E;</code> | ||
+ | | Read Long (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_REASS_BLK = $07;</code> | ||
+ | | Reassign Blocks (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RCV_DIAG = $1C;</code> | ||
+ | | Receive Diagnostic Results (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RELEASE = $17;</code> | ||
+ | | Release Unit (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_REZERO = $01;</code> | ||
+ | | Rezero Unit (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SRCH_DAT_E = $31;</code> | ||
+ | | Search Data Equal (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SRCH_DAT_H = $30;</code> | ||
+ | | Search Data High (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SRCH_DAT_L = $32;</code> | ||
+ | | Search Data Low (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SEEK6 = $0B;</code> | ||
+ | | Seek 6-Byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SEEK10 = $2B;</code> | ||
+ | | Seek 10-Byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SEND_DIAG = $1D;</code> | ||
+ | | Send Diagnostics (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SET_LIMIT = $33;</code> | ||
+ | | Set Limits (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_START_STP = $1B;</code> | ||
+ | | Start/Stop Unit (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SYNC_CACHE = $35;</code> | ||
+ | | Synchronize Cache (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_VERIFY = $2F;</code> | ||
+ | | Verify (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE6 = $0A;</code> | ||
+ | | Write 6-Byte (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE10 = $2A;</code> | ||
+ | | Write 10-Byte (MANDATORY) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE12 = $AA;</code> | ||
+ | | Write 12-Byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE16 = $8A;</code> | ||
+ | | Write 16-Byte (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRT_VERIFY = $2E;</code> | ||
+ | | Write and Verify (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE_LONG = $3F;</code> | ||
+ | | Write Long (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_WRITE_SAME = $41;</code> | ||
+ | | Write Same (Optional) | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_RD_FMT_CAP = $23;</code> | ||
+ | | Read Format Capacities | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_SVC_ACT_IN = $9E;</code> | ||
+ | | Service Action In | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI command data''' <code> SCSI_COMMAND_MAX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_COMMAND_MAX_SIZE = 16;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI service action''' <code> SCSI_SAI_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_SAI_READ_CAPACITY_16 = $10;</code> | ||
+ | | Read Capacity (16) | ||
+ | |- | ||
+ | | <code>SCSI_SAI_GET_LBA_STATUS = $12;</code> | ||
+ | | Get LBA Status | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI inquiry data''' <code> SCSI_INQUIRY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_INQUIRY_STANDARD = $00;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI standard inquiry data''' <code> SCSI_STANDARD_INQUIRY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_STANDARD_INQUIRY_SIZE = 36;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI inquiry peripheral device type''' <code> SCSI_DEVICE_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_DISK = $00;</code> | ||
+ | | SBC-3 - Direct access block device (e.g., magnetic disk) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_TAPE = $01;</code> | ||
+ | | SSC-3 - Sequential-access device (e.g., magnetic tape) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_PRINTER = $02;</code> | ||
+ | | SSC - Printer device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_PROCESSOR = $03;</code> | ||
+ | | SPC-2 - Processor device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_WRITE_ONCE = $04;</code> | ||
+ | | SBC - Write-once device (e.g., some optical disks) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_CD_DVD = $05;</code> | ||
+ | | MMC-5 - CD/DVD device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_SCANNER = $06;</code> | ||
+ | | Scanner device (obsolete) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_OPTICAL = $07;</code> | ||
+ | | SBC - Optical memory device (e.g., some optical disks) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_CHANGER = $08;</code> | ||
+ | | SMC-3 - Medium changer device (e.g., jukeboxes) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_COMMS = $09;</code> | ||
+ | | Communications device (obsolete) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_ARRAY = $0C;</code> | ||
+ | | SCC-2 - Storage array controller device (e.g., RAID) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_ENCLOSURE = $0D;</code> | ||
+ | | SES - Enclosure services device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_RBC = $0E;</code> | ||
+ | | RBC - Simplified direct-access device (e.g., magnetic disk) | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_CARD = $0F;</code> | ||
+ | | OCRW - Optical card reader/writer device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_BRIDGE = $10;</code> | ||
+ | | BCC - Bridge Controller Commands | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_OBJECT = $11;</code> | ||
+ | | OSD - Object-based Storage Device | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_AUTOMATION = $12;</code> | ||
+ | | ADC-2 - Automation/Drive Interface | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_WELL_KNOWN = $1E;</code> | ||
+ | | Well known logical unit | ||
+ | |- | ||
+ | | <code>SCSI_DEVICE_TYPE_UNKNOWN = $1F;</code> | ||
+ | | Unknown or no device type | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI inquiry removable media bit''' <code> SCSI_REMOVABLE_MEDIA_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_REMOVABLE_MEDIA_BIT = $80;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI request sense data''' <code> SCSI_REQUEST_SENSE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_REQUEST_SENSE_SIZE = 18;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI read capacity data''' <code> SCSI_READ_CAPACITY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_READ_CAPACITY_SIZE = 8;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCSI_READ_CAPACITY_16_SIZE = 32;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI read 10 data''' <code> SCSI_READ_10_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_READ_10_MAX_BLOCKS = $FFFF;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI write 10 data''' <code> SCSI_WRITE_10_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_WRITE_10_MAX_BLOCKS = $FFFF;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SCSI logging''' <code> SCSI_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCSI_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | SCSI debugging messages | ||
+ | |- | ||
+ | | <code>SCSI_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | SCSI informational messages, such as a device being attached or detached | ||
+ | |- | ||
+ | | <code>SCSI_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | SCSI error messages | ||
+ | |- | ||
+ | | <code>SCSI_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | SCSI warning messages | ||
+ | |- | ||
+ | | <code>SCSI_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No SCSI messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''SCSI host enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSCSIHostEnumerate = function(Host:PSCSIHost; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SCSI host''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIHost = ^TSCSIHost;</code> | ||
+ | |||
+ | <code>TSCSIHost = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Device Properties'' | ||
+ | |- | ||
+ | | <code>Device:TDevice;</code> | ||
+ | | The Device entry for this Host | ||
+ | |- | ||
+ | |colspan="2"|''Host Properties'' | ||
+ | |- | ||
+ | | <code>HostId:LongWord;</code> | ||
+ | | Unique Id of this Host in the Host table | ||
+ | |- | ||
+ | | <code>HostState:LongWord;</code> | ||
+ | | Host state (eg ?????) | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Driver Properties'' | ||
+ | |- | ||
+ | | <code>Lock:TMutexHandle;</code> | ||
+ | | Host lock | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PSCSIHost;</code> | ||
+ | | Previous entry in Host table | ||
+ | |- | ||
+ | | <code>Next:PSCSIHost;</code> | ||
+ | | Next entry in Host table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSCSIEnumerate = function(SCSI:PSCSIDevice; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SCSI notification callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSCSINotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SCSI device''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIDevice = ^TSCSIDevice;</code> | ||
+ | |||
+ | <code>TSCSIDevice = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Device Properties'' | ||
+ | |- | ||
+ | | <code>Device:TDevice;</code> | ||
+ | | The Device entry for this SCSI | ||
+ | |- | ||
+ | |colspan="2"|''SCSI Properties'' | ||
+ | |- | ||
+ | | <code>SCSIId:LongWord;</code> | ||
+ | | Unique Id of this SCSI in the SCSI table | ||
+ | |- | ||
+ | | <code>SCSIState:LongWord;</code> | ||
+ | | SCSI state (eg SCSI_STATE_INSERTED) | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Driver Properties'' | ||
+ | |- | ||
+ | | <code>Lock:TMutexHandle;</code> | ||
+ | | Device lock | ||
+ | |- | ||
+ | | <code>Vendor:PChar;</code> | ||
+ | | SCSI Vendor | ||
+ | |- | ||
+ | | <code>Product:PChar;</code> | ||
+ | | SCSI Product | ||
+ | |- | ||
+ | | <code>Revision:PChar;</code> | ||
+ | | Firmware Revision | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PSCSIDevice;</code> | ||
+ | | Previous entry in SCSI table | ||
+ | |- | ||
+ | | <code>Next:PSCSIDevice;</code> | ||
+ | | Next entry in SCSI table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI command block''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSICommandBlock = ^TSCSICommandBlock;</code> | ||
+ | |||
+ | <code>TSCSICommandBlock = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Command:array[0..SCSI_COMMAND_MAX_SIZE - 1] of Byte;</code> | ||
+ | | Command | ||
+ | |- | ||
+ | | <code>SenseData:array[0..63] of Byte;</code> | ||
+ | | Request Sense | ||
+ | |- | ||
+ | | <code>Status:Byte;</code> | ||
+ | | SCSI Status | ||
+ | |- | ||
+ | | <code>TargetID:Byte;</code> | ||
+ | | Target ID | ||
+ | |- | ||
+ | | <code>TargetLUN:Byte;</code> | ||
+ | | Target LUN | ||
+ | |- | ||
+ | | <code>CommandLength:Byte;</code> | ||
+ | | Command Length | ||
+ | |- | ||
+ | | <code>DataLength:LongWord;</code> | ||
+ | | Total Data Length | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | Pointer to Data | ||
+ | |- | ||
+ | | <code>MessageOut:array[0..11] of Byte;</code> | ||
+ | | Message out buffer | ||
+ | |- | ||
+ | | <code>MessageIn:array[0..11] of Byte;</code> | ||
+ | | Message in buffer | ||
+ | |- | ||
+ | | <code>SenseCommandLength:Byte;</code> | ||
+ | | Sense Command Length | ||
+ | |- | ||
+ | | <code>SenseDataLength:LongWord;</code> | ||
+ | | Sense Data Length | ||
+ | |- | ||
+ | | <code>SenseCommand:array[0..5] of Byte;</code> | ||
+ | | Sense Command | ||
+ | |- | ||
+ | | <code>ControllerStatus:LongWord;</code> | ||
+ | | Controller Status | ||
+ | |- | ||
+ | | <code>TransferredBytes:LongWord;</code> | ||
+ | | Transferred Bytes | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI standard inquiry data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIStandardInquiryData = ^TSCSIStandardInquiryData;</code> | ||
+ | |||
+ | <code>TSCSIStandardInquiryData = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DeviceType:Byte;</code> | ||
+ | | Peripheral Device Type (Bits 4..0) | ||
+ | |- | ||
+ | | <code>RemovableMediaBit:Byte;</code> | ||
+ | | Removable Media Bit (Bit 7) ($80) | ||
+ | |- | ||
+ | | <code>Version:Byte;</code> | ||
+ | | ISO/ECMA/ANSI Version (ISO Bits 7..6)(ECMA Bits 5..3)(ANSI Bits 2..0) | ||
+ | |- | ||
+ | | <code>ResponseFormat:Byte;</code> | ||
+ | | Response Data Format (Bits 3..0) | ||
+ | |- | ||
+ | | <code>AdditionalLength:Byte;</code> | ||
+ | | Additional Length | ||
+ | |- | ||
+ | | <code>Reserved1:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Reserved2:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Vendor:array[0..7] of Char;</code> | ||
+ | | Vendor Information | ||
+ | |- | ||
+ | | <code>Product:array[0..15] of Char;</code> | ||
+ | | Product Identification | ||
+ | |- | ||
+ | | <code>Revision:array[0..3] of Char;</code> | ||
+ | | Product Revision Level | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI request sense data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIRequestSenseData = ^TSCSIRequestSenseData;</code> | ||
+ | |||
+ | <code>TSCSIRequestSenseData = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>ErrorCode:Byte;</code> | ||
+ | | Error Code (Bits 6..0) (Bit 7 is Valid bit) | ||
+ | |- | ||
+ | | <code>Reserved1:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SenseKey:Byte;</code> | ||
+ | | Sense Key (Bits 3..0) | ||
+ | |- | ||
+ | | <code>Information:LongWord;</code> | ||
+ | | Information | ||
+ | |- | ||
+ | | <code>AdditionalLength:Byte;</code> | ||
+ | | Additional Sense Length | ||
+ | |- | ||
+ | | <code>Reserved2:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ASC:Byte;</code> | ||
+ | | Additional Sense Code | ||
+ | |- | ||
+ | | <code>ASCQ:Byte;</code> | ||
+ | | Additional Sense Code Qualifier | ||
+ | |- | ||
+ | | <code>Reserved3:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI read capacity data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIReadCapacityData = ^TSCSIReadCapacityData;</code> | ||
+ | |||
+ | <code>TSCSIReadCapacityData = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LastBlock:LongWord;</code> | ||
+ | | Last Logical Block Address (Big Endian) | ||
+ | |- | ||
+ | | <code>BlockSize:LongWord;</code> | ||
+ | | Block Length In Bytes (Big Endian) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SCSI read capacity 16 data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSCSIReadCapacity16Data = ^TSCSIReadCapacity16Data;</code> | ||
+ | |||
+ | <code>TSCSIReadCapacity16Data = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LastBlock:Int64;</code> | ||
+ | | Last Logical Block Address (Big Endian) | ||
+ | |- | ||
+ | | <code>BlockSize:LongWord;</code> | ||
+ | | Block Length In Bytes (Big Endian) | ||
+ | |- | ||
+ | | <code>Reserved1:Byte;</code> | ||
+ | | P_TYPE (Bits 3..1) PROT_EN (Bit 0) | ||
+ | |- | ||
+ | | <code>Reserved2:Byte;</code> | ||
+ | | P_I_EXPONENT (Bitss 7..4) LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT (Bits 3..0 | ||
+ | |- | ||
+ | | <code>Reserved3:Byte;</code> | ||
+ | | TPE (Bit 7) TPRZ (Bit 6) LOWEST ALIGNED LOGICAL BLOCK ADDRESS (Bits 5..0)(Big Endian) | ||
+ | |- | ||
+ | | <code>Reserved4:Byte;</code> | ||
+ | | LOWEST ALIGNED LOGICAL BLOCK ADDRESS (Bits 7..0)(Big Endian) | ||
+ | |- | ||
+ | | <code>Reserved5:array[0..15] of Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | |
+ | '''SCSI logging''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SCSI_DEFAULT_LOG_LEVEL:LongWord = SCSI_LOG_LEVEL_DEBUG;</code> | ||
+ | | style="width: 40%;"|Minimum level for SCSI messages. Only messages with level greater than or equal to this will be printed. | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SCSI_LOG_ENABLED:Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | |||
+ | '''Initialization functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSIInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''SCSI functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceInquiry(SCSI:PSCSIDevice; var DeviceType,DeviceFlags:LongWord; var Vendor,Product,Revision:PChar):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceRequestSense(SCSI:PSCSIDevice; var SenseKey,ASC,ASCQ:Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceReadCapacity(SCSI:PSCSIDevice; var BlockSize,BlockShift:LongWord; var BlockCount:Int64):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceTestUnitReady(SCSI:PSCSIDevice; var DeviceFlags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceRead10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceWrite10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceRead16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceWrite16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceTransport(SCSI:PSCSIDevice; Command:PSCSICommandBlock):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceCreate:PSCSIDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new SCSI entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer to new SCSI entry or nil if SCSI could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceCreateEx(Size:LongWord):PSCSIDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new SCSI entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Size | ||
+ | | Size in bytes to allocate for new SCSI (Including the SCSI entry) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer to new SCSI entry or nil if SCSI could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceDestroy(SCSI:PSCSIDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing SCSI entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceRegister(SCSI:PSCSIDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new SCSI in the SCSI table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceDeregister(SCSI:PSCSIDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a SCSI from the SCSI table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceFind(SCSIId:LongWord):PSCSIDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceFindByName(const Name:String):PSCSIDevice; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceFindByDescription(const Description:String):PSCSIDevice; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceEnumerate(Callback:TSCSIEnumerate; Data:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceNotification(SCSI:PSCSIDevice; Callback:TSCSINotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostCreate:PSCSIHost;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Host entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer to new Host entry or nil if host could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostCreateEx(Size:LongWord):PSCSIHost;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Host entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Size | ||
+ | | Size in bytes to allocate for new host (Including the host entry) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer to new Host entry or nil if host could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostDestroy(Host:PSCSIHost):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Host entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostRegister(Host:PSCSIHost):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Host in the Host table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostDeregister(Host:PSCSIHost):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a Host from the Host table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostFind(HostId:LongWord):PSCSIHost;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostEnumerate(Callback:TSCSIHostEnumerate; Data:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''SCSI helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current SCSI count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceCheck(SCSI:PSCSIDevice):PSCSIDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied SCSI is in the SCSI table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSILog(Level:LongWord; SCSI:PSCSIDevice; const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSILogInfo(SCSI:PSCSIDevice; const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSILogWarn(SCSI:PSCSIDevice; const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSILogError(SCSI:PSCSIDevice; const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SCSILogDebug(SCSI:PSCSIDevice; const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIDeviceTypeToStorageType(DeviceType:Byte; Removable,Floppy:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Host count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIHostCheck(Host:PSCSIHost):PSCSIHost;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Host is in the host table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''SCSI storage functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIStorageDeviceRead(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIStorageDeviceWrite(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SCSIStorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 03:36, 15 December 2022
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
SCSI_*
SCSI_NAME_PREFIX = 'SCSI';
|
Name prefix for SCSI Devices |
SCSI_HOST_PREFIX = 'SCSIHost';
|
Name prefix for Host Devices |
SCSI_TYPE_*
SCSI_TYPE_NONE = 0;
|
|
SCSI_TYPE_HDD = 1;
|
SCSI_STATE_*
SCSI_STATE_EJECTED = 0;
|
|
SCSI_STATE_INSERTED = 1;
|
SCSI_FLAG_*
SCSI_FLAG_NONE = $00000000;
|
SCSI_MESSAGE_*
SCSI_MESSAGE_COMPLETE = $00;
|
|
SCSI_MESSAGE_EXTENDED = $01;
|
|
SCSI_MESSAGE_SAVE_DP = $02;
|
|
SCSI_MESSAGE_RESTORE_DP = $03;
|
|
SCSI_MESSAGE_DISCONNECT = $04;
|
|
SCSI_MESSAGE_ID_ERROR = $05;
|
|
SCSI_MESSAGE_ABORT = $06;
|
|
SCSI_MESSAGE_REJECT = $07;
|
|
SCSI_MESSAGE_NOOP = $08;
|
|
SCSI_MESSAGE_PARITY = $09;
|
|
SCSI_MESSAGE_LCOMPLETE = $0a;
|
|
SCSI_MESSAGE_FCOMPLETE = $0b;
|
|
SCSI_MESSAGE_RESET = $0c;
|
|
SCSI_MESSAGE_ABORT_TAG = $0d;
|
|
SCSI_MESSAGE_CLEAR_QUEUE = $0e;
|
|
SCSI_MESSAGE_INIT_REC = $0f;
|
|
SCSI_MESSAGE_REL_REC = $10;
|
|
SCSI_MESSAGE_TERMINATE = $11;
|
|
SCSI_MESSAGE_SIMPLE_TAG = $20;
|
|
SCSI_MESSAGE_HEAD_TAG = $21;
|
|
SCSI_MESSAGE_ORDERED_TAG = $22;
|
|
SCSI_MESSAGE_IGN_RESIDUE = $23;
|
|
SCSI_MESSAGE_IDENTIFY = $80;
|
|
SCSI_MESSAGE_X_MODIFY_DP = $00;
|
|
SCSI_MESSAGE_X_SYNC_REQ = $01;
|
|
SCSI_MESSAGE_X_WIDE_REQ = $03;
|
|
SCSI_MESSAGE_X_PPR_REQ = $04;
|
SCSI_STATUS_*
SCSI_STATUS_GOOD = $00;
|
|
SCSI_STATUS_CHECK_COND = $02;
|
|
SCSI_STATUS_COND_MET = $04;
|
|
SCSI_STATUS_BUSY = $08;
|
|
SCSI_STATUS_INT = $10;
|
|
SCSI_STATUS_INT_COND_MET = $14;
|
|
SCSI_STATUS_CONFLICT = $18;
|
|
SCSI_STATUS_TERMINATED = $20;
|
|
SCSI_STATUS_QUEUE_FULL = $28;
|
|
SCSI_STATUS_ILLEGAL = $ff;
|
|
SCSI_STATUS_SENSE = $80;
|
SCSI_SENSE_*
SCSI_SENSE_NO_SENSE = $00;
|
|
SCSI_SENSE_RECOVERED_ERROR = $01;
|
|
SCSI_SENSE_NOT_READY = $02;
|
|
SCSI_SENSE_MEDIUM_ERROR = $03;
|
|
SCSI_SENSE_HARDWARE_ERROR = $04;
|
|
SCSI_SENSE_ILLEGAL_REQUEST = $05;
|
|
SCSI_SENSE_UNIT_ATTENTION = $06;
|
|
SCSI_SENSE_DATA_PROTECT = $07;
|
|
SCSI_SENSE_BLANK_CHECK = $08;
|
|
SCSI_SENSE_VENDOR_SPECIFIC = $09;
|
|
SCSI_SENSE_COPY_ABORTED = $0A;
|
|
SCSI_SENSE_ABORTED_COMMAND = $0B;
|
|
SCSI_SENSE_VOLUME_OVERFLOW = $0D;
|
|
SCSI_SENSE_MISCOMPARE = $0E;
|
SCSI_ASC_*
SCSI_ASC_NO_SENSE = $00;
|
NO SENSE |
SCSI_ASC_RECOVERED_RETRIES = $17;
|
RECOVERED DATA WITH RETRIES |
SCSI_ASC_RECOVERED_ECC = $18;
|
RECOVERED DATA WITH ECC |
SCSI_ASC_NOT_READY_LUN = $04;
|
LOGICAL UNIT NOT READY |
SCSI_ASC_NOT_READY_NO_REF_POS = $06;
|
NO REFERENCE POSITION FOUND |
SCSI_ASC_NOT_READY_LUN_COMM = $08;
|
LOGICAL UNIT COMMUNICATION |
SCSI_ASC_NOT_READY_MEDIUM_NOT_PRESENT = $3A;
|
MEDIUM NOT PRESENT |
SCSI_ASCQ_*
SCSI_ASCQ_NO_SENSE = $00;
|
NO SENSE |
SCSI_ASCQ_RECOVERED_RETRIES = $01;
|
RECOVERED DATA WITH RETRIES |
SCSI_ASCQ_RECOVERED_ECC = $00;
|
RECOVERED DATA WITH ECC |
SCSI_ASCQ_NOT_READY_LUN_BECOME_READY = $01;
|
LOGICAL DRIVE NOT READY - BECOMING READY |
SCSI_ASCQ_NOT_READY_LUN_INIT_REQUIRED = $02;
|
LOGICAL DRIVE NOT READY - INITIALIZATION REQUIRED |
SCSI_ASCQ_NOT_READY_LUN_FORMAT_PROGRESS = $04;
|
LOGICAL UNIT NOT READY - FORMAT IN PROGRESS |
SCSI_ASCQ_NOT_READY_LUN_DEVICE_BUSY = $FF;
|
LOGICAL DRIVE NOT READY - DEVICE IS BUSY |
SCSI_ASCQ_NOT_READY_LUN_COMM_FAILURE = $00;
|
LOGICAL UNIT COMMUNICATION FAILURE |
SCSI_ASCQ_NOT_READY_LUN_COMM_TIMEOUT = $01;
|
LOGICAL UNIT COMMUNICATION TIME-OUT |
SCSI_ASCQ_NOT_READY_LUN_COMM_OVERRUN = $80;
|
LOGICAL UNIT COMMUNICATION OVERRUN |
SCSI_COMMAND_*
SCSI_COMMAND_CHANGE_DEF = $40;
|
Change Definition (Optional) |
SCSI_COMMAND_COMPARE = $39;
|
Compare (Optional) |
SCSI_COMMAND_COPY = $18;
|
Copy (Optional) |
SCSI_COMMAND_COP_VERIFY = $3A;
|
Copy and Verify (Optional) |
SCSI_COMMAND_INQUIRY = $12;
|
Inquiry (MANDATORY) |
SCSI_COMMAND_LOG_SELECT = $4C;
|
Log Select (Optional) |
SCSI_COMMAND_LOG_SENSE = $4D;
|
Log Sense (Optional) |
SCSI_COMMAND_MODE_SEL6 = $15;
|
Mode Select 6-byte (Device Specific) |
SCSI_COMMAND_MODE_SEL10 = $55;
|
Mode Select 10-byte (Device Specific) |
SCSI_COMMAND_MODE_SEN6 = $1A;
|
Mode Sense 6-byte (Device Specific) |
SCSI_COMMAND_MODE_SEN10 = $5A;
|
Mode Sense 10-byte (Device Specific) |
SCSI_COMMAND_READ_BUFF = $3C;
|
Read Buffer (Optional) |
SCSI_COMMAND_REQ_SENSE = $03;
|
Request Sense (MANDATORY) |
SCSI_COMMAND_SEND_DIAG = $1D;
|
Send Diagnostic (Optional) |
SCSI_COMMAND_TST_U_RDY = $00;
|
Test Unit Ready (MANDATORY) |
SCSI_COMMAND_WRITE_BUFF = $3B;
|
Write Buffer (Optional) |
Commands Unique to Direct Access Devices | |
SCSI_COMMAND_COMPARE = $39;
|
Compare (Optional) |
SCSI_COMMAND_FORMAT = $04;
|
Format Unit (MANDATORY) |
SCSI_COMMAND_LCK_UN_CAC = $36;
|
Lock Unlock Cache (Optional) |
SCSI_COMMAND_PREFETCH = $34;
|
Prefetch (Optional) |
SCSI_COMMAND_MED_REMOVL = $1E;
|
Prevent/Allow medium Removal (Optional) |
SCSI_COMMAND_READ6 = $08;
|
Read 6-byte (MANDATORY) |
SCSI_COMMAND_READ10 = $28;
|
Read 10-byte (MANDATORY) |
SCSI_COMMAND_READ12 = $A8;
|
Read 12-byte (Optional) |
SCSI_COMMAND_READ16 = $88;
|
Read 16-byte (Optional) |
SCSI_COMMAND_RD_CAPAC = $25;
|
Read Capacity (MANDATORY) |
SCSI_COMMAND_RD_CAPAC10 = SCSI_COMMAND_RD_CAPAC;
|
Read Capacity (10) |
SCSI_COMMAND_RD_DEFECT = $37;
|
Read Defect Data (Optional) |
SCSI_COMMAND_READ_LONG = $3E;
|
Read Long (Optional) |
SCSI_COMMAND_REASS_BLK = $07;
|
Reassign Blocks (Optional) |
SCSI_COMMAND_RCV_DIAG = $1C;
|
Receive Diagnostic Results (Optional) |
SCSI_COMMAND_RELEASE = $17;
|
Release Unit (MANDATORY) |
SCSI_COMMAND_REZERO = $01;
|
Rezero Unit (Optional) |
SCSI_COMMAND_SRCH_DAT_E = $31;
|
Search Data Equal (Optional) |
SCSI_COMMAND_SRCH_DAT_H = $30;
|
Search Data High (Optional) |
SCSI_COMMAND_SRCH_DAT_L = $32;
|
Search Data Low (Optional) |
SCSI_COMMAND_SEEK6 = $0B;
|
Seek 6-Byte (Optional) |
SCSI_COMMAND_SEEK10 = $2B;
|
Seek 10-Byte (Optional) |
SCSI_COMMAND_SEND_DIAG = $1D;
|
Send Diagnostics (MANDATORY) |
SCSI_COMMAND_SET_LIMIT = $33;
|
Set Limits (Optional) |
SCSI_COMMAND_START_STP = $1B;
|
Start/Stop Unit (Optional) |
SCSI_COMMAND_SYNC_CACHE = $35;
|
Synchronize Cache (Optional) |
SCSI_COMMAND_VERIFY = $2F;
|
Verify (Optional) |
SCSI_COMMAND_WRITE6 = $0A;
|
Write 6-Byte (MANDATORY) |
SCSI_COMMAND_WRITE10 = $2A;
|
Write 10-Byte (MANDATORY) |
SCSI_COMMAND_WRITE12 = $AA;
|
Write 12-Byte (Optional) |
SCSI_COMMAND_WRITE16 = $8A;
|
Write 16-Byte (Optional) |
SCSI_COMMAND_WRT_VERIFY = $2E;
|
Write and Verify (Optional) |
SCSI_COMMAND_WRITE_LONG = $3F;
|
Write Long (Optional) |
SCSI_COMMAND_WRITE_SAME = $41;
|
Write Same (Optional) |
SCSI_COMMAND_RD_FMT_CAP = $23;
|
Read Format Capacities |
SCSI_COMMAND_SVC_ACT_IN = $9E;
|
Service Action In |
SCSI_COMMAND_MAX_*
SCSI_COMMAND_MAX_SIZE = 16;
|
SCSI_SAI_*
SCSI_SAI_READ_CAPACITY_16 = $10;
|
Read Capacity (16) |
SCSI_SAI_GET_LBA_STATUS = $12;
|
Get LBA Status |
SCSI_INQUIRY_*
SCSI_INQUIRY_STANDARD = $00;
|
SCSI_STANDARD_INQUIRY_*
SCSI_STANDARD_INQUIRY_SIZE = 36;
|
SCSI_DEVICE_TYPE_*
SCSI_DEVICE_TYPE_DISK = $00;
|
SBC-3 - Direct access block device (e.g., magnetic disk) |
SCSI_DEVICE_TYPE_TAPE = $01;
|
SSC-3 - Sequential-access device (e.g., magnetic tape) |
SCSI_DEVICE_TYPE_PRINTER = $02;
|
SSC - Printer device |
SCSI_DEVICE_TYPE_PROCESSOR = $03;
|
SPC-2 - Processor device |
SCSI_DEVICE_TYPE_WRITE_ONCE = $04;
|
SBC - Write-once device (e.g., some optical disks) |
SCSI_DEVICE_TYPE_CD_DVD = $05;
|
MMC-5 - CD/DVD device |
SCSI_DEVICE_TYPE_SCANNER = $06;
|
Scanner device (obsolete) |
SCSI_DEVICE_TYPE_OPTICAL = $07;
|
SBC - Optical memory device (e.g., some optical disks) |
SCSI_DEVICE_TYPE_CHANGER = $08;
|
SMC-3 - Medium changer device (e.g., jukeboxes) |
SCSI_DEVICE_TYPE_COMMS = $09;
|
Communications device (obsolete) |
SCSI_DEVICE_TYPE_ARRAY = $0C;
|
SCC-2 - Storage array controller device (e.g., RAID) |
SCSI_DEVICE_TYPE_ENCLOSURE = $0D;
|
SES - Enclosure services device |
SCSI_DEVICE_TYPE_RBC = $0E;
|
RBC - Simplified direct-access device (e.g., magnetic disk) |
SCSI_DEVICE_TYPE_CARD = $0F;
|
OCRW - Optical card reader/writer device |
SCSI_DEVICE_TYPE_BRIDGE = $10;
|
BCC - Bridge Controller Commands |
SCSI_DEVICE_TYPE_OBJECT = $11;
|
OSD - Object-based Storage Device |
SCSI_DEVICE_TYPE_AUTOMATION = $12;
|
ADC-2 - Automation/Drive Interface |
SCSI_DEVICE_TYPE_WELL_KNOWN = $1E;
|
Well known logical unit |
SCSI_DEVICE_TYPE_UNKNOWN = $1F;
|
Unknown or no device type |
SCSI_REMOVABLE_MEDIA_*
SCSI_REMOVABLE_MEDIA_BIT = $80;
|
SCSI_REQUEST_SENSE_*
SCSI_REQUEST_SENSE_SIZE = 18;
|
SCSI_READ_CAPACITY_*
SCSI_READ_CAPACITY_SIZE = 8;
|
|
SCSI_READ_CAPACITY_16_SIZE = 32;
|
SCSI_READ_10_*
SCSI_READ_10_MAX_BLOCKS = $FFFF;
|
SCSI_WRITE_10_*
SCSI_WRITE_10_MAX_BLOCKS = $FFFF;
|
SCSI_LOG_*
SCSI_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;
|
SCSI debugging messages |
SCSI_LOG_LEVEL_INFO = LOG_LEVEL_INFO;
|
SCSI informational messages, such as a device being attached or detached |
SCSI_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;
|
SCSI error messages |
SCSI_LOG_LEVEL_WARN = LOG_LEVEL_WARN;
|
SCSI warning messages |
SCSI_LOG_LEVEL_NONE = LOG_LEVEL_NONE;
|
No SCSI messages |
Type definitions
SCSI host enumeration callback
TSCSIHostEnumerate = function(Host:PSCSIHost; Data:Pointer):LongWord;
|
SCSI host
PSCSIHost = ^TSCSIHost;
TSCSIHost = record
Device Properties | |
Device:TDevice;
|
The Device entry for this Host |
Host Properties | |
HostId:LongWord;
|
Unique Id of this Host in the Host table |
HostState:LongWord;
|
Host state (eg ?????) |
Statistics Properties | |
Driver Properties | |
Lock:TMutexHandle;
|
Host lock |
Internal Properties | |
Prev:PSCSIHost;
|
Previous entry in Host table |
Next:PSCSIHost;
|
Next entry in Host table |
SCSI enumeration callback
TSCSIEnumerate = function(SCSI:PSCSIDevice; Data:Pointer):LongWord;
|
SCSI notification callback
TSCSINotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
SCSI device
PSCSIDevice = ^TSCSIDevice;
TSCSIDevice = record
Device Properties | |
Device:TDevice;
|
The Device entry for this SCSI |
SCSI Properties | |
SCSIId:LongWord;
|
Unique Id of this SCSI in the SCSI table |
SCSIState:LongWord;
|
SCSI state (eg SCSI_STATE_INSERTED) |
Statistics Properties | |
Driver Properties | |
Lock:TMutexHandle;
|
Device lock |
Vendor:PChar;
|
SCSI Vendor |
Product:PChar;
|
SCSI Product |
Revision:PChar;
|
Firmware Revision |
Internal Properties | |
Prev:PSCSIDevice;
|
Previous entry in SCSI table |
Next:PSCSIDevice;
|
Next entry in SCSI table |
SCSI command block
PSCSICommandBlock = ^TSCSICommandBlock;
TSCSICommandBlock = record
Command:array[0..SCSI_COMMAND_MAX_SIZE - 1] of Byte;
|
Command |
SenseData:array[0..63] of Byte;
|
Request Sense |
Status:Byte;
|
SCSI Status |
TargetID:Byte;
|
Target ID |
TargetLUN:Byte;
|
Target LUN |
CommandLength:Byte;
|
Command Length |
DataLength:LongWord;
|
Total Data Length |
Data:Pointer;
|
Pointer to Data |
MessageOut:array[0..11] of Byte;
|
Message out buffer |
MessageIn:array[0..11] of Byte;
|
Message in buffer |
SenseCommandLength:Byte;
|
Sense Command Length |
SenseDataLength:LongWord;
|
Sense Data Length |
SenseCommand:array[0..5] of Byte;
|
Sense Command |
ControllerStatus:LongWord;
|
Controller Status |
TransferredBytes:LongWord;
|
Transferred Bytes |
SCSI standard inquiry data
PSCSIStandardInquiryData = ^TSCSIStandardInquiryData;
TSCSIStandardInquiryData = packed record
DeviceType:Byte;
|
Peripheral Device Type (Bits 4..0) |
RemovableMediaBit:Byte;
|
Removable Media Bit (Bit 7) ($80) |
Version:Byte;
|
ISO/ECMA/ANSI Version (ISO Bits 7..6)(ECMA Bits 5..3)(ANSI Bits 2..0) |
ResponseFormat:Byte;
|
Response Data Format (Bits 3..0) |
AdditionalLength:Byte;
|
Additional Length |
Reserved1:Byte;
|
|
Reserved2:Word;
|
|
Vendor:array[0..7] of Char;
|
Vendor Information |
Product:array[0..15] of Char;
|
Product Identification |
Revision:array[0..3] of Char;
|
Product Revision Level |
SCSI request sense data
PSCSIRequestSenseData = ^TSCSIRequestSenseData;
TSCSIRequestSenseData = packed record
ErrorCode:Byte;
|
Error Code (Bits 6..0) (Bit 7 is Valid bit) |
Reserved1:Byte;
|
|
SenseKey:Byte;
|
Sense Key (Bits 3..0) |
Information:LongWord;
|
Information |
AdditionalLength:Byte;
|
Additional Sense Length |
Reserved2:LongWord;
|
|
ASC:Byte;
|
Additional Sense Code |
ASCQ:Byte;
|
Additional Sense Code Qualifier |
Reserved3:LongWord;
|
SCSI read capacity data
PSCSIReadCapacityData = ^TSCSIReadCapacityData;
TSCSIReadCapacityData = packed record
LastBlock:LongWord;
|
Last Logical Block Address (Big Endian) |
BlockSize:LongWord;
|
Block Length In Bytes (Big Endian) |
SCSI read capacity 16 data
PSCSIReadCapacity16Data = ^TSCSIReadCapacity16Data;
TSCSIReadCapacity16Data = packed record
LastBlock:Int64;
|
Last Logical Block Address (Big Endian) |
BlockSize:LongWord;
|
Block Length In Bytes (Big Endian) |
Reserved1:Byte;
|
P_TYPE (Bits 3..1) PROT_EN (Bit 0) |
Reserved2:Byte;
|
P_I_EXPONENT (Bitss 7..4) LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT (Bits 3..0 |
Reserved3:Byte;
|
TPE (Bit 7) TPRZ (Bit 6) LOWEST ALIGNED LOGICAL BLOCK ADDRESS (Bits 5..0)(Big Endian) |
Reserved4:Byte;
|
LOWEST ALIGNED LOGICAL BLOCK ADDRESS (Bits 7..0)(Big Endian) |
Reserved5:array[0..15] of Byte;
|
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
procedure SCSIInit;
Note | None documented |
---|
SCSI functions
function SCSIDeviceInquiry(SCSI:PSCSIDevice; var DeviceType,DeviceFlags:LongWord; var Vendor,Product,Revision:PChar):LongWord;
Note | None documented |
---|
function SCSIDeviceRequestSense(SCSI:PSCSIDevice; var SenseKey,ASC,ASCQ:Byte):LongWord;
Note | None documented |
---|
function SCSIDeviceReadCapacity(SCSI:PSCSIDevice; var BlockSize,BlockShift:LongWord; var BlockCount:Int64):LongWord;
Note | None documented |
---|
function SCSIDeviceTestUnitReady(SCSI:PSCSIDevice; var DeviceFlags:LongWord):LongWord;
Note | None documented |
---|
function SCSIDeviceRead10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIDeviceWrite10(SCSI:PSCSIDevice; Start:LongWord; Count:Word; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIDeviceRead16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIDeviceWrite16(SCSI:PSCSIDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIDeviceTransport(SCSI:PSCSIDevice; Command:PSCSICommandBlock):LongWord;
Note | None documented |
---|
function SCSIDeviceCreate:PSCSIDevice;
Return | Pointer to new SCSI entry or nil if SCSI could not be created |
---|
function SCSIDeviceCreateEx(Size:LongWord):PSCSIDevice;
Size | Size in bytes to allocate for new SCSI (Including the SCSI entry) |
---|---|
Return | Pointer to new SCSI entry or nil if SCSI could not be created |
function SCSIDeviceDestroy(SCSI:PSCSIDevice):LongWord;
Note | None documented |
---|
function SCSIDeviceRegister(SCSI:PSCSIDevice):LongWord;
Note | None documented |
---|
function SCSIDeviceDeregister(SCSI:PSCSIDevice):LongWord;
Note | None documented |
---|
function SCSIDeviceFind(SCSIId:LongWord):PSCSIDevice;
Note | None documented |
---|
function SCSIDeviceFindByName(const Name:String):PSCSIDevice; inline;
Note | None documented |
---|
function SCSIDeviceFindByDescription(const Description:String):PSCSIDevice; inline;
Note | None documented |
---|
function SCSIDeviceEnumerate(Callback:TSCSIEnumerate; Data:Pointer):LongWord;
Note | None documented |
---|
function SCSIDeviceNotification(SCSI:PSCSIDevice; Callback:TSCSINotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Note | None documented |
---|
function SCSIHostCreate:PSCSIHost;
Return | Pointer to new Host entry or nil if host could not be created |
---|
function SCSIHostCreateEx(Size:LongWord):PSCSIHost;
Size | Size in bytes to allocate for new host (Including the host entry) |
---|---|
Return | Pointer to new Host entry or nil if host could not be created |
function SCSIHostDestroy(Host:PSCSIHost):LongWord;
Note | None documented |
---|
function SCSIHostRegister(Host:PSCSIHost):LongWord;
Note | None documented |
---|
function SCSIHostDeregister(Host:PSCSIHost):LongWord;
Note | None documented |
---|
function SCSIHostFind(HostId:LongWord):PSCSIHost;
Note | None documented |
---|
function SCSIHostEnumerate(Callback:TSCSIHostEnumerate; Data:Pointer):LongWord;
Note | None documented |
---|
SCSI helper functions
function SCSIGetCount:LongWord;
Note | None documented |
---|
function SCSIDeviceCheck(SCSI:PSCSIDevice):PSCSIDevice;
Note | None documented |
---|
procedure SCSILog(Level:LongWord; SCSI:PSCSIDevice; const AText:String);
Note | None documented |
---|
procedure SCSILogInfo(SCSI:PSCSIDevice; const AText:String); inline;
Note | None documented |
---|
procedure SCSILogWarn(SCSI:PSCSIDevice; const AText:String); inline;
Note | None documented |
---|
procedure SCSILogError(SCSI:PSCSIDevice; const AText:String); inline;
Note | None documented |
---|
procedure SCSILogDebug(SCSI:PSCSIDevice; const AText:String); inline;
Note | None documented |
---|
function SCSIDeviceTypeToStorageType(DeviceType:Byte; Removable,Floppy:Boolean):LongWord;
Note | None documented |
---|
function SCSIHostGetCount:LongWord;
Note | None documented |
---|
function SCSIHostCheck(Host:PSCSIHost):PSCSIHost;
Note | None documented |
---|
SCSI storage functions
function SCSIStorageDeviceRead(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIStorageDeviceWrite(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Note | None documented |
---|
function SCSIStorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Note | None documented |
---|
Return to Unit Reference