Erweitern Minimieren

ScsiPortNotification routine

The ScsiPortNotification routine informs the operating system-specific port driver of certain events, such as when a miniport driver completes a request or is ready to start another SRB, as well as when the HBA indicates certain SCSI error conditions that occurred during an operation.

Syntax


VOID ScsiPortNotification(
  IN SCSI_NOTIFICATION_TYPE NotificationType,
  IN PVOID HwDeviceExtension
);

Parameters

NotificationType

Specifies the type of notification, which can be one of the following.

Notification TypeDescription

RequestComplete

Indicates the given Srb has finished. If this value is set, ScsiPortNotification requires one additional parameter: the address of the SRB. After this notification, the operating system-specific port driver owns the request. The miniport driver must not access the Srb, and it must not pass the Srb to another routine (such as ScsiPortLogError).

For a description of the optional parameters used with a NotificationType of RequestComplete, see ScsiPortNotification (NotificationType = RequestComplete)

NextRequest

Indicates the miniport driver is ready for another request to a target that is not currently busy. This notification should be sent by the miniport driver as soon as the driver is ready for another request. Usually, this notification is sent from the HwScsiStartIo routine but, sometimes, from the HwScsiInterrupt (or HwScsiEnableInterruptsCallback) routine.

For a description of the optional parameters used with a NotificationType of NextRequest, see ScsiPortNotification (NotificationType = NextLuRequest)

NextLuRequest

Indicates that the HBA is ready for another request for the specified logical unit. If this value is set, ScsiPortNotification requires three additional parameters: (1) the path ID, (2) the target ID, and (3) the logical unit number. This value should be used only if the HBA can queue multiple requests and support auto-request sense or tagged queuing.

For a description of the optional parameters used with a NotificationType of NextLuRequest, see ScsiPortNotification (NotificationType = NextLuRequest)

ResetDetected

Indicates that the HBA has detected a reset on the SCSI bus. After this notification, the miniport driver is still responsible for completing any active requests. The SCSI port driver will manage all required bus-reset delays.

For a description of the optional parameters used with a NotificationType of ResetDetected, see ScsiPortNotification (NotificationType = ResetDetected)

CallEnableInterrupts

Indicates that the miniport driver requires the operating system-specific port driver to call the miniport driver's HwScsiEnableInterruptsCallback routine. If this value is set, ScsiPortNotification requires an additional parameter: the entry point for the HwScsiEnableInterruptsCallback. The miniport driver's HwScsiInterrupt routine makes this call, after disabling interrupts on the HBA, to defer some interrupt-driven I/O processing if the HBA requires polling or stalling in the ISR. While the callback runs, system interrupts remain enabled but the miniport driver's HwScsiInterrupt routine will not be called. The HwScsiEnableInterruptsCallback is responsible for completing the deferred I/O processing and for calling ScsiPortNotification again with CallDisableInterrupts and the miniport driver's HwScsiDisableInterruptsCallback entry point.

For a description of the optional parameters used with a NotificationType of CallEnableInterrupts, see ScsiPortNotification (NotificationType = CallEnableInterrupts or CallDisableInterrupts)

CallDisableInterrupts

Indicates that the miniport driver requires the operating system-specific port driver to call the miniport driver's HwScsiDisableInterruptsCallback routine. If this value is set, ScsiPortNotification requires an additional parameter: the entry point for the HwScsiDisableInterruptsCallback. While this callback runs, it cannot be preempted by an interrupt except from a device with a higher priority interrupt than the HBA. In this callback, the miniport driver reenables interrupts on the HBA.

For a description of the optional parameters used with a NotificationType of CallDisableInterrupts, see ScsiPortNotification (NotificationType = CallEnableInterrupts or CallDisableInterrupts)

RequestTimerCall

Indicates that the miniport driver requires the operating system-specific port driver to call the miniport driver's HwScsiTimer routine in the requested number of microseconds. If this value is set, ScsiPortNotification requires two additional parameters: (1) the entry point for the miniport driver's HwScsiTimer routine, and (2) a MiniportTimerValue interval, in microseconds. Note that the resolution of the system timer is approximately 10 milliseconds.

For a description of the optional parameters used with a NotificationType of RequestTimerCall, see ScsiPortNotification (NotificationType = RequestTimerCall)

BusChangeDetected

Indicates that a target device might have been added or removed from a dynamic bus. If this value is set, ScsiPortNotification requires an additional parameter: the path ID of the bus on which the change was detected. After this notification, the port driver reenumerates the bus by issuing INQUIRY commands. Bus enumeration is time-consuming and ties up the bus, so a miniport driver should not send this notification unnecessarily

