SCSI_PNP_REQUEST_BLOCK structure (srb.h)

TheSCSI_PNP_REQUEST_BLOCK structure is a special version of a SCSI_REQUEST_BLOCK that is used for plug and play (PNP) requests.

Note  The SCSI port driver and SCSI miniport driver models may be altered or unavailable in the future. Instead, we recommend using the Storport driver and Storport miniport driver models.
 

Syntax

typedef struct _SCSI_PNP_REQUEST_BLOCK {
  USHORT                     Length;
  UCHAR                      Function;
  UCHAR                      SrbStatus;
  UCHAR                      PnPSubFunction;
  UCHAR                      PathId;
  UCHAR                      TargetId;
  UCHAR                      Lun;
  STOR_PNP_ACTION            PnPAction;
  ULONG                      SrbFlags;
  ULONG                      DataTransferLength;
  ULONG                      TimeOutValue;
  PVOID                      DataBuffer;
  PVOID                      SenseInfoBuffer;
  struct _SCSI_REQUEST_BLOCK *NextSrb;
  PVOID                      OriginalRequest;
  PVOID                      SrbExtension;
  ULONG                      SrbPnPFlags;
  ULONG                      Reserved;
  UCHAR                      Reserved4[16];
} SCSI_PNP_REQUEST_BLOCK, *PSCSI_PNP_REQUEST_BLOCK;

Members

Length

The size, in bytes, of the SCSI_PNP_REQUEST_BLOCK structure.

Function

The operation to perform. For the SCSI_PNP_REQUEST_BLOCK structure, this member is always set to SRB_FUNCTION_PNP.

SrbStatus

The status of the completed request. The miniport driver should set this value before notifying the Storport driver that the request has completed. A miniport driver notifies the Storport driver that the request has completed by calling the StorPortNotification routine with a notification type of RequestComplete. For a list of possible status values, see SCSI_REQUEST_BLOCK.

PnPSubFunction

This member is not currently used. Miniport drivers ignore this member.

PathId

The SCSI port or bus identifier for the request. This value is zero based.

TargetId

The target controller or device identifier on the bus.

Lun

The logical unit number (LUN) of the device.

PnPAction

The plug and play action to perform. This member can have one of the following values:

Value Meaning
StorStartDevice
0x00
Start the device.
StorRemoveDevice
0x02
Remove the device.
StorStopDevice
0x04
Stop the device.
StorQueryCapabilities
0x09
Query the capabilities of the device.
StorQueryResourceRequirements
0x0B
Query the resource requirements for the device.
StorFilterResourceRequirements
0x0D
Filter the resource requirements for the device.
StorSupriseRemoval
0x17
Surprise Removal of the device. This value was added in Windows 7.

SrbFlags

Miniport driver should ignore this member.

DataTransferLength

Miniport driver should ignore this member.

TimeOutValue

The interval, in seconds, that the request can execute before the Storport driver determines that the request has timed out.

DataBuffer

Miniport driver should ignore this member.

SenseInfoBuffer

Miniport driver should ignore this member.

NextSrb

Miniport driver should ignore this member.

OriginalRequest

Miniport driver should ignore this member.

SrbExtension

A pointer to the SRB extension. A miniport driver must not use this member if it set SrbExtensionSize to zero in the HW_INITIALIZATION_DATA structure. The Storport driver does not initialize the memory that this member points to. The HBA can directly access the data that the miniport driver writes into the SRB extension. A miniport driver can obtain the physical address of the SRB extension by calling the StorPortGetPhysicalAddress routine.

SrbPnPFlags

The PNP flags. Currently, the only flag allowed is SRB_PNP_FLAGS_ADAPTER_REQUEST, which indicates that the PNP request is for the adapter, and not for one of the devices on the adapter. If this flag is set, the miniport driver should ignore the values in the PathId, TargetId, and Lun.

Reserved

Reserved for system use.

Reserved4[16]

Reserved for system use.

Remarks

The Storport driver sends SCSI_PNP_REQUEST_BLOCK requests to a miniport driver to notify the miniport driver of Windows plug and play events that affect storage devices that are connected to the adapter.

The Storport driver calls HwStorBuildIo to pass SRBs to the miniport driver. HwStorBuildIo checks the Function member of the SRB to determine the type of the SRB. If the Function member is set to SRB_FUNCTION_PNP, the SRB is a structure of type SCSI_PNP_REQUEST_BLOCK.

Requirements

Requirement Value
Header srb.h (include Storport.h, Minitape.h, Srb.h)

See also

HwStorBuildIo

SCSI_REQUEST_BLOCK

StorPortNotification