ScsiPortSetBusDataByOffset function (srb.h)

The ScsiPortSetBusDataByOffset routine sets bus-configuration data for an adapter on a dynamically configurable I/O bus with a published, standard interface.

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

SCSIPORT_API ULONG ScsiPortSetBusDataByOffset(
  [in] PVOID DeviceExtension,
  [in] ULONG BusDataType,
  [in] ULONG SystemIoBusNumber,
  [in] ULONG SlotNumber,
  [in] PVOID Buffer,
  [in] ULONG Offset,
  [in] ULONG Length
);

Parameters

[in] DeviceExtension

Pointer to the miniport driver's device extension.

[in] BusDataType

Contains a value of type BUS_DATA_TYPE that specifies the type of bus data to be set. Currently, its value can be PCIConfiguration. However, additional types of standardized, dynamically configurable buses will be supported in future. The upper bound on the bus types supported is always MaximumBusDataType.

[in] SystemIoBusNumber

Specifies the system-assigned number of the I/O bus on which the HBA is connected. The miniport driver's HwScsiFindAdapter routine obtains this value from the input PORT_CONFIGURATION_INFORMATION SystemIoBusNumber member.

[in] SlotNumber

Specifies the logical slot number of the HBA.

When PCIConfiguration is specified as the BusDataType, this parameter must be specified as a PCI_SLOT_NUMBER-type value.

[in] Buffer

Pointer to a caller-supplied storage area with configuration information specific to BusDataType.

When PCIConfiguration is specified, the buffer contains some or all of the PCI_COMMON_CONFIG information for the given SlotNumber. The specified Offset and Length determine how much information is supplied.

[in] Offset

Specifies the byte offset within the PCI_COMMON_CONFIG structure at which the caller-supplied configuration values begin. A miniport driver can use PCI_COMMON_HDR_LENGTH to specify the offset of the device-specific area in PCI_COMMON_CONFIG.

[in] Length

Specifies the number of bytes in the storage area at Buffer.

Return value

ScsiPortSetBusDataByOffset returns the number of bytes of data successfully set for the given SlotNumber. If the given BusDataType is not valid for the current platform or if the supplied information is invalid, ScsiPortSetBusDataByOffset returns zero.

Remarks

Miniport drivers of HBAs on a PCI bus seldom call ScsiPortSetBusDataByOffset unless unusual circumstances or the nature of a particular driver's HBA requires such a call. For example, a miniport driver might call ScsiPortSetBusDataByOffset to clear a bit in the PCI status register if its HBA signals a target abort during initialization or to set device-specific configuration data for the HBA.

ScsiPortSetBusDataByOffset can be called only from the miniport driver's HwScsiFindAdapter routine or from HwScsiAdapterControl when the control type is ScsiSetRunningConfig.

Requirements

Requirement Value
Target Platform Desktop
Header srb.h (include Miniport.h, Scsi.h)
Library Scsiport.lib

See also

HalSetBusDataByOffset

HwScsiFindAdapter

PCI_COMMON_CONFIG

PCI_SLOT_NUMBER

PORT_CONFIGURATION_INFORMATION (SCSI)

ScsiPortGetBusData