Host Adapter Inquiry Command

Prototype: DWORD SendASPI32Command(LPSRB)

Declaration: LPSRB lpSRB;

The SendASPI32Command function with command code SC_HA_INQUIRY is used to get information on the installed host adapter hardware, including the number of host adapters installed. The number of host adapters returned represents the logical bus count instead of the true physical adapter count. For host adapters that support single bus only, the host adapter count and logical bus count are identical. For host adapters that support multiple buses, the host adapter count represents the total logical bus count.

Parameter

Description

lpSRB

Points to the following SCSI request block



typedef struct {
 
 BYTE  SRB_Cmd;            // ASPI command code = SC_HA_INQUIRY
 BYTE  SRB_Status;         // ASPI command status byte
 BYTE  SRB_HaId;           // ASPI host adapter number
 BYTE  SRB_Flags;          // ASPI request flags
 DWORD SRB_Hdr_Rsvd;       // Reserved, MUST = 0
 BYTE  HA_Count;           // Number of host adapters present
 BYTE  HA_SCSI_ID;         // SCSI ID of host adapter
 BYTE  HA_ManagerId[16];   // String describing the manager
 BYTE  HA_Identifier[16];  // String describing the host adapter
 BYTE  HA_Unique[16];      // Host Adapter Unique parameters
 WORD  HA_Rsvd1;           // Reserved

} SRB_HAInquiry, *PSRB_HAInquiry; 

Member

Description

SRB_Cmd

[IN] This field must contain SC_HA_INQUIRY.

SRB_Status

[OUT] On return, this field is 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 SCSI manager layer, beginning with zero.

SRB_Flags

[IN] Reserved = 0

SRB_Hdr_Rsvd

Reserved = 0

HA_Count

[OUT] The ASPI manager sets this field with the number of host adapters installed under ASPI. For example, a return value of 2 indicates that host adapters #0 and #1 are valid. To determine the total number of host adapters in the system, the SRB_HaId field should be set to zero, or GetASPI32SupportInfo can be used. The number of host adapters returned represents the logical bus count instead of the true physical adapter count. For host adapters that support single bus only, the host adapter count and logical bus count are identical.

HA_SCSI_ID

[OUT] The ASPI manager sets this field with the SCSI ID of the given host adapter.

HA_ManagerId[..]

[OUT] The ASPI manager fills this 16-character buffer with an ASCII string describing the ASPI manager. For ASPI for WIN32, the string "ASPI for WIN32" is returned.

HA_Identifier[..]

[OUT] The ASPI manager fills this 16-character buffer with a string describing the host adapter.

HA_Unique[..]

[OUT] The ASPI manager fills this 16-byte buffer with host adapter unique parameters. The returned buffer is encoded as follows:


Byte 15-8

Reserved = 0

Byte 7-4

Maximum Transfer Length.

Byte 3

Maximum SCSI Targets. Indicates the maximum number of targets (SCSI IDs) the adapter supports. If this value is not set, it is assumed that there are 8 targets. (SCSI IDs 0-7).

Byte 2

Adapter Unique Flags: Bits 7-2 and Bit 0 are reserved. If Bit 1 is 1, residual byte count reporting is supported; if Bit 1 is 0, residual byte count reporting is not supported.

Byte 1-0

Buffer Alignment Mask. The host adapter requires data buffer alignment specified by the 16-bit value. A value of 0x0000 indicates no boundary requirements (e.g. byte), 0x0001 word alignment, 0x0003 double-word, 0x0007 8-byte alignment, etc. The 16-bit value allows data buffer alignments of up to 65536-byte boundaries. Byte 1 is the most significant byte.



Value

Meaning

SS_COMP

SCSI/ASPI request has completed without error.

SS_INVALID_HA

Invalid host adapter number.



Residual Byte Length

Residual byte length is the number of bytes not transferred to, or received from, the target SCSI device. For example, if the ASPI buffer length for a SCSI Inquiry command is set for 100 bytes, but the target only returns 36 bytes; the residual length is 64 bytes. If the ASPI buffer length for a SCSI Write command is set for 514 bytes but the target only takes 512 bytes, the residual length is 2 bytes. ASPI modules can determine if the loaded ASPI manager supports residual byte length by issuing an Extended Host Adapter Inquiry command, as described in the previous section.

Example

This example of the Host Adapter Inquiry command gets host adapter hardware information from adapter #0.


 SRB_HAInquiry MySRB;
 DWORD ASPIStatus;   
  .
  .
 MySRB.SRB_Cmd     = SC_HA_INQUIRY;
 MySRB.SRB_HaId    = 0;
 MySRB.SRB_Flags    = 0;
 MySRB.SRB_Hdr_Rsvd   = 0;
 ASPIStatus     = SendASPI32Command ( (LPSRB) &MySRB );
  .
  .