For a description of the optional parameters used with a NotificationType of BusChangeDetected, see ScsiPortNotification (NotificationType = BusChangeDetected)

WMIEvent

Indicates that the miniport driver has detected an event for which one or more WMI data consumers is registered. If this value is set, ScsiPortNotification requires at least three additional arguments: (1) a pointer to a WMI event structure, (2) the size of the event structure, and (3) the path ID of the target device if the event originated from a device, or 0Xff if the event originated from the adapter. If (3) is a path ID, ScsiPortNotification requires two additional arguments: (4) the target ID, and (5) the logical unit number (LUN) of the target device.

For a description of the optional parameters used with a NotificationType of WMIEvent, see

ScsiPortNotification (NotificationType = WMIEvent, PathId != 0xFF)

WMIReregister

Indicates that the miniport driver has changed the data items or the number of instances of a given data block previously registered by calling IoWMIRegistrationControl. If WMIReregister is set, ScsiPortNotification requires at least two additional arguments: (1) the path ID of the target device to reregister that device, or 0xFF to reregister the adapter. If (1) is a path ID, ScsiPortNotification requires two additional arguments: (2) the target ID, and (3) the logical unit number (LUN) of the target device.

For a description of the optional parameters used with a NotificationType of WMIReregister, see ScsiPortNotification (NotificationType = WMIReregister, PathId != 0xFF)

 

HwDeviceExtension

Pointer to the hardware device extension. This is a per-HBA storage area that the port driver allocates and initializes on behalf of the miniport driver. Miniport drivers usually store HBA-specific information in this extension, such as the state of the HBA and the HBA's mapped access ranges. This area is available to the miniport driver in the DeviceExtension->HwDeviceExtension member of the HBA's device object immediately after the miniport driver calls ScsiPortInitialize. The port driver frees this memory when it removes the device.

Return value

None

Remarks

The ScsiPortNotification routine has a different set of optional parameters associated with each NotificationType. For a description of the optional parameters associated a particular NotificationType, see the reference page associated with that NotificationType. The following reference pages provide this information:

ScsiPortNotification (NotificationType = RequestComplete)

ScsiPortNotification (NotificationType = NextRequest)

ScsiPortNotification (NotificationType = NextLuRequest)

ScsiPortNotification (NotificationType = ResetDetected)

ScsiPortNotification (NotificationType = CallEnableInterrupts or CallDisableInterrupts)

ScsiPortNotification (NotificationType = RequestTimerCall))

ScsiPortNotification (NotificationType = BusChangeDetected)

ScsiPortNotification (NotificationType = WMIEvent, PathId != 0xFF)

ScsiPortNotification (NotificationType = WMIEvent, PathId = 0xFF)

ScsiPortNotification (NotificationType = WMIReregister, PathId != 0xFF)

ScsiPortNotification (NotificationType = WMIReregister, PathId = 0xFF)

Every miniport driver must call ScsiPortNotification twice for each call to the miniport driver's HwScsiStartIo routine with an SRB that the miniport driver completes successfully. First, the miniport driver calls ScsiPortNotification with the NotificationTypeNextRequest or with NextLuRequest if the miniport driver supports tagged queuing or multiple requests per LU. Then, the miniport driver calls ScsiPortNotification with the NotificationTypeRequestComplete and the request that it has just satisfied.

A miniport driver's HwScsiInterrupt routine is most likely to call ScsiPortNotification with the NotificationTypeResetDetected.

If an HBA requires the miniport driver to use more than a millisecond processing interrupt-driven I/O operations, its HwScsiInterrupt routine should disable interrupts on the HBA and call ScsiPortNotification with CallEnableInterrupts and a driver-supplied HwScsiEnableInterruptsCallback routine. This routine, in turn, calls ScsiPortNotification with CallDisableInterrupts and the corresponding driver-supplied HwScsiDisableInterruptsCallback.

A miniport driver that is registered as a WMI data provider can call ScsiPortNotification with WMIEvent to post an event for which it has previously received an enable request. The port driver queues the event in the interrupt data area of the miniport driver's device extension for later processing at a lower IRQL. Because only a limited number of events can be queued at one time, the miniport driver should use WMIEvent to signal exceptional rather than routine conditions, and it should give the port driver time to get back to DISPATCH_LEVEL between postings, to prevent events from being lost.

Requirements

Header

Srb.h (include Miniport.h or Scsi.h)

IRQL

(See Remarks section)

See also

HwScsiTimer
HwScsiDisableInterruptsCallback
HwScsiEnableInterruptsCallback
ScsiPortCompleteRequest
IoWMIRegistrationControl

 

 

Send comments about this topic to Microsoft

Anzeigen:
© 2014 Microsoft