MiTec/Common/MiTeC_CSMI.pas
2024-07-06 22:30:25 +02:00

2144 lines
68 KiB
ObjectPascal

{*******************************************************}
{ MiTeC Common Routines }
{ Common Storage Management Interface }
{ }
{ }
{ Copyright (c) by 1997-2021 Michal Mutl }
{ }
{*******************************************************}
{$INCLUDE Compilers.inc}
unit MiTeC_CSMI;
interface
uses {$IFDEF RAD9PLUS}
WinAPI.Windows, System.SysUtils,
{$ELSE}
Windows, SysUtils,
{$ENDIF}
MiTeC_WinIOCTL;
// Control Codes requiring CSMI_ALL_SIGNATURE
const CC_CSMI_SAS_GET_DRIVER_INFO = 1;
{$EXTERNALSYM CC_CSMI_SAS_GET_DRIVER_INFO}
const CC_CSMI_SAS_GET_CNTLR_CONFIG = 2;
{$EXTERNALSYM CC_CSMI_SAS_GET_CNTLR_CONFIG}
const CC_CSMI_SAS_GET_CNTLR_STATUS = 3;
{$EXTERNALSYM CC_CSMI_SAS_GET_CNTLR_STATUS}
const CC_CSMI_SAS_FIRMWARE_DOWNLOAD = 4;
{$EXTERNALSYM CC_CSMI_SAS_FIRMWARE_DOWNLOAD}
// Control Codes requiring CSMI_RAID_SIGNATURE
const CC_CSMI_SAS_GET_RAID_INFO = 10;
{$EXTERNALSYM CC_CSMI_SAS_GET_RAID_INFO}
const CC_CSMI_SAS_GET_RAID_CONFIG = 11;
{$EXTERNALSYM CC_CSMI_SAS_GET_RAID_CONFIG}
const CC_CSMI_SAS_GET_RAID_FEATURES = 12;
{$EXTERNALSYM CC_CSMI_SAS_GET_RAID_FEATURES}
const CC_CSMI_SAS_SET_RAID_CONTROL = 13;
{$EXTERNALSYM CC_CSMI_SAS_SET_RAID_CONTROL}
const CC_CSMI_SAS_GET_RAID_ELEMENT = 14;
{$EXTERNALSYM CC_CSMI_SAS_GET_RAID_ELEMENT}
const CC_CSMI_SAS_SET_RAID_OPERATION = 15;
{$EXTERNALSYM CC_CSMI_SAS_SET_RAID_OPERATION}
// Control Codes requiring CSMI_SAS_SIGNATURE
const CC_CSMI_SAS_GET_PHY_INFO = 20;
{$EXTERNALSYM CC_CSMI_SAS_GET_PHY_INFO}
const CC_CSMI_SAS_SET_PHY_INFO = 21;
{$EXTERNALSYM CC_CSMI_SAS_SET_PHY_INFO}
const CC_CSMI_SAS_GET_LINK_ERRORS = 22;
{$EXTERNALSYM CC_CSMI_SAS_GET_LINK_ERRORS}
const CC_CSMI_SAS_SMP_PASSTHRU = 23;
{$EXTERNALSYM CC_CSMI_SAS_SMP_PASSTHRU}
const CC_CSMI_SAS_SSP_PASSTHRU = 24;
{$EXTERNALSYM CC_CSMI_SAS_SSP_PASSTHRU}
const CC_CSMI_SAS_STP_PASSTHRU = 25;
{$EXTERNALSYM CC_CSMI_SAS_STP_PASSTHRU}
const CC_CSMI_SAS_GET_SATA_SIGNATURE = 26;
{$EXTERNALSYM CC_CSMI_SAS_GET_SATA_SIGNATURE}
const CC_CSMI_SAS_GET_SCSI_ADDRESS = 27;
{$EXTERNALSYM CC_CSMI_SAS_GET_SCSI_ADDRESS}
const CC_CSMI_SAS_GET_DEVICE_ADDRESS = 28;
{$EXTERNALSYM CC_CSMI_SAS_GET_DEVICE_ADDRESS}
const CC_CSMI_SAS_TASK_MANAGEMENT = 29;
{$EXTERNALSYM CC_CSMI_SAS_TASK_MANAGEMENT}
const CC_CSMI_SAS_GET_CONNECTOR_INFO = 30;
{$EXTERNALSYM CC_CSMI_SAS_GET_CONNECTOR_INFO}
const CC_CSMI_SAS_GET_LOCATION = 31;
{$EXTERNALSYM CC_CSMI_SAS_GET_LOCATION}
// Control Codes requiring CSMI_PHY_SIGNATURE
const CC_CSMI_SAS_PHY_CONTROL = 60;
{$EXTERNALSYM CC_CSMI_SAS_PHY_CONTROL}
type IOCTL_HEADER = SRB_IO_CONTROL;
{$EXTERNALSYM IOCTL_HEADER}
type PIOCTL_HEADER = PSRB_IO_CONTROL;
{$EXTERNALSYM PIOCTL_HEADER}
// Return codes for all IOCTL's regardless of class
// (IoctlHeader.ReturnCode)
const CSMI_SAS_STATUS_SUCCESS = 0;
{$EXTERNALSYM CSMI_SAS_STATUS_SUCCESS}
const CSMI_SAS_STATUS_FAILED = 1;
{$EXTERNALSYM CSMI_SAS_STATUS_FAILED}
const CSMI_SAS_STATUS_BAD_CNTL_CODE = 2;
{$EXTERNALSYM CSMI_SAS_STATUS_BAD_CNTL_CODE}
const CSMI_SAS_STATUS_INVALID_PARAMETER = 3;
{$EXTERNALSYM CSMI_SAS_STATUS_INVALID_PARAMETER}
const CSMI_SAS_STATUS_WRITE_ATTEMPTED = 4;
{$EXTERNALSYM CSMI_SAS_STATUS_WRITE_ATTEMPTED}
// Signature value
// (IoctlHeader.Signature)
const CSMI_ALL_SIGNATURE = 'CSMIAL';
{$EXTERNALSYM CSMI_ALL_SIGNATURE}
// Timeout value default of 60 seconds
// (IoctlHeader.Timeout)
const CSMI_ALL_TIMEOUT = 60;
{$EXTERNALSYM CSMI_ALL_TIMEOUT}
// Direction values for data flow on this IOCTL
// (IoctlHeader.Direction, Linux only)
const CSMI_SAS_DATA_READ = 0;
{$EXTERNALSYM CSMI_SAS_DATA_READ}
const CSMI_SAS_DATA_WRITE = 1;
{$EXTERNALSYM CSMI_SAS_DATA_WRITE}
// I/O Bus Types
// ISA and EISA bus types are not supported
// (bIoBusType)
const CSMI_SAS_BUS_TYPE_PCI = 3;
{$EXTERNALSYM CSMI_SAS_BUS_TYPE_PCI}
const CSMI_SAS_BUS_TYPE_PCMCIA = 4;
{$EXTERNALSYM CSMI_SAS_BUS_TYPE_PCMCIA}
// Controller Status
// (uStatus)
const CSMI_SAS_CNTLR_STATUS_GOOD = 1;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS_GOOD}
const CSMI_SAS_CNTLR_STATUS_FAILED = 2;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS_FAILED}
const CSMI_SAS_CNTLR_STATUS_OFFLINE = 3;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS_OFFLINE}
const CSMI_SAS_CNTLR_STATUS_POWEROFF = 4;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS_POWEROFF}
// Offline Status Reason
// (uOfflineReason)
const CSMI_SAS_OFFLINE_REASON_NO_REASON = 0;
{$EXTERNALSYM CSMI_SAS_OFFLINE_REASON_NO_REASON}
const CSMI_SAS_OFFLINE_REASON_INITIALIZING = 1;
{$EXTERNALSYM CSMI_SAS_OFFLINE_REASON_INITIALIZING}
const CSMI_SAS_OFFLINE_REASON_BACKSIDE_BUS_DEGRADED = 2;
{$EXTERNALSYM CSMI_SAS_OFFLINE_REASON_BACKSIDE_BUS_DEGRADED}
const CSMI_SAS_OFFLINE_REASON_BACKSIDE_BUS_FAILURE = 3;
{$EXTERNALSYM CSMI_SAS_OFFLINE_REASON_BACKSIDE_BUS_FAILURE}
// Controller Class
// (bControllerClass)
const CSMI_SAS_CNTLR_CLASS_HBA = 5;
{$EXTERNALSYM CSMI_SAS_CNTLR_CLASS_HBA}
// Controller Flag bits
// (uControllerFlags)
const CSMI_SAS_CNTLR_SAS_HBA = $00000001;
{$EXTERNALSYM CSMI_SAS_CNTLR_SAS_HBA}
const CSMI_SAS_CNTLR_SAS_RAID = $00000002;
{$EXTERNALSYM CSMI_SAS_CNTLR_SAS_RAID}
const CSMI_SAS_CNTLR_SATA_HBA = $00000004;
{$EXTERNALSYM CSMI_SAS_CNTLR_SATA_HBA}
const CSMI_SAS_CNTLR_SATA_RAID = $00000008;
{$EXTERNALSYM CSMI_SAS_CNTLR_SATA_RAID}
const CSMI_SAS_CNTLR_SMART_ARRAY = $00000010;
{$EXTERNALSYM CSMI_SAS_CNTLR_SMART_ARRAY}
// for firmware download
const CSMI_SAS_CNTLR_FWD_SUPPORT = $00010000;
{$EXTERNALSYM CSMI_SAS_CNTLR_FWD_SUPPORT}
const CSMI_SAS_CNTLR_FWD_ONLINE = $00020000;
{$EXTERNALSYM CSMI_SAS_CNTLR_FWD_ONLINE}
const CSMI_SAS_CNTLR_FWD_SRESET = $00040000;
{$EXTERNALSYM CSMI_SAS_CNTLR_FWD_SRESET}
const CSMI_SAS_CNTLR_FWD_HRESET = $00080000;
{$EXTERNALSYM CSMI_SAS_CNTLR_FWD_HRESET}
const CSMI_SAS_CNTLR_FWD_RROM = $00100000;
{$EXTERNALSYM CSMI_SAS_CNTLR_FWD_RROM}
// for RAID configuration supported
const CSMI_SAS_CNTLR_RAID_CFG_SUPPORT = $01000000;
{$EXTERNALSYM CSMI_SAS_CNTLR_RAID_CFG_SUPPORT}
// Download Flag bits
// (uDownloadFlags)
const CSMI_SAS_FWD_VALIDATE = $00000001;
{$EXTERNALSYM CSMI_SAS_FWD_VALIDATE}
const CSMI_SAS_FWD_SOFT_RESET = $00000002;
{$EXTERNALSYM CSMI_SAS_FWD_SOFT_RESET}
const CSMI_SAS_FWD_HARD_RESET = $00000004;
{$EXTERNALSYM CSMI_SAS_FWD_HARD_RESET}
// Firmware Download Status
// (usStatus)
const CSMI_SAS_FWD_SUCCESS = 0;
{$EXTERNALSYM CSMI_SAS_FWD_SUCCESS}
const CSMI_SAS_FWD_FAILED = 1;
{$EXTERNALSYM CSMI_SAS_FWD_FAILED}
const CSMI_SAS_FWD_USING_RROM = 2;
{$EXTERNALSYM CSMI_SAS_FWD_USING_RROM}
const CSMI_SAS_FWD_REJECT = 3;
{$EXTERNALSYM CSMI_SAS_FWD_REJECT}
const CSMI_SAS_FWD_DOWNREV = 4;
{$EXTERNALSYM CSMI_SAS_FWD_DOWNREV}
// Firmware Download Severity
// (usSeverity>
const CSMI_SAS_FWD_INFORMATION = 0;
{$EXTERNALSYM CSMI_SAS_FWD_INFORMATION}
const CSMI_SAS_FWD_WARNING = 1;
{$EXTERNALSYM CSMI_SAS_FWD_WARNING}
const CSMI_SAS_FWD_ERROR = 2;
{$EXTERNALSYM CSMI_SAS_FWD_ERROR}
const CSMI_SAS_FWD_FATAL = 3;
{$EXTERNALSYM CSMI_SAS_FWD_FATAL}
(* * * * * * * * * * SAS RAID Class IOCTL Constants * * * * * * * * *)
// Return codes for the RAID IOCTL's regardless of class
// (IoctlHeader.ReturnCode)
const CSMI_SAS_RAID_SET_OUT_OF_RANGE = 1000;
{$EXTERNALSYM CSMI_SAS_RAID_SET_OUT_OF_RANGE}
const CSMI_SAS_RAID_SET_BUFFER_TOO_SMALL = 1001;
{$EXTERNALSYM CSMI_SAS_RAID_SET_BUFFER_TOO_SMALL}
const CSMI_SAS_RAID_SET_DATA_CHANGED = 1002;
{$EXTERNALSYM CSMI_SAS_RAID_SET_DATA_CHANGED}
// Signature value
// (IoctlHeader.Signature)
const CSMI_RAID_SIGNATURE = 'CSMIARY';
{$EXTERNALSYM CSMI_RAID_SIGNATURE}
// Timeout value default of 60 seconds
// (IoctlHeader.Timeout)
const CSMI_RAID_TIMEOUT = 60;
{$EXTERNALSYM CSMI_RAID_TIMEOUT}
// RAID Types
// (bRaidType)
const CSMI_SAS_RAID_TYPE_NONE = 0;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_NONE}
const CSMI_SAS_RAID_TYPE_0 = 1;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_0}
const CSMI_SAS_RAID_TYPE_1 = 2;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_1}
const CSMI_SAS_RAID_TYPE_10 = 3;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_10}
const CSMI_SAS_RAID_TYPE_5 = 4;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_5}
const CSMI_SAS_RAID_TYPE_15 = 5;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_15}
const CSMI_SAS_RAID_TYPE_6 = 6;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_6}
const CSMI_SAS_RAID_TYPE_50 = 7;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_50}
const CSMI_SAS_RAID_TYPE_VOLUME = 8;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_VOLUME}
const CSMI_SAS_RAID_TYPE_1E = 9;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_1E}
const CSMI_SAS_RAID_TYPE_OTHER = 255;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_OTHER}
// the last value 255 was already defined for other
// so end is defined as 254
const CSMI_SAS_RAID_TYPE_END = 254;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_END}
// RAID Status
// (bStatus)
const CSMI_SAS_RAID_SET_STATUS_OK = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_OK}
const CSMI_SAS_RAID_SET_STATUS_DEGRADED = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_DEGRADED}
const CSMI_SAS_RAID_SET_STATUS_REBUILDING = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_REBUILDING}
const CSMI_SAS_RAID_SET_STATUS_FAILED = 3;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_FAILED}
const CSMI_SAS_RAID_SET_STATUS_OFFLINE = 4;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_OFFLINE}
const CSMI_SAS_RAID_SET_STATUS_TRANSFORMING = 5;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_TRANSFORMING}
const CSMI_SAS_RAID_SET_STATUS_QUEUED_FOR_REBUILD = 6;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_QUEUED_FOR_REBUILD}
const CSMI_SAS_RAID_SET_STATUS_QUEUED_FOR_TRANSFORMATION = 7;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATUS_QUEUED_FOR_TRANSFORMATION}
// RAID Drive Count
// (bDriveCount, 0xF1 to 0xFF are reserved)
const CSMI_SAS_RAID_DRIVE_COUNT_TOO_BIG = $F1;
{$EXTERNALSYM CSMI_SAS_RAID_DRIVE_COUNT_TOO_BIG}
const CSMI_SAS_RAID_DRIVE_COUNT_SUPRESSED = $F2;
{$EXTERNALSYM CSMI_SAS_RAID_DRIVE_COUNT_SUPRESSED}
// RAID Data cType
// (bDataType)
const CSMI_SAS_RAID_DATA_DRIVES = 0;
{$EXTERNALSYM CSMI_SAS_RAID_DATA_DRIVES}
const CSMI_SAS_RAID_DATA_DEVICE_ID = 1;
{$EXTERNALSYM CSMI_SAS_RAID_DATA_DEVICE_ID}
const CSMI_SAS_RAID_DATA_ADDITIONAL_DATA = 2;
{$EXTERNALSYM CSMI_SAS_RAID_DATA_ADDITIONAL_DATA}
// RAID Drive Status
// (bDriveStatus)
const CSMI_SAS_DRIVE_STATUS_OK = 0;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_OK}
const CSMI_SAS_DRIVE_STATUS_REBUILDING = 1;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_REBUILDING}
const CSMI_SAS_DRIVE_STATUS_FAILED = 2;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_FAILED}
const CSMI_SAS_DRIVE_STATUS_DEGRADED = 3;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_DEGRADED}
const CSMI_SAS_DRIVE_STATUS_OFFLINE = 4;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_OFFLINE}
const CSMI_SAS_DRIVE_STATUS_QUEUED_FOR_REBUILD = 5;
{$EXTERNALSYM CSMI_SAS_DRIVE_STATUS_QUEUED_FOR_REBUILD}
// RAID Drive Usage
// (bDriveUsage)
const CSMI_SAS_DRIVE_CONFIG_NOT_USED = 0;
{$EXTERNALSYM CSMI_SAS_DRIVE_CONFIG_NOT_USED}
const CSMI_SAS_DRIVE_CONFIG_MEMBER = 1;
{$EXTERNALSYM CSMI_SAS_DRIVE_CONFIG_MEMBER}
const CSMI_SAS_DRIVE_CONFIG_SPARE = 2;
{$EXTERNALSYM CSMI_SAS_DRIVE_CONFIG_SPARE}
const CSMI_SAS_DRIVE_CONFIG_SPARE_ACTIVE = 3;
{$EXTERNALSYM CSMI_SAS_DRIVE_CONFIG_SPARE_ACTIVE}
// RAID Drive cType
// (bDriveType)
const CSMI_SAS_DRIVE_TYPE_UNKNOWN = 0;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_UNKNOWN}
const CSMI_SAS_DRIVE_TYPE_SINGLE_PORT_SAS = 1;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_SINGLE_PORT_SAS}
const CSMI_SAS_DRIVE_TYPE_DUAL_PORT_SAS = 2;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_DUAL_PORT_SAS}
const CSMI_SAS_DRIVE_TYPE_SATA = 3;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_SATA}
const CSMI_SAS_DRIVE_TYPE_SATA_PS = 4;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_SATA_PS}
const CSMI_SAS_DRIVE_TYPE_OTHER = 255;
{$EXTERNALSYM CSMI_SAS_DRIVE_TYPE_OTHER}
// RAID Write Protect
// (bWriteProtect)
const CSMI_SAS_RAID_SET_WRITE_PROTECT_UNKNOWN = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT_UNKNOWN}
const CSMI_SAS_RAID_SET_WRITE_PROTECT_UNCHANGED = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT_UNCHANGED}
const CSMI_SAS_RAID_SET_WRITE_PROTECT_ENABLED = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT_ENABLED}
const CSMI_SAS_RAID_SET_WRITE_PROTECT_DISABLED = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT_DISABLED}
// RAID Cache Setting
// (bCacheSetting)
const CSMI_SAS_RAID_SET_CACHE_UNKNOWN = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_UNKNOWN}
const CSMI_SAS_RAID_SET_CACHE_UNCHANGED = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_UNCHANGED}
const CSMI_SAS_RAID_SET_CACHE_ENABLED = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_ENABLED}
const CSMI_SAS_RAID_SET_CACHE_DISABLED = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_DISABLED}
const CSMI_SAS_RAID_SET_CACHE_CORRUPT = 3;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_CORRUPT}
// RAID Features
// (uFeatures)
const CSMI_SAS_RAID_FEATURE_TRANSFORMATION = $00000001;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_TRANSFORMATION}
const CSMI_SAS_RAID_FEATURE_REBUILD = $00000002;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_REBUILD}
const CSMI_SAS_RAID_FEATURE_SPLIT_MIRROR = $00000004;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_SPLIT_MIRROR}
const CSMI_SAS_RAID_FEATURE_MERGE_MIRROR = $00000008;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_MERGE_MIRROR}
const CSMI_SAS_RAID_FEATURE_LUN_RENUMBER = $00000010;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_LUN_RENUMBER}
const CSMI_SAS_RAID_FEATURE_SURFACE_SCAN = $00000020;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_SURFACE_SCAN}
const CSMI_SAS_RAID_FEATURE_SPARES_SHARED = $00000040;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURE_SPARES_SHARED}
// RAID Priority
// (bDefaultTransformPriority, etc.)
const CSMI_SAS_PRIORITY_UNKNOWN = 0;
{$EXTERNALSYM CSMI_SAS_PRIORITY_UNKNOWN}
const CSMI_SAS_PRIORITY_UNCHANGED = 0;
{$EXTERNALSYM CSMI_SAS_PRIORITY_UNCHANGED}
const CSMI_SAS_PRIORITY_AUTO = 1;
{$EXTERNALSYM CSMI_SAS_PRIORITY_AUTO}
const CSMI_SAS_PRIORITY_OFF = 2;
{$EXTERNALSYM CSMI_SAS_PRIORITY_OFF}
const CSMI_SAS_PRIORITY_LOW = 3;
{$EXTERNALSYM CSMI_SAS_PRIORITY_LOW}
const CSMI_SAS_PRIORITY_MEDIUM = 4;
{$EXTERNALSYM CSMI_SAS_PRIORITY_MEDIUM}
const CSMI_SAS_PRIORITY_HIGH = 5;
{$EXTERNALSYM CSMI_SAS_PRIORITY_HIGH}
// RAID Transformation Rules
// (uRaidSetTransformationRules)
const CSMI_SAS_RAID_RULE_AVAILABLE_MEMORY = $00000001;
{$EXTERNALSYM CSMI_SAS_RAID_RULE_AVAILABLE_MEMORY}
const CSMI_SAS_RAID_RULE_OVERLAPPED_EXTENTS = $00000002;
{$EXTERNALSYM CSMI_SAS_RAID_RULE_OVERLAPPED_EXTENTS}
// RAID Cache Ratios Supported
// (bCacheRatiosSupported)
// from 0 to 100 defines the write to read ratio, 0 is 100% write
const CSMI_SAS_RAID_CACHE_RATIO_RANGE = 101;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_RANGE}
const CSMI_SAS_RAID_CACHE_RATIO_FIXED = 102;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_FIXED}
const CSMI_SAS_RAID_CACHE_RATIO_AUTO = 103;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_AUTO}
const CSMI_SAS_RAID_CACHE_RATIO_END = 255;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_END}
// RAID Cache Ratio Flag
// (bCacheRatioFlag)
const CSMI_SAS_RAID_CACHE_RATIO_DISABLE = 0;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_DISABLE}
const CSMI_SAS_RAID_CACHE_RATIO_ENABLE = 1;
{$EXTERNALSYM CSMI_SAS_RAID_CACHE_RATIO_ENABLE}
// RAID Clear Configuration Signature
// (bClearConfiguration)
const CSMI_SAS_RAID_CLEAR_CONFIGURATION_SIGNATURE = 'RAIDCLR';
{$EXTERNALSYM CSMI_SAS_RAID_CLEAR_CONFIGURATION_SIGNATURE}
// RAID Failure Codes
// (uFailureCode)
const CSMI_SAS_FAIL_CODE_OK = 0;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_OK}
const CSMI_SAS_FAIL_CODE_PARAMETER_INVALID = 1000;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_PARAMETER_INVALID}
const CSMI_SAS_FAIL_CODE_TRANSFORM_PRIORITY_INVALID = 1001;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_TRANSFORM_PRIORITY_INVALID}
const CSMI_SAS_FAIL_CODE_REBUILD_PRIORITY_INVALID = 1002;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_REBUILD_PRIORITY_INVALID}
const CSMI_SAS_FAIL_CODE_CACHE_RATIO_INVALID = 1003;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_CACHE_RATIO_INVALID}
const CSMI_SAS_FAIL_CODE_SURFACE_SCAN_INVALID = 1004;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_SURFACE_SCAN_INVALID}
const CSMI_SAS_FAIL_CODE_CLEAR_CONFIGURATION_INVALID = 1005;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_CLEAR_CONFIGURATION_INVALID}
const CSMI_SAS_FAIL_CODE_ELEMENT_INDEX_INVALID = 1006;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_ELEMENT_INDEX_INVALID}
const CSMI_SAS_FAIL_CODE_SUBELEMENT_INDEX_INVALID = 1007;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_SUBELEMENT_INDEX_INVALID}
const CSMI_SAS_FAIL_CODE_EXTENT_INVALID = 1008;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_EXTENT_INVALID}
const CSMI_SAS_FAIL_CODE_BLOCK_COUNT_INVALID = 1009;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_BLOCK_COUNT_INVALID}
const CSMI_SAS_FAIL_CODE_DRIVE_INDEX_INVALID = 1010;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_DRIVE_INDEX_INVALID}
const CSMI_SAS_FAIL_CODE_EXISTING_LUN_INVALID = 1011;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_EXISTING_LUN_INVALID}
const CSMI_SAS_FAIL_CODE_RAID_TYPE_INVALID = 1012;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_RAID_TYPE_INVALID}
const CSMI_SAS_FAIL_CODE_STRIPE_SIZE_INVALID = 1013;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_STRIPE_SIZE_INVALID}
const CSMI_SAS_FAIL_CODE_TRANSFORMATION_INVALID = 1014;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_TRANSFORMATION_INVALID}
const CSMI_SAS_FAIL_CODE_CHANGE_COUNT_INVALID = 1015;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_CHANGE_COUNT_INVALID}
const CSMI_SAS_FAIL_CODE_ENUMERATION_TYPE_INVALID = 1016;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_ENUMERATION_TYPE_INVALID}
const CSMI_SAS_FAIL_CODE_EXCEEDED_RAID_SET_COUNT = 2000;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_EXCEEDED_RAID_SET_COUNT}
const CSMI_SAS_FAIL_CODE_DUPLICATE_LUN = 2001;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_DUPLICATE_LUN}
const CSMI_SAS_FAIL_CODE_WAIT_FOR_OPERATION = 3000;
{$EXTERNALSYM CSMI_SAS_FAIL_CODE_WAIT_FOR_OPERATION}
// RAID Enumeration Types
// (uEnumerationType)
const CSMI_SAS_RAID_ELEMENT_TYPE_DRIVE = 0;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT_TYPE_DRIVE}
const CSMI_SAS_RAID_ELEMENT_TYPE_MODULE = 1;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT_TYPE_MODULE}
const CSMI_SAS_RAID_ELEMENT_TYPE_DRIVE_RAID_SET = 2;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT_TYPE_DRIVE_RAID_SET}
const CSMI_SAS_RAID_ELEMENT_TYPE_EXTENT_DRIVE = 3;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT_TYPE_EXTENT_DRIVE}
// RAID Extent Types
// (bExtentType)
const CSMI_SAS_RAID_EXTENT_RESERVED = 0;
{$EXTERNALSYM CSMI_SAS_RAID_EXTENT_RESERVED}
const CSMI_SAS_RAID_EXTENT_METADATA = 1;
{$EXTERNALSYM CSMI_SAS_RAID_EXTENT_METADATA}
const CSMI_SAS_RAID_EXTENT_ALLOCATED = 2;
{$EXTERNALSYM CSMI_SAS_RAID_EXTENT_ALLOCATED}
const CSMI_SAS_RAID_EXTENT_UNALLOCATED = 3;
{$EXTERNALSYM CSMI_SAS_RAID_EXTENT_UNALLOCATED}
// RAID Operation Types
// (uOperationType)
const CSMI_SAS_RAID_SET_CREATE = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CREATE}
const CSMI_SAS_RAID_SET_LABEL = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_LABEL}
const CSMI_SAS_RAID_SET_TRANSFORM = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM}
const CSMI_SAS_RAID_SET_DELETE = 3;
{$EXTERNALSYM CSMI_SAS_RAID_SET_DELETE}
const CSMI_SAS_RAID_SET_WRITE_PROTECT = 4;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT}
const CSMI_SAS_RAID_SET_CACHE = 5;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE}
const CSMI_SAS_RAID_SET_ONLINE_STATE = 6;
{$EXTERNALSYM CSMI_SAS_RAID_SET_ONLINE_STATE}
const CSMI_SAS_RAID_SET_SPARE = 7;
{$EXTERNALSYM CSMI_SAS_RAID_SET_SPARE}
// RAID Transform Types
// (bTransformType)
const CSMI_SAS_RAID_SET_TRANSFORM_SPLIT_MIRROR = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM_SPLIT_MIRROR}
const CSMI_SAS_RAID_SET_TRANSFORM_MERGE_RAID_0 = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM_MERGE_RAID_0}
const CSMI_SAS_RAID_SET_TRANSFORM_LUN_RENUMBER = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM_LUN_RENUMBER}
const CSMI_SAS_RAID_SET_TRANSFORM_RAID_SET = 3;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM_RAID_SET}
// RAID Online State
// (bOnlineState)
const CSMI_SAS_RAID_SET_STATE_UNKNOWN = 0;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATE_UNKNOWN}
const CSMI_SAS_RAID_SET_STATE_ONLINE = 1;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATE_ONLINE}
const CSMI_SAS_RAID_SET_STATE_OFFLINE = 2;
{$EXTERNALSYM CSMI_SAS_RAID_SET_STATE_OFFLINE}
(* * * * * * * * * * SAS HBA Class IOCTL Constants * * * * * * * * * *)
// Return codes for SAS IOCTL's
// (IoctlHeader.ReturnCode)
const CSMI_SAS_PHY_INFO_CHANGED = CSMI_SAS_STATUS_SUCCESS;
{$EXTERNALSYM CSMI_SAS_PHY_INFO_CHANGED}
const CSMI_SAS_PHY_INFO_NOT_CHANGEABLE = 2000;
{$EXTERNALSYM CSMI_SAS_PHY_INFO_NOT_CHANGEABLE}
const CSMI_SAS_LINK_RATE_OUT_OF_RANGE = 2001;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_OUT_OF_RANGE}
const CSMI_SAS_PHY_DOES_NOT_EXIST = 2002;
{$EXTERNALSYM CSMI_SAS_PHY_DOES_NOT_EXIST}
const CSMI_SAS_PHY_DOES_NOT_MATCH_PORT = 2003;
{$EXTERNALSYM CSMI_SAS_PHY_DOES_NOT_MATCH_PORT}
const CSMI_SAS_PHY_CANNOT_BE_SELECTED = 2004;
{$EXTERNALSYM CSMI_SAS_PHY_CANNOT_BE_SELECTED}
const CSMI_SAS_SELECT_PHY_OR_PORT = 2005;
{$EXTERNALSYM CSMI_SAS_SELECT_PHY_OR_PORT}
const CSMI_SAS_PORT_DOES_NOT_EXIST = 2006;
{$EXTERNALSYM CSMI_SAS_PORT_DOES_NOT_EXIST}
const CSMI_SAS_PORT_CANNOT_BE_SELECTED = 2007;
{$EXTERNALSYM CSMI_SAS_PORT_CANNOT_BE_SELECTED}
const CSMI_SAS_CONNECTION_FAILED = 2008;
{$EXTERNALSYM CSMI_SAS_CONNECTION_FAILED}
const CSMI_SAS_NO_SATA_DEVICE = 2009;
{$EXTERNALSYM CSMI_SAS_NO_SATA_DEVICE}
const CSMI_SAS_NO_SATA_SIGNATURE = 2010;
{$EXTERNALSYM CSMI_SAS_NO_SATA_SIGNATURE}
const CSMI_SAS_SCSI_EMULATION = 2011;
{$EXTERNALSYM CSMI_SAS_SCSI_EMULATION}
const CSMI_SAS_NOT_AN_END_DEVICE = 2012;
{$EXTERNALSYM CSMI_SAS_NOT_AN_END_DEVICE}
const CSMI_SAS_NO_SCSI_ADDRESS = 2013;
{$EXTERNALSYM CSMI_SAS_NO_SCSI_ADDRESS}
const CSMI_SAS_NO_DEVICE_ADDRESS = 2014;
{$EXTERNALSYM CSMI_SAS_NO_DEVICE_ADDRESS}
// Signature value
// (IoctlHeader.Signature)
const CSMI_SAS_SIGNATURE = 'CSMISAS';
{$EXTERNALSYM CSMI_SAS_SIGNATURE}
// Timeout value default of 60 seconds
// (IoctlHeader.Timeout)
const CSMI_SAS_TIMEOUT = 60;
{$EXTERNALSYM CSMI_SAS_TIMEOUT}
// Device types
// (bDeviceType)
const CSMI_SAS_PHY_UNUSED = $00;
{$EXTERNALSYM CSMI_SAS_PHY_UNUSED}
const CSMI_SAS_NO_DEVICE_ATTACHED = $00;
{$EXTERNALSYM CSMI_SAS_NO_DEVICE_ATTACHED}
const CSMI_SAS_END_DEVICE = $10;
{$EXTERNALSYM CSMI_SAS_END_DEVICE}
const CSMI_SAS_EDGE_EXPANDER_DEVICE = $20;
{$EXTERNALSYM CSMI_SAS_EDGE_EXPANDER_DEVICE}
const CSMI_SAS_FANOUT_EXPANDER_DEVICE = $30;
{$EXTERNALSYM CSMI_SAS_FANOUT_EXPANDER_DEVICE}
// Protocol options
// (bInitiatorPortProtocol, bTargetPortProtocol)
const CSMI_SAS_PROTOCOL_SATA = $01;
{$EXTERNALSYM CSMI_SAS_PROTOCOL_SATA}
const CSMI_SAS_PROTOCOL_SMP = $02;
{$EXTERNALSYM CSMI_SAS_PROTOCOL_SMP}
const CSMI_SAS_PROTOCOL_STP = $04;
{$EXTERNALSYM CSMI_SAS_PROTOCOL_STP}
const CSMI_SAS_PROTOCOL_SSP = $08;
{$EXTERNALSYM CSMI_SAS_PROTOCOL_SSP}
// Negotiated and hardware link rates
// (bNegotiatedLinkRate, bMinimumLinkRate, bMaximumLinkRate)
const CSMI_SAS_LINK_RATE_UNKNOWN = $00;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_UNKNOWN}
const CSMI_SAS_PHY_DISABLED = $01;
{$EXTERNALSYM CSMI_SAS_PHY_DISABLED}
const CSMI_SAS_LINK_RATE_FAILED = $02;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_FAILED}
const CSMI_SAS_SATA_SPINUP_HOLD = $03;
{$EXTERNALSYM CSMI_SAS_SATA_SPINUP_HOLD}
const CSMI_SAS_SATA_PORT_SELECTOR = $04;
{$EXTERNALSYM CSMI_SAS_SATA_PORT_SELECTOR}
const CSMI_SAS_LINK_RATE_1_5_GBPS = $08;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_1_5_GBPS}
const CSMI_SAS_LINK_RATE_3_0_GBPS = $09;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_3_0_GBPS}
const CSMI_SAS_LINK_VIRTUAL = $10;
{$EXTERNALSYM CSMI_SAS_LINK_VIRTUAL}
// Discover state
// (bAutoDiscover)
const CSMI_SAS_DISCOVER_NOT_SUPPORTED = $00;
{$EXTERNALSYM CSMI_SAS_DISCOVER_NOT_SUPPORTED}
const CSMI_SAS_DISCOVER_NOT_STARTED = $01;
{$EXTERNALSYM CSMI_SAS_DISCOVER_NOT_STARTED}
const CSMI_SAS_DISCOVER_IN_PROGRESS = $02;
{$EXTERNALSYM CSMI_SAS_DISCOVER_IN_PROGRESS}
const CSMI_SAS_DISCOVER_COMPLETE = $03;
{$EXTERNALSYM CSMI_SAS_DISCOVER_COMPLETE}
const CSMI_SAS_DISCOVER_ERROR = $04;
{$EXTERNALSYM CSMI_SAS_DISCOVER_ERROR}
// Phy features
const CSMI_SAS_PHY_VIRTUAL_SMP = $01;
{$EXTERNALSYM CSMI_SAS_PHY_VIRTUAL_SMP}
// Programmed link rates
// (bMinimumLinkRate, bMaximumLinkRate)
// (bProgrammedMinimumLinkRate, bProgrammedMaximumLinkRate)
const CSMI_SAS_PROGRAMMED_LINK_RATE_UNCHANGED = $00;
{$EXTERNALSYM CSMI_SAS_PROGRAMMED_LINK_RATE_UNCHANGED}
const CSMI_SAS_PROGRAMMED_LINK_RATE_1_5_GBPS = $08;
{$EXTERNALSYM CSMI_SAS_PROGRAMMED_LINK_RATE_1_5_GBPS}
const CSMI_SAS_PROGRAMMED_LINK_RATE_3_0_GBPS = $09;
{$EXTERNALSYM CSMI_SAS_PROGRAMMED_LINK_RATE_3_0_GBPS}
// Link rate
// (bNegotiatedLinkRate in CSMI_SAS_SET_PHY_INFO)
const CSMI_SAS_LINK_RATE_NEGOTIATE = $00;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_NEGOTIATE}
const CSMI_SAS_LINK_RATE_PHY_DISABLED = $01;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_PHY_DISABLED}
// Signal class
// (bSignalClass in CSMI_SAS_SET_PHY_INFO)
const CSMI_SAS_SIGNAL_CLASS_UNKNOWN = $00;
{$EXTERNALSYM CSMI_SAS_SIGNAL_CLASS_UNKNOWN}
const CSMI_SAS_SIGNAL_CLASS_DIRECT = $01;
{$EXTERNALSYM CSMI_SAS_SIGNAL_CLASS_DIRECT}
const CSMI_SAS_SIGNAL_CLASS_SERVER = $02;
{$EXTERNALSYM CSMI_SAS_SIGNAL_CLASS_SERVER}
const CSMI_SAS_SIGNAL_CLASS_ENCLOSURE = $03;
{$EXTERNALSYM CSMI_SAS_SIGNAL_CLASS_ENCLOSURE}
// Link error reset
// (bResetCounts)
const CSMI_SAS_LINK_ERROR_DONT_RESET_COUNTS = $00;
{$EXTERNALSYM CSMI_SAS_LINK_ERROR_DONT_RESET_COUNTS}
const CSMI_SAS_LINK_ERROR_RESET_COUNTS = $01;
{$EXTERNALSYM CSMI_SAS_LINK_ERROR_RESET_COUNTS}
// Phy identifier
// (bPhyIdentifier)
const CSMI_SAS_USE_PORT_IDENTIFIER = $FF;
{$EXTERNALSYM CSMI_SAS_USE_PORT_IDENTIFIER}
// Port identifier
// (bPortIdentifier)
const CSMI_SAS_IGNORE_PORT = $FF;
{$EXTERNALSYM CSMI_SAS_IGNORE_PORT}
// Programmed link rates
// (bConnectionRate)
const CSMI_SAS_LINK_RATE_NEGOTIATED = $00;
{$EXTERNALSYM CSMI_SAS_LINK_RATE_NEGOTIATED}
// Connection status
// (bConnectionStatus)
const CSMI_SAS_OPEN_ACCEPT = 0;
{$EXTERNALSYM CSMI_SAS_OPEN_ACCEPT}
const CSMI_SAS_OPEN_REJECT_BAD_DESTINATION = 1;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_BAD_DESTINATION}
const CSMI_SAS_OPEN_REJECT_RATE_NOT_SUPPORTED = 2;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RATE_NOT_SUPPORTED}
const CSMI_SAS_OPEN_REJECT_NO_DESTINATION = 3;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_NO_DESTINATION}
const CSMI_SAS_OPEN_REJECT_PATHWAY_BLOCKED = 4;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_PATHWAY_BLOCKED}
const CSMI_SAS_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED = 5;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED}
const CSMI_SAS_OPEN_REJECT_RESERVE_ABANDON = 6;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RESERVE_ABANDON}
const CSMI_SAS_OPEN_REJECT_RESERVE_CONTINUE = 7;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RESERVE_CONTINUE}
const CSMI_SAS_OPEN_REJECT_RESERVE_INITIALIZE = 8;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RESERVE_INITIALIZE}
const CSMI_SAS_OPEN_REJECT_RESERVE_STOP = 9;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RESERVE_STOP}
const CSMI_SAS_OPEN_REJECT_RETRY = 10;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_RETRY}
const CSMI_SAS_OPEN_REJECT_STP_RESOURCES_BUSY = 11;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_STP_RESOURCES_BUSY}
const CSMI_SAS_OPEN_REJECT_WRONG_DESTINATION = 12;
{$EXTERNALSYM CSMI_SAS_OPEN_REJECT_WRONG_DESTINATION}
// SSP Status
// (bSSPStatus)
const CSMI_SAS_SSP_STATUS_UNKNOWN = $00;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_UNKNOWN}
const CSMI_SAS_SSP_STATUS_WAITING = $01;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_WAITING}
const CSMI_SAS_SSP_STATUS_COMPLETED = $02;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_COMPLETED}
const CSMI_SAS_SSP_STATUS_FATAL_ERROR = $03;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_FATAL_ERROR}
const CSMI_SAS_SSP_STATUS_RETRY = $04;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_RETRY}
const CSMI_SAS_SSP_STATUS_NO_TAG = $05;
{$EXTERNALSYM CSMI_SAS_SSP_STATUS_NO_TAG}
// SSP Flags
// (uFlags)
const CSMI_SAS_SSP_READ = $00000001;
{$EXTERNALSYM CSMI_SAS_SSP_READ}
const CSMI_SAS_SSP_WRITE = $00000002;
{$EXTERNALSYM CSMI_SAS_SSP_WRITE}
const CSMI_SAS_SSP_UNSPECIFIED = $00000004;
{$EXTERNALSYM CSMI_SAS_SSP_UNSPECIFIED}
const CSMI_SAS_SSP_TASK_ATTRIBUTE_SIMPLE = $00000000;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_ATTRIBUTE_SIMPLE}
const CSMI_SAS_SSP_TASK_ATTRIBUTE_HEAD_OF_QUEUE = $00000010;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_ATTRIBUTE_HEAD_OF_QUEUE}
const CSMI_SAS_SSP_TASK_ATTRIBUTE_ORDERED = $00000020;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_ATTRIBUTE_ORDERED}
const CSMI_SAS_SSP_TASK_ATTRIBUTE_ACA = $00000040;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_ATTRIBUTE_ACA}
// SSP Data present
// (bDataPresent)
const CSMI_SAS_SSP_NO_DATA_PRESENT = $00;
{$EXTERNALSYM CSMI_SAS_SSP_NO_DATA_PRESENT}
const CSMI_SAS_SSP_RESPONSE_DATA_PRESENT = $01;
{$EXTERNALSYM CSMI_SAS_SSP_RESPONSE_DATA_PRESENT}
const CSMI_SAS_SSP_SENSE_DATA_PRESENT = $02;
{$EXTERNALSYM CSMI_SAS_SSP_SENSE_DATA_PRESENT}
// STP Flags
// (uFlags)
const CSMI_SAS_STP_READ = $00000001;
{$EXTERNALSYM CSMI_SAS_STP_READ}
const CSMI_SAS_STP_WRITE = $00000002;
{$EXTERNALSYM CSMI_SAS_STP_WRITE}
const CSMI_SAS_STP_UNSPECIFIED = $00000004;
{$EXTERNALSYM CSMI_SAS_STP_UNSPECIFIED}
const CSMI_SAS_STP_PIO = $00000010;
{$EXTERNALSYM CSMI_SAS_STP_PIO}
const CSMI_SAS_STP_DMA = $00000020;
{$EXTERNALSYM CSMI_SAS_STP_DMA}
const CSMI_SAS_STP_PACKET = $00000040;
{$EXTERNALSYM CSMI_SAS_STP_PACKET}
const CSMI_SAS_STP_DMA_QUEUED = $00000080;
{$EXTERNALSYM CSMI_SAS_STP_DMA_QUEUED}
const CSMI_SAS_STP_EXECUTE_DIAG = $00000100;
{$EXTERNALSYM CSMI_SAS_STP_EXECUTE_DIAG}
const CSMI_SAS_STP_RESET_DEVICE = $00000200;
{$EXTERNALSYM CSMI_SAS_STP_RESET_DEVICE}
// Task Management Flags
// (uFlags)
const CSMI_SAS_TASK_IU = $00000001;
{$EXTERNALSYM CSMI_SAS_TASK_IU}
const CSMI_SAS_HARD_RESET_SEQUENCE = $00000002;
{$EXTERNALSYM CSMI_SAS_HARD_RESET_SEQUENCE}
const CSMI_SAS_SUPPRESS_RESULT = $00000004;
{$EXTERNALSYM CSMI_SAS_SUPPRESS_RESULT}
// Task Management Functions
// (bTaskManagement)
const CSMI_SAS_SSP_ABORT_TASK = $01;
{$EXTERNALSYM CSMI_SAS_SSP_ABORT_TASK}
const CSMI_SAS_SSP_ABORT_TASK_SET = $02;
{$EXTERNALSYM CSMI_SAS_SSP_ABORT_TASK_SET}
const CSMI_SAS_SSP_CLEAR_TASK_SET = $04;
{$EXTERNALSYM CSMI_SAS_SSP_CLEAR_TASK_SET}
const CSMI_SAS_SSP_LOGICAL_UNIT_RESET = $08;
{$EXTERNALSYM CSMI_SAS_SSP_LOGICAL_UNIT_RESET}
const CSMI_SAS_SSP_CLEAR_ACA = $40;
{$EXTERNALSYM CSMI_SAS_SSP_CLEAR_ACA}
const CSMI_SAS_SSP_QUERY_TASK = $80;
{$EXTERNALSYM CSMI_SAS_SSP_QUERY_TASK}
// Task Management Information
// (uInformation)
const CSMI_SAS_SSP_TEST = 1;
{$EXTERNALSYM CSMI_SAS_SSP_TEST}
const CSMI_SAS_SSP_EXCEEDED = 2;
{$EXTERNALSYM CSMI_SAS_SSP_EXCEEDED}
const CSMI_SAS_SSP_DEMAND = 3;
{$EXTERNALSYM CSMI_SAS_SSP_DEMAND}
const CSMI_SAS_SSP_TRIGGER = 4;
{$EXTERNALSYM CSMI_SAS_SSP_TRIGGER}
// Connector Pinout Information
// (uPinout)
const CSMI_SAS_CON_UNKNOWN = $00000001;
{$EXTERNALSYM CSMI_SAS_CON_UNKNOWN}
const CSMI_SAS_CON_SFF_8482 = $00000002;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8482}
const CSMI_SAS_CON_SFF_8470_LANE_1 = $00000100;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8470_LANE_1}
const CSMI_SAS_CON_SFF_8470_LANE_2 = $00000200;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8470_LANE_2}
const CSMI_SAS_CON_SFF_8470_LANE_3 = $00000400;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8470_LANE_3}
const CSMI_SAS_CON_SFF_8470_LANE_4 = $00000800;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8470_LANE_4}
const CSMI_SAS_CON_SFF_8484_LANE_1 = $00010000;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8484_LANE_1}
const CSMI_SAS_CON_SFF_8484_LANE_2 = $00020000;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8484_LANE_2}
const CSMI_SAS_CON_SFF_8484_LANE_3 = $00040000;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8484_LANE_3}
const CSMI_SAS_CON_SFF_8484_LANE_4 = $00080000;
{$EXTERNALSYM CSMI_SAS_CON_SFF_8484_LANE_4}
// Connector Location Information
// (bLocation)
// same as uPinout above...
// #define CSMI_SAS_CON_UNKNOWN 0x01
const CSMI_SAS_CON_INTERNAL = $02;
{$EXTERNALSYM CSMI_SAS_CON_INTERNAL}
const CSMI_SAS_CON_EXTERNAL = $04;
{$EXTERNALSYM CSMI_SAS_CON_EXTERNAL}
const CSMI_SAS_CON_SWITCHABLE = $08;
{$EXTERNALSYM CSMI_SAS_CON_SWITCHABLE}
const CSMI_SAS_CON_AUTO = $10;
{$EXTERNALSYM CSMI_SAS_CON_AUTO}
const CSMI_SAS_CON_NOT_PRESENT = $20;
{$EXTERNALSYM CSMI_SAS_CON_NOT_PRESENT}
const CSMI_SAS_CON_NOT_CONNECTED = $80;
{$EXTERNALSYM CSMI_SAS_CON_NOT_CONNECTED}
// Device location identification
// (bIdentify)
const CSMI_SAS_LOCATE_UNKNOWN = $00;
{$EXTERNALSYM CSMI_SAS_LOCATE_UNKNOWN}
const CSMI_SAS_LOCATE_FORCE_OFF = $01;
{$EXTERNALSYM CSMI_SAS_LOCATE_FORCE_OFF}
const CSMI_SAS_LOCATE_FORCE_ON = $02;
{$EXTERNALSYM CSMI_SAS_LOCATE_FORCE_ON}
// Location Valid flags
// (uLocationFlags)
const CSMI_SAS_LOCATE_SAS_ADDRESS_VALID = $00000001;
{$EXTERNALSYM CSMI_SAS_LOCATE_SAS_ADDRESS_VALID}
const CSMI_SAS_LOCATE_SAS_LUN_VALID = $00000002;
{$EXTERNALSYM CSMI_SAS_LOCATE_SAS_LUN_VALID}
const CSMI_SAS_LOCATE_ENCLOSURE_IDENTIFIER_VALID = $00000004;
{$EXTERNALSYM CSMI_SAS_LOCATE_ENCLOSURE_IDENTIFIER_VALID}
const CSMI_SAS_LOCATE_ENCLOSURE_NAME_VALID = $00000008;
{$EXTERNALSYM CSMI_SAS_LOCATE_ENCLOSURE_NAME_VALID}
const CSMI_SAS_LOCATE_BAY_PREFIX_VALID = $00000010;
{$EXTERNALSYM CSMI_SAS_LOCATE_BAY_PREFIX_VALID}
const CSMI_SAS_LOCATE_BAY_IDENTIFIER_VALID = $00000020;
{$EXTERNALSYM CSMI_SAS_LOCATE_BAY_IDENTIFIER_VALID}
const CSMI_SAS_LOCATE_LOCATION_STATE_VALID = $00000040;
{$EXTERNALSYM CSMI_SAS_LOCATE_LOCATION_STATE_VALID}
(* * * * * * * * SAS Phy Control Class IOCTL Constants * * * * * * * * *)
// Return codes for SAS Phy Control IOCTL's
// (IoctlHeader.ReturnCode)
// Signature value
// (IoctlHeader.Signature)
const CSMI_PHY_SIGNATURE = 'CSMIPHY';
{$EXTERNALSYM CSMI_PHY_SIGNATURE}
// Phy Control Functions
// (bFunction)
// values 0x00 to 0xFF are consistent in definition with the SMP PHY CONTROL
// function defined in the SAS spec
const CSMI_SAS_PC_NOP = $00000000;
{$EXTERNALSYM CSMI_SAS_PC_NOP}
const CSMI_SAS_PC_LINK_RESET = $00000001;
{$EXTERNALSYM CSMI_SAS_PC_LINK_RESET}
const CSMI_SAS_PC_HARD_RESET = $00000002;
{$EXTERNALSYM CSMI_SAS_PC_HARD_RESET}
const CSMI_SAS_PC_PHY_DISABLE = $00000003;
{$EXTERNALSYM CSMI_SAS_PC_PHY_DISABLE}
// 0x04 to 0xFF reserved...
const CSMI_SAS_PC_GET_PHY_SETTINGS = $00000100;
{$EXTERNALSYM CSMI_SAS_PC_GET_PHY_SETTINGS}
// Link Flags
const CSMI_SAS_PHY_ACTIVATE_CONTROL = $00000001;
{$EXTERNALSYM CSMI_SAS_PHY_ACTIVATE_CONTROL}
const CSMI_SAS_PHY_UPDATE_SPINUP_RATE = $00000002;
{$EXTERNALSYM CSMI_SAS_PHY_UPDATE_SPINUP_RATE}
const CSMI_SAS_PHY_AUTO_COMWAKE = $00000004;
{$EXTERNALSYM CSMI_SAS_PHY_AUTO_COMWAKE}
// Device Types for Phy Settings
// (bType)
const CSMI_SAS_UNDEFINED = $00;
{$EXTERNALSYM CSMI_SAS_UNDEFINED}
const CSMI_SAS_SATA = $01;
{$EXTERNALSYM CSMI_SAS_SATA}
const CSMI_SAS_SAS = $02;
{$EXTERNALSYM CSMI_SAS_SAS}
// Transmitter Flags
// (uTransmitterFlags)
const CSMI_SAS_PHY_PREEMPHASIS_DISABLED = $00000001;
{$EXTERNALSYM CSMI_SAS_PHY_PREEMPHASIS_DISABLED}
// Receiver Flags
// (uReceiverFlags)
const CSMI_SAS_PHY_EQUALIZATION_DISABLED = $00000001;
{$EXTERNALSYM CSMI_SAS_PHY_EQUALIZATION_DISABLED}
// Pattern Flags
// (uPatternFlags)
// #define CSMI_SAS_PHY_ACTIVATE_CONTROL 0x00000001
const CSMI_SAS_PHY_DISABLE_SCRAMBLING = $00000002;
{$EXTERNALSYM CSMI_SAS_PHY_DISABLE_SCRAMBLING}
const CSMI_SAS_PHY_DISABLE_ALIGN = $00000004;
{$EXTERNALSYM CSMI_SAS_PHY_DISABLE_ALIGN}
const CSMI_SAS_PHY_DISABLE_SSC = $00000008;
{$EXTERNALSYM CSMI_SAS_PHY_DISABLE_SSC}
const CSMI_SAS_PHY_FIXED_PATTERN = $00000010;
{$EXTERNALSYM CSMI_SAS_PHY_FIXED_PATTERN}
const CSMI_SAS_PHY_USER_PATTERN = $00000020;
{$EXTERNALSYM CSMI_SAS_PHY_USER_PATTERN}
// Fixed Patterns
// (bFixedPattern)
const CSMI_SAS_PHY_CJPAT = $00000001;
{$EXTERNALSYM CSMI_SAS_PHY_CJPAT}
const CSMI_SAS_PHY_ALIGN = $00000002;
{$EXTERNALSYM CSMI_SAS_PHY_ALIGN}
// cType Flags
// (bTypeFlags)
const CSMI_SAS_PHY_POSITIVE_DISPARITY = $01;
{$EXTERNALSYM CSMI_SAS_PHY_POSITIVE_DISPARITY}
const CSMI_SAS_PHY_NEGATIVE_DISPARITY = $02;
{$EXTERNALSYM CSMI_SAS_PHY_NEGATIVE_DISPARITY}
const CSMI_SAS_PHY_CONTROL_CHARACTER = $04;
{$EXTERNALSYM CSMI_SAS_PHY_CONTROL_CHARACTER}
// Miscellaneous
const SLOT_NUMBER_UNKNOWN = $FFFF;
{$EXTERNALSYM SLOT_NUMBER_UNKNOWN}
(*************************************************************************)
(* DATA STRUCTURES *)
(*************************************************************************)
(* * * * * * * * * * Class Independent Structures * * * * * * * * * *)
// EDM #pragma CSMI_SAS_BEGIN_PACK(8)
//pragma pack(8)
// CC_CSMI_SAS_DRIVER_INFO
type
_CSMI_SAS_DRIVER_INFO = record
szName: array[0..80] of byte;
szDescription: array[0..80] of byte;
usMajorRevision: word;
usMinorRevision: word;
usBuildRevision: word;
usReleaseRevision: word;
usCSMIMajorRevision: word;
usCSMIMinorRevision: word;
end;
CSMI_SAS_DRIVER_INFO = _CSMI_SAS_DRIVER_INFO;
{$EXTERNALSYM CSMI_SAS_DRIVER_INFO}
PCSMI_SAS_DRIVER_INFO = ^CSMI_SAS_DRIVER_INFO;
type
_CSMI_SAS_DRIVER_INFO_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_DRIVER_INFO;
end;
CSMI_SAS_DRIVER_INFO_BUFFER = _CSMI_SAS_DRIVER_INFO_BUFFER;
{$EXTERNALSYM CSMI_SAS_DRIVER_INFO_BUFFER}
PCSMI_SAS_DRIVER_INFO_BUFFER = ^CSMI_SAS_DRIVER_INFO_BUFFER;
// CC_CSMI_SAS_CNTLR_CONFIGURATION
type
_CSMI_SAS_PCI_BUS_ADDRESS = record
bBusNumber: byte;
bDeviceNumber: byte;
bFunctionNumber: byte;
bReserved: byte;
end;
CSMI_SAS_PCI_BUS_ADDRESS = _CSMI_SAS_PCI_BUS_ADDRESS;
{$EXTERNALSYM CSMI_SAS_PCI_BUS_ADDRESS}
PCSMI_SAS_PCI_BUS_ADDRESS = ^CSMI_SAS_PCI_BUS_ADDRESS;
type
CSMI_SAS_IO_BUS_ADDRESS = record
PciAddress: CSMI_SAS_PCI_BUS_ADDRESS;
bReserved: array[0..31] of byte;
end;
TCSMI_SAS_IO_BUS_ADDRESS = CSMI_SAS_IO_BUS_ADDRESS;
{$EXTERNALSYM TCSMI_SAS_IO_BUS_ADDRESS}
PCSMI_SAS_IO_BUS_ADDRESS = ^CSMI_SAS_IO_BUS_ADDRESS;
type
_CSMI_SAS_CNTLR_CONFIG = record
uBaseIoAddress: cardinal;
BaseMemoryAddress: uint64;
uBoardID: cardinal;
usSlotNumber: word;
bControllerClass: byte;
bIoBusType: byte;
BusAddress: CSMI_SAS_IO_BUS_ADDRESS;
szSerialNumber: array[0..80] of byte;
usMajorRevision: word;
usMinorRevision: word;
usBuildRevision: word;
usReleaseRevision: word;
usBIOSMajorRevision: word;
usBIOSMinorRevision: word;
usBIOSBuildRevision: word;
usBIOSReleaseRevision: word;
uControllerFlags: cardinal;
usRromMajorRevision: word;
usRromMinorRevision: word;
usRromBuildRevision: word;
usRromReleaseRevision: word;
usRromBIOSMajorRevision: word;
usRromBIOSMinorRevision: word;
usRromBIOSBuildRevision: word;
usRromBIOSReleaseRevision: word;
bReserved: array[0..6] of byte;
end;
CSMI_SAS_CNTLR_CONFIG = _CSMI_SAS_CNTLR_CONFIG;
{$EXTERNALSYM CSMI_SAS_CNTLR_CONFIG}
PCSMI_SAS_CNTLR_CONFIG = ^CSMI_SAS_CNTLR_CONFIG;
type
_CSMI_SAS_CNTLR_CONFIG_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Configuration: CSMI_SAS_CNTLR_CONFIG;
end;
CSMI_SAS_CNTLR_CONFIG_BUFFER = _CSMI_SAS_CNTLR_CONFIG_BUFFER;
{$EXTERNALSYM CSMI_SAS_CNTLR_CONFIG_BUFFER}
PCSMI_SAS_CNTLR_CONFIG_BUFFER = ^CSMI_SAS_CNTLR_CONFIG_BUFFER;
// CC_CSMI_SAS_CNTLR_STATUS
type
_CSMI_SAS_CNTLR_STATUS = record
uStatus: cardinal;
uOfflineReason: cardinal;
bReserved: array[0..27] of byte;
end;
CSMI_SAS_CNTLR_STATUS = _CSMI_SAS_CNTLR_STATUS;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS}
PCSMI_SAS_CNTLR_STATUS = ^CSMI_SAS_CNTLR_STATUS;
type
_CSMI_SAS_CNTLR_STATUS_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Status: CSMI_SAS_CNTLR_STATUS;
end;
CSMI_SAS_CNTLR_STATUS_BUFFER = _CSMI_SAS_CNTLR_STATUS_BUFFER;
{$EXTERNALSYM CSMI_SAS_CNTLR_STATUS_BUFFER}
PCSMI_SAS_CNTLR_STATUS_BUFFER = ^CSMI_SAS_CNTLR_STATUS_BUFFER;
// CC_CSMI_SAS_FIRMWARE_DOWNLOAD
type
_CSMI_SAS_FIRMWARE_DOWNLOAD = record
uBufferLength: cardinal;
uDownloadFlags: cardinal;
bReserved: array[0..31] of byte;
usStatus: word;
usSeverity: word;
end;
CSMI_SAS_FIRMWARE_DOWNLOAD = _CSMI_SAS_FIRMWARE_DOWNLOAD;
{$EXTERNALSYM CSMI_SAS_FIRMWARE_DOWNLOAD}
PCSMI_SAS_FIRMWARE_DOWNLOAD = ^CSMI_SAS_FIRMWARE_DOWNLOAD;
type
_CSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_FIRMWARE_DOWNLOAD;
bDataBuffer: array[0..0] of byte;
end;
CSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER = _CSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER;
{$EXTERNALSYM CSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER}
PCSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER = ^CSMI_SAS_FIRMWARE_DOWNLOAD_BUFFER;
// CC_CSMI_SAS_RAID_INFO
type
_CSMI_SAS_RAID_INFO = record
uNumRaidSets: cardinal;
uMaxDrivesPerSet: cardinal;
uMaxRaidSets: cardinal;
bMaxRaidTypes: byte;
bReservedByteFields: array[0..6] of byte;
ulMinRaidSetBlocks: uint64;
ulMaxRaidSetBlocks: uint64;
uMaxPhysicalDrives: cardinal;
uMaxExtents: cardinal;
uMaxModules: cardinal;
uMaxTransformationMemory: cardinal;
uChangeCount: cardinal;
bReserved: array[0..43] of byte;
end;
CSMI_SAS_RAID_INFO = _CSMI_SAS_RAID_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_INFO}
PCSMI_SAS_RAID_INFO = CSMI_SAS_RAID_INFO;
type
_CSMI_SAS_RAID_INFO_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_RAID_INFO;
end;
CSMI_SAS_RAID_INFO_BUFFER = _CSMI_SAS_RAID_INFO_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_INFO_BUFFER}
PCSMI_SAS_RAID_INFO_BUFFER = ^CSMI_SAS_RAID_INFO_BUFFER;
// CC_CSMI_SAS_GET_RAID_CONFIG
type
_CSMI_SAS_RAID_DRIVES = record
bModel: array[0..39] of byte;
bFirmware: array[0..7] of byte;
bSerialNumber: array[0..39] of byte;
bSASAddress: array[0..7] of byte;
bSASLun: array[0..7] of byte;
bDriveStatus: byte;
bDriveUsage: byte;
usBlockSize: word;
bDriveType: byte;
bReserved: array[0..14] of byte;
uDriveIndex: cardinal;
ulTotalUserBlocks: uint64;
end;
CSMI_SAS_RAID_DRIVES = _CSMI_SAS_RAID_DRIVES;
{$EXTERNALSYM CSMI_SAS_RAID_DRIVES}
PCSMI_SAS_RAID_DRIVES = ^CSMI_SAS_RAID_DRIVES;
type
_CSMI_SAS_RAID_DEVICE_ID = record
bDeviceIdentificationVPDPage: array[0..0] of byte;
end;
CSMI_SAS_RAID_DEVICE_ID = _CSMI_SAS_RAID_DEVICE_ID;
{$EXTERNALSYM CSMI_SAS_RAID_DEVICE_ID}
PCSMI_SAS_RAID_DEVICE_ID = ^CSMI_SAS_RAID_DEVICE_ID;
type
_CSMI_SAS_RAID_SET_ADDITIONAL_DATA = record
bLabel: array[0..15] of byte;
bRaidSetLun: array[0..7] of byte;
bWriteProtection: byte;
bCacheSetting: byte;
bCacheRatio: byte;
usBlockSize: word;
bReservedBytes: array[0..10] of byte;
ulRaidSetExtentOffset: uint64;
ulRaidSetBlocks: uint64;
uStripeSizeInBlocks: cardinal;
uSectorsPerTrack: cardinal;
bApplicationScratchPad: array[0..15] of byte;
uNumberOfHeads: cardinal;
uNumberOfTracks: cardinal;
bReserved: array[0..23] of byte;
end;
CSMI_SAS_RAID_SET_ADDITIONAL_DATA = _CSMI_SAS_RAID_SET_ADDITIONAL_DATA;
{$EXTERNALSYM CSMI_SAS_RAID_SET_ADDITIONAL_DATA}
PCSMI_SAS_RAID_SET_ADDITIONAL_DATA = ^CSMI_SAS_RAID_SET_ADDITIONAL_DATA;
type
_CSMI_SAS_RAID_CONFIG = record
uRaidSetIndex: cardinal;
uCapacity: cardinal;
uStripeSize: cardinal;
bRaidType: byte;
bStatus: byte;
bInformation: byte;
bDriveCount: byte;
bDataType: byte;
bReserved: array[0..10] of byte;
uFailureCode: cardinal;
uChangeCount: cardinal;
Drives: array[0..0] of CSMI_SAS_RAID_DRIVES;
DeviceId: array[0..0] of CSMI_SAS_RAID_DEVICE_ID;
Data: array[0..0] of CSMI_SAS_RAID_SET_ADDITIONAL_DATA;
end;
CSMI_SAS_RAID_CONFIG = _CSMI_SAS_RAID_CONFIG;
{$EXTERNALSYM CSMI_SAS_RAID_CONFIG}
PCSMI_SAS_RAID_CONFIG = ^CSMI_SAS_RAID_CONFIG;
type
_CSMI_SAS_RAID_CONFIG_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Configuration: CSMI_SAS_RAID_CONFIG;
end;
CSMI_SAS_RAID_CONFIG_BUFFER = _CSMI_SAS_RAID_CONFIG_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_CONFIG_BUFFER}
PCSMI_SAS_RAID_CONFIG_BUFFER = ^CSMI_SAS_RAID_CONFIG_BUFFER;
// CC_CSMI_SAS_GET_RAID_FEATURES
type
_CSMI_SAS_RAID_TYPE_DESCRIPTION = record
bRaidType: byte;
bReservedBytes: array[0..6] of byte;
uSupportedStripeSizeMap: cardinal;
bReserved: array[0..23] of byte;
end;
CSMI_SAS_RAID_TYPE_DESCRIPTION = _CSMI_SAS_RAID_TYPE_DESCRIPTION;
{$EXTERNALSYM CSMI_SAS_RAID_TYPE_DESCRIPTION}
PCSMI_SAS_RAID_TYPE_DESCRIPTION = ^CSMI_SAS_RAID_TYPE_DESCRIPTION;
type
_CSMI_SAS_RAID_FEATURES = record
uFeatures: cardinal;
bReservedFeatures: array[0..31] of byte;
bDefaultTransformPriority: byte;
bTransformPriority: byte;
bDefaultRebuildPriority: byte;
bRebuildPriority: byte;
bDefaultSurfaceScanPriority: byte;
bSurfaceScanPriority: byte;
usReserved: word;
uRaidSetTransformationRules: cardinal;
uReserved: array[0..10] of cardinal;
RaidType: array[0..23] of CSMI_SAS_RAID_TYPE_DESCRIPTION;
bCacheRatiosSupported: array[0..103] of byte;
uChangeCount: cardinal;
uFailureCode: cardinal;
bReserved: array[0..119] of byte;
end;
CSMI_SAS_RAID_FEATURES = _CSMI_SAS_RAID_FEATURES;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURES}
PCSMI_SAS_RAID_FEATURES = ^CSMI_SAS_RAID_FEATURES;
type
_CSMI_SAS_RAID_FEATURES_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_RAID_FEATURES;
end;
CSMI_SAS_RAID_FEATURES_BUFFER = _CSMI_SAS_RAID_FEATURES_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_FEATURES_BUFFER}
PCSMI_SAS_RAID_FEATURES_BUFFER = ^CSMI_SAS_RAID_FEATURES_BUFFER;
// CC_CSMI_SAS_SET_RAID_CONTROL
type
_CSMI_SAS_RAID_CONTROL = record
bTransformPriority: byte;
bRebuildPriority: byte;
bCacheRatioFlag: byte;
bCacheRatio: byte;
bSurfaceScanPriority: byte;
bReservedBytes: array[0..14] of byte;
bClearConfiguration: array[0..7] of byte;
uChangeCount: cardinal;
bReserved: array[0..87] of byte;
uFailureCode: cardinal;
bFailureDescription: array[0..79] of byte;
end;
CSMI_SAS_RAID_CONTROL = _CSMI_SAS_RAID_CONTROL;
{$EXTERNALSYM CSMI_SAS_RAID_CONTROL}
PCSMI_SAS_RAID_CONTROL = ^CSMI_SAS_RAID_CONTROL;
type
_CSMI_SAS_RAID_CONTROL_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_RAID_CONTROL;
end;
CSMI_SAS_RAID_CONTROL_BUFFER = _CSMI_SAS_RAID_CONTROL_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_CONTROL_BUFFER}
PCSMI_SAS_RAID_CONTROL_BUFFER = ^CSMI_SAS_RAID_CONTROL_BUFFER;
// CC_CSMI_SAS_GET_RAID_ELEMENT
type
_CSMI_SAS_DRIVE_EXTENT_INFO = record
uDriveIndex: cardinal;
bExtentType: byte;
bReservedBytes: array[0..6] of byte;
ulExtentOffset: uint64;
ulExtentBlocks: uint64;
uRaidSetIndex: cardinal;
bReserved: array[0..95] of byte;
end;
CSMI_SAS_DRIVE_EXTENT_INFO = _CSMI_SAS_DRIVE_EXTENT_INFO;
{$EXTERNALSYM CSMI_SAS_DRIVE_EXTENT_INFO}
PCSMI_SAS_DRIVE_EXTENT_INFO = ^CSMI_SAS_DRIVE_EXTENT_INFO;
type
_CSMI_SAS_RAID_MODULE_INFO = record
bReserved: array[0..127] of byte;
end;
CSMI_SAS_RAID_MODULE_INFO = _CSMI_SAS_RAID_MODULE_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_MODULE_INFO}
PCSMI_SAS_RAID_MODULE_INFO = ^CSMI_SAS_RAID_MODULE_INFO;
type
_CSMI_SAS_DRIVE_LOCATION = record
bConnector: array[0..15] of byte;
bBoxName: array[0..15] of byte;
uBay: cardinal;
bReservedBytes: array[0..3] of byte;
bAttachedSASAddress: array[0..7] of byte;
bAttachedPhyIdentifier: byte;
bReserved: array[0..78] of byte;
end;
CSMI_SAS_DRIVE_LOCATION = _CSMI_SAS_DRIVE_LOCATION;
{$EXTERNALSYM CSMI_SAS_DRIVE_LOCATION}
PCSMI_SAS_DRIVE_LOCATION = ^CSMI_SAS_DRIVE_LOCATION;
type
_CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA = record
bNegotiatedLinkRate: array[0..1] of byte;
bReserved: array[0..125] of byte;
end;
CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA = _CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA;
{$EXTERNALSYM CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA}
PCSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA = ^CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA;
type
_CSMI_SAS_DRIVE_INFO = record
Device: CSMI_SAS_RAID_DRIVES;
Data: CSMI_SAS_RAID_DRIVES_ADDITIONAL_DATA;
Location: CSMI_SAS_DRIVE_LOCATION;
bReserved: array[0..15] of byte;
end;
CSMI_SAS_DRIVE_INFO = _CSMI_SAS_DRIVE_INFO;
{$EXTERNALSYM CSMI_SAS_DRIVE_INFO}
PCSMI_SAS_DRIVE_INFO = ^CSMI_SAS_DRIVE_INFO;
type
_CSMI_SAS_RAID_ELEMENT = record
uEnumerationType: cardinal;
uElementIndex: cardinal;
uNumElements: cardinal;
uChangeCount: cardinal;
uSubElementIndex: cardinal;
bReserved: array[0..31] of byte;
uFailureCode: cardinal;
bFailureDescription: array[0..79] of byte;
case integer of
0: (Drive: CSMI_SAS_DRIVE_INFO);
1: (Module: CSMI_SAS_RAID_MODULE_INFO);
2: (Extent: CSMI_SAS_DRIVE_EXTENT_INFO);
end;
CSMI_SAS_RAID_ELEMENT = _CSMI_SAS_RAID_ELEMENT;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT}
PCSMI_SAS_RAID_ELEMENT = ^CSMI_SAS_RAID_ELEMENT;
type
_CSMI_SAS_RAID_ELEMENT_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_RAID_ELEMENT;
end;
CSMI_SAS_RAID_ELEMENT_BUFFER = _CSMI_SAS_RAID_ELEMENT_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_ELEMENT_BUFFER}
PCSMI_SAS_RAID_ELEMENT_BUFFER = ^CSMI_SAS_RAID_ELEMENT_BUFFER;
// CC_CSMI_SAS_SET_RAID_OPERATION
type
_CSMI_SAS_RAID_SET_LIST = record
uRaidSetIndex: cardinal;
bExistingLun: array[0..7] of byte;
bNewLun: array[0..7] of byte;
bReserved: array[0..11] of byte;
end;
CSMI_SAS_RAID_SET_LIST = _CSMI_SAS_RAID_SET_LIST;
{$EXTERNALSYM CSMI_SAS_RAID_SET_LIST}
PCSMI_SAS_RAID_SET_LIST = ^CSMI_SAS_RAID_SET_LIST;
type
_CSMI_SAS_RAID_SET_DRIVE_LIST = record
uDriveIndex: cardinal;
bDriveUsage: byte;
bReserved: array[0..26] of byte;
end;
CSMI_SAS_RAID_SET_DRIVE_LIST = _CSMI_SAS_RAID_SET_DRIVE_LIST;
{$EXTERNALSYM CSMI_SAS_RAID_SET_DRIVE_LIST}
PCSMI_SAS_RAID_SET_DRIVE_LIST = ^CSMI_SAS_RAID_SET_DRIVE_LIST;
type
_CSMI_SAS_RAID_SET_SPARE_INFO = record
uRaidSetIndex: cardinal;
uDriveCount: cardinal;
bApplicationScratchPad: array[0..15] of byte;
bReserved: array[0..103] of byte;
end;
CSMI_SAS_RAID_SET_SPARE_INFO = _CSMI_SAS_RAID_SET_SPARE_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_SPARE_INFO}
PCSMI_SAS_RAID_SET_SPARE_INFO = ^CSMI_SAS_RAID_SET_SPARE_INFO;
type
_CSMI_SAS_RAID_SET_ONLINE_STATE_INFO = record
uRaidSetIndex: cardinal;
bOnlineState: byte;
bReserved: array[0..122] of byte;
end;
CSMI_SAS_RAID_SET_ONLINE_STATE_INFO = _CSMI_SAS_RAID_SET_ONLINE_STATE_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_ONLINE_STATE_INFO}
PCSMI_SAS_RAID_SET_ONLINE_STATE_INFO = ^CSMI_SAS_RAID_SET_ONLINE_STATE_INFO;
type
_CSMI_SAS_RAID_SET_CACHE_INFO = record
uRaidSetIndex: cardinal;
bCacheSetting: byte;
bCacheRatioFlag: byte;
bCacheRatio: byte;
bReserved: array[0..120] of byte;
end;
CSMI_SAS_RAID_SET_CACHE_INFO = _CSMI_SAS_RAID_SET_CACHE_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_CACHE_INFO}
PCSMI_SAS_RAID_SET_CACHE_INFO = ^CSMI_SAS_RAID_SET_CACHE_INFO;
type
_CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO = record
uRaidSetIndex: cardinal;
bWriteProtectSetting: byte;
bReserved: array[0..122] of byte;
end;
CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO = _CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO}
PCSMI_SAS_RAID_SET_WRITE_PROTECT_INFO = ^CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO;
type
_CSMI_SAS_RAID_SET_DELETE_INFO = record
uRaidSetIndex: cardinal;
bReserved: array[0..123] of byte;
end;
CSMI_SAS_RAID_SET_DELETE_INFO = _CSMI_SAS_RAID_SET_DELETE_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_DELETE_INFO}
PCSMI_SAS_RAID_SET_DELETE_INFO = ^CSMI_SAS_RAID_SET_DELETE_INFO;
type
_CSMI_SAS_RAID_SET_MODIFY_INFO = record
bRaidType: byte;
bReservedBytes: array[0..6] of byte;
uStripeSize: cardinal;
ulRaidSetBlocks: uint64;
ulRaidSetExtentOffset: uint64;
uDriveCount: cardinal;
bReserved: array[0..95] of byte;
end;
CSMI_SAS_RAID_SET_MODIFY_INFO = _CSMI_SAS_RAID_SET_MODIFY_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_MODIFY_INFO}
PCSMI_SAS_RAID_SET_MODIFY_INFO = ^CSMI_SAS_RAID_SET_MODIFY_INFO;
type
_CSMI_SAS_RAID_SET_TRANSFORM_INFO = record
bTransformType: byte;
bReservedBytes: array[0..2] of byte;
uRaidSetIndex: cardinal;
bRaidType: byte;
bReservedBytes2: array[0..10] of byte;
uAdditionalRaidSetIndex: cardinal;
uRaidSetCount: cardinal;
bApplicationScratchPad: array[0..15] of byte;
Modify: CSMI_SAS_RAID_SET_MODIFY_INFO;
bReserved: array[0..79] of byte;
end;
CSMI_SAS_RAID_SET_TRANSFORM_INFO = _CSMI_SAS_RAID_SET_TRANSFORM_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_TRANSFORM_INFO}
PCSMI_SAS_RAID_SET_TRANSFORM_INFO = ^CSMI_SAS_RAID_SET_TRANSFORM_INFO;
type
_CSMI_SAS_RAID_SET_LABEL_INFO = record
uRaidSetIndex: cardinal;
bLabel: array[0..15] of byte;
bReserved: array[0..107] of byte;
end;
CSMI_SAS_RAID_SET_LABEL_INFO = _CSMI_SAS_RAID_SET_LABEL_INFO;
{$EXTERNALSYM CSMI_SAS_RAID_SET_LABEL_INFO}
PCSMI_SAS_RAID_SET_LABEL_INFO = ^CSMI_SAS_RAID_SET_LABEL_INFO;
type
_CSMI_SAS_RAID_SET_CREATE_INFO = record
bRaidType: byte;
bReservedBytes: array[0..6] of byte;
uStripeSize: cardinal;
uTrackSectorCount: cardinal;
ulRaidSetBlocks: uint64;
ulRaidSetExtentOffset: uint64;
uDriveCount: cardinal;
bLabel: array[0..15] of byte;
uRaidSetIndex: cardinal;
bApplicationScratchPad: array[0..15] of byte;
uNumberOfHeads: cardinal;
uNumberOfTracks: cardinal;
bReserved: array[0..47] of byte;
end;
CSMI_SAS_RAID_SET_CREATE_INFO = _CSMI_SAS_RAID_SET_CREATE_INFO;
PCSMI_SAS_RAID_SET_CREATE_INFO = ^CSMI_SAS_RAID_SET_CREATE_INFO;
type
_TOperation = record
case integer of
0: (Create: CSMI_SAS_RAID_SET_CREATE_INFO);
1: (&Label: CSMI_SAS_RAID_SET_LABEL_INFO);
2: (Transform: CSMI_SAS_RAID_SET_TRANSFORM_INFO);
3: (Delete: CSMI_SAS_RAID_SET_DELETE_INFO);
4: (Protect: CSMI_SAS_RAID_SET_WRITE_PROTECT_INFO);
5: (Cache: CSMI_SAS_RAID_SET_CACHE_INFO);
6: (State: CSMI_SAS_RAID_SET_ONLINE_STATE_INFO);
7: (Spare: CSMI_SAS_RAID_SET_SPARE_INFO);
end;
_TParameters = record
case integer of
0: (DriveList: array[0..0] of CSMI_SAS_RAID_SET_DRIVE_LIST);
1: (RaidSetList: array[0..0] of CSMI_SAS_RAID_SET_LIST);
end;
_CSMI_SAS_RAID_SET_OPERATION = record
uOperationType: cardinal;
uChangeCount: cardinal;
uFailureCode: cardinal;
bFailureDescription: array[0..79] of byte;
bReserved: array[0..27] of byte;
Operation: _TOperation;
Parameters: _TParameters;
end;
CSMI_SAS_RAID_SET_OPERATION = _CSMI_SAS_RAID_SET_OPERATION;
{$EXTERNALSYM CSMI_SAS_RAID_SET_OPERATION}
PCSMI_SAS_RAID_SET_OPERATION = ^CSMI_SAS_RAID_SET_OPERATION;
type
_CSMI_SAS_RAID_SET_OPERATION_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_RAID_SET_OPERATION;
end;
CSMI_SAS_RAID_SET_OPERATION_BUFFER = _CSMI_SAS_RAID_SET_OPERATION_BUFFER;
{$EXTERNALSYM CSMI_SAS_RAID_SET_OPERATION_BUFFER}
PCSMI_SAS_RAID_SET_OPERATION_BUFFER = ^CSMI_SAS_RAID_SET_OPERATION_BUFFER;
(* * * * * * * * * * SAS HBA Class Structures * * * * * * * * * *)
// CC_CSMI_SAS_GET_PHY_INFO
type
_CSMI_SAS_IDENTIFY = record
bDeviceType: byte;
bRestricted: byte;
bInitiatorPortProtocol: byte;
bTargetPortProtocol: byte;
bRestricted2: array[0..7] of byte;
bSASAddress: array[0..7] of byte;
bPhyIdentifier: byte;
bSignalClass: byte;
bReserved: array[0..5] of byte;
end;
CSMI_SAS_IDENTIFY = _CSMI_SAS_IDENTIFY;
{$EXTERNALSYM CSMI_SAS_IDENTIFY}
PCSMI_SAS_IDENTIFY = ^CSMI_SAS_IDENTIFY;
type
_CSMI_SAS_PHY_ENTITY = record
Identify: CSMI_SAS_IDENTIFY;
bPortIdentifier: byte;
bNegotiatedLinkRate: byte;
bMinimumLinkRate: byte;
bMaximumLinkRate: byte;
bPhyChangeCount: byte;
bAutoDiscover: byte;
bPhyFeatures: byte;
bReserved: byte;
Attached: CSMI_SAS_IDENTIFY;
end;
CSMI_SAS_PHY_ENTITY = _CSMI_SAS_PHY_ENTITY;
{$EXTERNALSYM CSMI_SAS_PHY_ENTITY}
PCSMI_SAS_PHY_ENTITY = ^CSMI_SAS_PHY_ENTITY;
type
_CSMI_SAS_PHY_INFO = record
bNumberOfPhys: byte;
bReserved: array[0..2] of byte;
Phy: array[0..31] of CSMI_SAS_PHY_ENTITY;
end;
CSMI_SAS_PHY_INFO = _CSMI_SAS_PHY_INFO;
{$EXTERNALSYM CSMI_SAS_PHY_INFO}
PCSMI_SAS_PHY_INFO = ^CSMI_SAS_PHY_INFO;
type
_CSMI_SAS_PHY_INFO_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_PHY_INFO;
end;
CSMI_SAS_PHY_INFO_BUFFER = _CSMI_SAS_PHY_INFO_BUFFER;
{$EXTERNALSYM CSMI_SAS_PHY_INFO_BUFFER}
PCSMI_SAS_PHY_INFO_BUFFER = ^CSMI_SAS_PHY_INFO_BUFFER;
// CC_CSMI_SAS_SET_PHY_INFO
type
_CSMI_SAS_SET_PHY_INFO = record
bPhyIdentifier: byte;
bNegotiatedLinkRate: byte;
bProgrammedMinimumLinkRate: byte;
bProgrammedMaximumLinkRate: byte;
bSignalClass: byte;
bReserved: array[0..2] of byte;
end;
CSMI_SAS_SET_PHY_INFO = _CSMI_SAS_SET_PHY_INFO;
{$EXTERNALSYM CSMI_SAS_SET_PHY_INFO}
PCSMI_SAS_SET_PHY_INFO = ^CSMI_SAS_SET_PHY_INFO;
type
_CSMI_SAS_SET_PHY_INFO_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_SET_PHY_INFO;
end;
CSMI_SAS_SET_PHY_INFO_BUFFER = _CSMI_SAS_SET_PHY_INFO_BUFFER;
{$EXTERNALSYM CSMI_SAS_SET_PHY_INFO_BUFFER}
PCSMI_SAS_SET_PHY_INFO_BUFFER = ^CSMI_SAS_SET_PHY_INFO_BUFFER;
// CC_CSMI_SAS_GET_LINK_ERRORS
type
_CSMI_SAS_LINK_ERRORS = record
bPhyIdentifier: byte;
bResetCounts: byte;
bReserved: array[0..1] of byte;
uInvalidDwordCount: cardinal;
uRunningDisparityErrorCount: cardinal;
uLossOfDwordSyncCount: cardinal;
uPhyResetProblemCount: cardinal;
end;
CSMI_SAS_LINK_ERRORS = _CSMI_SAS_LINK_ERRORS;
{$EXTERNALSYM CSMI_SAS_LINK_ERRORS}
PCSMI_SAS_LINK_ERRORS = ^CSMI_SAS_LINK_ERRORS;
type
_CSMI_SAS_LINK_ERRORS_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Information: CSMI_SAS_LINK_ERRORS;
end;
CSMI_SAS_LINK_ERRORS_BUFFER = _CSMI_SAS_LINK_ERRORS_BUFFER;
{$EXTERNALSYM CSMI_SAS_LINK_ERRORS_BUFFER}
PCSMI_SAS_LINK_ERRORS_BUFFER = ^CSMI_SAS_LINK_ERRORS_BUFFER;
// CC_CSMI_SAS_SMP_PASSTHRU
type
_CSMI_SAS_SMP_REQUEST = record
bFrameType: byte;
bFunction: byte;
bReserved: array[0..1] of byte;
bAdditionalRequestBytes: array[0..1015] of byte;
end;
CSMI_SAS_SMP_REQUEST = _CSMI_SAS_SMP_REQUEST;
{$EXTERNALSYM CSMI_SAS_SMP_REQUEST}
PCSMI_SAS_SMP_REQUEST = ^CSMI_SAS_SMP_REQUEST;
type
_CSMI_SAS_SMP_RESPONSE = record
bFrameType: byte;
bFunction: byte;
bFunctionResult: byte;
bReserved: byte;
bAdditionalResponseBytes: array[0..1015] of byte;
end;
CSMI_SAS_SMP_RESPONSE = _CSMI_SAS_SMP_RESPONSE;
{$EXTERNALSYM CSMI_SAS_SMP_RESPONSE}
PCSMI_SAS_SMP_RESPONSE = ^CSMI_SAS_SMP_RESPONSE;
type
_CSMI_SAS_SMP_PASSTHRU = record
bPhyIdentifier: byte;
bPortIdentifier: byte;
bConnectionRate: byte;
bReserved: byte;
bDestinationSASAddress: array[0..7] of byte;
uRequestLength: cardinal;
Request: CSMI_SAS_SMP_REQUEST;
bConnectionStatus: byte;
bReserved2: array[0..2] of byte;
uResponseBytes: cardinal;
Response: CSMI_SAS_SMP_RESPONSE;
end;
CSMI_SAS_SMP_PASSTHRU = _CSMI_SAS_SMP_PASSTHRU;
{$EXTERNALSYM CSMI_SAS_SMP_PASSTHRU}
PCSMI_SAS_SMP_PASSTHRU = ^CSMI_SAS_SMP_PASSTHRU;
type
_CSMI_SAS_SMP_PASSTHRU_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Parameters: CSMI_SAS_SMP_PASSTHRU;
end;
CSMI_SAS_SMP_PASSTHRU_BUFFER = _CSMI_SAS_SMP_PASSTHRU_BUFFER;
{$EXTERNALSYM CSMI_SAS_SMP_PASSTHRU_BUFFER}
PCSMI_SAS_SMP_PASSTHRU_BUFFER = ^CSMI_SAS_SMP_PASSTHRU_BUFFER;
// CC_CSMI_SAS_SSP_PASSTHRU
type
_CSMI_SAS_SSP_PASSTHRU = record
bPhyIdentifier: byte;
bPortIdentifier: byte;
bConnectionRate: byte;
bReserved: byte;
bDestinationSASAddress: array[0..7] of byte;
bLun: array[0..7] of byte;
bCDBLength: byte;
bAdditionalCDBLength: byte;
bReserved2: array[0..1] of byte;
bCDB: array[0..15] of byte;
uFlags: cardinal;
bAdditionalCDB: array[0..23] of byte;
uDataLength: cardinal;
end;
CSMI_SAS_SSP_PASSTHRU = _CSMI_SAS_SSP_PASSTHRU;
{$EXTERNALSYM CSMI_SAS_SSP_PASSTHRU}
PCSMI_SAS_SSP_PASSTHRU = ^CSMI_SAS_SSP_PASSTHRU;
type
_CSMI_SAS_SSP_PASSTHRU_STATUS = record
bConnectionStatus: byte;
bSSPStatus: byte;
bReserved: array[0..1] of byte;
bDataPresent: byte;
bStatus: byte;
bResponseLength: array[0..1] of byte;
bResponse: array[0..255] of byte;
uDataBytes: cardinal;
end;
CSMI_SAS_SSP_PASSTHRU_STATUS = _CSMI_SAS_SSP_PASSTHRU_STATUS;
{$EXTERNALSYM CSMI_SAS_SSP_PASSTHRU_STATUS}
PCSMI_SAS_SSP_PASSTHRU_STATUS = ^CSMI_SAS_SSP_PASSTHRU_STATUS;
type
_CSMI_SAS_SSP_PASSTHRU_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Parameters: CSMI_SAS_SSP_PASSTHRU;
Status: CSMI_SAS_SSP_PASSTHRU_STATUS;
bDataBuffer: array[0..0] of byte;
end;
CSMI_SAS_SSP_PASSTHRU_BUFFER = _CSMI_SAS_SSP_PASSTHRU_BUFFER;
{$EXTERNALSYM CSMI_SAS_SSP_PASSTHRU_BUFFER}
PCSMI_SAS_SSP_PASSTHRU_BUFFER = ^CSMI_SAS_SSP_PASSTHRU_BUFFER;
// CC_CSMI_SAS_STP_PASSTHRU
type
_CSMI_SAS_STP_PASSTHRU = record
bPhyIdentifier: byte;
bPortIdentifier: byte;
bConnectionRate: byte;
bReserved: byte;
bDestinationSASAddress: array[0..7] of byte;
bReserved2: array[0..3] of byte;
bCommandFIS: array[0..19] of byte;
uFlags: cardinal;
uDataLength: cardinal;
end;
CSMI_SAS_STP_PASSTHRU = _CSMI_SAS_STP_PASSTHRU;
{$EXTERNALSYM CSMI_SAS_STP_PASSTHRU}
PCSMI_SAS_STP_PASSTHRU = ^CSMI_SAS_STP_PASSTHRU;
type
_CSMI_SAS_STP_PASSTHRU_STATUS = record
bConnectionStatus: byte;
bReserved: array[0..2] of byte;
bStatusFIS: array[0..19] of byte;
uSCR: array[0..15] of cardinal;
uDataBytes: cardinal;
end;
CSMI_SAS_STP_PASSTHRU_STATUS = _CSMI_SAS_STP_PASSTHRU_STATUS;
{$EXTERNALSYM CSMI_SAS_STP_PASSTHRU_STATUS}
PCSMI_SAS_STP_PASSTHRU_STATUS = ^CSMI_SAS_STP_PASSTHRU_STATUS;
type
_CSMI_SAS_STP_PASSTHRU_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Parameters: CSMI_SAS_STP_PASSTHRU;
Status: CSMI_SAS_STP_PASSTHRU_STATUS;
bDataBuffer: array[0..0] of byte;
end;
CSMI_SAS_STP_PASSTHRU_BUFFER = _CSMI_SAS_STP_PASSTHRU_BUFFER;
{$EXTERNALSYM CSMI_SAS_STP_PASSTHRU_BUFFER}
PCSMI_SAS_STP_PASSTHRU_BUFFER = ^CSMI_SAS_STP_PASSTHRU_BUFFER;
// CC_CSMI_SAS_GET_SATA_SIGNATURE
type
_CSMI_SAS_SATA_SIGNATURE = record
bPhyIdentifier: byte;
bReserved: array[0..2] of byte;
bSignatureFIS: array[0..19] of byte;
end;
CSMI_SAS_SATA_SIGNATURE = _CSMI_SAS_SATA_SIGNATURE;
{$EXTERNALSYM CSMI_SAS_SATA_SIGNATURE}
PCSMI_SAS_SATA_SIGNATURE = ^CSMI_SAS_SATA_SIGNATURE;
type
_CSMI_SAS_SATA_SIGNATURE_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Signature: CSMI_SAS_SATA_SIGNATURE;
end;
CSMI_SAS_SATA_SIGNATURE_BUFFER = _CSMI_SAS_SATA_SIGNATURE_BUFFER;
{$EXTERNALSYM CSMI_SAS_SATA_SIGNATURE_BUFFER}
PCSMI_SAS_SATA_SIGNATURE_BUFFER = ^CSMI_SAS_SATA_SIGNATURE_BUFFER;
// CC_CSMI_SAS_GET_SCSI_ADDRESS
type
_CSMI_SAS_GET_SCSI_ADDRESS_BUFFER = record
IoctlHeader: IOCTL_HEADER;
bSASAddress: array[0..7] of byte;
bSASLun: array[0..7] of byte;
bHostIndex: byte;
bPathId: byte;
bTargetId: byte;
bLun: byte;
end;
CSMI_SAS_GET_SCSI_ADDRESS_BUFFER = _CSMI_SAS_GET_SCSI_ADDRESS_BUFFER;
{$EXTERNALSYM CSMI_SAS_GET_SCSI_ADDRESS_BUFFER}
PCSMI_SAS_GET_SCSI_ADDRESS_BUFFER = ^CSMI_SAS_GET_SCSI_ADDRESS_BUFFER;
// CC_CSMI_SAS_GET_DEVICE_ADDRESS
type
_CSMI_SAS_GET_DEVICE_ADDRESS_BUFFER = record
IoctlHeader: IOCTL_HEADER;
bHostIndex: byte;
bPathId: byte;
bTargetId: byte;
bLun: byte;
bSASAddress: array[0..7] of byte;
bSASLun: array[0..7] of byte;
end;
CSMI_SAS_GET_DEVICE_ADDRESS_BUFFER = _CSMI_SAS_GET_DEVICE_ADDRESS_BUFFER;
{$EXTERNALSYM CSMI_SAS_GET_DEVICE_ADDRESS_BUFFER}
PCSMI_SAS_GET_DEVICE_ADDRESS_BUFFER = ^CSMI_SAS_GET_DEVICE_ADDRESS_BUFFER;
// CC_CSMI_SAS_TASK_MANAGEMENT
type
_CSMI_SAS_SSP_TASK_IU = record
bHostIndex: byte;
bPathId: byte;
bTargetId: byte;
bLun: byte;
uFlags: cardinal;
uQueueTag: cardinal;
uReserved: cardinal;
bTaskManagementFunction: byte;
bReserved: array[0..6] of byte;
uInformation: cardinal;
end;
CSMI_SAS_SSP_TASK_IU = _CSMI_SAS_SSP_TASK_IU;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_IU}
PCSMI_SAS_SSP_TASK_IU = ^CSMI_SAS_SSP_TASK_IU;
type
_CSMI_SAS_SSP_TASK_IU_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Parameters: CSMI_SAS_SSP_TASK_IU;
Status: CSMI_SAS_SSP_PASSTHRU_STATUS;
end;
CSMI_SAS_SSP_TASK_IU_BUFFER = _CSMI_SAS_SSP_TASK_IU_BUFFER;
{$EXTERNALSYM CSMI_SAS_SSP_TASK_IU_BUFFER}
PCSMI_SAS_SSP_TASK_IU_BUFFER = ^CSMI_SAS_SSP_TASK_IU_BUFFER;
// CC_CSMI_SAS_GET_CONNECTOR_INFO
type
_CSMI_SAS_GET_CONNECTOR_INFO = record
uPinout: cardinal;
bConnector: array[0..15] of byte;
bLocation: byte;
bReserved: array[0..14] of byte;
end;
CSMI_SAS_CONNECTOR_INFO = _CSMI_SAS_GET_CONNECTOR_INFO;
{$EXTERNALSYM CSMI_SAS_CONNECTOR_INFO}
PCSMI_SAS_CONNECTOR_INFO = ^CSMI_SAS_CONNECTOR_INFO;
type
_CSMI_SAS_CONNECTOR_INFO_BUFFER = record
IoctlHeader: IOCTL_HEADER;
Reference: array[0..31] of CSMI_SAS_CONNECTOR_INFO;
end;
CSMI_SAS_CONNECTOR_INFO_BUFFER = _CSMI_SAS_CONNECTOR_INFO_BUFFER;
{$EXTERNALSYM CSMI_SAS_CONNECTOR_INFO_BUFFER}
PCSMI_SAS_CONNECTOR_INFO_BUFFER = ^CSMI_SAS_CONNECTOR_INFO_BUFFER;
// CC_CSMI_SAS_GET_LOCATION
type
_CSMI_SAS_LOCATION_IDENTIFIER = record
bLocationFlags: cardinal;
bSASAddress: array[0..7] of byte;
bSASLun: array[0..7] of byte;
bEnclosureIdentifier: array[0..7] of byte;
bEnclosureName: array[0..31] of byte;
bBayPrefix: array[0..31] of byte;
bBayIdentifier: byte;
bLocationState: byte;
bReserved: array[0..1] of byte;
end;
CSMI_SAS_LOCATION_IDENTIFIER = _CSMI_SAS_LOCATION_IDENTIFIER;
{$EXTERNALSYM CSMI_SAS_LOCATION_IDENTIFIER}
PCSMI_SAS_LOCATION_IDENTIFIER = ^CSMI_SAS_LOCATION_IDENTIFIER;
type
_CSMI_SAS_GET_LOCATION_BUFFER = record
IoctlHeader: IOCTL_HEADER;
bHostIndex: byte;
bPathId: byte;
bTargetId: byte;
bLun: byte;
bIdentify: byte;
bNumberOfLocationIdentifiers: byte;
bLengthOfLocationIdentifier: byte;
Location: array[0..0] of CSMI_SAS_LOCATION_IDENTIFIER;
end;
CSMI_SAS_GET_LOCATION_BUFFER = _CSMI_SAS_GET_LOCATION_BUFFER;
{$EXTERNALSYM CSMI_SAS_GET_LOCATION_BUFFER}
PCSMI_SAS_GET_LOCATION_BUFFER = ^CSMI_SAS_GET_LOCATION_BUFFER;
// CC_CSMI_SAS_PHY_CONTROL
type
_CSMI_SAS_CHARACTER = record
bTypeFlags: byte;
bValue: byte;
end;
CSMI_SAS_CHARACTER = _CSMI_SAS_CHARACTER;
{$EXTERNALSYM CSMI_SAS_CHARACTER}
PCSMI_SAS_CHARACTER = ^CSMI_SAS_CHARACTER;
type
_CSMI_SAS_PHY_CONTROL = record
bType: byte;
bRate: byte;
bReserved: array[0..5] of byte;
uVendorUnique: array[0..7] of cardinal;
uTransmitterFlags: cardinal;
bTransmitAmplitude: shortint;
bTransmitterPreemphasis: shortint;
bTransmitterSlewRate: shortint;
bTransmitterReserved: array[0..12] of shortint;
bTransmitterVendorUnique: array[0..63] of byte;
uReceiverFlags: cardinal;
bReceiverThreshold: shortint;
bReceiverEqualizationGain: shortint;
bReceiverReserved: array[0..13] of shortint;
bReceiverVendorUnique: array[0..63] of byte;
uPatternFlags: cardinal;
bFixedPattern: byte;
bUserPatternLength: byte;
bPatternReserved: array[0..5] of byte;
UserPatternBuffer: array[0..15] of CSMI_SAS_CHARACTER;
end;
CSMI_SAS_PHY_CONTROL = _CSMI_SAS_PHY_CONTROL;
{$EXTERNALSYM CSMI_SAS_PHY_CONTROL}
PCSMI_SAS_PHY_CONTROL = ^CSMI_SAS_PHY_CONTROL;
type
_CSMI_SAS_PHY_CONTROL_BUFFER = record
IoctlHeader: IOCTL_HEADER;
uFunction: cardinal;
bPhyIdentifier: byte;
usLengthOfControl: word;
bNumberOfControls: byte;
bReserved: array[0..3] of byte;
uLinkFlags: cardinal;
bSpinupRate: byte;
bLinkReserved: array[0..6] of byte;
uVendorUnique: array[0..7] of cardinal;
Control: array[0..0] of CSMI_SAS_PHY_CONTROL;
end;
CSMI_SAS_PHY_CONTROL_BUFFER = _CSMI_SAS_PHY_CONTROL_BUFFER;
{$EXTERNALSYM CSMI_SAS_PHY_CONTROL_BUFFER}
PCSMI_SAS_PHY_CONTROL_BUFFER = ^CSMI_SAS_PHY_CONTROL_BUFFER;
function CSMI_IOCTL(AHandle: THandle; ACode: Cardinal; var ABuffer: IOCTL_HEADER; ABufSize: Cardinal): boolean;
implementation
function CSMI_IOCTL(AHandle: THandle; ACode: Cardinal; var ABuffer: IOCTL_HEADER; ABufSize: Cardinal): boolean;
var
sig: ansistring;
n: cardinal;
begin
Result:=False;
sig:='';
case ACode of
CC_CSMI_SAS_GET_DRIVER_INFO: sig:=CSMI_ALL_SIGNATURE;
CC_CSMI_SAS_GET_RAID_INFO: sig:=CSMI_RAID_SIGNATURE;
CC_CSMI_SAS_GET_PHY_INFO,
CC_CSMI_SAS_STP_PASSTHRU: sig:=CSMI_SAS_SIGNATURE;
else Exit;
end;
ABuffer.HeaderLength:=sizeof(IOCTL_HEADER);
Move(sig[1],ABuffer.Signature[0],sizeof(ABuffer.Signature));
ABuffer.Timeout:=CSMI_SAS_TIMEOUT;
ABuffer.ControlCode:=ACode;
ABuffer.ReturnCode:=0;
ABuffer.Length:=ABufSize-sizeof(IOCTL_HEADER);
n:=0;
Result:=DeviceIoControl(AHandle,IOCTL_SCSI_MINIPORT,@ABuffer,ABufSize,@ABuffer,ABufSize,n,nil) and (ABuffer.ReturnCode=0);
end;
end.