Hardware Dev Center

StorPortGetBusData routine

The StorPortGetBusData routine retrieves the bus-specific configuration information necessary to initialize the HBA.

Syntax


ULONG StorPortGetBusData(
  _In_    PVOID DeviceExtension,
  _In_    ULONG BusDataType,
  _In_    ULONG SystemIoBusNumber,
  _In_    ULONG SlotNumber,
  _Inout_ PVOID Buffer,
  _In_    ULONG Length
);

Parameters

DeviceExtension [in]

Pointer to the miniport driver's per-HBA storage area.

BusDataType [in]

Contains a value of type BUS_DATA_TYPE that specifies the type of bus-specific configuration data to be returned. Currently, this value can be one of the following: Cmos, EisaConfiguration, Pos, or PCIConfiguration. However, additional types of bus configuration will be supported in the future. The upper bound on the types supported is always MaximumBusDataType.

SystemIoBusNumber [in]

Specifies the system-assigned number of the I/O bus. The miniport driver's HwStorFindAdapter routine obtains this value from the SystemIoBusNumber member initially set in PORT_CONFIGURATION_INFORMATION.

SlotNumber [in]

Specifies the logical slot number or location of the device.

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

Buffer [in, out]

Pointer to a buffer or area to which the configuration data is returned or, if the given Length is zero, points to a location to which the OS-specific port driver returns a pointer to a buffer that it allocates.

Length [in]

Specifies the maximum number of bytes to return at Buffer, or zero if the caller requires the OS-specific port driver to allocate a buffer to contain the data.

Return value

StorPortGetBusData returns the number of bytes of configuration information it stored in the buffer. When the input BusDataType is PCIConfiguration, StorPortGetBusData can return either of the following values to indicate an error.

Return codeDescription
0 (zero)

The PCI bus does not exist.

2

The PCI bus exists, but there is no device at the given PCI SlotNumber. The Buffer contains the value PCI_INVALID_VENDOR_ID at the PCI_COMMON_CONFIG VendorId member.

 

Remarks

StorPortGetBusData can be called only from a miniport driver's HwStorFindAdapter routine or from HwStorAdapterControl when the control type is ScsiSetRunningConfig. Calls from other miniport driver routines will result in system failure or incorrect operation for the caller.

Configuration data returned by StorPortGetBusData is valid only until the miniport driver calls StorPortGetBusData again. As soon as the caller's HwStorFindAdapter routine returns control, any returned configuration data becomes invalid.

Requirements

Target platform

Universal

Header

Storport.h (include Storport.h)

Library

Storport.lib

See also

HwStorFindAdapter
PORT_CONFIGURATION_INFORMATION

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft