Get SCSI Disk Information Command

Prototype: DWORD SendASPI32Command(LPSRB)

Declaration: LPSRB lpSRB;

The SendASPI32Command function with command code SC_GET_DISK_INFO is used to obtain information about a disk type SCSI device. The information returned includes BIOS Int 13h control and accessibility of the device, the drive's Int 13h physical drive number, and the geometry used by the Int 13h services for the drive.

Note:

This command is not valid for Windows NT, which does not use the Int 13 interface.

Parameter

Description

lpSRB

Points to the following SCSI request block



typedef struct {
 BYTE  SRB_Cmd;     // ASPI command code = SC_EXEC_SCSI_CMD
 BYTE  SRB_Status;    // ASPI command status byte
 BYTE  SRB_HaId;     // ASPI host adapter number
 BYTE  SRB_Flags;    // Reserved
 DWORD  SRB_Hdr_Rsvd;   // Reserved
 BYTE  SRB_Target;    // Target's SCSI ID
 BYTE  SRB_Lun;     // Target's LUN number
 BYTE  SRB_DriveFlags;   // Driver flags
 BYTE  SRB_Int13HDriveInfo; // Host Adapter Status
 BYTE  SRB_Heads;    // Preferred number of heads translation
 BYTE  SRB_Sectors;    // Preferred number of sectors translation
 BYTE  SRB_Rsvd1[10];   // Reserved

} SRB_GetDiskInfo, *PSRB_GetDiskInfo; 

Table 4-12. Get SCSI Disk Information Command

Member

Description

SRB_Cmd

[IN] This field must contain SC_GET_DISK_INFO.

SRB_Status

[OUT] On return, this field will be the same as the return status defined below.

SRB_HaId

[IN] This field specifies which installed host adapter the request is intended for. Host adapter numbers are always assigned by the ASPI manager layer beginning with zero.

SRB_Flags

[IN] Reserved = 0

SRB_Hdr_Rsvd

Reserved = 0

SRB_Target

[IN] SCSI ID of target device.

SRB_Lun

[IN] Logical Unit Number (LUN) of device. This field is ignored by ASPI for Win32, since SCSI Bus Device resets are done on a per-target basis only.

SRB_DriveFlags

[OUT] Upon completion of the SCSI command, the ASPI manager sets this field as follows:


Bit 7-2

Reserved

Bit 1-0

These bits are encoded to reflect Int 13h control and accessibility to the device. Bit 1 is the most significant bit. DISK_NOT_INT13 Device is not controlled by Int 13h services DISK_INT13_AND_DOS Device is under Int 13h control and is claimed by DOS DISK_INT1 Device is under Int 13h control but not claimed by DOS


SRB_Int13DriveInfo

[OUT] Upon completion of the SCSI command, the ASPI manager sets this field with the physical drive number that Int 13h services assigned to the device. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.

SRB_Heads

[OUT] Upon completion of the SCSI command, the ASPI manager sets this field to the number of heads the Int13h services is using for this device's geometry. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.

SRB_Sectors

[OUT] Upon completion of the SCSI command, the ASPI manager sets this field to the number of sectors the Int 13h services is using for this device's geometry. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.


Table 4-13. Return Values from Get SCSI Disk Information Command

Value

Meaning

SS_COMP

SCSI/ASPI request has completed without error.

SS_INVALID_HA

Invalid host adapter number.

SS_INVALID_SRB

One or more parameters in the SCSI Request Block (SRB) are set incorrectly.


Example

This example obtains disk information from device LUN 0, SCSI ID 2, attached to host adapter #0.


 SRB_GetDiskInfo MySRB;
 DWORD ASPIStatus;   
  .
  .
 MySRB.SRB_Header.SRB_Cmd = SC_GET_DISK_INFO;
 MySRB.SRB_HaId    = 0;
 MySRB.SRB_Flags    = 0;
 MySRB.SRB_Hdr_Rsvd   = 0;
 MySRB.SRB_Target    = 2;
 MySRB.SRB_Lun    = 0;
 ASPIStatus     = SendASPI32Command ( (LPSRB) &MySRB );
  .
  .